/* ============================================================================
   Ad safety — space reservation + accidental-click distance
   ----------------------------------------------------------------------------
   Written 2026-08-07 in response to AdSense limiting ad serving on
   footballvotearena.com for "invalid traffic concerns" (30 Jul – 7 Aug: 2,606,793
   page views / 3,070,589 impressions / 150,689 clicks = 4.91% CTR, ~1 click
   every 17 page views, high in EVERY country — a page-layout cause, not a
   visitor-behaviour one).

   MEASURED CAUSE, not assumed. Lighthouse mobile on /face-of-kpop-2026/
   reported CLS 0.437, and the single 0.4028 shift moves `div.main-content` —
   the whole article column — 8.7s into a slow-4G load. The mover is the
   below-header AdSense unit: `.stream-item-size` renders with NO reserved
   height (TIELABS_ADVERTISMENT only emits inline width/height when the slot's
   `_img_width` / `_img_height` options are filled, and they are empty), so the
   article jumps down by a full ad height once the unit paints. Anyone whose
   thumb was already on its way to the title or the category link lands on the
   ad instead.

   ── Reservation values are MEASURED, not guessed ────────────────────────────
   Headless Chrome, real iPhone UA, 7 viewport widths, both a poll article and
   a news article, sampled after the units settled:

     viewport   below-header (7996178232)   sidebar (7111430726)   in-post (PubFuture)
     360        360 x 360   (= 100vw)       360 x 360              --
     375        375 x 375   (= 100vw)       375 x 375  (box 399)   box 245
     414        414 x 414   (= 100vw)       414 x 414  (box 438)   box 205
     480        480 x 480   (= 100vw)       480 x 480              --
     540        540 x 280                   510 x 280  (box 304)   box 205
     600        600 x 280                   570 x 280  (box 304)   box 205
     680        680 x 280                   650 x 280  (box 304)   box 205
     768        768 x 280                   738 x 280  (box 304)   no fill (desktop UA)
     1280       no fill                     329 x 250  (box 274)   no fill (desktop UA)

   Two facts drive every number below:

     1. Both AdSense units are responsive `auto` with
        `data-full-width-responsive="true"`. Below ~500px of container width
        Google serves a 1:1 SQUARE at the full viewport width; above it, a
        280px-tall banner. So on phones the correct reservation is `100vw` —
        an exact fit, not a round number. The crossover measured between
        480px (still square) and 540px (already 280px).
     2. The in-article PubFuture unit is a 180px-tall VIDEO unit that fills
        only for mobile user agents (four desktop-UA probes: 0px). It is
        therefore reserved on phones/tablets only — a desktop reservation
        would hold open a ~200px hole that no ad ever moves into.

   Re-measure with tools/../scratchpad probe if the AdSense units are ever
   changed from responsive to fixed size in the AdSense console.

   ── Rules of engagement ─────────────────────────────────────────────────────
   * `min-height` goes on the CONTAINER, never on `<ins>` — Google's own script
     writes inline width/height onto `<ins>` and would overwrite us. It also
     writes `height: auto !important` onto `.stream-item-below-header` when a
     unit does not fill, which is precisely why the reservation targets the
     inner `.stream-item-size` box instead of that wrapper.
   * No `aspect-ratio`: it resolves against the box's own width, which for the
     sidebar unit (ad 375px wide inside a 345px container via
     `margin-left:-15px`) is the wrong width and would under-reserve on mobile.
   * Nothing here clips, hides or overlays an ad — that would be the very
     policy breach we are fixing. We only reserve space and add distance.
   * `!important` on the custom-property-free declarations for the same reason
     bridge.css uses it: LiteSpeed combines CSS, so "our file loads last" is
     not a guarantee at equal specificity.
   ========================================================================== */

/* Minimum distance between an ad and an action button (VOTE, VIEW RANKING,
   BACK TO VOTE, Read more, share, Post Comment). AdSense's accidental-click
   guidance asks for clear separation; the brief for this work set 150px, so
   160px leaves headroom for sub-pixel rounding and font-size settings. */
:root { --sa-ad-safe-gap: 160px; }

/* ==========================================================================
   1. SPACE RESERVATION
   ========================================================================== */

/* --- Below-header AdSense unit (slot 7996178232) ------------------------- */

/* Phones: the unit is a square at the viewport width. */
@media (max-width: 500px) {
	.stream-item-below-header .stream-item-size { min-height: 100vw; }
}

/* Everything wider: a 280px banner (measured identical at 540/600/680/768). */
@media (min-width: 501px) {
	.stream-item-below-header .stream-item-size { min-height: 280px; }
}

/* --- Sidebar AdSense unit (slot 7111430726) ------------------------------ */

/* The widget prints the label INSIDE `.stream-item-widget-content`, so the
   reservation carries the ad height plus the ~24px `.stream-title` line. */
@media (max-width: 500px) {
	.stream-item-widget .stream-item-widget-content { min-height: calc(100vw + 24px); }
}

/* Tablet / stacked sidebar: the column is still full width (Jannah drops to
   one column below 992px), so the unit is the same 280px banner. */
@media (min-width: 501px) and (max-width: 991px) {
	.stream-item-widget .stream-item-widget-content { min-height: 304px; }
}

/* Desktop: the sidebar column is ~330px, so the unit serves a 250px rectangle. */
@media (min-width: 992px) {
	.stream-item-widget .stream-item-widget-content { min-height: 274px; }
}

/* --- In-article PubFuture unit ------------------------------------------- */

