/* =========================================================================
   PRINT / PDF  (Part 2: §2.6)
   Loaded globally via extra_css; the @media print guard means these rules
   ONLY apply when the reader prints or "Save as PDF" - zero effect on screen.
   Goal: a clean, ink-friendly, fully-expanded reference page.
   ========================================================================= */
@media print {

    /* --- hide site chrome + screen-only / interactive bits --- */
    .md-header, .md-tabs, .md-sidebar, .md-footer, .md-banner,
    .survey-announce-bar, .md-content__button, .md-top,
    .share-link-wrapper, .redirect-btn-wrap,
    .gear-tooltip-box, #custom-survey {
        display: none !important;
    }

    /* --- use the full page width --- */
    .md-grid { max-width: none !important; }
    .md-main__inner { margin-top: 0 !important; }
    .md-content { margin: 0 !important; }

    /* --- ink-friendly: force the dark theme to black-on-white --- */
    [data-md-color-scheme] {
        --md-default-bg-color: #ffffff;
        --md-default-fg-color: #000000;
        --md-typeset-color: #000000;
    }
    body, .md-typeset { background: #ffffff !important; color: #000000 !important; }
    .md-typeset a { color: #000000 !important; text-decoration: underline; }

    /* Utility colours that vanish on white (white text, pale gold/magenta) or
       render as transparent gradient fills - force them to readable ink. */
    .md-typeset .white { color: #000000 !important; }
    .md-typeset .yellow { color: #7a5c00 !important; }
    .md-typeset .magenta { color: #8a008a !important; }
    .md-typeset .rainbow-text, .md-typeset .rainbow-text *,
    .md-typeset .price-premium {
        background: none !important;
        -webkit-text-fill-color: #000000 !important;
        color: #000000 !important;
    }

    /* --- reveal collapsed ??? admonitions/details so nothing hides on paper --- */
    .md-typeset details:not([open]) > *:not(summary) { display: block !important; }

    /* --- keep blocks from splitting across page breaks where possible --- */
    .md-typeset table, .md-typeset .admonition, .md-typeset details,
    .md-typeset figure, .territory-grid-tile, .gallery figure {
        break-inside: avoid;
    }

    /* --- images shouldn't overflow the page --- */
    .md-typeset img { max-width: 100% !important; }
}