/* ==========================================================================
   Book, story, chapter, author and about pages in the paper-and-ink look.
   Builds on paper.css and restyles the shared story classes from style.css.
   Every rule is scoped to body.reading.
   ========================================================================== */

/* One centered column, sized for comfortable reading */
.reading .story-page {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

.reading .story-page > .row > [class*="col-"] {
    max-width: 46rem;
}

/* --------------------------------------------------------------------------
   Header: breadcrumb, title, author and meta
   -------------------------------------------------------------------------- */

.reading .breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    --bs-breadcrumb-divider-color: var(--ink-soft);
}

.reading .breadcrumb-item,
.reading .breadcrumb-item.active {
    color: var(--ink-soft);
}

.reading .breadcrumb-item a {
    text-decoration: none;
}

.reading .breadcrumb-item a:hover {
    color: var(--accent);
}

.reading .story-header {
    border-bottom: var(--frame);
    padding-bottom: 1.75rem;
}

.reading .story-page-title {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(2.3rem, 5vw, 3.6rem);
    line-height: 1.1;
    text-wrap: balance;
    color: var(--ink);
    margin-bottom: 1.25rem;
}

.reading .story-meta-info {
    color: var(--ink-soft);
    font-size: 0.95rem;
    gap: 0.5rem 1.5rem;
}

.reading .story-meta-info svg {
    display: none;
}

/* Share link in the meta line: quiet text, keeps its icon */
.reading .share-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--rule-soft);
}

.reading .share-link:hover,
.reading .share-link:focus-visible {
    color: var(--accent);
    border-bottom-color: currentColor;
}

.reading .story-meta-info .share-link svg {
    display: inline-block;
    margin: 0;
}

/* Share call to action at the end of the text */
.share-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--rule-soft);
}

.share-cta-text {
    margin: 0;
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
}

.reading .author-info {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.05rem;
}

.reading .author-info a {
    color: inherit;
}

.reading .free-read-badge {
    background: none;
    border: var(--frame);
    border-radius: 0;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    padding: 0.15rem 0.7rem;
}

/* --------------------------------------------------------------------------
   Narration player: play/pause and stop under the title
   -------------------------------------------------------------------------- */

.audio-player {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-block-start: 1.25rem;
}

.audio-player .ink-btn {
    padding: 0.45rem 1.1rem;
    font-size: 0.95rem;
}

.audio-player .ink-btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.audio-time {
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Cover plate and intro
   -------------------------------------------------------------------------- */

.reading .book-cover {
    max-width: 360px;
    margin: 2.5rem auto 2rem;
}

.reading .book-cover img {
    border-radius: 0;
    box-shadow: none;
    border: var(--frame);
    padding: 10px;
    background: var(--paper-deep);
}

.reading .book-cover figcaption {
    color: var(--ink-soft);
    font-size: 0.8rem;
    margin-block-start: 0.75rem;
}

/* Small label above the book summary and above the text itself */
.reading .section-label {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.2rem; /* same as the chapter titles in the list */
    color: var(--accent);
    margin-block: 2rem 0.5rem;
}

.reading .section-label + .book-intro {
    margin-block-start: 0;
}

.reading .book-intro {
    font-family: var(--display);
    font-size: 1.25rem;
    line-height: 1.85;
    color: var(--ink);
    margin-block: 2rem 2.5rem;
}

/* --------------------------------------------------------------------------
   Summary page: chapter summaries, characters, discussion questions
   -------------------------------------------------------------------------- */

.reading .summary-link {
    margin-block: -0.25rem 1rem;
}

.reading .summary-link a,
.reading .summary-lead a,
.reading .summary-read {
    color: var(--accent);
}

.reading .summary-lead {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--ink);
}

.reading .summary-section {
    margin-block: 2.5rem;
}

.reading .summary-characters dt {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ink);
    margin-block-start: 1rem;
}

.reading .summary-characters dd {
    margin: 0.2rem 0 0;
    line-height: 1.75;
    color: var(--ink);
}

.reading .summary-chapter {
    padding-block: 1rem;
    border-bottom: 1px solid var(--rule-soft);
}

.reading .summary-chapter h3 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.reading .summary-chapter p {
    line-height: 1.85;
    color: var(--ink);
    margin-bottom: 0.4rem;
}

.reading .summary-read {
    font-size: 0.95rem;
}

