/* ---------------------------------------------------------------
   Print / PDF export.

   The live site is an interactive, scroll-driven experience: chapters
   are pinned and scroll-scrubbed (journey, roadmap), content fades in
   via IntersectionObserver as it's scrolled to, and Presenter Mode
   compacts spacing to fit one viewport per chapter. None of that
   translates to a printed page, so this stylesheet flattens the whole
   site into a linear, fully-visible document: one chapter per page,
   every reveal already "revealed", presenter-mode's compaction
   neutralized back to natural spacing regardless of which mode was
   active when the visitor printed — and each pinned step (journey,
   roadmap) gets its own full page: a clone of the whole chapter with
   just that step's node marked is-active and that step's panel,
   rather than one bare overview page followed by stripped-down step
   pages with no header or track context above them (see main.js's
   buildPrintStepPages()).
--------------------------------------------------------------- */
@media print {
  /* margin: 0 — a nonzero @page margin shrinks the printable content
     box below the full page size, but 100vh (used for min-height below)
     resolves against the full page, not that shrunk box. The mismatch
     made every chapter overflow by the margin amount and bleed a sliver
     onto the next page. Zero the page margin and use our own chapter
     padding for inset instead, so 100vh and "one physical page" match
     exactly. */
  @page {
    size: landscape;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  html, body {
    background: var(--navy-900) !important;
    overflow: visible !important;
  }

  /* -------- Hide all interactive-only chrome -------- */
  .progress-bar,
  .brandmark,
  .navrail,
  .presenter-controls,
  .scroll-cue,
  .pin-hint {
    display: none !important;
  }

  /* -------- Kill scroll/snap mechanics -------- */
  #story {
    scroll-snap-type: none !important;
  }

  /* -------- Every chapter becomes one page, natural spacing --------
     min-height:100vh is intentionally NOT zeroed here: a short chapter
     (e.g. the hero) still needs to occupy a full page so its full-bleed
     background photo has real room to render in, rather than collapsing
     to whatever tiny height its sparse text content would otherwise
     produce. Any chapter whose content genuinely exceeds that floor
     simply grows past it onto additional pages — `overflow: visible`
     is what makes that safe instead of clipping. */
  .chapter {
    display: block !important;
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
    padding: 48px !important;
    page-break-after: always;
    break-after: page;
  }
  .chapter:last-of-type {
    page-break-after: auto;
    break-after: auto;
  }
  .chapter__inner {
    padding: 0 !important;
  }

  /* -------- Force every scroll-reveal to its resolved state -------- */
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Problem cards, comparison-table rows, trust cards, commercial
     cards, fit-check columns and the next-steps items/closing block
     are presenter-mode click-to-build groups (see builds.js) that
     start hidden and reveal one at a time on screen — print always
     shows the fully-built end state, regardless of whichever partial
     build state was on screen when printed. */
  .problemcard,
  .compare__row,
  .trust-card,
  .commercial-card,
  .fitcheck__col,
  .nextsteps__item,
  .cta__final {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  /* main.js's buildPrintStepPages() clones the entire pinned chapter
     once per step (journey: 6 clones, roadmap: 3), each keeping only
     that step's .track__node marked is-active and that step's
     .track__panel (every other panel is removed from the clone
     outright, not just hidden, so nothing duplicates). The live
     chapter is then redundant for print — everything it showed is
     reproduced, per step, across its clones — so it's hidden here. */
  .print-pin-original { display: none !important; }

  /* Within each cloned page, the one surviving .track__panel needs the
     live site's flex row turned into a stacked block layout — num,
     title and description don't read legibly in a fixed-width row on
     a printed page the way they do on screen. */
  .track__panel {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  /* Cloned step pages repeat the chapter header + track above the panel
     on every page — tightening this vertical rhythm for print keeps
     each fully-expanded step on the one page it's meant to occupy. */
  .print-step-page .chapter__header { margin-bottom: 20px; }
  .print-step-page .track { margin-top: 20px; padding-top: 16px; }
  .print-step-page .track__detail { margin-top: 20px; }

  /* Roadmap panels have no in-panel heading (only the icon row on the
     original chapter's page names each phase) — each cloned phase page
     needs a self-contained label since it's now a standalone page. */
  .track__print-label {
    display: block !important;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-soft);
    margin-bottom: 10px;
  }

  /* Roadmap's background photo isn't designed to stretch across three
     stacked phase blocks worth of height — drop it for print rather
     than let it smear/crop oddly. */
  .chapter--roadmap { background: var(--navy-900) !important; }
  .chapter--roadmap .chapter__bg,
  .chapter--roadmap .chapter__scrim { display: none !important; }

  /* chapter__bg deliberately overhangs its chapter by -6% on every side
     for the live site's parallax drift. That overhang relies on the
     chapter's own overflow:hidden to clip it — but overflow is forced
     to visible above (so tall un-pinned content isn't cut off), which
     let the overhang bleed past the page break onto the next printed
     page. Parallax doesn't happen in a static print anyway, so just
     contain the image to its own chapter here. */
  .chapter__bg { inset: 0 !important; }

  /* -------- Force the collapsed "Capital Access" panel open -------- */
  .bonus__body { display: block !important; }
  .bonus summary { display: none !important; }

  /* -------- Let the comparison table use the full page width -------- */
  .compare { overflow: visible !important; }
}
