/* Print rules only. The host links this file with media="print" so it does not block the first paint.
   Reduced motion and 640px reflow stay in cu-print.css.
   FOIA letters stay on cu-clocks.css: this file never sets visibility on body *. */

@media print {
    html:has(.cu-print-sheet) {
        color-scheme: light only;
    }

    html:has(.cu-print-sheet),
    html:has(.cu-print-sheet) body,
    html:has(.cu-print-sheet) .cu-shell,
    html:has(.cu-print-sheet) .cu-shell__main {
        background: #fff !important;
        color: #1c1917 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }

    .cu-print-sheet .cu-civic-diagram__frame,
    .cu-print-sheet .cu-civic-diagram__preview,
    .cu-print-sheet .cu-civic-diagram__scroll,
    .cu-print-sheet .cu-map-canvas,
    .cu-print-sheet .cu-map-canvas-wrap {
        max-height: none !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Lesson actor marks are svg. A width of 100% would print each one as a page. */
    .cu-print-sheet .cu-gfx .cu-ico,
    .cu-print-sheet .cu-learn .cu-ico {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        flex: none !important;
    }

    html:has(.cu-print-sheet) .cu-shell__header,
    html:has(.cu-print-sheet) nav.cu-tabs,
    html:has(.cu-print-sheet) footer.cu-footer,
    html:has(.cu-print-sheet) .cu-pending-banner,
    html:has(.cu-print-sheet) .cu-guest-banner,
    html:has(.cu-print-sheet) .cu-learn-dots,
    html:has(.cu-print-sheet) .cu-learn-nav,
    html:has(.cu-print-sheet) .cu-map-scroll-hint,
    html:has(.cu-print-sheet) [role="dialog"] {
        display: none !important;
    }

    .cu-print-sheet,
    .cu-print-sheet * {
        color: #1c1917 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-text-fill-color: #1c1917 !important;
    }

    .cu-print-sheet {
        background: #fff !important;
    }

    .cu-print-sheet a,
    .cu-print-sheet a * {
        color: #0f766e !important;
        -webkit-text-fill-color: #0f766e !important;
        text-decoration: underline;
    }

    .cu-print-sheet .cu-card-cream,
    .cu-print-sheet .cu-card-dark,
    .cu-print-sheet .cu-compare-board,
    .cu-print-sheet .cu-compare-person,
    .cu-print-sheet .cu-source-block,
    .cu-print-sheet .cu-dossier-tab-panel {
        background: #fff !important;
        border: 1px solid #d6d3d1 !important;
    }

    .cu-print-sheet h1,
    .cu-print-sheet h2,
    .cu-print-sheet h3,
    .cu-print-sheet .cu-section-title {
        break-after: avoid;
        page-break-after: avoid;
    }

    .cu-print-sheet .cu-card-cream,
    .cu-print-sheet .cu-card-dark,
    .cu-print-sheet .cu-compare-row,
    .cu-print-sheet .cu-compare-person,
    .cu-print-sheet .cu-source-block,
    .cu-print-sheet .cu-dossier-tab-panel,
    .cu-print-sheet .cu-civic-diagram,
    .cu-print-sheet .cu-gfx,
    .cu-print-sheet .cu-fine-facts > div,
    .cu-print-sheet .cu-fine-time > li,
    .cu-print-sheet .cu-learn-check,
    .cu-print-sheet tr,
    .cu-print-sheet thead {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Screen hides inactive tabs with the hidden attribute. Print shows those panels. */
    .cu-print-sheet .cu-learn-print-step[hidden],
    .cu-print-sheet .cu-dossier-tab-panel[hidden],
    .cu-print-sheet .cu-compare-panel[hidden] {
        display: block !important;
    }

    .cu-print-sheet .cu-compare-row[hidden] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }

    .cu-print-sheet details,
    .cu-print-sheet details > * {
        display: block !important;
    }

    .cu-print-sheet .cu-prov__link[href]::after,
    .cu-print-sheet .cu-gfx-source a[href]::after,
    .cu-print-sheet .cu-learn-sources a[href]::after,
    .cu-print-sheet .cu-map-sources a[href]::after,
    .cu-print-sheet .cu-link-row a[href]::after,
    .cu-print-sheet .cu-speech-drawer a[href]::after,
    .cu-print-sheet .cu-source-block a[href]::after,
    .cu-print-sheet a[href^="http"]::after {
        content: " (" attr(href) ")";
        color: #1c1917 !important;
        -webkit-text-fill-color: #1c1917 !important;
        font-weight: 400;
        text-decoration: none;
        overflow-wrap: anywhere;
    }
}
