/* Print / Save as PDF for the memo slide preview (AB#4084). Port of the JSX buildPrintDoc CSS: landscape letter,
   one slide per page at 10 x 7.5 in, app chrome hidden. Global because the chrome lives in MainLayout; the slide
   rules need !important to beat the scoped MemoDeck.razor.css selectors (.memo-slide[b-xxxx]). */

@media print {
    @page {
        size: letter landscape;
        margin: 0.25in;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* White paper even in dark mode (exact colour printing would otherwise print the dark page background). */
    html,
    body,
    .mud-layout,
    .mud-main-content {
        background: #ffffff !important;
    }

    /* MainLayout offsets the content for the app bar and the mini drawer. */
    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* App chrome, toolbars, banners, suggestion boxes and every button. */
    .no-print,
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-overlay,
    .mud-overlay,
    .mud-popover-provider,
    .mud-snackbar-provider,
    .mud-alert,
    .mud-button-root,
    .mud-menu,
    .mud-progress-linear,
    .suggest-bar,
    .suggest-panel,
    .line-editor-actions,
    #blazor-error-ui,
    #components-reconnect-modal {
        display: none !important;
    }

    .memo-editor,
    .memo-deck {
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
    }

    /* Block layout (not flex) so the page breaks between slides are honoured by every browser. */
    .memo-deck {
        display: block !important;
        gap: 0 !important;
    }

    .memo-page {
        margin: 0 !important;
    }

    .memo-slide {
        width: 10in !important;
        height: 7.5in !important;
        aspect-ratio: auto !important;
        box-shadow: none !important;
        margin: 0 auto !important;
        break-after: page;
        page-break-after: always;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* No blank page after the last slide. */
    .memo-deck > :last-child,
    .memo-deck > :last-child > .memo-slide {
        break-after: auto !important;
        page-break-after: auto !important;
    }

    /* The in-place edit outline is screen-only. */
    .narrative-line-editable {
        outline: none !important;
    }
}