.reading .summary-questions li {
    line-height: 1.8;
    margin-block-end: 0.6rem;
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Chapter list: a printed table of contents
   -------------------------------------------------------------------------- */

.reading .chapters-heading {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.2rem; /* same as the chapter titles in the list */
    color: var(--ink);
    text-align: start;
    margin-bottom: 1rem;
}

.reading .chapters-heading::after {
    content: '';
    flex: 1;
    border-top: var(--frame);
}

.reading .chapters-grid {
    gap: 0;
}

.reading .chapter-card {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--rule-soft);
    border-radius: 0;
    padding: 0.9rem 0.5rem;
    gap: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.reading .chapter-card::before {
    content: none;
}

.reading .chapter-card:hover,
.reading .chapter-card:focus-visible {
    transform: none;
    box-shadow: none;
    background: var(--paper-deep);
    color: var(--accent);
}

.reading .chapter-number {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.35rem;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--accent);
    min-width: 2.25rem;
    text-align: start;
    font-variant-numeric: tabular-nums;
}

.reading .chapter-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.2rem;
}

.reading .chapter-arrow {
    color: var(--ink-soft);
}

/* Reading time of each chapter, beside the arrow */
.reading .chapter-time {
    flex: none;
    color: var(--ink-soft);
    font-size: 0.85rem;
    white-space: nowrap;
}

