/* Trading Hub v2 — Print stylesheet (Bible §15.149)
   Long-form pages (/security, /trust, /audit, /audit-quarterly, /audit-form-adv,
   /about/ai/*, /help, /terms, /privacy, /changelog) print cleanly.
   ─────────────────────────────────────────────────────────────────────
   Goals:
   - No nav chrome, no overlays, no interactive UI
   - Black-on-white for readability + ink savings
   - Sized fonts (12pt body / 18pt h1 / 14pt h2)
   - Page breaks at major sections
   - URLs visible after links (so printed copies remain useful)
   - First page has a print-only header with brand + URL + print date
   ───────────────────────────────────────────────────────────────────── */

@media print {
  @page {
    size: letter;
    margin: 0.75in;
  }

  /* Reset to a clean B/W palette */
  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: #999 !important;
  }
  html, body {
    background: #fff !important;
    color: #000 !important;
    font: 11pt/1.45 Georgia, "Times New Roman", serif !important;
  }

  /* Hide navigation + overlays + interactive widgets */
  nav.subnav,
  .crumb,
  .thv2-cmdk-backdrop,
  .thv2-fresh,
  .search-input,
  .controls,
  .actions,
  .btn,
  .toc,
  button,
  [data-thv2-fresh],
  .live-indicator,
  .refresh-meta,
  .last-refresh,
  .subscribe-card,
  #search-empty {
    display: none !important;
  }

  /* Layout: full-width single column */
  .container, .layout {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }
  main, aside { width: auto !important; }

  /* Typography */
  h1 {
    font-size: 22pt !important;
    font-weight: 700 !important;
    margin: 0 0 6pt 0 !important;
    page-break-after: avoid !important;
    border-bottom: 2pt solid #000 !important;
    padding-bottom: 4pt !important;
  }
  h2 {
    font-size: 14pt !important;
    margin: 18pt 0 6pt 0 !important;
    page-break-after: avoid !important;
  }
  h2::before { content: none !important; }
  h3 {
    font-size: 12pt !important;
    margin: 12pt 0 4pt 0 !important;
    page-break-after: avoid !important;
  }
  p, li, td { font-size: 11pt !important; }
  .lede { font-size: 12pt !important; font-style: italic !important; margin-bottom: 12pt !important; }

  /* Tables print with visible borders */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: avoid !important;
    margin: 8pt 0 !important;
  }
  th, td {
    border: 0.5pt solid #888 !important;
    padding: 4pt 6pt !important;
    font-size: 10pt !important;
  }
  th {
    background: #eee !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    font-weight: 700 !important;
  }

  /* Show link URLs after the anchor text */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666 !important;
    word-wrap: break-word;
  }
  /* But don't show URL for in-page anchors or javascript:* */
  a[href^="#"]::after,
  a[href^="javascript:"]::after,
  a[href^="mailto:"]::after {
    content: "";
  }
  /* Email links: keep mailto visible */
  a[href^="mailto:"]::after {
    content: " <" attr(href) ">";
    font-size: 9pt;
  }

  /* Code + monospace — keep readable */
  code, pre {
    font-family: "Courier New", monospace !important;
    font-size: 10pt !important;
    background: #f4f4f4 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    padding: 1pt 3pt !important;
    border: 0.5pt solid #ccc !important;
  }
  pre {
    padding: 6pt !important;
    page-break-inside: avoid !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
  }

  /* Page-break hints */
  .release, .qa-section, .commitment, .panel {
    page-break-inside: avoid !important;
  }
  h1 { page-break-before: avoid !important; }
  h2 { page-break-before: auto !important; }

  /* Print-only header (visible only when printing). Add to pages by including:
     <div class="print-header">Trading Hub v2 · {Page Title}</div>     */
  .print-header {
    display: block !important;
    font-size: 9pt !important;
    color: #666 !important;
    border-bottom: 0.5pt solid #ccc !important;
    padding-bottom: 4pt !important;
    margin-bottom: 12pt !important;
  }
  .print-header::after {
    content: " · Printed " counter(page) " of " counter(pages) " · trading-hub.kylifehub.com";
  }
  /* Hide the print-header in screen view */
}
@media screen {
  .print-header { display: none !important; }
}
