/* ==========================================================================
   FEMH Inaugural Report — Print Stylesheet
   Optimised for A4. Content width fits within US Letter margins too.
   ========================================================================== */

@media print {

  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* -- Pages ---------------------------------------------------------- */
  @page {
    size: A4;
    margin: 18mm 16mm 18mm;
    @bottom-left {
      content: "femh.foundation";
      font-family: "Inter", sans-serif;
      font-size: 7pt;
      color: #6B7F7B;
    }
    @bottom-center {
      content: counter(page);
      font-family: "Inter", sans-serif;
      font-weight: 600;
      font-size: 8pt;
      color: #0F4A44;
    }
    @bottom-right {
      content: "Before Evolution · The State of Mental Health";
      font-family: "Inter", sans-serif;
      font-size: 7pt;
      color: #6B7F7B;
    }
  }
  /* The cover is the very first page. Zero margins so the cover bleeds
     to the paper edge, and suppress the running footer. */
  @page :first {
    margin: 0;
    @bottom-left { content: ""; }
    @bottom-center { content: ""; }
    @bottom-right { content: ""; }
  }

  html, body {
    background: #fff !important;
    color: #0B2A26 !important;
    font-size: 8pt;
    line-height: 1.4;
  }
  body { margin: 0; overflow-x: visible !important; }

  .site-nav, .nav-toggle, .btn-print, .skip-link,
  .site-hero, .site-footer { display: none !important; }
  .site-hero__currency-note { display: none !important; }
  .section-divider { display: none !important; }

  /* ============================================================
     COVER PAGE — full A4 bleed (restored to the version that worked)
     ============================================================ */
  .print-cover {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    box-sizing: border-box;
    width: 210mm;
    min-height: 297mm;
    padding: 32mm 24mm 28mm;
    background: #0F4A44 !important;
    color: #fff !important;
    page-break-after: always;
    break-after: page;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
    position: relative;
    overflow: hidden;
  }
  .print-cover__top, .print-cover__bottom { position: relative; z-index: 2; }
  .print-cover__mark {
    position: absolute;
    right: -30mm; bottom: -30mm;
    width: 160mm; height: 160mm;
    opacity: 0.10;
    z-index: 1;
  }
  .print-cover__eyebrow {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 10pt;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #CFDDDB !important;
    margin-bottom: 8mm;
  }
  .print-cover__title {
    font-family: "Source Serif 4", Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 38pt;
    line-height: 1.05;
    color: #CFDDDB !important;
    margin: 0 0 4mm;
  }
  .print-cover__subtitle {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 400;
    font-size: 60pt;
    line-height: 1.0;
    color: #fff !important;
    margin: 0 0 14mm;
    letter-spacing: -0.02em;
  }
  .print-cover__lede {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 300;
    font-size: 14pt;
    line-height: 1.45;
    color: #CFDDDB !important;
    max-width: 130mm;
    margin: 0;
  }
  .print-cover__meta {
    border-top: 0.5pt solid rgba(255,255,255,0.3);
    padding-top: 8mm;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8mm;
    font-family: "Inter", sans-serif;
    font-size: 9.5pt;
    line-height: 1.5;
    color: #CFDDDB !important;
  }
  .print-cover__meta strong {
    display: block;
    font-size: 8.5pt;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65) !important;
    margin-bottom: 2mm;
    font-weight: 600;
  }
  .print-cover__currency {
    margin-top: 8mm;
    font-family: "Source Serif 4", Georgia, serif;
    font-style: italic;
    font-size: 8.5pt;
    color: rgba(255,255,255,0.55) !important;
    line-height: 1.45;
  }
  .print-cover__charity {
    margin-top: 10mm;
    font-family: "Inter", sans-serif;
    font-size: 8.5pt;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5) !important;
  }

  /* ============================================================
     TYPOGRAPHY
     ============================================================ */
  h1, h2, h3, h4 {
    color: #0B2A26 !important;
    page-break-after: avoid;
    break-after: avoid;
  }
  h1, .section-title { font-size: 20pt; line-height: 1.1; margin: 0 0 5pt; }
  h2, .subsection-title { font-size: 11pt; line-height: 1.2; margin: 10pt 0 3pt; }
  h3 { font-size: 9.5pt; }
  p, li { font-size: 8pt; line-height: 1.4; orphans: 3; widows: 3; }
  .lead { font-size: 9pt; line-height: 1.45; }

  /* Chapter eyebrow */
  .section-num {
    font-size: 9pt !important;
    letter-spacing: 0.22em;
    color: #1E8F7E !important;
    margin: 0 0 4pt;
    font-weight: 700;
    display: block !important;
  }
  .section-num::before { display: none !important; }
  .section-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 400;
    color: #0F4A44 !important;
    border-bottom: 1pt solid #0F4A44;
    padding-bottom: 4pt;
    margin-bottom: 10pt;
  }
  .section-title--lead {
    font-size: 24pt !important;
    border-bottom: 1.2pt solid #0F4A44;
  }

  /* Drop the right-side watermark in print to free up width */
  .section[data-numbered]::before { display: none !important; }

  /* Executive summary section: extra top breathing room after the
     Key Findings panel, and slightly bigger lede paragraph */
  #summary { padding-top: 10mm !important; }
  #summary p, #summary li { font-size: 8.5pt; line-height: 1.45; }
  #summary .lead { font-size: 10pt; }
  .summary-part p { font-size: 7.5pt; line-height: 1.4; }

  /* ============================================================
     PART OPENERS — fill exactly one A4 page each
     ============================================================ */
  .part-opener {
    page-break-before: always;
    break-before: page;
    page-break-after: always;
    break-after: page;
    background: #0F4A44 !important;
    color: #fff !important;
    box-sizing: border-box;
    width: 100%;
    height: calc(297mm - 36mm) !important;
    min-height: 0 !important;
    padding: 60mm 22mm !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
  }
  .part-opener__num   { color: rgba(255,255,255,0.20) !important; font-size: 110pt; line-height: 1; margin: 0 0 8mm; }
  .part-opener__label { color: #CFDDDB !important; font-size: 11pt; letter-spacing: 0.22em; margin: 0 0 5mm; }
  .part-opener__title { color: #fff !important; font-size: 40pt; line-height: 1.05; margin: 0; }
  .part-opener__mark {
    width: 140mm !important;
    max-width: none !important;
    opacity: 0.10 !important;
    right: -10mm !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    position: absolute !important;
  }

  /* ============================================================
     SECTIONS — start each on a fresh page; tighter prose width
     ============================================================ */
  .section[data-print-break] {
    page-break-before: always;
    break-before: page;
  }
  .section { padding: 0 !important; }
  .prose, .prose-mid {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .container, .container-mid, .container-narrow {
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* ============================================================
     BOX TYPES IN PRINT
     ============================================================ */
  .box {
    page-break-inside: avoid;
    break-inside: avoid;
    border-radius: 2pt;
    padding: 4mm 5mm;
    margin: 3mm 0;
  }
  .box__title { font-size: 12pt; line-height: 1.2; margin: 0 0 3pt; }
  .box__eyebrow { font-size: 7.5pt; }

  .box-key-findings {
    background: #F7F4EC !important;
    border-left: 2.5pt solid #0F4A44 !important;
  }
  .box-key-findings .box__title { font-size: 14pt; }
  .box-key-findings li { font-size: 8pt; line-height: 1.4; }

  .box-crisis-stats { background: #F7F4EC !important; }
  .stat-card { background: #fff !important; border: 0.5pt solid #D9D9D6 !important; padding: 2.5mm; }
  .stat-card__body { font-size: 7.5pt; line-height: 1.4; }
  .stat-card__region { font-size: 7pt; }
  .stat-card__src { font-size: 6.5pt; }

  .box-femh-proposes {
    background: #0F4A44 !important;
    color: #fff !important;
    border-radius: 2pt;
  }
  .box-femh-proposes::after { display: none; }
  .box-femh-proposes .box__eyebrow { color: #8FD4C4 !important; }
  .box-femh-proposes .box__title   { color: #fff !important; font-size: 13pt; }
  .box-femh-proposes p, .box-femh-proposes li { color: #D6EBE6 !important; font-size: 8pt; }
  .box-femh-proposes h4 { font-size: 9pt; }
  .box-femh-proposes a, .box-femh-proposes strong,
  .box-femh-proposes h3, .box-femh-proposes h4 { color: #fff !important; }

  .box-case-study {
    background: #F7F4EC !important;
    border-top: 1.5pt solid #1E8F7E !important;
  }
  .box-case-study p { font-size: 8pt; line-height: 1.45; }
  .box-feature {
    background: #fff !important;
    border: 0.5pt solid #D9D9D6 !important;
  }
  .box-feature p, .box-feature li { font-size: 8pt; line-height: 1.45; }
  .box-institutional {
    background: #fff !important;
    border: 0.5pt solid #D9D9D6 !important;
    grid-template-columns: 1fr 2fr !important;
    gap: 5mm !important;
  }
  .box-institutional p, .box-institutional li { font-size: 8pt; line-height: 1.4; }
  .box-institutional__name { font-size: 12pt; }
  .box-institutional__detail { font-size: 7.5pt; }

  /* Expert bios */
  .box-expert {
    background: #F7F4EC !important;
    grid-template-columns: 22mm 1fr !important;
    gap: 4mm !important;
    padding: 4mm 5mm !important;
  }
  .box-expert__photo { width: 22mm !important; height: 22mm !important; }
  .box-expert__name  { font-size: 11pt; margin-bottom: 2pt; }
  .box-expert__bio   { font-size: 7.5pt; line-height: 1.4; margin-bottom: 2.5mm; }
  .box-expert__quote { font-size: 9.5pt; line-height: 1.4; }

  .box-next-gen {
    background: #fff !important;
    border-top: 1.5pt solid #3D6B5E !important;
    grid-template-columns: 18mm 1fr !important;
    gap: 4mm !important;
    padding: 4mm 5mm !important;
  }
  .box-next-gen__photo { width: 18mm !important; height: 18mm !important; }
  .box-next-gen__name { font-size: 11pt; }
  .box-next-gen__bio  { font-size: 7.5pt; }
  .box-next-gen__body { font-size: 8pt; }

  /* Pull quotes */
  .pull-quote {
    page-break-inside: avoid;
    break-inside: avoid;
    border-left: 1.5pt solid #0F4A44 !important;
    margin: 4mm 0;
    padding-left: 4mm;
  }
  .pull-quote__text { font-size: 10.5pt; line-height: 1.4; font-style: italic; color: #0B2A26 !important; }
  .pull-quote__cite { font-size: 7.5pt; }

  /* Hero pull quote (Hunt opener) */
  .pull-quote--hero {
    background: #F7F4EC !important;
    border-left: 2.5pt solid #0F4A44 !important;
    grid-template-columns: 22mm 1fr !important;
    gap: 5mm !important;
    padding: 5mm 6mm !important;
  }
  .pull-quote--hero .pull-quote__text { font-size: 10.5pt; }
  .pull-quote__photo { width: 22mm !important; height: 22mm !important; }

  .pull-quote--with-photo {
    grid-template-columns: 20mm 1fr !important;
    gap: 4mm !important;
  }
  .pull-quote--with-photo .pull-quote__photo { width: 20mm !important; height: 20mm !important; }

  /* Cambridge spotlight — print FULL bios and quotes */
  .spotlight {
    background: #F7F4EC !important;
    border: 0.5pt solid #D9D9D6 !important;
    border-radius: 2pt;
    padding: 5mm 6mm;
    page-break-inside: auto;
  }
  .spotlight::after { display: none; }
  .spotlight__title { font-size: 18pt; }
  .spotlight__lede { font-size: 9pt; }
  .spotlight__body { font-size: 8pt; line-height: 1.45; }
  .people-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
  }
  .person-card {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 0.5pt solid #D9D9D6 !important;
    padding: 4mm 5mm !important;
    margin-bottom: 3mm;
  }
  .person-card > .person-card__quote,
  .person-card__expand { display: none !important; }
  .person-card .person-card__full { display: block !important; margin-top: 2mm; }
  .person-card__full p { font-size: 8pt; line-height: 1.45; margin-bottom: 2mm; }
  .person-card__full blockquote,
  .person-card__full__quote {
    font-style: italic;
    font-size: 8.5pt;
    line-height: 1.4;
    border-left: 1.2pt solid #0F4A44 !important;
    padding-left: 3mm;
    margin: 2mm 0 0 !important;
  }
  .person-card__top { display: flex !important; gap: 3mm !important; align-items: center !important; margin-bottom: 2mm !important; }
  .person-card__photo { width: 18mm !important; height: 18mm !important; }
  .person-card__name { font-size: 10.5pt; }
  .person-card__role { font-size: 7.5pt; }

  /* ============================================================
     RECOMMENDATIONS — gap around cards inside cream band
     ============================================================ */
  #recommendations { padding: 5mm 0 !important; }
  .band--cream { background: #F7F4EC !important; padding: 5mm !important; border-radius: 3pt; }
  .recommendations {
    grid-template-columns: 1fr 1fr !important;
    gap: 3mm !important;
    margin-top: 3mm !important;
  }
  .rec-card {
    background: #fff !important;
    border: 0.5pt solid #D9D9D6 !important;
    page-break-inside: avoid;
    break-inside: avoid;
    padding: 3mm 4mm !important;
  }
  .rec-card__num   { font-size: 18pt; margin-bottom: 1.5mm; }
  .rec-card__title { font-size: 9pt; }
  .rec-card__body  { font-size: 7.5pt; line-height: 1.4; }

  #about-femh { padding-top: 5mm !important; }

  /* SUMMARY GRID — single column in print */
  .summary-grid { grid-template-columns: 1fr !important; gap: 3mm !important; }
  .summary-part { padding: 3mm 4mm !important; }
  .summary-part__label { font-size: 7pt; }
  .summary-part__title { font-size: 12pt; }
  .summary-part h4 { font-size: 8pt; margin: 2mm 0 1mm; }
  .summary-part p  { font-size: 7.5pt; line-height: 1.4; }

  /* Closing statement section in print */
  .closing-statement::before { display: none !important; }
  .closing-statement .subsection-title { font-size: 16pt; text-align: center; }
  .closing-statement p { font-size: 9pt; line-height: 1.5; }

  /* ============================================================
     LINKS
     ============================================================ */
  a {
    color: #0F4A44 !important;
    text-decoration: underline;
    text-decoration-thickness: 0.5pt;
  }
  a[href]::after { content: ""; }

  /* ============================================================
     FIGURES — full-width, fit on one A4 page each, with smaller type
     so the chart bodies have room. We use scale() to bring everything
     down proportionally because the figures' internal type is hard-coded
     in pixels. 0.78 keeps text readable (≈9 pt body) but shrinks the
     overall footprint enough to fit on one page.
     ============================================================ */
  .figure-wrap, figure {
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-before: always;
    break-before: page;
    margin: 0 !important;
    width: 178mm !important;
    max-width: 178mm !important;
    overflow: hidden;
  }
  .figure-block {
    width: calc(178mm / 0.78) !important;
    max-width: none !important;
    transform: scale(0.78) !important;
    transform-origin: top left !important;
  }
  /* Fig 9.1 alone is the densest layout and was clipping its last card; give
     it a slightly smaller scale so all five trait cards fit comfortably. */
  .figure-wrap #fig-9-1-anchor + style ~ * .fig-9-1.figure-block,
  .fig-9-1.figure-block {
    width: calc(178mm / 0.72) !important;
    transform: scale(0.72) !important;
  }
  .figure-block .figure {
    margin: 0 !important;
    box-shadow: none !important;
    border: 0.5pt solid #D9D9D6 !important;
    padding: 5mm 6mm !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Override the figures' own px-based type to print-friendly sizes */
  .figure-block .fig-label { font-size: 8.5pt !important; }
  .figure-block .fig-title { font-size: 14pt !important; line-height: 1.15 !important; margin-bottom: 3mm !important; }
  .figure-block .fig-dek   { font-size: 8pt !important; line-height: 1.45 !important; margin-bottom: 4mm !important; }
  .figure-block p, .figure-block li,
  .figure-block .ms-headline, .figure-block .ms-desc,
  .figure-block .topic-body p, .figure-block .topic-body h4,
  .figure-block .hero-label, .figure-block .stat-label,
  .figure-block .factor-card p, .figure-block .factor-card h3 {
    font-size: 7.5pt !important;
    line-height: 1.4 !important;
  }
  .figure-block h3 { font-size: 9pt !important; }
  .figure-block h4 { font-size: 8pt !important; }

  img { max-width: 100%; page-break-inside: avoid; break-inside: avoid; }

  .figure-block .bar-col,
  .figure-block .range,
  .figure-block .low,
  .figure-block .high {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
