/* ==========================================================================
   RPG Event Content: whimsical section layout for TEC single event descriptions
   Scope: .rpg-ev (wrapper placed inside .tribe-events-single-event-description)
   Fonts: Fraunces + DM Sans + Cinzel are already loaded by the theme.
   Icons are CSS masks so the post HTML stays clean (survives wp_kses / editors).

   SPECIFICITY AGAINST THE HOST PAGE (rpg-events 1.21.0, measured on dev)
   This sheet prints after TEC's, Kadence's and ml-event.css (rpg-events
   enqueues it with ml-event as a dependency), so it wins every TIE. What it
   does not win on its own are the host rules that out-specify a plain
   `.rpg-ev` selector:
     .tribe-events-content p              0,1,1  font-size 18px, line-height
     .tribe-events-content p:last-child  0,2,1  margin-bottom 28px
     .rpg-ml-event .evtext h3             0,2,1  font-size 19px, margin-top 20px
     .rpg-ml-event .evtext li             0,2,1  margin 5px 0
   The rules marked "host guard" below are raised just enough to beat those —
   still inside .rpg-ev, no !important. `.rpg-ev.rpg-ev` repeats the class to
   reach 0,2,1 for a bare element selector; it matches nothing extra.
   ========================================================================== */

.rpg-ev {
  /* Tokens matched to theroleplaygoblin.nl (Kadence palette) */
  --ev-ink: #23201a;
  --ev-parchment: #efe6d4;
  --ev-card: #fbf7ee;
  --ev-card-alt: #f7f1e4;
  --ev-line: #dccca9;
  --ev-line-strong: #cdb88c;
  --ev-forest: #12271f;
  --ev-gold: #b08d57;
  --ev-gold-text: #6f5418;   /* 6:1 on card, use for small text */
  --ev-gold-light: #e2c58e;
  --ev-cream: #f7edd6;
  --ev-clay: #a63a1f;        /* warning text, passes 4.5:1 */
  --ev-clay-line: #c44a2b;
  --ev-radius: 16px;
  --ev-font-display: "Fraunces", Georgia, serif;
  --ev-font-label: "Cinzel", serif;
  --ev-font-body: "DM Sans", system-ui, sans-serif;

  display: flex;
  flex-direction: column;
  gap: 36px;
  font-family: var(--ev-font-body);
  color: var(--ev-ink);
  line-height: 1.6;
}
.rpg-ev *, .rpg-ev *::before { box-sizing: border-box; }
/* Host guard: TEC sizes every description <p> at 18px; inside .rpg-ev a
   paragraph takes the block's size unless a class below says otherwise. */
.rpg-ev p { margin: 0; font-size: inherit; line-height: inherit; }
.rpg-ev p:last-child { margin-bottom: 0; }

/* Shared: small caps label + display heading */
.rpg-ev__label {
  display: block;
  font-family: var(--ev-font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ev-gold-text);
}
.rpg-ev.rpg-ev h3 { /* host guard: beats .rpg-ml-event .evtext h3 */
  margin: 0;
  font-family: var(--ev-font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ev-ink);
}

