/* Zine-mode print stylesheet for blog posts.
   Loaded via media="print" so browsers fetch and apply it only during print rendering. */

@page {
    margin: 2cm 2.2cm;
}

@media print {
    /* Force light-on-white regardless of prefers-color-scheme. */
    html, body {
        background: #ffffff !important;
        color: #111111 !important;
    }

    /* Hide site chrome — we want just the post on paper. */
    .site-header,
    .site-nav,
    .site-footer,
    .announcement-banner,
    .reading-progress,
    .post-toc,
    .palette-dialog,
    .comments-section,
    .post-footer,
    .post-actions,
    .post-adjacent,
    .bookmarklet,
    .aliveness-panel,
    .footer-links {
        display: none !important;
    }

    .site-main,
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    /* Undo the grid layout so the post flows full-width on paper. */
    .post-layout {
        display: block !important;
    }

    /* Serif zine typography. */
    body,
    .prose,
    .post-content,
    .post-content p,
    .post-content li {
        font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif !important;
        font-size: 11pt !important;
        line-height: 1.55 !important;
        color: #111111 !important;
    }

    .post-content p {
        text-align: justify;
        hyphens: auto;
        -webkit-hyphens: auto;
        orphans: 3;
        widows: 3;
    }

    /* Hanging punctuation where supported. Safari honors this; Chrome/Firefox no-op. */
    .post-content,
    .prose {
        hanging-punctuation: first last;
    }

    .post-header h1,
    .post-content h2,
    .post-content h3,
    .post-content h4 {
        font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif !important;
        font-variant-caps: all-small-caps;
        letter-spacing: 0.02em;
        color: #111111 !important;
        break-after: avoid;
        page-break-after: avoid;
    }

    .post-header h1 {
        font-size: 22pt !important;
        margin-bottom: 0.3em !important;
    }

    .post-content h2 { font-size: 15pt !important; margin-top: 1.2em !important; }
    .post-content h3 { font-size: 13pt !important; }

    .post-meta,
    .reading-time {
        font-family: Georgia, "Iowan Old Style", serif !important;
        font-size: 9pt !important;
        color: #555555 !important;
        font-variant-caps: all-small-caps;
        letter-spacing: 0.04em;
    }

    /* Tag chips — render as inline bracketed markers, not pills. */
    .post-tags {
        margin-bottom: 0.8em !important;
    }

    .post-tags .tag {
        display: inline;
        background: none !important;
        color: #555555 !important;
        border: 0 !important;
        padding: 0 !important;
        margin-right: 0.5em !important;
        font-family: "Courier New", Courier, monospace !important;
        font-size: 9pt !important;
    }

    .post-tags .tag::before { content: "["; }
    .post-tags .tag::after { content: "]"; }

    /* Block elements that should stay together. */
    pre,
    figure,
    blockquote,
    .highlight,
    table {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    pre,
    code {
        background: #f4f4f4 !important;
        color: #111111 !important;
        font-family: "Courier New", Courier, monospace !important;
        font-size: 9pt !important;
        border: 1px solid #dddddd !important;
    }

    pre {
        padding: 0.6em !important;
        overflow: visible !important;
        white-space: pre-wrap;
    }

    code {
        padding: 0 0.2em !important;
    }

    blockquote {
        border-left: 2pt solid #888888 !important;
        margin: 1em 0 !important;
        padding: 0 0 0 1em !important;
        font-style: italic;
        color: #333333 !important;
    }

    img, figure {
        max-width: 100% !important;
        height: auto !important;
    }

    figure figcaption {
        font-size: 9pt !important;
        font-style: italic;
        color: #555555 !important;
        text-align: center;
        margin-top: 0.3em;
    }

    /* Body links get their URL printed inline. */
    .post-content a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555555;
        font-family: "Courier New", Courier, monospace;
        word-break: break-all;
    }

    /* Escape hatch for in-post anchors and links we'd rather not clutter. */
    .post-content a[href^="#"]::after,
    .post-content a.no-print-url::after {
        content: "" !important;
    }

    a,
    a:visited {
        color: #111111 !important;
        text-decoration: underline;
    }

    /* Printed-from footer stamped by the template. */
    .print-footer {
        display: block !important;
        margin-top: 2em;
        padding-top: 0.6em;
        border-top: 1px solid #999999;
        font-family: Georgia, "Iowan Old Style", serif;
        font-size: 9pt;
        color: #555555;
        font-variant-caps: all-small-caps;
        letter-spacing: 0.04em;
        text-align: center;
    }
}

/* Hide the print footer on-screen. */
.print-footer {
    display: none;
}
