/*
 * Print-Only Stylesheet
 * This hides all UI elements and formats the article for paper.
 */

/* This outer block applies all rules inside ONLY when printing. */
@media print {

    /* --- 1. HIDE ALL UNWANTED UI --- */

    /* Hide the header, footer, and all comment elements */
    .fixed-header,
    .fixed-footer,
    .os2-window.content-post:has(form[method="POST"]), /* Hides the comment window */
    .admin-toolbar,
    .os2-control-center {
        display: none !important;
    }

    /* Hide any element we manually flag as "no-print", like the print button itself */
    .no-print {
        display: none !important;
    }

    /* --- 2. RESET AND STYLE THE PAGE --- */

    /* Remove the grey desktop background and page padding */
    body.os2-desktop {
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        color: #000 !important;
    }

    /* Remove all OS/2 window borders and shadows */
    .os2-window,
    .os2-window-content {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    /* --- 3. STYLE THE ARTICLE FOR PRINT --- */

    /* Style the title bar to act as a main headline */
    .os2-window.content-post .os2-window-titlebar {
        background: none !important;
        color: #000 !important;
        font-size: 24pt !important;
        font-weight: bold;
        padding: 0 0 10px 0 !important;
        margin: 0 0 15px 0 !important;
        border-bottom: 2px solid #000 !important;
    }

    /* Ensure all article text is black and readable */
    .os2-window.content-post .os2-window-content,
    .os2-window.content-post .os2-window-content p {
        color: #000 !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }

    /* Ensure links are still visible (though not clickable) */
    .os2-window.content-post a {
        color: #000080 !important;
        text-decoration: underline;
    }
    
    /* --- 4. SHOW THE HIDDEN ARTICLE LINK --- */

    /* This is the class for the element we are about to add to index.php */
    .print-only-link-container {
        display: block !important; /* Makes it visible ONLY on print */
        border-top: 1px dashed #999;
        border-bottom: 1px dashed #999;
        padding: 10px 0;
        margin: 20px 0;
        background: #f9f9f9;
    }

    .print-only-link-container p {
        font-size: 10pt !important;
        color: #555 !important;
        margin: 0;
    }
}

/* By default, hide the article link container from the browser view */
.print-only-link-container {
    display: none;
}