/* 180px video + its own label and 20px/20px wrapper margins = 205px measured
   at 414-680px, 245px at 375px (the label wraps to two lines there). Reserved
   only where the unit actually fills: it returned 0px in every desktop-UA
   probe, and reserving there would be a permanent empty gap. */
@media (max-width: 991px) {
	.stream-item-in-post .stream-item-size,
	.sa-postfold-ad .stream-item-size { min-height: 250px; }
}

/* The unit's own width cap is 500px; keep it from riding outside its column on
   any surface (the sidebar unit does exactly that with margin-left:-15px). */
.stream-item,
.stream-item-widget,
.stream-item-in-post { max-width: 100%; }

/* ==========================================================================
   2. DISTANCE FROM ACTION BUTTONS
   ========================================================================== */

/* Vote posts: every prose paragraph lives inside the read-more collapse, so
   the inline slots are relocated below the fold (voting.php) — which put them
   40px under the "Read more" pill. Measured on mobile: 40px above the ad
   wrapper, i.e. a tap that misses the pill lands on a video ad. */
.entry-content .sa-postfold-ad { margin-top: var(--sa-ad-safe-gap); }
.entry-content .sa-postfold-ad + .sa-postfold-ad { margin-top: var(--sa-ad-safe-gap); }

/* In-article slots on news posts sit BETWEEN two paragraphs (Jannah's
   paragraph-counting inserter), so they already clear headings and buttons —
   but the paragraph that follows starts ~37px under the unit and its first
   inline link is well inside the 160px floor. Separate both sides so an
   in-article ad is never the thing a mis-aimed tap on a link finds, and so a
   PubFuture unit is never flush against an AdSense one. */
.entry-content .stream-item-in-post,
.entry-content .sa-postfold-ad { margin-bottom: var(--sa-ad-safe-gap); }
.entry-content .stream-item-in-post { margin-top: var(--sa-ad-safe-gap); }

/* The below-header unit measured 24px under the header (its Menu / Search
   buttons) and 20px above the article kicker link.

   DELIBERATE DEVIATION from the 160px floor, stated rather than silent: this
   unit is the first thing on the page, so 160px of clearance top and bottom
   would push ~320px of empty space above every article on a 812px screen and
   make an already 14.6s LCP worse. The accidental-click vector here was the
   375px JUMP (it arrived ~8.7s into a slow-4G load and shoved the whole
   article column down), and reserving its height above removes that vector
   completely. What is left is a static banner in a fixed position, which is
   the normal, compliant shape for a below-header slot.

   The real remaining risk is its SIZE — responsive `auto` serves a 1:1 square
   at the full viewport width, i.e. ~46% of a phone screen, sitting between the
   header and the headline. Shrinking that is an AdSense-console change (make
   the unit a fixed 320x100 or 300x250 instead of responsive), not a theme
   change, and it is the recommended next step. */
.stream-item-below-header { margin-top: 48px; margin-bottom: 56px; }

/* Comments end with the "Post Comment" submit; on mobile the sidebar stacks
   directly under it, and the ad widget is the sidebar's FIRST child — measured
   76px of separation. Two independent fixes below: distance, and order.
   Mobile only — on desktop the widget is the top of a real sidebar column and
   there is no button anywhere near it. */
@media (max-width: 991px) {
	.sidebar .stream-item-widget { margin-top: var(--sa-ad-safe-gap); }
}

/* On mobile the sidebar is no longer a sidebar: it stacks under the article,
   the comments and the poll. Move its ad widget to the END of that stack so it
   can never sit next to the poll's VOTE / VIEW RANKING buttons or the comment
   submit. Desktop (>=992px, where the sidebar is a real column and the sticky
   script runs) is untouched — the ad keeps its high-viewability first slot.

   `order` needs a flex parent; `.theiaStickySidebar` is the element the sticky
   script owns, and below 992px that script leaves it alone. */
@media (max-width: 991px) {
	.sidebar .theiaStickySidebar {
		display: flex;
		flex-direction: column;
	}
	.sidebar .theiaStickySidebar > .stream-item-widget,
	.sidebar .theiaStickySidebar > .stream-item-125-widget { order: 99; }
}

/* Poll pages: hard floor on the distance between the end of the poll and
   whatever ad comes next, at every breakpoint. The poll changes height on
   every vote (popup -> success screen -> results swap), so anything close
   underneath it moves under the voter's finger. `~` rather than `+` because
   the share block, the receipt and the related rail can sit in between. */
#totalpoll ~ .stream-item,
#totalpoll ~ .sa-adslot,
.totalpoll-wrapper ~ .stream-item,
.totalpoll-wrapper ~ .sa-adslot { margin-top: max(250px, var(--sa-ad-safe-gap)); }

/* ==========================================================================
   3. OVERLAY / THUMB-ZONE FORMATS — verification note, deliberately no CSS
   ==========================================================================
   Audited 2026-08-07 on the live site, mobile UA, poll article and news
   article: NO ad element computes to `position: fixed` (the only fixed element
   on the page is the theme's own off-canvas panel, z-index 111), no
   interstitial, no pop-under, no auto-refresh. AdSense Anchor and Vignette are
   switched off account-side by the site owner. The in-article PubFuture unit
   is `data-format="video"` and rendered INLINE at 180px in every probe.

   No defensive CSS is shipped here on purpose. Clamping a network's element
   would need selectors we would have to invent (PubFuture ships its markup at
   runtime), and a wrong guess either does nothing or silently breaks a paid
   format. If a floating player ever does appear, the fix belongs in the
   PubFuture dashboard, not in a stylesheet — see the note in skin.css about
   this unit's player being able to detach to `position: fixed`, which is why
   the ad slots are kept out of their own stacking context. */
