/* This file is loaded via <link media="print">, so everything in it — including
   rules outside this @media block — only ever applies while printing. Screen-only
   concerns (hiding .print-footer, styling the print buttons) belong in the page's
   own <style>, not here. */
@media print {
    * {
        background: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        color: #000 !important;
    }

    html, body {
        background: #fff !important;
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 12pt;
        line-height: 1.5;
    }

    /* Always hidden on paper, full page or worksheet-only */
    .site-header,
    .breadcrumb,
    footer,
    .digital-extension,
    .interactive-sort,
    .interactive-grid,
    .related-lessons {
        display: none !important;
    }

    /* Worksheet-only is the default print view. The "Print Full Lesson" button
       adds .print-full to <body> before printing to include the teacher-facing
       sections; "Print Worksheet Only" removes it. */
    .at-a-glance,
    .objectives,
    .background,
    .procedure,
    .differentiation,
    .answer-key {
        display: none;
    }

    body.print-full .at-a-glance,
    body.print-full .objectives,
    body.print-full .background,
    body.print-full .procedure,
    body.print-full .differentiation,
    body.print-full .answer-key {
        display: block;
    }

    /* Admin header: hidden on worksheet-only prints always; on full-lesson prints it
       only shows if the on-page "include this header" checkbox is still checked. The
       toggle control itself never prints, regardless of state. */
    .admin-header {
        display: none !important;
    }

    body.print-full .admin-header:has(#admin-header-toggle:checked) {
        display: block !important;
        border: 1pt solid #000;
        border-radius: 0;
        margin-bottom: 12pt;
        padding: 8pt 10pt;
    }

    .admin-header-toggle-label {
        display: none !important;
    }

    .admin-input {
        border: none;
        border-bottom: 1pt solid #000;
        border-radius: 0;
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 11pt;
        padding: 0 2pt;
    }

    h1 {
        font-size: 18pt;
    }

    h2 {
        font-size: 14pt;
        page-break-after: avoid;
    }

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

    /* Don't clutter student pages with expanded URLs */
    a::after,
    .breadcrumb a::after,
    nav a::after {
        content: none !important;
    }

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

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

    .print-footer {
        display: block !important;
        margin-top: 1.5rem;
        padding-top: 0.5rem;
        border-top: 1pt solid #000;
        font-size: 9pt;
        text-align: center;
    }

    /* Logic grids need solid, dark lines on paper — students mark in every cell. */
    .logic-grid th,
    .logic-grid td {
        border: 1pt solid #000 !important;
    }

    .logic-grid th.corner {
        border: none !important;
    }

    .logic-grid .grid-split {
        border-left: 2.5pt solid #000 !important;
    }

    .logic-grid .grid-split-row th,
    .logic-grid .grid-split-row td {
        border-top: 2.5pt solid #000 !important;
    }

    .logic-grid td.blocked {
        background: #ddd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .logic-grid.logic-grid-write td {
        width: 0.55in !important;
        height: 0.55in !important;
        padding: 0 !important;
    }

    .logic-grid.logic-grid-write th {
        font-size: 8pt;
        line-height: 1.15;
        padding: 2pt !important;
    }

    .logic-grid.logic-grid-write tr:first-child th:not(.corner) {
        width: 0.55in !important;
        font-size: 7pt;
    }

    .write-line {
        border-bottom: 1pt solid #000;
    }

    .case-file {
        border: 1pt solid #000;
        border-radius: 0;
        padding: 6pt 9pt;
    }
}
