/* ==========================================================================
   print.css — "Download PDF" / printed-report stylesheet
   --------------------------------------------------------------------------
   js/pdf.js assembles a hidden #print-root document (cover + every section +
   every modal, in the active language) and calls window.print(). These rules
   hide the live app and lay #print-root out as a clean, light, paginated
   report. Brand accents are retained on headings/eyebrows; bodies are dark
   ink on white. Nothing here affects the on-screen experience.
   ========================================================================== */

/* Hidden during normal browsing — only rendered for print/PDF. */
#print-root { display: none; }

@media print {
  /* Hide the live application; show only the assembled report. */
  body > *:not(#print-root) { display: none !important; }
  html, body {
    background: #ffffff !important;
    margin: 0;
    padding: 0;
  }

  #print-root {
    display: block !important;
    color: #33394f;
    font-family: "Poppins", system-ui, -apple-system, sans-serif;
    font-size: 10.5pt;
    line-height: 1.5;
    /* Print brand colours, chart fills and rules faithfully. */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page { size: A4; margin: 17mm 15mm; }

  /* ---- Shared elements --------------------------------------------------- */
  #print-root p { margin: 0 0 7pt; color: #3b4258; }
  #print-root a { color: #006b76; text-decoration: underline; text-underline-offset: 1.5pt; }
  #print-root strong { font-weight: 600; color: #1e293b; }
  #print-root h2, #print-root h3, #print-root h4 {
    color: #1e293b;
    font-weight: 600;
    line-height: 1.2;
    break-after: avoid;
  }

  /* Keep figures, charts, stats and headings from splitting awkwardly. */
  #print-root figure,
  #print-root .pdf-chart,
  #print-root .pdf-stat { break-inside: avoid; }

  /* ---- Cover ------------------------------------------------------------- */
  .pdf-cover {
    break-after: page;
    min-height: 250mm;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 30mm;
  }
  /* White master-strap SVG darkened to near-black for the light page. */
  .pdf-cover__logo { width: 62mm; height: auto; filter: brightness(0); margin-bottom: 18mm; }
  .pdf-cover__eyebrow {
    font-size: 11pt; font-weight: 600; letter-spacing: 0.16em;
    text-transform: uppercase; color: #006b76; margin: 0 0 6pt;
  }
  .pdf-cover__title { font-size: 34pt; line-height: 1.05; margin: 0; color: #1e293b; }
  .pdf-cover__meta { margin-top: 10mm; font-size: 10pt; color: #64748b; }

  /* ---- Section scaffold -------------------------------------------------- */
  .pdf-section { break-before: page; }
  .pdf-section > h2 {
    font-size: 21pt;
    margin: 0 0 3mm;
    padding-bottom: 2.5mm;
    border-bottom: 2pt solid #37c5ee;
  }
  .pdf-section--strategy > h2 { border-color: #37c5ee; }
  .pdf-section--content  > h2 { border-color: #ef539e; }
  .pdf-section--finance  > h2 { border-color: #e8a020; }
  .pdf-section--advocacy > h2 { border-color: #006b76; }
  .pdf-lead {
    font-size: 11.5pt; line-height: 1.55; color: #475569;
    margin: 0 0 6mm; max-width: 52em;
  }

  /* ---- Welcome ----------------------------------------------------------- */
  .pdf-welcome p { font-size: 11pt; }
  .pdf-sign {
    margin-top: 6mm; font-size: 9.5pt; color: #64748b;
    border-top: 0.5pt solid #cbd5e1; padding-top: 3mm;
  }
  .pdf-sign strong { color: #1e293b; }

  /* ---- Highlights / stats ------------------------------------------------ */
  .pdf-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm 10mm;
    margin-top: 4mm;
  }
  .pdf-stat { padding-left: 4mm; border-left: 2.5pt solid #37c5ee; }
  .pdf-stat:nth-child(3n+1) { border-color: #37c5ee; }
  .pdf-stat:nth-child(3n+2) { border-color: #ef539e; }
  .pdf-stat:nth-child(3n+3) { border-color: #e8a020; }
  .pdf-stat__eyebrow {
    font-size: 8.5pt; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: #006b76; margin: 0 0 1mm;
  }
  .pdf-stat__num { font-size: 24pt; font-weight: 600; line-height: 1; color: #1e293b; display: block; }
  .pdf-stat__label { font-size: 9.5pt; color: #475569; margin: 1.5mm 0 0; }
  .pdf-stat--statement .pdf-stat__headline { font-size: 13pt; font-weight: 600; color: #1e293b; margin: 0; }

  /* ---- Modal article ----------------------------------------------------- */
  .pdf-modal { margin: 0 0 9mm; }
  .pdf-modal__eyebrow {
    font-size: 8.5pt; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: #006b76; margin: 0 0 1.5mm;
  }
  .pdf-modal > h3 { font-size: 15pt; margin: 0 0 2.5mm; }
  .pdf-modal__intro { font-size: 11pt; color: #33394f; }
  .pdf-modal h4 { font-size: 11.5pt; margin: 4mm 0 2mm; color: #334155; }

  /* Two-column finance/staff layout collapses to single column for print. */
  .pdf-split .pdf-chart { margin-top: 3mm; }

  /* ---- Charts ------------------------------------------------------------ */
  .pdf-chart {
    margin: 4mm 0;
    padding: 4mm;
    border: 0.5pt solid #e2e8f0;
    border-radius: 3mm;
    max-width: 120mm;
  }
  .pdf-chart__label { font-size: 9pt; font-weight: 600; color: #475569; margin: 0 0 2mm; }
  /* Charts are frozen to <img> before printing (see js/pdf.js renderCharts). */
  .pdf-chart canvas,
  .pdf-chart__img { width: 100% !important; height: auto !important; display: block; }
  /* A wide time-series chart uses the full content width instead of the column cap. */
  .pdf-chart--full { max-width: none; }

  /* ---- Images ------------------------------------------------------------ */
  .pdf-figure { margin: 4mm 0; }
  .pdf-figure img {
    width: 100%; max-width: 120mm; max-height: 70mm;
    object-fit: cover; border-radius: 2mm; display: block;
  }
  .pdf-figure figcaption { font-size: 8.5pt; color: #64748b; margin-top: 1.5mm; }

  /* ---- Members ----------------------------------------------------------- */
  .pdf-members__statement { font-size: 11pt; color: #33394f; }
  .pdf-members__link { margin-top: 4mm; font-size: 11pt; color: #33394f; }

  /* ---- Colophon ---------------------------------------------------------- */
  .pdf-colophon {
    break-before: page;
    margin-top: 6mm; padding-top: 4mm;
    border-top: 0.5pt solid #cbd5e1;
    font-size: 9pt; color: #94a3b8;
  }
}
