/* ─────────────────────────────────────────────────────────────
 * SWARM Whitepaper — print stylesheet
 * Loaded only at @media print (and via headless Chrome PDF export).
 * Purpose: produce a clean PDF for grant submissions.
 * Created 2026-06-05 for docs/funding attachment.
 * ───────────────────────────────────────────────────────────── */

@media print {
  /* Page geometry */
  @page {
    size: A4;
    margin: 18mm 16mm 18mm 16mm;
  }

  /* Kill chrome and overlays that don't belong in a PDF */
  #wp-particles,
  canvas,
  .print-bar,
  .site-header,
  .mobile-nav,
  .mobile-menu-btn,
  .cookie-consent-banner,
  .cookie-consent,
  .cookie-banner,
  #cookie-consent,
  #cookie-consent-banner,
  .omega-chat,
  #omegaChat,
  .ai-assistant,
  .type-cursor,
  .scroll-progress,
  .back-to-top,
  .floating-bee,
  .cosmic-bg,
  .stars,
  .nebula {
    display: none !important;
  }

  /* Reveal anything hidden behind entrance / scroll animations.
   * On screen these classes start at opacity:0 and animate in;
   * print disables animations, so without this they'd stay invisible. */
  .hero-fade-in,
  .scroll-reveal,
  .wp-reveal,
  [data-reveal],
  .fade-in,
  .slide-in,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    animation: none !important;
  }

  /* The hero "typed" tagline pulls its text from data-type-text — JS
   * normally injects it. For print we surface it via CSS so PDFs from
   * the live URL still show the subtitle even if JS hasn't typed yet. */
  [data-type-text]::before {
    content: attr(data-type-text);
  }
  [data-type-text] .type-cursor { display: none !important; }

  /* Force readable colors on white paper */
  html, body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 10.5pt;
    line-height: 1.55;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Remove dark backgrounds from cards/boxes so text reads on paper */
  .disclaimer-box,
  .toc,
  .callout,
  .info-box,
  .warn-box,
  pre, code,
  section, header, footer,
  .doc-header,
  .card, .stat-card, .feature-card {
    background: transparent !important;
    color: #111 !important;
    border-color: #cccccc !important;
    box-shadow: none !important;
  }

  /* Links — keep cyan brand but darken slightly for contrast on white */
  a, a:link, a:visited {
    color: #0066cc !important;
    text-decoration: none;
  }

  /* Avoid awkward breaks */
  h1, h2, h3, h4 { page-break-after: avoid; break-after: avoid; }
  pre, table, figure, .disclaimer-box, .toc { page-break-inside: avoid; break-inside: avoid; }

  /* Full-width layout for print */
  .page-wrap {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Logo image: keep but cap height */
  .doc-header img, .logo-wrap img {
    max-height: 56px !important;
    width: auto !important;
    filter: none !important;
  }
}
