/* Clean print stylesheet for documentation */
@media print {
    /* Reset and base styles - FORCE WHITE BACKGROUND */
    * {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Force white page background */
    html, body {
        background: white !important;
        background-color: white !important;
    }

    /* Page setup - clean without headers */
    @page {
        margin: 2cm;
        size: A4;

        @bottom-right {
            content: counter(page);
            font-family: 'Arial', sans-serif;
            font-size: 9pt;
            color: #999;
        }
    }

    /* Remove browser-generated headers/footers */
    @page :first {
        margin-top: 1cm;
    }

    /* Hide unnecessary elements for clean PDF */
    .progress-container,
    .progress-indicator,
    .load-time-display,
    .performance-footer,
    nav,
    header,
    footer,
    .table-of-contents,
    .toc-header,
    .toc-nav,
    .toc-toggle,
    .code-language-label,
    pre::before, /* copy button */
    button,
    .performance-stats,
    .tag-section,
    [style*="Tagged:"],
    [style*="Back to posts"],
    [style*="powered by"],
    [href="/rss"],
    [href="/atom"],
    [href="/json"],
    [href*="blogo"] {
        display: none !important;
    }

    /* Hide tags section specifically */
    div[style*="border-top: 1px solid #333; border-bottom: 1px solid #333"] {
        display: none !important;
    }

    /* Hide article footer */
    div[style*="margin-top: 60px; padding-top: 30px; border-top: 1px solid #333; text-align: center"] {
        display: none !important;
    }

    /* Body and layout */
    body {
        font-family: Georgia, 'Times New Roman', Times, serif !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: #000 !important;
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    main {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Typography */
    h1, h2, h3, h4, h5, h6 {
        font-family: 'Arial', 'Helvetica', sans-serif !important;
        color: #000 !important;
        page-break-after: avoid;
        margin-top: 1.8em !important;
        margin-bottom: 0.8em !important;
        font-weight: bold !important;
        line-height: 1.2 !important;
    }

    /* Main article title - larger and more prominent */
    article h1:first-of-type,
    main h1:first-of-type {
        font-size: 24pt !important;
        text-align: center !important;
        border-bottom: 3px solid #000 !important;
        padding-bottom: 0.8em !important;
        margin-bottom: 1.5em !important;
        page-break-after: avoid !important;
        margin-top: 0 !important;
    }

    h1 {
        font-size: 18pt !important;
        border-bottom: 2px solid #000;
        padding-bottom: 0.5em;
    }

    h2 {
        font-size: 16pt !important;
        border-bottom: 1px solid #666;
        padding-bottom: 0.3em;
        margin-top: 2em !important;
    }

    h3 {
        font-size: 14pt !important;
        margin-top: 1.5em !important;
    }

    h4, h5, h6 {
        font-size: 12pt !important;
    }

    /* Article metadata styling */
    [style*="color: #888"] {
        font-size: 11pt !important;
        color: #666 !important;
        text-align: center !important;
        margin-bottom: 2em !important;
        border-bottom: 1px solid #eee !important;
        padding-bottom: 1em !important;
    }

    /* Paragraphs and text */
    p {
        margin: 1em 0 !important;
        orphans: 3;
        widows: 3;
        color: #000 !important;
        text-align: justify !important;
        line-height: 1.6 !important;
    }

    /* Blockquotes - elegant styling */
    blockquote {
        border-left: 4px solid #333 !important;
        background: #f9f9f9 !important;
        padding: 1.2em 1.8em !important;
        margin: 1.8em 0 !important;
        border-radius: 0 4px 4px 0 !important;
        color: #444 !important;
        font-style: italic !important;
        font-size: 11pt !important;
        page-break-inside: avoid !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    }

    blockquote p {
        margin: 0.5em 0 !important;
        text-align: left !important;
    }

    /* Links */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }

    /* Code styling */
    code:not(pre code) {
        font-family: 'Courier New', 'Monaco', monospace !important;
        background: #f5f5f5 !important;
        padding: 2px 4px !important;
        border: 1px solid #ddd !important;
        border-radius: 2px !important;
        font-size: 10pt !important;
        color: #000 !important;
    }

    /* Code blocks - enhanced for print */
    pre {
        font-family: 'Courier New', 'Monaco', monospace !important;
        background: #f8f8f8 !important;
        border: 1px solid #ccc !important;
        border-left: 4px solid #666 !important;
        border-radius: 0 3px 3px 0 !important;
        padding: 1em !important;
        margin: 1.5em 0 !important;
        font-size: 9pt !important;
        line-height: 1.4 !important;
        overflow: visible !important;
        page-break-inside: avoid;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    }

    pre code {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        color: #000 !important;
        font-size: inherit !important;
    }

    /* Strip ALL syntax highlighting for clean code */
    pre *, code *, span[style*="color"] {
        color: #000 !important;
        background: transparent !important;
    }

    /* Remove line numbers and syntax elements */
    span[style*="-webkit-user-select: none"],
    span[style*="user-select: none"],
    span[style*="margin-right"],
    span[style*="padding: 0 0.4em"],
    .line-number {
        display: none !important;
    }

    /* Lists */
    ul, ol {
        margin: 0.8em 0 !important;
        padding-left: 2em !important;
    }

    li {
        margin: 0.3em 0 !important;
        color: #000 !important;
    }

    /* Tables */
    table {
        border-collapse: collapse !important;
        width: 100% !important;
        margin: 1em 0 !important;
        page-break-inside: avoid;
    }

    th, td {
        border: 1px solid #000 !important;
        padding: 0.5em !important;
        text-align: left !important;
        color: #000 !important;
    }

    th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
    }

    /* Blockquotes */
    blockquote {
        border-left: 3px solid #000 !important;
        margin: 1em 0 !important;
        padding-left: 1em !important;
        font-style: italic !important;
        color: #333 !important;
        background: none !important;
    }

    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
        border: 1px solid #ddd !important;
    }

    /* Table of Contents */
    .table-of-contents {
        background: #f8f8f8 !important;
        border: 1px solid #ddd !important;
        border-radius: 3px !important;
        padding: 1em !important;
        margin: 1em 0 !important;
        page-break-inside: avoid;
    }

    .toc-header {
        background: none !important;
        border: none !important;
        padding: 0 0 0.5em 0 !important;
        font-weight: bold !important;
        color: #000 !important;
    }

    .toc-title {
        color: #000 !important;
        font-family: 'Arial', sans-serif !important;
        font-size: 12pt !important;
    }

    .toc-nav {
        padding: 0.5em 0 0 0 !important;
        max-height: none !important;
    }

    .toc-list {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .toc-item {
        margin: 0.2em 0 !important;
    }

    .toc-link {
        color: #000 !important;
        text-decoration: none !important;
        font-size: 11pt !important;
        border: none !important;
        background: none !important;
    }

    .toc-h1 .toc-link { padding-left: 0 !important; font-weight: bold; }
    .toc-h2 .toc-link { padding-left: 1em !important; }
    .toc-h3 .toc-link { padding-left: 2em !important; }
    .toc-h4 .toc-link { padding-left: 3em !important; }
    .toc-h5 .toc-link { padding-left: 4em !important; }
    .toc-h6 .toc-link { padding-left: 5em !important; }

    /* Tags section */
    .tag-section {
        border-top: 1px solid #ddd !important;
        padding-top: 1em !important;
        margin-top: 2em !important;
        page-break-inside: avoid;
    }

    .tag-link {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #ddd !important;
        padding: 0.2em 0.5em !important;
        margin: 0.2em 0.2em 0.2em 0 !important;
        border-radius: 2px !important;
        text-decoration: none !important;
        font-size: 10pt !important;
        display: inline-block;
    }

    /* Horizontal rules */
    hr {
        border: none !important;
        border-top: 1px solid #000 !important;
        margin: 1.5em 0 !important;
    }

    /* Article meta */
    .article-meta {
        border-bottom: 1px solid #ddd !important;
        padding-bottom: 1em !important;
        margin-bottom: 1.5em !important;
        font-size: 11pt !important;
        color: #666 !important;
    }

    /* Page breaks */
    h1, h2 {
        page-break-before: auto;
        page-break-after: avoid;
    }

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

    /* Footer */
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        font-size: 9pt;
        color: #666;
        text-align: center;
        border-top: 1px solid #ddd;
        padding: 0.5em;
        background: #fff;
    }

    /* Custom page header */
    @page :first {
        @top-center {
            content: "";
        }
    }

    @page :left {
        @bottom-left {
            content: counter(page);
            font-size: 9pt;
            color: #666;
        }
    }

    @page :right {
        @bottom-right {
            content: counter(page);
            font-size: 9pt;
            color: #666;
        }
    }

    /* Optimize for readability */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Remove any remaining interactive elements */
    input, button, select, textarea {
        display: none !important;
    }

    /* Ensure good contrast for all text */
    span, div, p, li, td, th {
        color: #000 !important;
    }
}