/* ═══════════════════════════════════════════════════════════
   AdSense Auto Ads — CLS Protection Layer
   Prevents layout shift when Auto Ads dynamically inject
   ad containers into the DOM.
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Contain ad-injected iframes ── */
ins.adsbygoogle {
    display: block;
    overflow: hidden;
    /* Reserve minimum space so the ad doesn't push content */
    min-height: 0;
    /* Prevent layout recalculations from propagating */
    contain: layout style;
}

/* ── 2. Stabilize main content wrappers ── */
/* Navbar is sticky — immune to vertical CLS by design */
nav.sticky {
    flex-shrink: 0;
}

/* Main content should not reflow when ads inject above/below */
body {
    overflow-x: hidden;
}

/* ── 3. Vignette / Overlay ads ── */
/* Auto Ads may inject full-screen vignette overlays.
   Ensure they layer above content but under modals. */
.adsbygoogle[data-ad-format="auto"],
.adsbygoogle[data-ad-format="fluid"] {
    max-width: 100%;
}

/* ── 4. Anchor ads bottom bar ── */
/* Bottom anchor ads should not push footer */
.adsbygoogle[data-anchor-status] {
    position: fixed !important;
    z-index: 40; /* Below nav (z-50) */
}

/* ── 5. In-article ad spacing ── */
/* When Auto Ads inject between sections, add breathing room */
.adsbygoogle + section,
section + .adsbygoogle {
    margin-top: 1rem;
}

/* ── 6. Dark mode ad container blending ── */
.dark ins.adsbygoogle {
    background-color: transparent;
}
