/* This CSS file will be loaded when you print the notebook (@media print), or when the disable_ui frontend parameter is set (in a static HTML export). */

main {
    margin-top: 20px;
    cursor: auto;
}

body header#pluto-nav,
preamble > button,
pluto-cell > button,
pluto-input > button,
pluto-shoulder,
footer,
pluto-runarea,
#helpbox-wrapper {
    display: none !important;
}

/* These next rules only apply to @media print, i.e. the PDF export. We want to hide these items in the PDF, but not in a static HTML. */
@media print {
    .pluto-frontmatter,
    .edit_or_run,
    .loading-bar,
    .floating_back_button,
    .outline-frame,
    .outline-frame-actions-container,
    pkg-status-mark,
    .MJX_ToolTip,
    .MJX_HoverRegion,
    .MJX_LiveRegion,
    nav#undo_delete {
        display: none !important;
    }
    main {
        padding-bottom: 0;
    }
    pluto-input .cm-editor {
        border-left: 1px solid var(--normal-cell-color);
        border-radius: 4px !important;
    }

    pluto-cell {
        break-inside: avoid;
    }
    /* Cells with simple prose content should be allowed to break. Here is a hearistic for that: (we could check for the `.markdown` class generated by the Markdown stdlib but we also want to fully support alternatives) */
    pluto-cell.code_folded:has(p) {
        break-inside: auto;
    }

    /* When printing, hr should act like a page break */
    pluto-output > div > div.markdown > hr,
    pluto-output > div > div > hr {
        height: 0;
        margin: 0;
        visibility: hidden;
        break-after: page;
    }

    pluto-output h1 {
        break-before: page;
    }
    pluto-cell:first-of-type pluto-output h1 {
        break-before: avoid;
    }
    pluto-output :is(.admonition, .pluto-docs-binding, blockquote) h1 {
        break-before: avoid;
    }

    /* pluto-cell:has(h1) + pluto-cell {
        break-inside: auto;
    } */

    pluto-output :is(h1, h2, h3, h4) {
        break-after: avoid;
    }
}

@page {
    widows: 2;
}
