/* Simplified Print Styles - Safe and Non-Blocking */

/* Hide footnotes on screen, only show in print */
.print-footnotes {
    display: none;
}

@media print {
    /* Hide non-content elements including icons */
    nav,
    header,
    footer,
    .skip-to-comments,
    .comments-section,
    .code-toolbar,
    .subscribe-form,
    .site-footer,
    .print-button,
    button,
    .dark-mode-toggle,
    .icon-comments,
    svg,
    .theme-toggle,
    .comments-button {
        display: none !important;
    }

    /* Black and white only - no colors or backgrounds */
    * {
        background: white !important;
        color: black !important;
    }

    /* Basic page setup */
    body {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 12pt;
        line-height: 1.6;
    }

    /* URLs with dagger references */
    a[href^="http"] {
        text-decoration: none;
        border-bottom: 1px dotted black;
    }

    a[href^="http"]:after {
        content: "†" attr(data-footnote);
        vertical-align: super;
        font-size: 0.7em;
        margin-left: 2px;
    }

    /* Don't add footnote markers to internal links */
    a[href^="#"]:after,
    a[href^="/"]:after {
        content: "";
    }

    /* Show footnotes section in print */
    .print-footnotes {
        display: block;
        border-top: 3px solid black;
        margin-top: 3em;
        padding-top: 1em;
        page-break-inside: avoid;
    }

    .print-footnotes h3 {
        font-size: 14pt;
        font-weight: bold;
        margin-bottom: 0.5em;
        border-bottom: 2px solid black;
        padding-bottom: 0.2em;
    }

    .print-footnotes ol {
        font-size: 10pt;
        line-height: 1.4;
    }

    .print-footnotes li {
        margin-bottom: 0.3em;
        word-break: break-all;
    }

    /* Images */
    img {
        max-width: 100%;
        page-break-inside: avoid;
        border: 1px solid black;
    }

    /* Code blocks - hide line numbers, full width */
    .highlight {
        width: 100%;
        max-width: 100%;
        margin: 1em 0;
        border: 2px solid black;
        page-break-inside: avoid;
    }

    /* Hide line numbers completely */
    .lnt,
    .ln,
    .lntd:first-child,
    span.lnt,
    span.ln {
        display: none !important;
    }

    /* Make code take full width */
    .lntable {
        width: 100%;
        display: block;
    }

    .lntd {
        display: block;
        width: 100%;
    }

    .lntd:last-child {
        width: 100%;
    }

    pre, code {
        page-break-inside: avoid;
        border: none;
        background: white !important;
        color: black !important;
        width: 100%;
    }

    pre {
        padding: 10px;
        margin: 0;
        overflow: visible;
        white-space: pre-wrap;
        word-wrap: break-word;
        font-weight: normal;
        width: 100%;
        box-sizing: border-box;
    }

    code {
        font-family: 'Courier New', monospace;
        font-weight: bold;
        font-size: 10pt;
    }

    /* Ensure code lines don't have extra styling */
    .highlight .chroma {
        background: white !important;
        width: 100%;
    }

    .highlight span {
        background: transparent !important;
        color: black !important;
    }

    /* Headings - use font weight and size for hierarchy */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        font-weight: bold;
    }

    h1 {
        font-size: 24pt;
        border-bottom: 3px solid black;
        padding-bottom: 0.3em;
    }

    h2 {
        font-size: 18pt;
        border-bottom: 2px solid black;
        padding-bottom: 0.2em;
    }

    h3 {
        font-size: 14pt;
        border-bottom: 1px solid black;
        padding-bottom: 0.1em;
    }

    /* Blockquotes - bold left border */
    blockquote {
        border-left: 4px solid black;
        margin: 1em 0;
        padding-left: 1em;
        font-style: italic;
    }

    /* Tables */
    table {
        border-collapse: collapse;
        border: 2px solid black;
    }

    th, td {
        border: 1px solid black;
        padding: 0.5em;
    }

    th {
        font-weight: bold;
        border-bottom: 2px solid black;
    }

    /* Add print header with timestamp */
    body:before {
        content: "Printed from https://andrew-quinn.me on " attr(data-print-date);
        display: block;
        font-size: 9pt;
        font-weight: normal;
        border-bottom: 2px solid black;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
}
