/* ==========================================================================
   Print / Save-as-PDF stylesheet for the capacity report.

   Loaded with media="print", so every rule here applies only when printing.
   The screen-side rules that hide .rep-cover and .rep-print-header live in
   report.css; putting them here would hide the print chrome from the print.

   Layout: a full cover page, then the report sections. Browsers do not support
   @page margin boxes, so there are no automatic page numbers. The running
   header carries identity instead.
   ========================================================================== */

@page {
  margin: 16mm 16mm 18mm;
}

@media print {

  /* Chrome and Safari both need this or fills and the day bar print white. */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html, body {
    background: #fff !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10pt;
    line-height: 1.45;
    color: #1a2b3c;
  }

  /* Strip everything interactive or navigational. */
  .header, .top-bar, .footer, .main-nav, .mobile-drawer,
  .cap-breadcrumb, nav, form, button,
  .cap-btn-primary, .cap-btn-secondary, .cap-btn-quiet,
  .cap-chips, .cap-gate-card, .cap-cta,
  .rep-actions, .rep-notice, #elogiiConsentBanner, .no-print {
    display: none !important;
  }

  .rep-page { max-width: none; margin: 0; padding: 0; }

  /* The on-screen h1 is redundant once the cover carries the title. */
  .rep-page > h1 { display: none; }

  /* ---------------------------------------------------------- cover page -- */

  .rep-cover {
    display: flex !important;
    flex-direction: column;
    /* US Letter is 279.4mm; less the 16mm/18mm @page margins that leaves
       245.4mm of content box. Anything at or near that spills onto a second
       page and leaves an almost-empty orphan, so this sits well under it and
       the cover simply ends early on A4. */
    min-height: 200mm;
    break-after: page;
    page-break-after: always;
  }

  .rep-cover-logo { height: 26pt; width: auto; margin-bottom: 44pt; }

  .rep-cover-eyebrow {
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #00b7e5 !important;
    margin: 0 0 10pt;
  }

  .rep-cover-headline {
    font-size: 30pt;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 12pt;
    max-width: 22em;
  }

  .rep-cover-band {
    font-size: 13pt;
    color: #5a6670 !important;
    margin: 0 0 34pt;
    padding-bottom: 22pt;
    border-bottom: 2pt solid #1a2b3c;
  }

  .rep-cover-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16pt 28pt;
    margin: 0;
  }
  .rep-cover-stats dt {
    font-size: 8.5pt;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a6670 !important;
    margin: 0 0 3pt;
  }
  .rep-cover-stats dd {
    font-size: 17pt;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
  }

  /* Pushed to the bottom of the cover. */
  .rep-cover-foot { margin-top: auto; padding-top: 28pt; }
  .rep-cover-caveat {
    font-size: 8.5pt;
    line-height: 1.5;
    color: #5a6670 !important;
    margin: 0 0 6pt;
    max-width: 42em;
    padding-top: 10pt;
    border-top: 1px solid #e0e4ea;
  }
  .rep-cover-meta { font-size: 8.5pt; color: #8a9bab !important; margin: 0; }

  /* ------------------------------------------------------ running header -- */

  .rep-print-header {
    display: flex !important;
    align-items: center;
    gap: 10pt;
    border-bottom: 1px solid #e0e4ea;
    padding-bottom: 6pt;
    margin-bottom: 16pt;
  }
  .rep-print-header img { height: 14pt; width: auto; }
  .rep-print-header .rep-print-title {
    font-size: 8.5pt;
    font-weight: 600;
    color: #5a6670 !important;
    margin: 0;
  }

  .rep-print-footer {
    display: block !important;
    margin-top: 18pt;
    padding-top: 8pt;
    border-top: 1px solid #e0e4ea;
    font-size: 8pt;
    color: #8a9bab !important;
  }
  .rep-print-footer p { margin: 0 0 2pt; }

  /* ---------------------------------------------------------------- flow -- */

  .rep-block {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 18pt;
  }

  /* The full working is long and may legitimately span pages. */
  .rep-break-before { break-before: page; page-break-before: always; }

  .rep-headline {
    break-inside: avoid;
    page-break-inside: avoid;
    background: #f4f5f7 !important;
    border-left: 3pt solid #00b7e5 !important;
    color: #1a2b3c !important;
    padding: 12pt 14pt;
    border-radius: 0;
    margin-bottom: 18pt;
  }
  .rep-headline h2 { font-size: 15pt; margin: 0 0 4pt; color: #1a2b3c !important; }
  .rep-headline .rep-eyebrow {
    color: #5a6670 !important; font-size: 8pt; letter-spacing: 0.1em; margin: 0 0 4pt;
  }
  .rep-headline .rep-sub, .rep-headline .rep-band {
    color: #5a6670 !important; font-size: 9.5pt; margin: 0 0 3pt;
  }
  .rep-headline strong { color: #1a2b3c !important; }

  h3 {
    font-size: 12pt;
    margin: 0 0 5pt;
    padding-bottom: 3pt;
    border-bottom: 1px solid #e0e4ea;
    break-after: avoid;
    page-break-after: avoid;
  }
  h4 { font-size: 10pt; margin: 9pt 0 3pt; break-after: avoid; page-break-after: avoid; }

  /* -------------------------------------------------------------- tables -- */

  .cap-table-wrap { overflow: visible !important; }

  .cap-table {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 8pt;
    border-collapse: collapse;
  }
  .cap-table caption { font-size: 8pt; padding-bottom: 4pt; color: #5a6670 !important; }
  .cap-table th, .cap-table td { padding: 4pt 5pt; border-bottom: 1px solid #e8eaed; }
  /* On screen a wide table scrolls; on paper it has nowhere to go and gets
     clipped, so headers and figures are allowed to wrap instead. */
  .cap-table th { white-space: normal !important; }
  .cap-table .cap-num { white-space: normal !important; }
  .cap-table { table-layout: fixed; }
  .cap-table thead th {
    background: #1a2b3c !important;
    color: #fff !important;
    font-size: 7pt;
    letter-spacing: 0.03em;
    border-bottom: none;
  }
  /* Repeat headers when a table breaks across pages. */
  .cap-table thead { display: table-header-group; }
  .cap-table tr { break-inside: avoid; page-break-inside: avoid; }
  .cap-table tbody tr:nth-child(even) { background: #fafbfc !important; }
  .rep-base-row { background: #eaf6fb !important; font-weight: 700; }

  .cap-pos { color: #2f855a !important; }
  .cap-neg { color: #c53030 !important; }

  /* ------------------------------------------------------------- working -- */

  .cap-maths-trace {
    background: #f4f5f7 !important;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 7.2pt;
    line-height: 1.5;
    padding: 8pt 10pt;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: visible !important;
    break-inside: auto;
    page-break-inside: auto;
  }

  .rep-assumptions { font-size: 8.5pt; padding-left: 13pt; }
  .rep-assumptions li { margin-bottom: 3pt; break-inside: avoid; }

  .rep-guidance { break-inside: avoid; page-break-inside: avoid; margin-bottom: 9pt; }
  .rep-guidance ul { font-size: 8.5pt; padding-left: 13pt; margin: 0; }
  .rep-guidance li { margin-bottom: 3pt; }

  .rep-note { font-size: 8pt; color: #5a6670 !important; margin: 0 0 5pt; }

  .cap-daybar { height: 12pt; border-radius: 2pt; }
  .cap-daybar-seg { box-shadow: inset -1pt 0 0 #fff; }
  .cap-daybar-legend { font-size: 8pt; }

  a { text-decoration: none; color: inherit; }
}
