/* Keep the original stanza breaks when switching from the excerpt to the full text. */
.classic-reading-verse { display: block; min-width: 0; }
.classic-reading-verse:has(details[open]) > .classic-reading-lines,
.poem-card-body:has(.poem-card-rest:not([hidden])) > .poem-card-preview { display: none; }

.classic-reading-verse details[open],
.poem-card-body .poem-card-rest { margin-block-start: 0; }

.classic-reading-card header h3,
article.poem .poem-heading h1,
article.poem .random-title {
    font-weight: 700;
}
.classic-reading-card header h3 { margin-block-end: 0; }
.classic-reading-card .poem-title-rule { margin-block: 12px 16px; }
.poem-card-body .poem-read-more { font-family: var(--font-body); }

[data-poem-card] .poem-card-title-row h2 {
    margin: 0;
    font: 500 clamp(24px, 2.3vw, 30px)/1.16 Georgia, serif;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}
[data-poem-card] .poem-card-title-row h2 a {
    color: var(--ink);
    text-decoration: none;
}
[data-poem-card] .poem-card-title-row h2 a:is(:hover, :focus-visible) {
    color: var(--violet);
    text-decoration: underline;
}

.category-detail-page .category-subtopic-nav {
    margin-block-end: 0;
}
.category-subtopic-nav + .category-detail-feed .category-detail-feed-heading {
    padding-block-start: 0;
}

@media screen {
    .classic-reading-more[open] > summary,
    .poem-card-actions:has([aria-expanded="true"]) {
        position: sticky;
        bottom: calc(var(--mobile-nav-height, 0px) + env(safe-area-inset-bottom) + 8px);
        z-index: 1;
        width: fit-content;
        margin-inline: 0 auto;
    }
    .classic-reading-more[open] > summary,
    .poem-card-actions .poem-read-more[aria-expanded="true"] {
        background: var(--violet);
        border-color: var(--violet);
        color: white;
        box-shadow: 0 2px 6px rgb(35 22 64 / 20%);
    }
    :is(.classic-reading-more[open], .poem-read-more[aria-expanded="true"]) .poem-read-more-icon {
        background: transparent;
    }
}

/* Give lists of classic poems the same column as the homepage feed. */
:is(.library-works, .library-content-panel, .library-sought-section, .search-result-section):has(.classic-reading-list) {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
}

@media screen and (max-width: 760px) {
    .classic-reading-card header h3 { font-size: 27px; }
    .poem-card .poem-card-summary, article.poem .poem-summary { border-radius: 0; }

    /* Lists can be nested inside padded library, search and profile panels. */
    #main-content :is(article[data-classic-card], article.poem-card[data-poem-card], article.poem:has(.poem-body)) {
        box-sizing: border-box;
        width: auto;
        max-width: none;
        margin-inline: calc(50% - 50vw);
        padding-inline: max(var(--poem-reading-gutter, 14px), env(safe-area-inset-left)) max(var(--poem-reading-gutter, 14px), env(safe-area-inset-right));
        border-inline: 0;
        border-radius: 0;
        box-shadow: none;
        transform: none;
        overflow-wrap: anywhere;
    }
    .classic-reading-card {
        --poem-reading-gutter: 8px;
    }
    .classic-reading-card .classic-reading-content { grid-template-columns: minmax(0, 1fr); }
}