/* Shared: icon via mask. Set --icon on the element. */
.rpg-ev [data-icon]::before {
  content: "";
  display: inline-block;
  flex: none;
  width: var(--icon-size, 22px);
  height: var(--icon-size, 22px);
  background: var(--icon-color, var(--ev-gold-text));
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}
.rpg-ev [data-icon="star"]    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.6 5.6 6 .7-4.5 4.1 1.2 6L12 16.4 6.7 19.4l1.2-6L3.4 9.3l6-.7z'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="spark"]   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="seats"]   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3 20c0-3.3 2.7-5.5 6-5.5s6 2.2 6 5.5'/%3E%3Ccircle cx='17.5' cy='9' r='2.4'/%3E%3Cpath d='M16 14.6c2.8.2 5 2 5 5'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="time"]    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M7 3h10M7 21h10M8 3c0 5 8 5 8 9s-8 4-8 9M16 3c0 5-8 5-8 9s8 4 8 9'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="dice"]    { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 2.5l8.5 5v9L12 21.5l-8.5-5v-9z'/%3E%3Cpath d='M12 2.5v19M3.5 7.5l17 9M20.5 7.5l-17 9'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="shield"]  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 4.5-3.4 8-8 9-4.6-1-8-4.5-8-9V6z'/%3E%3Cpath d='M9 12h6'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="heart"]   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7.5-4.6-7.5-10.2A4.3 4.3 0 0 1 12 8a4.3 4.3 0 0 1 7.5 2.8C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="bag"]     { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M8 7V5a4 4 0 0 1 8 0v2'/%3E%3Crect x='4' y='7' width='16' height='14' rx='4'/%3E%3Cpath d='M8 13h8v4H8z'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="table"]   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.3' fill='black'/%3E%3Ccircle cx='12' cy='12' r='1.3' fill='black'/%3E%3Ccircle cx='15.5' cy='15.5' r='1.3' fill='black'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="chest"]   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 10a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4v9H3z'/%3E%3Cpath d='M3 12h18M11 11h2v3h-2z'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="scroll"]  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M6 4h11a3 3 0 0 1 0 6H8'/%3E%3Cpath d='M6 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V10'/%3E%3Cpath d='M8 14h7M8 17h5'/%3E%3C/svg%3E"); }
.rpg-ev [data-icon="warning"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9.5 16.5h-19z'/%3E%3Cpath d='M12 10v4.5M12 17.5v.2'/%3E%3C/svg%3E"); }

/* 1. Hook card */
.rpg-ev__hook {
  background: var(--ev-forest);
  border-radius: 18px;
  padding: 10px;
}
.rpg-ev__hook-inner {
  border: 1px solid rgba(176, 141, 87, .55);
  border-radius: 12px;
  padding: 32px 30px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rpg-ev__hook .rpg-ev__label {
  display: flex; align-items: center; gap: 10px;
  color: var(--ev-gold);
  font-size: 12px; letter-spacing: .22em;
  --icon-size: 16px; --icon-color: var(--ev-gold);
}
/* Host guard on the <p> classes here, __perfect and __warning: `.rpg-ev .x`
   (0,2,0) beats both TEC's p rule and the `.rpg-ev p` reset above. */
.rpg-ev .rpg-ev__hook-line {
  font-family: var(--ev-font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 27px;
  line-height: 1.3;
  color: var(--ev-cream);
}
.rpg-ev .rpg-ev__hook-text   { color: #e3d8bf; }
.rpg-ev .rpg-ev__hook-credit { color: #c9bd9f; font-size: 14px; font-style: italic; }

/* 2. At a glance */
.rpg-ev__glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.rpg-ev__stat {
  background: var(--ev-card);
  border: 1px solid var(--ev-line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.rpg-ev__stat strong { font-size: 16px; }

/* 3. Perfect for ribbon */
.rpg-ev .rpg-ev__perfect {
  display: flex; align-items: center; gap: 16px;
  background: var(--ev-card-alt);
  border: 1px dashed var(--ev-gold);
  border-radius: 999px;
  padding: 14px 24px;
  font-size: 15px;
  --icon-size: 28px;
}
.rpg-ev__perfect strong { font-family: var(--ev-font-display); font-size: 17px; }

/* 4. Bring / provide cards */
.rpg-ev__pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.rpg-ev__card {
  background: var(--ev-card);
  border: 1px solid var(--ev-line);
  border-radius: 18px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
/* Card head: ::before draws the forest disc, ::after draws the gold glyph on top */
.rpg-ev__card-head { position: relative; display: flex; align-items: center; gap: 12px; }
.rpg-ev__card-head[data-icon]::before {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ev-forest);
  -webkit-mask: none; mask: none;
}
.rpg-ev__card-head > span { display: flex; flex-direction: column; }
.rpg-ev__card-head::after {
  content: "";
  position: absolute; left: 11px; top: 50%;
  width: 22px; height: 22px; margin-top: -11px;
  background: var(--ev-gold-light);
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}

/* Diamond-bullet list (used in cards) */
.rpg-ev ul.rpg-ev__list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.rpg-ev .rpg-ev__list li { position: relative; padding-left: 22px; margin: 0; } /* host guard: .evtext li */
.rpg-ev__list li::before {
  content: "";
  position: absolute; left: 1px; top: .55em;
  width: 10px; height: 10px;
  background: var(--ev-gold);
  transform: rotate(45deg);
}

/* 5. How it plays */
.rpg-ev__divider {
  display: flex; align-items: center; gap: 14px; text-align: center;
}
.rpg-ev__divider::before,
.rpg-ev__divider::after { content: ""; flex: 1; height: 1px; background: var(--ev-line-strong); }
.rpg-ev .rpg-ev__divider h3 { font-size: 26px; } /* host guard: after, and level with, .rpg-ev.rpg-ev h3 */
.rpg-ev__rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  counter-reset: rule;
  margin-top: 18px;
}
.rpg-ev__rule {
  background: var(--ev-card);
  border: 1px solid var(--ev-line);
  border-radius: var(--ev-radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 15px;
  counter-increment: rule;
}
.rpg-ev__rule::before {
  content: counter(rule, upper-roman);
  font-family: var(--ev-font-label);
  font-size: 22px; font-weight: 700;
  color: var(--ev-gold);
}
.rpg-ev__rule strong { font-family: var(--ev-font-display); font-size: 18px; font-weight: 600; }

/* 6. Take home tokens */
.rpg-ev__loot {
  background: var(--ev-card-alt);
  border-radius: 18px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.rpg-ev__head { display: flex; align-items: center; gap: 12px; --icon-size: 30px; }
.rpg-ev__tokens { display: flex; flex-wrap: wrap; gap: 10px; }
.rpg-ev__tokens span {
  background: var(--ev-card);
  border: 1px solid var(--ev-line-strong);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
}

/* 7. Free resources */
.rpg-ev__scrolls { display: flex; flex-direction: column; gap: 12px; }
.rpg-ev__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.rpg-ev a.rpg-ev__link {
  display: flex; align-items: center; gap: 14px;
  min-height: 44px;
  background: var(--ev-forest);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ev-cream);
  transition: transform .15s ease, box-shadow .15s ease;
}
.rpg-ev a.rpg-ev__link:hover,
.rpg-ev a.rpg-ev__link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(18, 39, 31, .25);
  color: var(--ev-cream);
}
.rpg-ev a.rpg-ev__link:focus-visible { outline: 2px solid var(--ev-gold); outline-offset: 3px; }
.rpg-ev__link span { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rpg-ev__link strong { font-size: 16px; color: var(--ev-cream); }
.rpg-ev__link small  { font-size: 14px; color: #d9cdb0; }
.rpg-ev__link::after {
  content: ""; flex: none; width: 20px; height: 20px;
  background: var(--ev-gold-light);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 8. Content warning */
.rpg-ev .rpg-ev__warning {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1.5px dashed var(--ev-clay-line);
  border-radius: var(--ev-radius);
  padding: 18px 20px;
  background: var(--ev-card);
  font-size: 15px;
  --icon-size: 30px; --icon-color: var(--ev-clay);
}
.rpg-ev__warning strong { color: var(--ev-clay); }

/* Phone */
@media (max-width: 600px) {
  .rpg-ev { gap: 28px; }
  .rpg-ev__hook-inner { padding: 24px 20px; }
  .rpg-ev .rpg-ev__hook-line { font-size: 22px; }
  .rpg-ev .rpg-ev__perfect { border-radius: 18px; align-items: flex-start; padding: 16px 18px; }
  .rpg-ev__glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rpg-ev a.rpg-ev__link { transition: none; }
  .rpg-ev a.rpg-ev__link:hover,
  .rpg-ev a.rpg-ev__link:focus-visible { transform: none; } /* keyboard focus lifted the card too */
}
