/* Print stylesheet — hide non-essential UI, optimise for paper */

@media print {
    /* Hide navigation, footer, ads, search, interactive elements */
    header,
    footer,
    nav,
    .back-to-top,
    .adBlock,
    .ad-block,
    #mobileSearchToggle,
    #mobileSearchContainer,
    form[role="search"],
    .navbar,
    .breadcrumb,
    [id^="search"],
    script {
        display: none !important;
    }

    /* Reset colours for readability */
    body,
    main,
    article {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    /* Full-width content */
    .container,
    main {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Expand collapsed Bootstrap columns */
    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-md-9 {
        width: 100% !important;
    }

    /* Make links show their URL */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    /* Avoid page breaks inside headings and callouts */
    h1, h2, h3, h4,
    .fact, .tip, .caution, .lesson, .insight {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    /* Avoid orphaned images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}
