/* ── Print / Save-as-PDF ────────────────────────────────────────────────────
   Loaded with media="print", so it costs screen readers nothing.

   The site is white-on-dark-green; printing that as-is would drain a cartridge
   and read badly, so everything inverts to black-on-white here. Headings keep
   the brand green rather than gold, which is unreadable on white.

   The masthead flows once at the top of the document. The footer is
   position: fixed, which browsers repeat on every printed page — the @page
   bottom margin reserves room for it.
   ───────────────────────────────────────────────────────────────────────── */

@page {
    margin: 16mm 15mm 20mm;
}

@media print {
    :root {
        --ink: #111111;
        --ink-soft: #444444;
        --brand: #00231A;
        --rule: #cccccc;
    }

    html, body {
        background: #ffffff !important;
        color: var(--ink) !important;
        font-size: 10.5pt;
        line-height: 1.45;
    }

    /* Screen chrome has no place on paper. */
    .nav,
    .footer,
    .crumbs,
    .player,
    .player-missing,
    .pager,
    .guide-nav,
    .filters,
    .result-count,
    .spks,
    .lesson__tags,
    .print-btn,
    .print-intro,
    .video__frame,
    .video__cap,
    .downloads,
    .subs,
    .spotify-show,
    .card__go {
        display: none !important;
    }

    .wrap,
    .wrap--narrow {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    /* ── Masthead (first page only) ── */
    .print-head {
        display: block !important;
        margin-bottom: 10mm;
        padding-bottom: 5mm;
        border-bottom: 2px solid var(--brand);
    }

    .print-head__logo {
        width: 46mm;
        height: auto;
        margin-bottom: 4mm;
        /* The logo is drawn light-on-dark and all but disappears on white.
           It has an alpha channel, so blacking it out gives a crisp solid
           mark that reproduces on colour and mono printers alike. */
        filter: brightness(0);
    }

    .print-head__eyebrow {
        font-family: var(--font-accent), sans-serif;
        font-size: 8pt;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: var(--brand);
    }

    .print-head__title {
        font-family: var(--font-heading), sans-serif;
        font-weight: 700;
        font-size: 22pt;
        line-height: 1.05;
        text-transform: uppercase;
        color: var(--brand);
        margin-top: 1mm;
    }

    /* ── Repeating footer ── */
    .print-foot {
        display: block !important;
        position: fixed;
        left: 0;
        right: 0;
        bottom: -14mm;
        padding-top: 2mm;
        border-top: 1px solid var(--rule);
        font-family: var(--font-accent), sans-serif;
        font-size: 7.5pt;
        letter-spacing: 0.06em;
        color: var(--ink-soft);
        text-transform: uppercase;
    }

    .print-foot__right { float: right; }

    /* A player is useless on paper — print where to find it instead. */
    .video__print {
        display: block !important;
        margin-bottom: 6mm;
        font-family: var(--font-accent), sans-serif;
        font-size: 9pt;
        color: var(--ink-soft);
    }

    /* ── Body copy ── */
    .page-head { display: none !important; }

    .prose { color: var(--ink) !important; font-size: 10.5pt; }
    .prose > * + * { margin-top: 3mm; }

    .prose h2 {
        font-family: var(--font-heading), sans-serif;
        font-size: 15pt;
        color: var(--brand) !important;
        margin-top: 8mm;
    }
    .prose h3 {
        font-size: 11pt;
        color: var(--brand) !important;
        margin-top: 6mm;
    }
    .prose h4, .prose h5 { font-size: 10.5pt; color: var(--ink) !important; }

    .prose a {
        color: var(--ink) !important;
        text-decoration: none;
    }
    .prose strong { color: var(--ink) !important; }
    .prose em { color: var(--ink) !important; }
    .prose li::marker { color: var(--brand) !important; }

    .prose blockquote {
        border-left: 2px solid var(--brand);
        background: #f4f4f4;
        color: var(--ink) !important;
    }

    /* ── Pagination control ── */
    h2, h3, h4, h5 { break-after: avoid; page-break-after: avoid; }
    li, blockquote, p { break-inside: avoid; page-break-inside: avoid; }
    img { max-width: 100% !important; }

    /* Each study starts a fresh sheet in the combined guide. */
    .print-study { break-before: page; page-break-before: always; }
    .print-study:first-of-type { break-before: auto; page-break-before: auto; }

    .print-study__title {
        font-family: var(--font-heading), sans-serif;
        font-size: 18pt;
        text-transform: uppercase;
        color: var(--brand);
        margin-bottom: 5mm;
        padding-bottom: 2mm;
        border-bottom: 1px solid var(--rule);
    }
}
