/* ATLAS · print.css — AuditHunt print stylesheet
 * Provenance: Phase 8 · authored 2026-04-28
 * Spec: DESIGN-BIBLE-v3 §D.12 — "Print CSS is the one light treatment."
 *
 * Apply as a separate stylesheet loaded only for print:
 *   <link rel="stylesheet" href="atlas/print.css" media="print">
 *
 * Goals:
 *   — Invert to white ground (the one light treatment)
 *   — Suppress chrome (nav, footer, fixed elements, feather, crosshair)
 *   — Strip interactive states (hover, focus rings)
 *   — Collapse scroll-driven transforms to their end states
 *   — Ensure all text is readable at black-on-white
 *   — Respect ink economy: no decorative backgrounds
 *   — Page breaks at logical section boundaries
 */

@media print {

  /* ── Ground: white. Text: black. This is the one light treatment. ── */
  :root {
    --ink:       #ffffff !important;
    --night:     #ffffff !important;
    --steel:     #f4f4f4 !important;
    --steel-2:   #e8e8e8 !important;
    --bone:       #000000 !important;
    --ash:        #444444 !important;
    --mute:       #666666 !important;
    --faint:      #cccccc !important;
    --line:       rgba(0,0,0,0.12) !important;
    --line-strong: rgba(0,0,0,0.20) !important;
    --shield-hi:  #1a3a8a !important;
    --gold:       #7a5c1a !important;
    --verify:     #1a6640 !important;
    --ember-hi:   #8a1a1a !important;
    --bronze-hi:  #7a4c10 !important;
    --depth: 0.5 !important;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ── Suppress chrome ── */
  .nav,
  .feather,
  .crosshair-horizon,
  .crosshair-reticle,
  .crosshair-readout,
  .act-marker,
  .skip-link,
  [data-scroll-stage],
  .ss-gradient,
  .ss-motifs,
  .ss-grain,
  .ss-vignette,
  .ss-horizon,
  .pointer-line,
  .bullet-trace,
  .btn-primary,
  .btn-ghost,
  .arrow-link,
  .chip,
  .footer-base .chip,
  #atlas-scroll-stage-root,
  .ah-fid-pill,
  .ah-ids-active::before,
  .ah-ids-active::after {
    display: none !important;
  }

  /* ── Main: full width, no nav offset ── */
  main {
    padding-top: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* ── Typography ── */
  h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif !important;
    font-weight: bold !important;
    color: #000 !important;
    page-break-after: avoid;
    orphans: 3;
    widows: 3;
  }
  h1 { font-size: 24pt !important; margin-bottom: 12pt !important; }
  h2 { font-size: 18pt !important; margin-bottom: 8pt !important; }
  h3 { font-size: 14pt !important; margin-bottom: 6pt !important; }
  p  { orphans: 4; widows: 4; }

  /* ── Code blocks: border, no background ── */
  .code, .code-block, pre, code {
    background: #f8f8f8 !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    font-size: 9pt !important;
    page-break-inside: avoid;
  }

  /* ── Cards: flatten ── */
  .contract-card,
  .finding-card, .finding,
  .detector-chip, .det-chip,
  .aside {
    background: #f4f4f4 !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  /* ── Severity bars: keep colored — match both class conventions ── */
  .finding-card[data-sev="critical"], .finding[data-sev="crit"]  { border-left: 4px solid #8a1a1a !important; }
  .finding-card[data-sev="high"],     .finding[data-sev="high"]  { border-left: 4px solid #7a4c10 !important; }
  .finding-card[data-sev="medium"],   .finding[data-sev="med"]   { border-left: 4px solid #6b5a1f !important; }
  .finding-card[data-sev="low"],      .finding[data-sev="low"]   { border-left: 4px solid #1a3a8a !important; }
  .finding-card[data-sev="info"],     .finding[data-sev="info"]  { border-left: 4px solid #1a6640 !important; }

  /* ── Tables ── */
  table { border-collapse: collapse !important; width: 100% !important; }
  th, td { border: 1px solid #ccc !important; padding: 6pt 8pt !important; color: #000 !important; }
  thead  { background: #f0f0f0 !important; }

  /* ── Links: show URLs ── */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
  }
  a[href^="#"]::after,
  a[href^="javascript"]::after,
  .nav-link::after,
  .btn::after { content: none; }

  /* ── Section breaks ── */
  section { page-break-before: auto; }
  .section { page-break-inside: avoid; }

  /* ── Pinned sequences: collapse to flat ── */
  .ast-pin,
  .radar-pin,
  .replay-pin {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* ── Animations: end state ── */
  * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* ── Footer: minimal ── */
  .footer {
    border-top: 1px solid #ccc !important;
    padding: 12pt 0 0 !important;
    margin-top: 24pt !important;
  }
  .footer * { color: #666 !important; font-size: 8pt !important; }
  .footer-grid { display: none !important; }

  /* ── Page setup ── */
  @page {
    margin: 20mm 18mm 18mm;
    size: A4;
  }
  @page :first {
    margin-top: 28mm;
  }
}