.reading .chapter-card:hover .chapter-arrow {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   The story text
   -------------------------------------------------------------------------- */

/* The reader settings (main.js) set --reader-scale and data-reader-font /
   data-reader-spacing on <html>; these defaults apply without them */
.reading {
    --reader-font: var(--display);
    --reader-leading: 1.95;
    --reader-gap: 1.1em;
}

html[data-reader-font="sans"] .reading {
    --reader-font: 'Heebo', 'Assistant', 'Arial', sans-serif;
}

html[data-reader-spacing="tight"] .reading {
    --reader-leading: 1.6;
    --reader-gap: 0.75em;
}

html[data-reader-spacing="loose"] .reading {
    --reader-leading: 2.35;
    --reader-gap: 1.6em;
}

.reading .story-content {
    font-family: var(--reader-font);
    font-size: calc(1.25rem * var(--reader-scale, 1));
    line-height: var(--reader-leading);
    color: var(--ink);
    margin-top: 2.5rem;
}

.reading .story-content p {
    margin-bottom: var(--reader-gap);
    text-indent: 1.5em;
}

.reading .story-content p:first-of-type {
    font-size: inherit;
    font-weight: 400;
    text-indent: 0;
}

/* Drop cap in the accent red */
.reading .story-content p:first-of-type::first-letter {
    font-family: var(--reader-font);
    font-weight: 900;
    font-size: 3.6em;
    line-height: 0.85;
    color: var(--accent);
    float: right;
    margin-left: 0.12em;
    padding-top: 0.08em;
}

/* --------------------------------------------------------------------------
   Footer navigation and progress bar
   -------------------------------------------------------------------------- */

.reading .story-footer.border-top {
    border-top: var(--frame) !important;
}

.reading .btn-chapter-nav {
    padding: 0.6rem 1.1rem;
    font-size: 0.95rem;
}

.reading .reading-progress-bar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 3px;
    width: 0;
    background: var(--accent);
    z-index: 1100;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   "Save to my list" toggle in the meta line (styled like the share link)
   -------------------------------------------------------------------------- */

.reading .save-book {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--rule-soft);
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.reading .save-book[hidden] {
    display: none;
}

.reading .save-book:hover,
.reading .save-book:focus-visible,
.reading .save-book[aria-pressed="true"] {
    color: var(--accent);
    border-bottom-color: currentColor;
}

.reading .story-meta-info .save-book svg {
    display: inline-block;
}

.reading .save-book[aria-pressed="true"] svg {
    fill: currentColor;
}

/* --------------------------------------------------------------------------
   Reader settings: a floating "אא" button opening a small framed panel
   -------------------------------------------------------------------------- */

.reader-settings {
    position: fixed;
    bottom: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 1050;
}

.reader-settings[hidden] {
    display: none;
}

.reader-settings-toggle {
    width: 3.25rem;
    height: 3.25rem;
    border: var(--frame);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.reader-settings-toggle small {
    font-size: 0.7em;
}

.reader-settings-toggle:hover,
.reader-settings-toggle[aria-expanded="true"] {
    background: var(--ink);
    color: var(--paper);
}

.reader-panel {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    inset-inline-end: 0;
    width: min(20rem, calc(100vw - 2rem));
    padding: 1rem 1.1rem 0.9rem;
    background: var(--paper);
    border: var(--frame);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    color: var(--ink);
}

.reader-panel[hidden] {
    display: none;
}

.reader-panel-title {
    margin: 0 0 0.75rem;
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.15rem;
}

.reader-row {
    margin-bottom: 0.85rem;
}

.reader-row-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
    font-weight: 600;
}

.reader-stepper,
.reader-choices {
    display: flex;
    align-items: stretch;
}

.reader-opt {
    flex: 1;
    min-height: 2.5rem;
    padding: 0.35rem 0.5rem;
    border: var(--frame);
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Joined segments: drop the doubled border between neighbours */
.reader-choices .reader-opt + .reader-opt,
.reader-stepper > * + * {
    margin-inline-start: -1.5px;
}

.reader-opt:hover:not(:disabled) {
    background: var(--paper-deep);
}

.reader-opt[aria-pressed="true"] {
    background: var(--ink);
    color: var(--paper);
}

.reader-opt:disabled {
    opacity: 0.35;
    cursor: default;
}

.reader-size-value {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--frame);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

.reader-font-serif {
    font-family: 'Frank Ruhl Libre', serif;
}

.reader-font-sans {
    font-family: 'Heebo', sans-serif;
}

/* Paper swatches keep their own colours whatever the current theme */
.reader-swatch-light {
    background: #f3eee3;
    color: #1c1b19;
}

.reader-swatch-sepia {
    background: #f1e2c0;
    color: #3a2c1c;
}

.reader-swatch-dark {
    background: #1a1917;
    color: #efe9dc;
}

.reader-swatch:hover:not(:disabled) {
    background-image: linear-gradient(rgba(128, 128, 128, 0.12), rgba(128, 128, 128, 0.12));
}

.reader-swatch[aria-pressed="true"] {
    outline: 2px solid var(--accent);
    outline-offset: -5px;
}

.reader-swatch-light[aria-pressed="true"] { background: #f3eee3; color: #1c1b19; }
.reader-swatch-sepia[aria-pressed="true"] { background: #f1e2c0; color: #3a2c1c; }
.reader-swatch-dark[aria-pressed="true"] { background: #1a1917; color: #efe9dc; }

.reader-reset {
    padding: 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--rule-soft);
    color: var(--ink-soft);
    font-size: 0.85rem;
    cursor: pointer;
}

.reader-reset:hover,
.reader-reset:focus-visible {
    color: var(--accent);
}

@media (max-width: 767.98px) {
    .reader-settings {
        bottom: 1rem;
        inset-inline-end: 1rem;
    }

    .reader-settings-toggle {
        width: 3rem;
        height: 3rem;
    }
}

@media print {
    .reader-settings,
    .save-book {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .reading .story-content {
        font-size: calc(1.15rem * var(--reader-scale, 1));
    }

    .reading .story-content p {
        text-indent: 1.2em;
    }

    .reading .book-intro {
        font-size: 1.1rem;
    }

    .reading .chapter-title,
    .reading .section-label,
    .reading .chapters-heading {
        font-size: 1.05rem;
    }
}

/* --------------------------------------------------------------------------
   Author page: the author's books, each beside its framed cover
   -------------------------------------------------------------------------- */

/* Portrait beside the biography, and the "where to start" list */
.reading .author-portrait {
    float: inline-start;
    width: 200px;
    margin-block: 0.5rem 1rem;
    margin-inline-end: 1.75rem;
}

.reading .author-portrait img {
    display: block;
    width: 100%;
    height: auto;
    border: var(--frame);
    padding: 6px;
    background: var(--paper-deep);
}

.reading .author-portrait figcaption {
    color: var(--ink-soft);
    font-size: 0.75rem;
    margin-block-start: 0.5rem;
}

.reading .author-portrait figcaption a {
    color: inherit;
}

.reading .author-start,
.reading .author-portrait ~ .chapters-list {
    clear: both;
}

.reading .author-start {
    margin-block: 2.5rem;
}

.reading .author-start ol {
    padding-inline-start: 1.25rem;
    line-height: 1.8;
}

.reading .author-start li {
    margin-block-end: 0.6rem;
}

.reading .author-start a {
    color: var(--accent);
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .reading .author-portrait {
        float: none;
        width: 160px;
        margin-inline: auto;
        text-align: center;
    }
}

/* Collection (hub) pages and the links to them */
.reading .collection-section {
    margin-block-start: 2.5rem;
}

.reading .collection-section-text {
    line-height: 1.8;
}

.reading .collection-meta {
    display: block;
    color: var(--ink-soft);
    font-size: 0.8rem;
    margin-block-start: 0.35rem;
}

.reading .collection-link a {
    color: var(--accent);
    font-weight: 700;
}

.reading .author-book {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--rule-soft);
    border-radius: 0;
    padding: 1.25rem 0.5rem;
    margin: 0;
    transition: background-color 0.2s ease;
}

.reading .author-book:hover,
.reading .author-book:focus-visible {
    background: var(--paper-deep);
    box-shadow: none;
}

.reading .author-book-cover {
    flex: none;
    width: 84px;
    aspect-ratio: 3 / 4;
    border: var(--frame);
    padding: 4px;
    background: var(--paper-deep);
    overflow: hidden;
}

.reading .author-book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reading .author-book-text {
    min-width: 0;
}

.reading .author-book-title {
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.45rem;
    color: var(--ink);
    margin-block-end: 0.35rem;
}

.reading .author-book:hover .author-book-title {
    color: var(--accent);
}

.reading .author-book-intro {
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.7;
}

.reading .author-book-time {
    display: block;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   About page: running text with section headings
   -------------------------------------------------------------------------- */

.reading .prose {
    font-family: var(--display);
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--ink);
}

.reading .prose h2 {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(1.6rem, 3vw, 2rem);
    margin: 2.75rem 0 1rem;
}

.reading .prose h2::after {
    content: '';
    flex: 1;
    border-top: var(--frame);
}

.reading .prose a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

.reading .prose ul {
    list-style: none;
    padding: 0;
}

.reading .prose li {
    position: relative;
    padding-inline-start: 1.6rem;
    margin-bottom: 0.4rem;
}

/* A short red dash, as in the homepage's promise list */
.reading .prose li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0.95em;
    width: 0.9rem;
    height: 1.5px;
    background: var(--accent);
}

.reading .prose-signoff {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: var(--frame);
    text-align: center;
}

.reading .prose-signoff p {
    margin-bottom: 0.25rem;
}

@media (max-width: 767.98px) {
    .reading .author-book-cover {
        width: 64px;
    }

    .reading .author-book-title {
        font-size: 1.2rem;
    }

    .reading .prose {
        font-size: 1.05rem;
    }
}

/* --------------------------------------------------------------------------
   Search results page
   -------------------------------------------------------------------------- */

.reading .search-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-basis: 100%;
    color: var(--ink-soft);
    cursor: pointer;
}

.reading .search-filter input {
    accent-color: var(--ink);
    width: 1.05rem;
    height: 1.05rem;
}

.reading .search-status {
    color: var(--ink-soft);
    font-size: 1.05rem;
    margin-block: 1.5rem 2.5rem;
}

.reading .search-result {
    padding-block: 1.5rem;
    border-bottom: 1px solid var(--rule-soft);
}

.reading .search-result-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.45rem;
    margin-bottom: 0.75rem;
}

.reading .search-result-title a {
    text-decoration: none;
}

.reading .search-result-title a:hover {
    color: var(--accent);
}

.reading .search-result-meta {
    font-family: inherit;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.reading .search-snippets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reading .search-snippets a {
    display: block;
    padding: 0.6rem 0.75rem;
    margin-inline: -0.75rem;
    text-decoration: none;
    line-height: 1.75;
}

.reading .search-snippets a:hover,
.reading .search-snippets a:focus-visible {
    background: var(--paper-deep);
}

.reading .search-snippet-chapter {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}

.reading .search-snippet-text {
    font-family: var(--display);
    font-size: 1.05rem;
}

.reading .search-snippets mark {
    background: none;
    color: inherit;
    padding: 0;
    font-weight: 700;
    box-shadow: inset 0 -0.45em 0 rgba(143, 42, 36, 0.2);
}

.reading.dark-mode .search-snippets mark {
    box-shadow: inset 0 -0.45em 0 rgba(224, 103, 92, 0.3);
}

/* --------------------------------------------------------------------------
   Talk to a book character
   -------------------------------------------------------------------------- */

.reading .talk {
    margin-block: 1.5rem;
    padding: 1rem 1.25rem;
    border: var(--frame);
}

.reading .talk-title {
    font-family: var(--display);
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
}

.talk-dialog {
    width: min(36rem, calc(100vw - 2rem));
    border: var(--frame);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    padding: 1.5rem;
}

.talk-dialog::backdrop {
    background: rgb(0 0 0 / 0.45);
}

.talk-consent ul {
    padding-inline-start: 1.25rem;
    line-height: 1.7;
}

.talk-consent-check {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-block: 1rem;
    font-weight: 700;
}

.talk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

/* Chat bubbles: the child on the right (start in RTL), the character on the left (end) */
.talk-log {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 45vh;
    overflow-y: auto;
    padding-block: 0.25rem;
}

.talk-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.6rem;
    max-width: 85%;
    margin: 0;
    padding: 0.55rem 0.9rem;
    line-height: 1.6;
    border: var(--frame);
}

.talk-text {
    flex: 1 1 0;
    min-width: 0;
}

.talk-play {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: var(--frame);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

.talk-play:hover,
.talk-play:focus-visible {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
}

.talk-child-line {
    align-self: flex-start;
    background: var(--paper-deep);
    font-size: 1rem;
}

.talk-character-line {
    align-self: flex-end;
    background: var(--paper);
    font-family: var(--display);
    font-size: 1.1rem;
}

.talk-status {
    min-height: 1.5em;
    color: var(--accent);
    font-weight: 700;
}

.talk-unsupported {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.7;
}

/* Typing a question */
.talk-compose {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.talk-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: var(--frame);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    border-radius: 0;
}

.talk-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* The dove: flies from the child's side (right) to the island (left), waits, flies back */
.talk-flight {
    position: relative;
    flex: none;
    height: 70px;
    overflow: hidden;
    color: var(--ink);
}

.talk-island {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    width: 64px;
    height: 40px;
}

.talk-sand {
    fill: var(--paper-deep);
    stroke: currentColor;
    stroke-width: 1.5;
}

.talk-trunk,
.talk-leaves {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.talk-dove {
    position: absolute;
    top: 4px;
    inset-inline-start: 0;
    width: 52px;
}

.talk-dove svg {
    display: block;
    width: 100%;
    overflow: visible;
}

.dove-body,
.dove-wing {
    fill: var(--paper);
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.dove-beak {
    fill: var(--accent);
}

.dove-eye {
    fill: currentColor;
}

.dove-letter rect,
.dove-letter path {
    fill: var(--paper-deep);
    stroke: currentColor;
    stroke-width: 1.3;
}

.dove-wing {
    transform-box: fill-box;
    transform-origin: 10% 90%;
}

.is-going .talk-dove {
    animation: dove-go 2.4s ease-in-out forwards;
}

.is-waiting .talk-dove {
    inset-inline-start: calc(100% - 96px);
    animation: dove-bob 1.6s ease-in-out infinite;
}

/* The letter was delivered: Cyrus is reading it */
.is-waiting .dove-letter {
    visibility: hidden;
}

.is-returning .talk-dove {
    animation: dove-back 1.8s ease-in-out forwards;
}

/* Flying back toward the child: face right */
.is-returning .talk-dove svg {
    transform: scaleX(-1);
}

.is-going .dove-wing,
.is-returning .dove-wing {
    animation: dove-flap 0.32s ease-in-out infinite alternate;
}

.is-waiting .dove-wing {
    animation: dove-flap 1.2s ease-in-out infinite alternate;
}

@keyframes dove-go {
    0% { inset-inline-start: 0; transform: translateY(14px); }
    50% { transform: translateY(-2px); }
    100% { inset-inline-start: calc(100% - 96px); transform: translateY(0); }
}

@keyframes dove-back {
    0% { inset-inline-start: calc(100% - 96px); transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { inset-inline-start: 0; transform: translateY(14px); opacity: 0.2; }
}

@keyframes dove-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

@keyframes dove-flap {
    from { transform: rotate(0deg); }
    to { transform: rotate(28deg) scaleY(0.6); }
}

@media (prefers-reduced-motion: reduce) {
    .talk-flight .talk-dove,
    .talk-flight .dove-wing {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   Related books: more by the author and similar books, at the end of a book
   -------------------------------------------------------------------------- */

.reading .related-books {
    margin-block-start: 3rem;
}

.reading .related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.reading .related-card {
    display: block;
    color: var(--ink);
    text-decoration: none;
}

.reading .related-cover {
    display: block;
    aspect-ratio: 3 / 4;
    border: var(--frame);
    padding: 4px;
    background: var(--paper-deep);
    overflow: hidden;
    margin-block-end: 0.5rem;
}

.reading .related-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reading .related-title {
    display: block;
    font-family: var(--display);
    font-weight: 700;
    line-height: 1.4;
}

.reading .related-card:hover .related-title,
.reading .related-card:focus-visible .related-title {
    color: var(--accent);
}

.reading .related-author,
.reading .related-time {
    display: block;
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.reading .related-more {
    margin-block-end: 2rem;
}

.reading .related-more a {
    color: var(--accent);
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .reading .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
