/*
 * print.css — how a page prints.
 *
 * Its own file, loaded after app.css with media="print", so the screen
 * stylesheet does not carry it and the browser fetches it at low priority.
 * The rules stay inside @media print as well, so they mean the same wherever
 * they are loaded from. Dark mode's print colours are here too.
 */

/* Without this, printing a scene gave the nav, the whole sidebar tree and one
   viewport's worth of text — everything below the fold lives inside a
   scrolling box and was simply dropped. Export to .docx or .md is the better
   route, but Ctrl-P should not silently produce a truncated page. */
@media print {
    .nav,
    .sidebar,
    .sidebar-backdrop,
    .sidebar-expand-strip,
    .editor-doc-toolbar,
    .ql-toolbar,
    .snapshots-panel,
    .autolink-panel,
    .flash,
    .item-menu,
    .overflow-menu,
    .split-empty-state,
    .comment-sidebar,
    .comment-sidebar-backdrop,
    .comment-popover,
    .editor-toolbar-row,
    .editor-pane-right,
    /* By id as well: the class alone ties with .editor-pane below, which comes
       later and so won, printing the right pane's empty header after every
       document. */
    #pane-right {
        display: none !important;
    }

    html, body,
    .main,
    /* The project page, statistics and the wiki hub: the sidebar layout is
       one screen tall and scrolls inside, so it printed one page. */
    .layout-split,
    .content,
    .editor-shell,
    .editor-layout,
    .editor-panes-row,
    .editor-pane,
    #quill-editor,
    .ql-container,
    .ql-editor {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }

    body { background: #fff; color: #000; }
    /* The editor keeps its dark-mode colour otherwise, and printed grey. Quill's
       own text colours sit on inner spans and still apply. */
    .ql-editor,
    .scene-title-input { color: #000 !important; background: #fff !important; }

    .ql-editor {
        max-width: none;
        padding: 0;
        font-size: 12pt;
        line-height: 1.5;
    }

    .editor-title-row { border: none; padding: 0 0 12pt; }
    .scene-title-input {
        border: none;
        font-size: 18pt;
        font-weight: 700;
        padding: 0;
    }

    /* Keep a heading with the text under it. */
    h1, h2, h3 { break-after: avoid; }
    p { orphans: 3; widows: 3; }
}

