/* Print styles. Served as a static file from /public/ so the root layout
   can load it via `<link rel="stylesheet" href="/print.css" media="print">`,
   which keeps it OFF the render-blocking critical path. Browsers download
   it with low priority and never parse-block initial paint on screen
   media. Moved out of `src/styles/globals.css` 2026-05-22 to recover the
   ~3 KB this block contributed to the homepage's blocking CSS download
   (PSI `render-blocking-insight` flagged 750 ms FCP delay on mobile).
   See docs/public-marketing-performance.md.

   When changing this file, bump the `?v=` query string in the <link>
   tag inside src/app/layout.tsx so browsers don't serve a stale copy
   from disk cache. */

@media print {
  /* Hide non-content UI */
  nav,
  aside,
  header,
  .print\:hidden,
  [data-print-hide],
  [data-sidebar-rail],
  [data-sidebar-panel] {
    display: none !important;
  }

  /* Clean background */
  body,
  main {
    background: white !important;
    color: black !important;
  }

  /* Remove sidebar padding from content wrapper */
  .pl-\[84px\] {
    padding-left: 0 !important;
  }

  /* Statement sizing */
  .bg-surface-0,
  .bg-surface-1 {
    background: white !important;
    border-color: #ccc !important;
  }

  /* Typography for print — general UI */
  * {
    font-size: 10pt !important;
    line-height: 1.4 !important;
  }

  h1,
  h2,
  h3 {
    font-size: 12pt !important;
  }

  /* Financial statement tables use their own sizing */
  .font-\[var\(--font-statement\)\] * {
    font-size: inherit !important;
    line-height: inherit !important;
  }

  .font-\[var\(--font-statement\)\] {
    font-size: 11pt !important;
    line-height: 1.35 !important;
  }

  /* Amounts stay consistent in print */
  .font-numbers {
    font-family: var(--font-numbers) !important;
    font-size: 9pt !important;
  }

  /* Page layout — portrait by default */
  @page {
    margin: 0.6in 0.5in;
    size: letter;
  }

  /* Landscape for consolidated / multi-column statements */
  .print-landscape {
    page: landscape;
  }
  @page landscape {
    size: letter landscape;
    margin: 0.5in 0.4in;
  }

  /* Prevent breaking inside table rows and sections */
  .rounded-xl {
    page-break-inside: avoid;
  }

  tr {
    break-inside: avoid;
  }

  /* Grid-based rows: avoid breaking inside */
  [style*="display: grid"] {
    break-inside: avoid;
  }

  /* Keep subtotal/total rows with preceding content */
  .border-double {
    break-before: avoid;
  }

  .border-t.border-text-primary {
    break-before: avoid;
  }

  /* Repeat table headers across pages */
  thead {
    display: table-header-group;
  }

  /* Preserve colored amounts (negative red, positive green) */
  .text-negative,
  .text-positive {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Remove shadows and rounded corners */
  * {
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Make borders visible in print */
  .border-border-subtle {
    border-color: #999 !important;
  }

  .border-text-primary {
    border-color: #000 !important;
  }

  /* Ensure text colors are dark for readability */
  .text-text-primary {
    color: #000 !important;
  }

  .text-text-secondary {
    color: #333 !important;
  }

  .text-text-tertiary {
    color: #666 !important;
  }

  .text-negative {
    color: #c00 !important;
  }

  .text-positive {
    color: #060 !important;
  }

  /* Statement paper: strip shadow & constraints for print */
  .statement-paper-print {
    box-shadow: none !important;
    max-width: none !important;
    border-radius: 0 !important;
    background: white !important;
  }

  /* Remove horizontal scroll wrappers — let content flow for print */
  .overflow-x-auto {
    overflow: visible !important;
  }
}
