/* wgf-monetization.css — THE one ad-slot stylesheet (module M04). Merged 2026-08-11.
   Replaces the split brain that produced two audit findings:
     - wgf-ad-slot.css reserved space ALWAYS, so pages showed a bare "Advertisement"
       label over a well nothing could fill (the "site not ready to show ads" optic
       the 2026-08-09 AdSense rejection named);
     - this sheet's old display:none -> block reveal at fill time shifted layout,
       making the documented "CLS=0 guard" claim fiction.
   Contract now:
     EMPTY     = fully hidden, label included (reviewer sees nothing).
     LOADING / = visible, with a FIXED variant-sized well, so the creative's own
     FILLED      async render cannot shift layout further. One deterministic,
                 bounded shift at mount; nothing after. Since 2026-09-02 the
                 wgf-adnetworks.js fill sizes the well INLINE to the unit it chose
                 (data-ad-variant on the slot), centred in its column: the bronze
                 rule sits on the creative's edge and the label centres over it.
                 The sizes below are the pre-fill reservation and the AdSense path.
     UNFILLED  = collapsed again, label included (AdSense no-fill sets
                 data-ad-state="unfilled"; wgf-adnetworks.js sets it ~6s after a
                 fill that painted nothing, after emptying the well).
   JS lifecycle owners: wgf-adsense.js / wgf-adnetworks.js set
   data-ad-state ("loading"|"loaded"|"unfilled") and data-ad-loaded="true" on fill.
   Palette (2026-09-02): Blizzard only - bronze #6e5a2a rule, muted #9d9d9d label,
   slate #14161c skeleton. No token that resolves to the green ithildin ramp, which
   is being removed sitewide (docs/ui-ux/15-ithildin-reskin.md).
   wgf-ad-slot.css is DEPRECATED — never link it; this sheet is the one home.
   Tokens come from /static/css/_tokens.css (linked before this sheet in every
   head); every var() carries a fallback for the rare page without tokens. */

.wgf-ad-slot {
  display: none;
}

/* ── visible lifecycle states ── */
.wgf-ad-slot[data-ad-state="loading"],
.wgf-ad-slot[data-ad-loaded="true"] {
  display: block;
  width: 100%;
  margin: 0.75rem 0 1rem;
}

/* "Advertisement" label — visible whenever the slot is (Google policy) */
.wgf-ad-slot__label {
  display: block;
  font-family: var(--font-display, inherit);
  font-size: var(--text-xs, 0.72rem);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #9d9d9d;
  text-align: center;
  margin-bottom: var(--space-1, 0.25rem);
  user-select: none;
}

/* the ad well — fixed-height reserved area once visible (the CLS bound) */
.wgf-ad-slot__well {
  position: relative;
  overflow: hidden;
  background: transparent;
  /* content-box on purpose: the rule sits OUTSIDE the unit's box, so a 728px well
     really holds 728px of creative. Under border-box its clientWidth read 726, the
     728x90 "did not fit", and every desktop leaderboard on the site fell through to
     the 468x60 (walked live 2026-09-02; wgf-adnetworks.js pickVariant has the rest). */
  box-sizing: content-box;
  border: 1px solid #6e5a2a;
  border-radius: 2px;
}

/* ── variant well sizes ── */
/* calc(100% - 2px): the well is content-box, so its 1px rule on each side is paid
   for here instead of spilling past the column on a phone. */
.wgf-ad-slot--leaderboard .wgf-ad-slot__well {
  width: calc(100% - 2px);
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
}
.wgf-ad-slot--rectangle .wgf-ad-slot__well {
  width: calc(100% - 2px);
  max-width: 336px;
  height: 280px;
  margin: 0 auto;
}
/* --item-below-fold RETIRED 2026-08-12. It styled a real 728x120 well, but neither
   ad loader maps that modifier to a size (both know only leaderboard / rectangle /
   sidebar), so the token pages' below-chart slot could never fill from ANY network -
   and since a slot only becomes visible on data-ad-loaded="true", no reader ever saw
   it either. The five token pages now use --leaderboard (728x90 fits the same space).
   Keep this note: adding a bespoke modifier without teaching BOTH loaders about it
   silently recreates dead inventory. */
.wgf-ad-slot--sidebar .wgf-ad-slot__well {
  width: calc(100% - 2px);
  max-width: 300px;
  height: 600px;
  margin: 0 auto;
}
/* sidebar disappears entirely below the two-column breakpoint, filled or not: the
   .wgf-seo-layout grid drops its 300px column under 980px (assets/wgf-seo-pages.css),
   and the AH rail hides itself at its own 1050px collapse. Specificity (0,3,0) on
   purpose - the reveal rules above are (0,2,0), and until 2026-09-02 this rule was
   (0,1,0) at 899px and LOST to them, so a filled sidebar would have painted a 300px
   well straight into a phone's content flow. */
@media (max-width: 979px) {
  .wgf-ad-slot.wgf-ad-slot--sidebar,
  .wgf-ad-slot.wgf-ad-slot--sidebar[data-ad-state],
  .wgf-ad-slot.wgf-ad-slot--sidebar[data-ad-loaded="true"] {
    display: none;
  }
}

/* ── loading skeleton (inside the reserved well) ── */
.wgf-ad-slot__skeleton {
  position: absolute;
  inset: 0;
  background: #14161c;
  border-radius: 1px;
  animation: wgf-ad-sk-pulse 1.4s ease-in-out infinite alternate;
}
@keyframes wgf-ad-sk-pulse {
  from { opacity: 0.35; }
  to { opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .wgf-ad-slot__skeleton {
    animation: none;
    opacity: 0.5;
  }
}

/* ── unfilled: collapse. AFTER the visible rules on purpose — an AdSense no-fill
      carries data-ad-loaded="true" AND data-ad-state="unfilled"; equal specificity,
      later rule wins, the slot disappears instead of sitting as an empty box. ── */
.wgf-ad-slot[data-ad-state="unfilled"] {
  display: none;
}

/* ── dev preview: `document.body.classList.add('wgf-ads-preview')` in the console
      shows every empty slot as a dashed placeholder for layout work ── */
body.wgf-ads-preview .wgf-ad-slot {
  display: block;
}
body.wgf-ads-preview .wgf-ad-slot .wgf-ad-slot__well {
  min-height: 90px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

/* ── unrelated legacy rule, kept: AH pages tuck the footer against the tool ── */
.wgf-ah-page .wgf-site-footer {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
