/* ════════════════════════════════════════════════════════════════════
   PinInspect — Google Ad Manager slot styling (pi-gam3.css,
   2026-11-14). GAM v4 adds the PI_Hero_Search rules at the bottom;
   GAM v3 added the PI_Hero_CTA rules; everything else is
   pi-gam1.css verbatim. Companion to public/js/pi-gam3.js; loaded only on
   pages that carry GAM slots (injected by routes/publicPages.js
   alongside the GPT tags), so app pages never pay for it.

   Jobs: centre the slot, print the small "Advertisement" label the
   site already uses on its Perch slot, and — the important one —
   RESERVE the slot's height before the ad arrives so the page never
   jumps (layout shift is what makes ads feel intrusive). An
   unfilled slot collapses fully, label included (.pi-gam-empty is
   set by pi-gam1.js on GPT's slotRenderEnded, and GPT's own
   collapseEmptyDivs handles the inner box).
   ════════════════════════════════════════════════════════════════════ */
.pi-gam {
  margin: 30px auto;
  max-width: 970px;
  padding: 0 12px;
  text-align: center;
  clear: both;
  /* GAM build fix (2026-11-13, staging-proven): inside the tool
     landings' .seo-tool-content GRID, an auto-margined item shrinks
     to its content width (the slot collapsed to 123px — the label
     text). Full width + spanning every grid column keeps the slot
     a full content band in grid and block layouts alike. */
  width: 100%;
  box-sizing: border-box;
  grid-column: 1 / -1;
}
.pi-gam-label {
  display: block;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6F6357;
  margin-bottom: 6px;
}
.pi-gam-box {
  margin: 0 auto;
  /* Phone-first reservation: the phone size sets top out at 250px
     tall (300x250 in PI_Home_Mid / mid-article); leaderboards are
     100px. Per-unit overrides below set the exact reservation. */
  min-height: 100px;
}
.pi-gam-empty { display: none !important; }

/* Per-unit reserved heights (largest size in each mapping row), so
   the reserved box matches what will actually render. */
.pi-gam--home-mid .pi-gam-box { min-height: 100px; }
.pi-gam--home-tools .pi-gam-box { min-height: 100px; }
.pi-gam--home-lower .pi-gam-box { min-height: 100px; }
/* GAM v2 (2026-11-13): the login slot lives inside the auth
   dialog's form column, below the sign-in form. It keeps the
   dialog's own width (never wider than the 336px large format),
   sits tight under the form, and — like every slot — collapses
   fully via .pi-gam-empty so an unfilled login page is pixel-true
   to the approved cream design. */
.pi-gam--login { margin: 18px auto 4px; max-width: 336px; padding: 0; }
.pi-gam--login .pi-gam-box { min-height: 250px; }
.pi-gam--tool-content .pi-gam-box { min-height: 250px; }
.pi-gam--tool-bottom .pi-gam-box { min-height: 100px; }
.pi-gam--article-intro .pi-gam-box { min-height: 250px; }
.pi-gam--article-mid .pi-gam-box { min-height: 250px; }
.pi-gam--article-end .pi-gam-box { min-height: 250px; }

@media (min-width: 768px) {
  .pi-gam--home-mid .pi-gam-box { min-height: 90px; }
  .pi-gam--home-tools .pi-gam-box { min-height: 90px; }
  .pi-gam--home-lower .pi-gam-box { min-height: 90px; }
  .pi-gam--login .pi-gam-box { min-height: 280px; }
  .pi-gam--tool-content .pi-gam-box { min-height: 90px; }
  .pi-gam--tool-bottom .pi-gam-box { min-height: 90px; }
  .pi-gam--article-intro .pi-gam-box { min-height: 90px; }
  .pi-gam--article-mid .pi-gam-box { min-height: 280px; }
  .pi-gam--article-end .pi-gam-box { min-height: 90px; }
}
@media (min-width: 1024px) {
  .pi-gam--home-mid .pi-gam-box { min-height: 250px; }
  /* PI_Home_Tools carries the PI_Home_Mid size set (970x250 at
     desktop); PI_Home_Lower carries the PI_Tool_Bottom set, whose
     tallest desktop format is 90px — the 768px rule above stands. */
  .pi-gam--home-tools .pi-gam-box { min-height: 250px; }
  .pi-gam--tool-content .pi-gam-box { min-height: 90px; }
  .pi-gam--article-intro .pi-gam-box { min-height: 90px; }
  .pi-gam--article-mid .pi-gam-box { min-height: 280px; }
  .pi-gam--article-end .pi-gam-box { min-height: 250px; }
}

