/* print_cms.css
 *
 * Print styles for CMS article pages only.
 *
 * Loaded with media="print" from cms/templates/cms/page.html (see the
 * syllabus page's use of print_syllabus.css for the same pattern). Keeping
 * the @page rule out of the globally-loaded screen stylesheet (cms.css)
 * means CMS page geometry no longer bleeds onto unrelated documents such
 * as the syllabus, logbook, or member lists (Issue #1187).
 */

@page {
    size: portrait;
    margin: 1in 0.75in;
}

@media print {

    /* Hide edit/admin buttons and controls */
    .page-title-row .btn,
    .page-title-row .btn-group,
    .create-subpage,
    .no-print {
        display: none !important;
    }

    /* Hide breadcrumb navigation */
    .cms-breadcrumb {
        display: none !important;
    }

    /* Hide access control alerts in CMS pages */
    .cms-content~.alert,
    .page-title-row~.alert {
        display: none !important;
    }

    /* Ensure proper page breaks */
    .cms-content h1,
    .cms-content h2,
    .cms-content h3 {
        page-break-after: avoid;
    }

    /* Avoid breaking inside important elements */
    .cms-content table,
    .cms-content img,
    .cms-content pre {
        page-break-inside: avoid;
    }

    /* Optimize table printing */
    .cms-content table {
        width: 100% !important;
    }

    /* Remove box shadows and transitions for CMS cards */
    .cms-edit-card,
    .cms-content .card {
        box-shadow: none !important;
        border: none !important;
    }
}
