/* Print stylesheet for Vogelview report pages.
 *
 * Applied via <link rel="stylesheet" href="/print.css" media="print"> in
 * report viewer routes. Strips chrome, expands findings, forces high-
 * contrast black-on-white, and avoids page breaks inside cards.
 */

@media print {
  /* Strip navigation / floating UI */
  header.app-header,
  nav.app-sidebar,
  nav.mobile-tab-bar,
  .floating-help,
  .floating-cursor,
  .cookie-consent-banner,
  .skip-to-content,
  [data-no-print],
  button[type='button'][aria-label*='Dismiss'],
  button[type='button'][aria-label*='Close'] {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font: 11pt/1.5 -apple-system, system-ui, sans-serif !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  /* Force every interpretation finding to its own card, no truncation */
  .finding-card,
  [data-finding],
  [data-print-expand] {
    page-break-inside: avoid;
    break-inside: avoid;
    background: #ffffff !important;
    border: 1px solid #d0d0d0 !important;
    padding: 12pt !important;
    margin: 8pt 0 !important;
  }

  /* Section headings start on a new page when the section is large enough */
  section[data-section='triage'],
  section[data-section='ancestry'],
  section[data-section='pgx'],
  section[data-section='recommendations'] {
    page-break-before: auto;
  }

  /* Link URLs after each link for printed clarity */
  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    color: #555555;
  }

  /* Drop background gradients and shadows */
  *,
  *::before,
  *::after {
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Tabular columns stay aligned in print */
  table {
    border-collapse: collapse !important;
  }
  th,
  td {
    border: 1px solid #d0d0d0 !important;
    padding: 4pt 6pt !important;
  }

  /* Footer with timestamp + page numbers */
  @page {
    margin: 0.6in;
  }

  /* Hide the AI-personalization disclaimer on print only if user opted out */
  [data-print-hide-ai] {
    display: none !important;
  }

  /* Show citations expanded (collapsed in screen reading) */
  details {
    display: block;
  }
  details > summary {
    list-style: none;
  }
  details > summary::-webkit-details-marker {
    display: none;
  }
  details:not([open]) > *:not(summary) {
    display: revert;
  }
}
