@media print {
    /* strip site chrome and any on-screen-only widgets */
    nav,
    header.navbar,
    footer,
    .navbar-custom,
    .legacy-period-indicator,
    .legacy-journey-map,
    .legacy-inquiry-button,
    .legacy-hero-initials .badge,
    .legacy-lightbox,
    .dossier-banner,
    .lc-hero-cta,
    .print-hide,
    iframe {
        display: none !important;
    }

    /* paper-safe surface: white background, black ink, no dark hero */
    html, body,
    .legacy-center,
    .legacy-body,
    .legacy-dossier,
    .lc-hero,
    .lc-layers,
    .lc-pullquote {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* hero stays compact and stays with the identity strip + first chapter */
    .lc-hero {
        padding: 0.25in 0 0.15in !important;
        page-break-after: avoid;
        break-after: avoid;
    }
    .lc-hero .lc-name,
    .lc-hero .lc-name .first,
    .lc-hero .lc-name .last { color: #000 !important; }
    .lc-hero .lc-portrait img {
        max-width: 2.2in !important;
        max-height: 2.6in !important;
        filter: grayscale(15%);
    }

    /* identity strip is small reference info; keep it whole and with the hero */
    .meta-strip,
    .lc-strip {
        page-break-inside: avoid;
        break-inside: avoid;
        page-break-before: avoid;
        break-before: avoid;
    }

    /* chapters must not split mid-narrative; the inline style on .chapter
       already requests this but the explicit rule covers print-only edge cases
       (long narratives still wrap to a new page as a whole block) */
    .chapter,
    .chap-top,
    .chap-body,
    .yearblock {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* chapter photo stays attached to its copy; never split an image */
    .chap-photo {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .chap-photo img {
        max-width: 100% !important;
        max-height: 3.5in !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* story-layer cells are short enough to fit whole; keep each on one page */
    .lc-layers .layer,
    .lc-layers .layer.is-quote,
    .lc-layers .layer.is-mission {
        page-break-inside: avoid;
        break-inside: avoid;
        background: #fff !important;
        color: #000 !important;
    }
    .lc-layers .layer.is-quote .qmark,
    .lc-layers .layer .lh .num,
    .lc-layers .layer .lh .lbl,
    .lc-layers .layer h3 { color: #000 !important; }

    /* closing quote stays whole */
    .lc-pullquote {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* keep section headings attached to the content below */
    h1, h2, h3,
    .chap-title,
    .layers-head h2 {
        page-break-after: avoid;
        break-after: avoid;
    }

    /* blockquote callouts and narrative paragraphs should not split */
    blockquote,
    .narrative blockquote {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    p, li {
        orphans: 3;
        widows: 3;
    }

    /* gallery cells stay whole, but the gallery itself can break */
    .legacy-gallery,
    .lc-gallery {
        column-count: 3 !important;
        page-break-inside: auto;
    }
    .legacy-gallery-item,
    .lc-gallery .item {
        page-break-inside: avoid;
        break-inside: avoid;
        margin: 0 0 0.4rem;
    }

    /* generic image safety - never split a photo across two sheets */
    img {
        page-break-inside: avoid;
        break-inside: avoid;
        max-width: 100% !important;
    }

    /* render link URLs inline inside narrative copy so they survive on paper */
    .narrative a::after,
    .layer-body a::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
    }

    /* page setup: tighter margins maximise content per sheet, footer shows
       page x of y so a multi-page dossier is navigable in print */
    @page {
        margin: 0.55in 0.5in 0.65in;
        @bottom-center {
            content: counter(page) " of " counter(pages);
            font-size: 9pt;
            color: #555;
        }
    }

    body::after {
        content: "International Player Services - internationalplayerservices.com";
        position: fixed;
        bottom: 0.2in;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt;
        color: #888;
    }

    /* drop interactive shadows and decorative backgrounds in galleries */
    .legacy-gallery-link {
        box-shadow: none !important;
        background: transparent !important;
    }
}
