/* ============================================================================
   PRINT STYLESHEET — Learning Platform
   ============================================================================
   Optimized for paper output: strips navigation, resolves footnotes, 
   and ensures clean typography for printing.
   ============================================================================ */

@media print {

    /* --- Reset for Print --- */

    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* --- Page Setup --- */

    @page {
        margin: 2cm;
        size: A4;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        font-family: Georgia, 'Times New Roman', serif;
    }

    /* --- Hide Navigation & UI Elements --- */

    .site-header,
    .header-skeleton,
    .scroll-progress,
    .toc,
    .back-to-top,
    .breadcrumbs,
    .btn,
    .collapsible-trigger,
    .skip-link,
    footer,
    nav,
    aside {
        display: none !important;
    }

    /* --- Typography --- */

    h1 {
        font-size: 24pt;
        margin-bottom: 12pt;
        page-break-after: avoid;
    }

    h2 {
        font-size: 18pt;
        margin-top: 24pt;
        margin-bottom: 8pt;
        page-break-after: avoid;
        border-top: none;
    }

    h3 {
        font-size: 14pt;
        margin-top: 18pt;
        margin-bottom: 6pt;
        page-break-after: avoid;
    }

    h4,
    h5,
    h6 {
        font-size: 12pt;
        font-weight: bold;
        margin-top: 12pt;
        margin-bottom: 4pt;
        page-break-after: avoid;
    }

    p,
    li {
        orphans: 3;
        widows: 3;
        font-size: 11pt;
    }

    /* --- Links --- */

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

    /* Show URL after external links */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666 !important;
        word-wrap: break-word;
    }

    /* Don't show URL for internal links */
    a[href^="#"]::after,
    a[href^="/"]::after {
        content: "";
    }

    /* --- Content Blocks --- */

    blockquote {
        border-left: 2pt solid #333;
        padding-left: 12pt;
        margin-left: 0;
        font-style: italic;
    }

    pre,
    code {
        font-family: 'Courier New', monospace;
        font-size: 10pt;
        border: 1pt solid #ccc;
        padding: 8pt;
        page-break-inside: avoid;
    }

    code {
        padding: 2pt 4pt;
    }

    /* --- Callouts --- */

    .callout {
        border: 1pt solid #666;
        padding: 8pt 12pt;
        margin: 12pt 0;
        page-break-inside: avoid;
    }

    .callout::before {
        display: none;
        /* Hide icons */
    }

    .callout-note::before {
        content: "[Note] ";
        font-weight: bold;
        display: inline;
    }

    .callout-tip::before {
        content: "[Tip] ";
        font-weight: bold;
        display: inline;
    }

    .callout-warning::before {
        content: "[Warning] ";
        font-weight: bold;
        display: inline;
    }

    .callout-caution::before {
        content: "[Caution] ";
        font-weight: bold;
        display: inline;
    }

    /* --- Collapsibles: Show All Content --- */

    .collapsible-content {
        display: block !important;
    }

    .collapsible {
        border: 1pt solid #ccc;
        padding: 8pt;
    }

    /* --- Tables --- */

    table {
        border-collapse: collapse;
        width: 100%;
        page-break-inside: avoid;
    }

    th,
    td {
        border: 1pt solid #333;
        padding: 6pt 8pt;
        text-align: left;
    }

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

    /* --- Images --- */

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* --- Page Breaks --- */

    .page-break-before {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    .avoid-break {
        page-break-inside: avoid;
    }

    /* --- Dithering: Remove for Print --- */

    .dither-divider,
    .dither-bg,
    .dither-border::after,
    .dither-fade::after,
    .section-dither::before {
        display: none !important;
    }

    /* --- Layout --- */

    .shell,
    .article-content {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .article-layout {
        display: block;
    }
}