/* GAM v3 (2026-11-14, owner order): PI_Hero_CTA sits INSIDE the
   homepage hero, directly above the "Start Free Today" button
   row. It keeps a clear gap under the ad (18px bottom margin, on
   top of the CTA row's own spacing) so the ad can never crowd
   the button, centres like the hero text it lives in, and — like
   every slot — collapses fully via .pi-gam-empty when unfilled,
   leaving the hero pixel-true to the no-ads design. Reserved
   heights mirror the unit's mapping: 100px on phones (the
   320x100 leaderboard leads the set), 90px from 768px up (the
   desktop set tops out at 970x90). */
.pi-gam--hero-cta { margin: 22px auto 18px; max-width: 970px; padding: 0 12px; }
.pi-gam--hero-cta .pi-gam-box { min-height: 100px; }
@media (min-width: 768px) {
  .pi-gam--hero-cta .pi-gam-box { min-height: 90px; }
}

/* GAM v4 (2026-11-14, owner order 18:37): PI_Hero_Search sits
   INSIDE the hero keyword panel, directly below the search row
   (under the "Preview data shown instantly…" note) and above the
   Popular chips + results area. It follows the panel's own
   rhythm: a clear gap above it, a slim gap below (the chips
   carry their own top margin from the hero styles), panel width
   with the standard 970px cap, no side padding (the panel's own
   padding already insets it), and — like every slot — it
   collapses fully via .pi-gam-empty when unfilled, so the
   resting panel stays clean. It lives OUTSIDE
   #freeKeywordPreviewResults, so it is present in the empty
   resting state and stays above the report after a search.
   Reserved heights mirror the unit's mapping: 100px on phones
   (320x100 leads the set), 90px from 768px up (970x90 tops the
   desktop set). */
.pi-gam--hero-search { margin: 18px auto 2px; max-width: 970px; padding: 0; }
.pi-gam--hero-search .pi-gam-box { min-height: 100px; }
@media (min-width: 768px) {
  .pi-gam--hero-search .pi-gam-box { min-height: 90px; }
}

/* ════════════════════════════════════════════════════════════
   ADS-COMPLETION (2026-11-16): everything above is pi-gam3.css
   verbatim. This appended block is the ONLY change in
   pi-gam4.css — the BOTTOM ANCHOR body reservation (GAM study
   2026-11-15 §4.1: the publisher's CSS must reserve
   padding-bottom equal to the anchor height on <body>, or the
   anchor covers content and buttons).
   pi-gam7.js adds .pi-has-bottom-anchor to <body> when the
   PI_Web_Anchor out-of-page slot is defined, and removes it if
   the anchor renders empty — so this space exists only while
   an anchor can actually show. Heights mirror the anchor's
   reservation sizes (study §4.1): phones 320x100 max -> 100px;
   tablet/desktop 728x90 / 970x90 -> 90px. The env() line adds
   the phone's bottom safe-area inset where the browser
   supports it; the plain line above it is the fallback.
   The anchor's own container is generated by GPT — there is
   deliberately no .pi-gam holder rule for PI_Web_Anchor.
   ════════════════════════════════════════════════════════════ */
body.pi-has-bottom-anchor { padding-bottom: 100px; padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) {
  body.pi-has-bottom-anchor { padding-bottom: 90px; }
}

/* ════════════════════════════════════════════════════════════
   HERO-3ADS (2026-11-18, owner order 19:45): everything above is
   pi-gam5.css verbatim. This appended block is the ONLY change
   in pi-gam6.css — the PI_Hero_Mid holder rules. PI_Hero_Mid
   sits INSIDE the homepage hero copy, between the H1 and the
   lead paragraph, PHONES ONLY (the holder is inserted at parse
   time only at <=860px, so these rules never take effect on
   desktop). It follows the hero-cta rhythm: a clear gap under
   the headline, a slim gap above the lead, and a reserved
   height matching the unit's phone mapping (320x100 leads the
   set) so the hero never jumps when the ad arrives. Like every
   slot it collapses fully via .pi-gam-empty when unfilled,
   leaving the hero pixel-true to the no-ads design. The slot
   box is capped to the copy column by the #home guards in
   pi-approved-clean5.css, so an over-wide creative can never
   stretch the hero.
   ════════════════════════════════════════════════════════════ */
.pi-gam--hero-mid { margin: 16px auto 8px; max-width: 970px; padding: 0 12px; }
.pi-gam--hero-mid .pi-gam-box { min-height: 100px; }
