/* assets/css/v2/ad.css — The one AdSense layout contract of the v2 skins: reserved height, 48px gap, ancestor safety, unfilled collapse
   keywords: ad.css, ad-slot, min-height, CLS, ancestors, transform, sticky, P3 P4 P6 P7 P8, contract
   Mirrors docs/AD-CONTRACT.md. Load after base.css, never edit without running tools/verify/lint-ad-contract.ps1. */

:root {
  --ad-min-h: 100px;      /* P7: reserved before the ad script runs */
  --ad-gap: 48px;         /* P8: gap kept by the slot itself; 48 - 12 (--fx-max-shift) = 36px >= 32px */
}

/* The container. Plain block, no decoration, nothing animated, nothing positioned. */
.ad-slot {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: var(--ad-min-h);
  margin-block: var(--ad-gap);
  margin-inline: auto;
  padding: 0;
  text-align: center;
}
.ad-slot ins { display: block; width: 100%; }

/* Reserved-height variants never go below the base. */
.ad-slot--tall { min-height: 250px; }       /* in-article / large responsive units */
.ad-slot--rail { min-height: 600px; }       /* 300x600 column, desktop only layouts */

/* Optional wrapper for a band that holds a slot; it only adds the gap, nothing else. */
.ad-zone { display: block; margin-block: var(--ad-gap); }
.ad-zone > .ad-slot { margin-block: 0; }

/* P3/P4 safety net: whatever a component sets later, no element that contains a slot
   (html, body, main, sections, wrappers, the slot itself) may transform, filter, fade,
   animate or clip. sticky/fixed is not touched here: it is banned in v2 CSS by the lint (P4). Needs :has(); browsers without it
   do not apply the net, and the lint and render checks remain the guard. */
:has(.ad-slot) {
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
  perspective: none !important;
  animation: none !important;
  transition-property: none !important;
  will-change: auto !important;
  overflow: visible !important;
  clip-path: none !important;
  mix-blend-mode: normal !important;
}
.ad-slot, .ad-slot * {
  transform: none !important;
  filter: none !important;
  opacity: 1 !important;
  animation: none !important;
  will-change: auto !important;
}

/* P6: the only allowed hiding is reactive, after the ad script reports "unfilled". */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-slot:has(> ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
