.book-form textarea {
    resize: vertical;
}

.book-form .recipe-results {
    max-height: 16rem;
    overflow-y: auto;
}

.book-nav {
    justify-content: flex-end;
}

.library-item + .library-item {
    margin-top: 0.25rem;
}

/* Sharing brings the whole section as it is, so the choices about what to copy do not apply. */
.library-options:has(input[value="share"]:checked) .copy-options {
    display: none;
}

/* On screen the page header already shows the book's title and the sidebar the navigation. */
.book-title,
.book-byline {
    display: none;
}

.book-toc ol,
.book-index ul {
    padding-left: 1.25rem;
}

.book-section {
    margin-top: 2.5rem;
}

.book-section:first-of-type {
    margin-top: 0.5rem;
}

/* A recipe that opens a section needs no divider above it. */
.book-section > .book-recipe:first-child {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: 0;
}

.book-section-title {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.25rem;
}

.book-preface {
    margin: 1rem 0;
}

.book-recipe {
    margin: 1.75rem 0;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.book-recipe-title a {
    color: inherit;
    text-decoration: none;
}

.book-recipe h4 {
    font-size: 1.1rem;
    margin-top: 1rem;
}

.book-index {
    margin-top: 3rem;
}

/* Saving the page as a PDF should give a book: no site chrome, sections start on new pages. */
@media print {
    header.bd-header,
    .nav-overlay,
    .toast-container,
    .col-sm-3 {
        display: none !important;
    }

    body {
        display: block;
        height: auto;
        min-height: 0;
    }

    .content-container,
    .col-md-9 {
        height: auto;
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    .book-title {
        display: block;
        font-size: 2.25rem;
        margin-bottom: 0.25rem;
    }

    .book-byline {
        display: block;
    }

    .book-private,
    .book-nav {
        display: none;
    }

    .book-toc,
    .book-section:not(:first-of-type),
    .book-index {
        break-before: page;
    }

    .book-recipe {
        break-inside: avoid-page;
    }

    h2,
    h3,
    h4 {
        break-after: avoid-page;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}
