/* Print / "Save as PDF" support for the Neopause members portal.
   Members print any article, meal plan or month from the browser and
   choose "Save as PDF" as the destination. */

.print-only { display: none; }

@media print {
    @page {
        size: A4;
        margin: 16mm 14mm;
    }

    html,
    body {
        background: #fff !important;
        color: #16181a !important;
        font-size: 11pt;
        line-height: 1.55;
    }

    /* Interactive chrome that should not appear on paper */
    body > header,
    body > footer,
    aside,
    nav,
    .no-print {
        display: none !important;
    }

    .print-only { display: block !important; }

    /* Compact brand block so a saved PDF is identifiable and dated */
    .print-brand {
        display: block !important;
        border-bottom: 1.5pt solid #16181a;
        padding-bottom: 4mm;
        margin-bottom: 7mm;
    }

    .print-brand .pb-brand {
        font-size: 8.5pt;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: #444;
    }

    .print-brand .pb-title {
        font-size: 15pt;
        font-weight: 700;
        margin-top: 1.5mm;
    }

    .print-brand .pb-meta {
        font-size: 9pt;
        color: #555;
        margin-top: 1mm;
    }

    main {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Flatten decorative surfaces so the page is legible in mono print */
    [class*="shadow"] { box-shadow: none !important; }
    [class*="bg-"] { background: transparent !important; }

    /* Keep headings with their content and blocks unsplit */
    h1, h2, h3, h4, h5 {
        break-after: avoid;
        page-break-after: avoid;
    }

    table, tr, img, figure, blockquote, pre, svg {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    thead { display: table-header-group; }

    /* Repeat table headers on every printed page */
    p, li { orphans: 3; widows: 3; }

    /* Printed links stay usable once the page is on paper */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8.5pt;
        color: #555;
        word-break: break-all;
    }
}