@media print {

    /* Page setup */
    @page {
        size: A4;
        margin: 2cm 2.5cm;
        @bottom-center {
            content: "twentyfirstcenturycompetition.com — Page " counter(page);
            font-family: 'Source Sans Pro', sans-serif;
            font-size: 8pt;
            color: #999;
        }
    }

    /* Hide non-content elements */
    .site-header,
    .primary-nav,
    .site-footer,
    .reading-progress-bar,
    .pagination,
    .related-posts,
    .article-footer,
    .dark-mode-toggle,
    .search-toggle,
    .newsletter-signup,
    .article-toc,
    .print-pdf-btn,
    #wpadminbar {
        display: none !important;
    }

    /* Reset background and colours */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10.5pt;
        line-height: 1.5;
    }

    /* Collapse Tufte grid to single column */
    .tufte-article {
        display: block !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .article-content {
        max-width: 100% !important;
    }

    /* Headings */
    h1 { font-size: 18pt; margin-bottom: 0.3em; }
    h2 { font-size: 14pt; margin-top: 1em; margin-bottom: 0.3em; }
    h3 { font-size: 12pt; margin-top: 0.8em; margin-bottom: 0.2em; }

    /* Sidenotes: collapse from margin to inline blocks */
    .sidenote {
        display: block !important;
        float: none !important;
        width: 100% !important;
        margin: 0.5em 0 0.5em 1em !important;
        padding: 0.4em 0 0.4em 0.8em !important;
        border-left: 2px solid #999;
        font-size: 9pt;
        color: #333;
        clear: both;
    }

    /* Links: show URLs after text */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666;
        word-break: break-all;
    }

    /* Don't show URLs for anchors, mailto, or internal xref links */
    a[href^="#"]::after,
    a[href^="mailto:"]::after,
    a.xref::after {
        content: none;
    }

    /* Page break control */
    h1, h2, h3, h4 {
        page-break-after: avoid;
        break-after: avoid;
    }

    blockquote, pre, .sidenote, figure, img {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Ensure images don't overflow */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Post meta */
    .post-meta {
        color: #666;
    }
}
