/* ═══════════════════════════════════════════════════════════════
   OmicsLab — Print Styles (Prompt 12)
   ─ Clean researcher report output for all pages
   ─ Hides nav, sidebars, UI chrome; expands content for print
   ═══════════════════════════════════════════════════════════════ */

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

  /* ── Reset ── */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* ── Body / background ── */
  html, body {
    background: #fff !important;
    color: #111 !important;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 11pt;
    line-height: 1.6;
  }

  /* ── Hide chrome ── */
  .landing-nav,
  #main-nav,
  .nav-primary,
  .nav-hamburger,
  .nav-right,
  #nav-right,
  #nt-container,
  #nt-panel,
  #oi-bar,
  #nt-bell-btn,
  .nav-settings-btn,
  .page-route-header,
  .hero,
  .stats-strip,
  #home-page-content,
  .screen-chooser,
  #screen-chooser,
  .sidebar,
  .st-nav,
  .ot-header-actions,
  .ot-filters,
  .ot-export-btns,
  .ot-item-actions,
  .ot-back-btn,
  .ot-form,
  .kg-controls .kg-zoom-btns,
  .kg-sidebar .kg-stats,
  .sra-download-btn,
  .pw-tab-strip,
  button:not(.print-keep),
  [onclick]:not(.print-keep),
  .skip-link,
  footer,
  .footer,
  #install-banner,
  .tour-overlay,
  .er-wrap {
    display: none !important;
  }

  /* ── Show sections that are hidden by router ── */
  .reveal {
    display: block !important;
  }

  /* ── Screen-landing becomes plain container ── */
  #screen-landing {
    overflow: visible !important;
    height: auto !important;
  }

  /* ── Links: show URL ── */
  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 8pt;
    color: #555;
  }
  a[href^="#"]::after,
  a[href^="javascript"]::after {
    content: '' !important;
  }

  /* ── Prevent widows/orphans ── */
  p, li { orphans: 3; widows: 3; }
  h1, h2, h3, h4 { page-break-after: avoid; }
  table, figure, .ot-kpi-row, .ot-list, .kg-wrap { page-break-inside: avoid; }

  /* ── Output Tracker print view ── */
  .ot-wrap { max-width: 100% !important; padding: 0 !important; }
  .ot-item {
    border: 1pt solid #ccc !important;
    background: #fff !important;
    break-inside: avoid;
    margin-bottom: 6pt;
  }
  .ot-item-title { color: #000 !important; font-weight: bold; }
  .ot-item-meta { color: #444 !important; }
  .ot-tag { background: #eee !important; color: #333 !important; }
  .ot-summary-row { display: none !important; }
  .ot-stats .ot-year-chart,
  .ot-stats .ot-type-bars { break-inside: avoid; }
  .ot-kpi { border: 1pt solid #ccc !important; background: #f9f9f9 !important; }
  .ot-kpi-num { color: #000 !important; }

  /* ── Knowledge Graph print view ── */
  .kg-canvas-wrap { border: 1pt solid #ccc !important; break-inside: avoid; max-height: 400pt; overflow: hidden !important; }
  .kg-detail { border: 1pt solid #ccc !important; background: #f9f9f9 !important; }
  .kg-detail-name { color: #000 !important; }
  .kg-detail-desc { color: #333 !important; }
  .kg-svg text { fill: #333 !important; }

  /* ── Gene Lookup print ── */
  .gl-card { border: 1pt solid #ccc !important; break-inside: avoid; }
  .gl-dgn-table td, .gl-dgn-table th { border: 1pt solid #ddd !important; }

  /* ── SRA Browser print ── */
  .sra-pinned-card { border: 1pt solid #ccc !important; break-inside: avoid; }

  /* ── Pathway map print ── */
  .pw-map-scroll { max-height: 350pt !important; overflow: hidden !important; }
  .pw-layout { grid-template-columns: 1fr !important; }
  .pw-panel { display: none !important; }

  /* ── Analysis print ── */
  .az-canvas, canvas { max-width: 100% !important; }

  /* ── Tables ── */
  table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  th { background: #eee !important; color: #000 !important; font-weight: bold; }
  td, th { border: 1pt solid #ccc; padding: 4pt 6pt; }
  tr:nth-child(even) { background: #f9f9f9 !important; }

  /* ── OmicsLab print header (auto-inserted via JS) ── */
  body::before {
    content: 'OmicsLab — Africa Genomics Training Platform';
    display: block;
    font-size: 8pt;
    color: #777;
    border-bottom: 1pt solid #ccc;
    padding-bottom: 4pt;
    margin-bottom: 12pt;
    font-family: 'Inter', sans-serif;
  }
  body::after {
    content: 'omicslab.africa  ·  Printed: ' attr(data-print-date);
    display: block;
    font-size: 7pt;
    color: #aaa;
    border-top: 1pt solid #eee;
    padding-top: 4pt;
    margin-top: 20pt;
    text-align: center;
  }
}
