/* Cluster BB print stylesheet — consumed by puppeteer page.pdf() (defaults to
   print media). Applies to Surface A (placement PDF retrofit) + Surface B
   (Certificate template scaffold; consumer-deferred via PF-BB-1).

   Q-BB-arb-3 (γ): brand integration at template layer; PDF service is
   brand-agnostic. These rules hide chrome (nav/footer) + preserve Saturn
   brand colors at PDF export. Web users at standard browser print operation
   benefit too (graceful side-effect).

   Probe 1 ARCH REFINEMENT mechanical: puppeteer awaits document.fonts.ready
   before page.pdf(); Saturn fonts (Bagel Fat One + DM Sans + IBM Plex Sans
   Thai) load via Google Fonts CDN @import at colors_and_type.css:7. */

@media print {
  /* Saturn brand color preservation at PDF export (Chromium default strips
     backgrounds for paper printing; -webkit-print-color-adjust: exact retains
     brand fidelity). */
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide app chrome (Cluster BB doesn't ship nav/footer in cert templates;
     Surface A web view shares main.ejs layout chrome that should disappear
     at PDF). */
  .eng-nav,
  nav,
  /* Every footer EXCEPT the certificate's own: that one carries the
     verification line ("Verify with the ID above"), and the unscoped rule
     was dropping it from every certificate PDF — the same trap the header
     rule below was already scoped against. */
  footer:not(.cert-frame__footer),
  .no-print,
  script,
  /* The marketing chrome's root is <header>, not <nav> — so the logo and the
     two CTA buttons printed on every PDF, including the placement report,
     which has been shipping that way. Scoped to a DIRECT child of body: an
     unscoped `header` would also hide the certificate frame's own title, which
     is a content header. */
  body > header,
  /* The cookie banner is fixed-position chrome and was printing across the
     bottom of the page. Certificate views also pass hideFooter so it never
     renders at all; this is the belt for every other printable surface. */
  .cns-banner {
    display: none !important;
  }

  /* A4 page setup with reasonable margins (matches PDF_DEFAULTS in
     pdf-generation.js; @page rules document the intent at CSS layer). */
  @page {
    size: A4;
    margin: 20mm 15mm;
  }

  /* Body resets — no flex column at print (single-page content flow). */
  body {
    background: var(--eng-white) !important;
    color: var(--eng-ink) !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  main {
    padding: 0 !important;
  }

  /* Page break helpers for Certificate template scaffold (Surface B). */
  .pdf-page-break-before {
    page-break-before: always;
  }
  .pdf-page-break-avoid {
    page-break-inside: avoid;
  }

  /* Surface A: hero image + cards remain visible; interactive buttons
     (e.g., "เริ่มทดลองใช้ฟรี" magic link CTA) hidden at PDF.

     ⚠️ THE REPORT'S PDF IS A SCREENSHOT OF THE REAL PAGE — puppeteer renders it
     by URL (placement-test.js, renderPdf({ url })), so ANY control added to the
     web report lands in the artefact unless it is hidden here. `.js-report-exit`
     is the "read your weakest skill's articles →" button: a live destination on
     screen, a green rectangle with an arrow pointing at nothing on paper. Same
     call as the magic-link CTA above, and the same reason. */
  .eng-btn--primary[href*="/auth/magic-link"],
  .js-report-exit,
  a[href*="?utm_"] {
    display: none !important;
  }
}
