/* ./html/style/site.css
 * Site styles, loaded after tufte.css on every page (see partials/head.php).
 *
 * Colours, dark mode, the theme toggle, the print button and the "Printed from" line all come from the
 * tufte-css fork (style/tufte): use its --tufte-* variables, and put anything generic there rather than here.
 *
 * Sections:
 *   1. Site header            (all pages)
 *   2. Catalogue              (body.page-catalogue)
 *   3. Article pages          (body.page-article)
 *
 * Page sections are scoped with :where(), so they add no specificity.
 */


/* ===================================================================
   1. Site header
   =================================================================== */

/* ---- Masthead: the site name as a logo, on a double-ruled plaque ---- */
.site-masthead {
    margin: 3rem 12.5% 0 0;
    text-align: center;
}

.site-logo {
    display: inline-block;
    padding: 5px;
    color: var(--tufte-ink);
    text-decoration: none;
    background: var(--tufte-paper);
    border: 1px solid var(--tufte-ink);
    box-shadow: 0 1px 0 var(--tufte-paper-edge), 0 2px 6px rgba(var(--tufte-shadow-rgb), 0.08);
}

.site-logo-name {
    display: block;
    padding: 0.55rem 1.6rem 0.6rem;
    border: 1px solid var(--tufte-ink);
    font-size: 2.1rem;
    line-height: 1;
    font-variant: small-caps;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

/* Whose it is, in small italic above the plaque */
.site-masthead-owner {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-style: italic;
    letter-spacing: 0.03em;
    color: var(--tufte-muted);
}

/* Diamond ornaments flanking the name */
.site-logo-name::before,
.site-logo-name::after {
    content: "\25C6";
    display: inline-block;
    margin: 0 0.7em;
    font-size: 0.4em;
    vertical-align: middle;
    color: var(--tufte-accent);
    letter-spacing: 0;
}

.site-logo:hover .site-logo-name,
.site-logo:focus-visible .site-logo-name {
    border-color: var(--tufte-accent);
}

/* ---- Primary nav: a centred band between hairline rules ---- */
.site-nav {
    margin: 1.5rem 12.5% 0 0;
    border-top: 1px solid var(--tufte-rule);
    border-bottom: 1px solid var(--tufte-rule);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 2.5rem;
}

.site-nav li {
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: block;
    padding: 0.55rem 0.1rem 0.45rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
    background: none;
    text-shadow: none;
    color: var(--tufte-muted);
    font-size: 1rem;
    font-variant: small-caps;
    letter-spacing: 0.1em;
}

.site-nav a:hover {
    color: var(--tufte-ink);
}

.site-nav a[aria-current="page"] {
    color: var(--tufte-ink);
    border-bottom-color: var(--tufte-accent);
}

@media (max-width: 760px) {
    .site-masthead,
    .site-nav {
        margin-right: 0;
    }

    .site-logo-name {
        font-size: 1.6rem;
        padding: 0.5rem 0.9rem;
    }

    .site-nav ul {
        gap: 0 1.1rem;
    }
}

/* ---- "[This is an automatically generated summary]" after a summary (summary_note() in data.php), on a line of
        its own, as inline it would stretch a justified summary's last line ---- */
.summary-note {
    display: block;
    margin-top: 0.2rem;
    text-align: left;
    font-size: 0.7rem;
    font-style: normal;
    letter-spacing: 0.02em;
    color: var(--tufte-muted);
}

/* ---- The notice under the view switch that a translation is unchecked (translation_note() in data.php) ---- */
.translation-note {
    margin: 0.4rem 0 0;
    text-align: center;
    text-indent: 0;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: var(--tufte-muted);
}

/* ---- About page: embedded talk video ---- */
.about-video video {
    display: block;
    width: 100%;
    height: auto;
}


/* ===================================================================
   2. Catalogue
   =================================================================== */

/* ---- "Newly added" and "Last edited" ($newly_added and $last_edited in data.php), above the cards ---- */
:where(.page-catalogue) .spotlight {
    margin: 0 12.5% 2rem 0;
    padding: 0 0 0 1.25rem;
    border-left: 3px solid var(--tufte-accent);
}
:where(.page-catalogue) .spotlight-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0;
    font-size: 0.8rem;
    color: var(--tufte-muted);
}
:where(.page-catalogue) .spotlight-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--tufte-accent);
}
:where(.page-catalogue) .spotlight-title {
    margin: 0.35rem 0 0.4rem;
    font-size: 1.6rem;
    font-style: normal;
    line-height: 1.25;
}
:where(.page-catalogue) .spotlight-title a {
    color: var(--tufte-ink);
    text-decoration: none;
}
:where(.page-catalogue) .spotlight-title a:hover {
    text-decoration: underline;
}
:where(.page-catalogue) .spotlight-summary {
    margin: 0;
    width: auto;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--tufte-ink-soft);
}

/* ---- Toolbar: a card holding search, the Filters toggle, its panel and the count ---- */
:where(.page-catalogue) .catalogue-tools {
    margin: 0 12.5% 2.5rem 0;
    padding: 1.25rem 1.5rem 1rem;
    background: var(--tufte-panel);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 6px;
}
:where(.page-catalogue) .tools-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}
:where(.page-catalogue) .search-field {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
:where(.page-catalogue) .search-field label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--tufte-muted);
    margin-bottom: 0.35rem;
}
:where(.page-catalogue) .search-field input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-family: et-book, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: 1.25rem;
    color: var(--tufte-ink);
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--tufte-ink);
    border-radius: 0;
    padding: 0.35rem 2rem 0.35rem 0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
:where(.page-catalogue) .search-field input::placeholder {
    color: var(--tufte-faint);
    font-style: italic;
}
:where(.page-catalogue) .search-field input:focus {
    border-bottom-color: var(--tufte-accent);
}
:where(.page-catalogue) .search-field input::-webkit-search-cancel-button {
    cursor: pointer;
}
:where(.page-catalogue) .search-field kbd {
    position: absolute;
    right: 0;
    bottom: 0.55rem;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--tufte-muted);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 3px;
    padding: 0 0.35rem;
    pointer-events: none;
}
:where(.page-catalogue) .search-field input:focus ~ kbd,
:where(.page-catalogue) .search-field input:not(:placeholder-shown) ~ kbd {
    display: none;
}

/* ---- Filters toggle ---- */
:where(.page-catalogue) .filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: none;
    font: inherit;
    font-size: 0.9rem;
    color: var(--tufte-ink);
    background: var(--tufte-paper);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    cursor: pointer;
}
:where(.page-catalogue) .filter-toggle:hover {
    border-color: var(--tufte-muted);
}
:where(.page-catalogue) .filter-toggle:focus-visible {
    outline: 2px solid var(--tufte-accent);
    outline-offset: 2px;
}
:where(.page-catalogue) .filter-toggle::after {
    content: "";
    width: 0.4em;
    height: 0.4em;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-0.15em) rotate(45deg);
    transition: transform 0.15s ease;
}
:where(.page-catalogue) .filter-toggle[aria-expanded="true"]::after {
    transform: translateY(0.1em) rotate(-135deg);
}
/* The full-text search's submit button: the toggle's look, without its chevron */
:where(.page-search) .search-submit::after {
    content: none;
}
:where(.page-catalogue) .filter-badge {
    min-width: 1.3em;
    padding: 0 0.3em;
    font-size: 0.75rem;
    line-height: 1.3em;
    text-align: center;
    color: var(--tufte-paper);
    background: var(--tufte-accent);
    border-radius: 999px;
}
:where(.page-catalogue) .filter-badge[hidden] {
    display: none;
}

/* ---- Filter panel: sort and category ---- */
:where(.page-catalogue) .filter-panel {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--tufte-panel-edge);
}
:where(.page-catalogue) .filter-panel[hidden] {
    display: none;
}
:where(.page-catalogue) .filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 1rem;
}
:where(.page-catalogue) .filter-label {
    flex: 0 0 5.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--tufte-muted);
}
:where(.page-catalogue) .sort-controls,
:where(.page-catalogue) .category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    /* Beside its label, wrapping there when the chips don't fit on one line (the authors) */
    flex: 1 1 18rem;
}
:where(.page-catalogue) .sort-link,
:where(.page-catalogue) .category-filter button {
    font: inherit;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--tufte-ink);
    text-decoration: none;
    background: var(--tufte-paper);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    cursor: pointer;
}
:where(.page-catalogue) .sort-link:hover,
:where(.page-catalogue) .category-filter button:hover:not(:disabled) {
    border-color: var(--tufte-muted);
}
:where(.page-catalogue) .sort-link.active,
:where(.page-catalogue) .category-filter button[aria-pressed="true"] {
    color: var(--tufte-paper);
    background: var(--tufte-ink);
    border-color: var(--tufte-ink);
}
:where(.page-catalogue) .sort-link.active {
    pointer-events: none;
}
:where(.page-catalogue) .category-filter button:disabled {
    color: var(--tufte-faint);
    background: transparent;
    cursor: default;
}
:where(.page-catalogue) .category-filter .n {
    color: var(--tufte-muted);
    margin-left: 0.2rem;
}
:where(.page-catalogue) .category-filter button[aria-pressed="true"] .n {
    color: inherit;
    opacity: 0.7;
}
:where(.page-catalogue) .result-count {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    color: var(--tufte-muted);
}

/* ---- Card grid ---- */
:where(.page-catalogue) section > ul.clip-grid {
    width: auto;
    padding: 0;
    margin: 0 12.5% 0 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    grid-auto-flow: dense;
    gap: 2rem 1.75rem;
}
:where(.page-catalogue) .clip-grid > li {
    margin: 0;
}
:where(.page-catalogue) .clip-grid > li[hidden] {
    display: none;
}

/* ---- A card is a newspaper clipping ---- */
:where(.page-catalogue) .clip {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.1rem 1.3rem 0.9rem;
    background: var(--tufte-paper);
    border: 1px solid var(--tufte-paper-edge);
    box-shadow:
        0 1px 0 rgba(var(--tufte-shadow-rgb), 0.05),
        0 10px 24px -18px rgba(var(--tufte-shadow-rgb), 0.45);
    color: var(--tufte-ink);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
:where(.page-catalogue) .clip:hover,
:where(.page-catalogue) .clip:focus-within {
    transform: translateY(-3px);
    box-shadow:
        0 1px 0 rgba(var(--tufte-shadow-rgb), 0.05),
        0 18px 30px -18px rgba(var(--tufte-shadow-rgb), 0.55);
}
:where(.page-catalogue) .clip:focus-within {
    outline: 2px solid var(--tufte-accent);
    outline-offset: 3px;
}

:where(.page-catalogue) .clip-byline {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--tufte-muted);
    white-space: nowrap;
    overflow: hidden;
}
:where(.page-catalogue) .clip-pub {
    font-weight: 600;
    color: var(--tufte-ink);
    overflow: hidden;
    text-overflow: ellipsis;
}
:where(.page-catalogue) .clip-date {
    flex-shrink: 0;
    margin-left: auto;
}

:where(.page-catalogue) .clip-headline {
    margin: 0.7rem 0 0;
    font-size: 1.45rem;
    font-weight: 700;
    font-style: normal;
    line-height: 1.15;
    text-align: center;
    text-wrap: balance;
}
:where(.page-catalogue) .clip-headline a {
    text-decoration: none;
    color: inherit;
    outline: none;
}
/* Whole card is clickable via the headline link */
:where(.page-catalogue) .clip-headline a::after {
    content: "";
    position: absolute;
    inset: 0;
}
:where(.page-catalogue) .clip:hover .clip-headline a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

:where(.page-catalogue) .clip-dinkus {
    width: 2.5rem;
    height: 0;
    margin: 0.75rem auto 0.85rem;
    border: 0;
    border-top: 1px solid var(--tufte-ink);
}

:where(.page-catalogue) .clip-body {
    flex: 1;
    margin: 0;
    max-height: 11.5em;
    overflow: hidden;
    font-size: 0.98rem;
    line-height: 1.45;
    text-align: justify;
    -webkit-hyphens: auto; /* Safari */
    hyphens: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
    mask-image: linear-gradient(to bottom, #000 65%, transparent);
}
:where(.page-catalogue) .clip-body::first-letter {
    float: left;
    font-size: 3.1em;
    line-height: 0.85;
    padding: 0.08em 0.08em 0 0;
    font-weight: 700;
    color: var(--tufte-accent);
}
/* A card with a scan splits down the middle: text on the left, scan on the right. A fixed height and a row
   that can't outgrow it: with only a max-height, Safari lets the row grow to fit the whole text, which then
   runs out of the card. */
:where(.page-catalogue) .clip-split {
    flex: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 0.75rem;
    height: 13em;
    overflow: hidden;
}
:where(.page-catalogue) .clip .clip-split .clip-body {
    max-height: none;
    columns: auto;
    column-rule: none;
}
:where(.page-catalogue) .clip-scan {
    /* Zoomed in, so the print reads as print; card_position in data.json picks the spot */
    background: var(--tufte-panel-edge) 15% 12% / 190% auto no-repeat;
    filter: grayscale(0.35) contrast(1.05) var(--tufte-img-dim);
}
:where(.page-catalogue) .clip-body.is-summary {
    font-style: italic;
    color: var(--tufte-ink-soft);
}
:where(.page-catalogue) .clip-body.is-summary::first-letter {
    float: none;
    font-size: inherit;
    line-height: inherit;
    padding: 0;
    font-weight: inherit;
    color: inherit;
}

:where(.page-catalogue) .clip-foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin: 0.75rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--tufte-paper-edge);
    font-size: 0.78rem;
    color: var(--tufte-muted);
}
:where(.page-catalogue) .clip-foot .read-more {
    color: var(--tufte-accent);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
:where(.page-catalogue) .pending-tag {
    font-style: italic;
}

/* A collection (a work in several parts) is a small stack of clippings */
:where(.page-catalogue) .is-collection .clip,
:where(.page-catalogue) .is-collection .clip:hover,
:where(.page-catalogue) .is-collection .clip:focus-within {
    box-shadow:
        4px 4px 0 -1px var(--tufte-paper),
        4px 4px 0 0 var(--tufte-paper-edge),
        8px 8px 0 -1px var(--tufte-paper),
        8px 8px 0 0 var(--tufte-paper-edge),
        0 10px 24px -18px rgba(var(--tufte-shadow-rgb), 0.45);
}

/* Featured pieces get a double-width front-page slot */
@media (min-width: 900px) {
    :where(.page-catalogue) .clip-grid > li.is-featured {
        grid-column: span 2;
    }
    :where(.page-catalogue) .is-featured .clip-headline {
        font-size: 1.9rem;
    }
    :where(.page-catalogue) .is-featured .clip-body {
        columns: 2;
        column-gap: 1.75rem;
        column-rule: 1px solid var(--tufte-paper-edge);
        max-height: 13em;
    }
}

:where(.page-catalogue) .no-results {
    width: auto;
    margin: 3rem 12.5% 0 0;
    text-align: center;
    font-style: italic;
    color: var(--tufte-muted);
}

/* "Search the full text →" beside the count, once something is typed */
:where(.page-catalogue) .full-text-link {
    margin-left: 0.25em;
    color: inherit;
}

/* ---- Full-text search results (search.php): one entry per text, with its matching passages ---- */
:where(.page-search) section > ol.search-results {
    width: auto;
    margin: 0 12.5% 0 0;
    padding: 0;
    list-style: none;
}
:where(.page-search) .search-results > li {
    margin: 0 0 2.25rem;
    padding: 0 0 1.75rem;
    border-bottom: 1px solid var(--tufte-rule);
}
:where(.page-search) .search-byline {
    margin: 0 0 0.3rem;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tufte-muted);
}
:where(.page-search) .search-title {
    margin: 0 0 0.75rem;
    font-size: 1.6rem;
    font-style: normal;
}
:where(.page-search) .search-title a {
    color: var(--tufte-ink);
    text-decoration: none;
}
:where(.page-search) .search-snippet {
    width: auto;
    margin: 0 0 0.9rem;
    font-size: 1.15rem;
    line-height: 1.45;
}
:where(.page-search) .search-snippet a {
    color: var(--tufte-ink-soft);
    text-decoration: none;
}
:where(.page-search) .search-snippet a:hover {
    color: var(--tufte-ink);
}
:where(.page-search) .search-heading {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
    color: var(--tufte-muted);
}
:where(.page-search) .search-snippet mark {
    padding: 0 0.1em;
    background: var(--tufte-panel-hover);
    color: var(--tufte-ink);
    border-bottom: 2px solid var(--tufte-accent);
}
:where(.page-search) .search-more summary {
    width: fit-content;
    margin: 0 0 0.9rem;
    font-size: 0.8rem;
    color: var(--tufte-muted);
    cursor: pointer;
}

@media (max-width: 760px) {
    :where(.page-search) section > ol.search-results {
        margin-right: 0;
    }
}

@media (max-width: 760px) {
    :where(.page-catalogue) section > ul.clip-grid,
    :where(.page-catalogue) .no-results {
        padding-right: 0;
        margin-right: 0;
    }
}

@media (max-width: 760px) {
    :where(.page-catalogue) .catalogue-tools {
        margin-right: 0;
        padding: 1rem 1rem 0.85rem;
    }
    :where(.page-catalogue) .spotlight {
        margin-right: 0;
        padding-left: 1rem;
    }
    :where(.page-catalogue) .filter-label {
        flex-basis: 100%;
    }    :where(.page-catalogue) .search-field kbd {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(.page-catalogue) .filter-toggle::after {
        transition: none;
    }
    :where(.page-catalogue) .clip {
        transition: none;
    }
    :where(.page-catalogue) .clip:hover,
    :where(.page-catalogue) .clip:focus-within {
        transform: none;
    }
}


/* ===================================================================
   3. Article pages (articles, pending transcriptions, scans)
   =================================================================== */

/* ---- Newspaper styling for the article body ---- */
:where(.page-article) article p {
    text-indent: 1.5em;
}

:where(.page-article) .centered {
    text-align: center;
}

:where(.page-article) section>h1,
:where(.page-article) section>h2,
:where(.page-article) section>h3 {
    max-width: 500px;
    width: 100%;
    text-align: center;
    font-style: normal;
}

:where(.page-article) h1 { font-size: 2rem; }
:where(.page-article) h2 { font-size: 1.8rem; }
:where(.page-article) h3 { font-size: 1.6rem; }

/* A minor heading at the size of the text, such as the title of each recipe in a book of secrets */
:where(.page-article) section>h4 {
    max-width: 500px;
    width: 100%;
    margin: 2rem 0 0.8rem;
    font-size: 1.4rem;
    font-weight: normal;
    font-style: normal;
    line-height: 1.25;
    text-align: center;
}

:where(.page-article) p {
    max-width: 500px;
    width: 100%;
    text-align: justify;
    font-kerning: none;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

:where(.page-article) section>p {
    width: 100%;
}

@media (max-width: 760px) {
    :where(.page-article) section>h1,
    :where(.page-article) section>h2,
    :where(.page-article) section>h3 {
        max-width: 100%;
    }
}

/* ---- Article pages: the header shrinks to one quiet line (name left, nav right) over the text
        column, so the article title leads; the catalogue, About and Contribute keep the full one ---- */
body:where(.page-article) > header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1.5rem;
    max-width: 500px;
    margin: 1.75rem 0 2.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--tufte-panel-edge);
}

body:where(.page-article) .site-masthead {
    margin: 0;
    text-align: left;
}

body:where(.page-article) .site-masthead-owner {
    margin: 0 0 0.15rem;
    font-size: 0.8rem;
}

body:where(.page-article) .site-logo {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

body:where(.page-article) .site-logo-name {
    padding: 0;
    border: 0;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
}

body:where(.page-article) .site-logo-name::before {
    margin: 0 0.6em 0 0;
}

body:where(.page-article) .site-logo-name::after {
    content: none;
}

body:where(.page-article) .site-logo:hover .site-logo-name,
body:where(.page-article) .site-logo:focus-visible .site-logo-name {
    color: var(--tufte-accent);
}

body:where(.page-article) > header .site-nav {
    margin: 0;
    border: 0;
}

body:where(.page-article) .site-nav ul {
    gap: 0 1.1rem;
}

body:where(.page-article) .site-nav a {
    padding: 0;
    margin: 0;
    border: 0;
    font-size: 0.95rem;
}

body:where(.page-article) > article {
    padding-top: 0;
}

/* ---- Title, with the "i" beside it ---- */
:where(.page-article) .article-top {
    position: relative;
    max-width: 500px;
}

:where(.page-article) .article-top > h1,
:where(.page-article) .article-top > h2,
:where(.page-article) .article-top > h3 {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0 2.75rem;
    font-size: 2.3rem;
    line-height: 1.15;
    font-weight: 400;
    font-style: normal;
    text-align: center;
    text-wrap: balance;
}

:where(.page-article) .article-top > p.subtitle {
    margin: 0.6rem 0 0;
    padding: 0 2.75rem;
    text-indent: 0;
    text-align: center;
    text-wrap: balance;
    font-size: 1.3rem;
    line-height: 1.3;
    color: var(--tufte-muted);
}

/* The "i", which opens the panel about the text, and under it the quotation mark (the citation) and the map
   (info_panel.php). The title is at least as tall as the column of them, --title-icons long. */
:where(.page-article) .article-top {
    min-height: calc(var(--title-icons, 1) * 2.5rem - 0.25rem);
}

:where(.page-article) p.title-icons {
    position: absolute;
    top: 0.2rem;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: auto;
    margin: 0;
    text-indent: 0;
}

:where(.page-article) .title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--tufte-muted);
    background: none;
    text-shadow: none;
    border: 1px solid transparent;
    border-radius: 999px;
}

:where(.page-article) .title-icon:hover,
:where(.page-article) .title-icon[aria-expanded="true"] {
    color: var(--tufte-ink);
    background: var(--tufte-panel);
    border-color: var(--tufte-panel-edge);
}

:where(.page-article) .title-icon:focus-visible {
    outline: 2px solid var(--tufte-accent);
    outline-offset: 2px;
}

/* ---- The panel about the text: summary, source note, then the page tools ---- */
:where(.page-article) .info-panel:not(.open):not(:target):not(:has(:target)) {
    display: none;
}

:where(.page-article) .info-panel {
    max-width: 500px;
    margin: 0 0 1.5rem;
    padding: 0.9rem 1.1rem 0.5rem;
    background: var(--tufte-panel);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 6px;
}

/* A panel with only the page tools (a commentary) starts with them, without a rule above */
:where(.page-article) .info-panel:has(> .info-tools:first-child) {
    padding-top: 0;
}

:where(.page-article) .info-panel > .info-tools:first-child {
    margin-top: 0;
}

:where(.page-article) .info-panel > .info-tools:first-child > .info-tools-heading:first-child {
    border-top: 0;
}

:where(.page-article) .info-panel p.info-summary {
    width: auto;
    margin: 0 0 1rem;
    text-indent: 0;
    text-align: left;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--tufte-ink-soft);
}

:where(.page-article) .info-panel .editorial-note {
    margin: 0;
    padding: 0;
    border: 0;
}

:where(.page-article) .info-panel .editorial-note p {
    width: auto;
    font-size: 0.95rem;
}

/* The letters whose dates are still to be checked (date_checks) */
:where(.page-article) .info-panel ul.date-checks {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--tufte-muted);
}

:where(.page-article) .info-panel ul.date-checks li {
    margin-bottom: 0.4rem;
}

/* On paper there is no "i" to press: the panel prints open, without its tools */
@media print {
    :where(.page-article) .info-panel:not(.open):not(:target):not(:has(:target)) {
        display: block;
    }

    :where(.page-article) .info-panel {
        padding: 0;
        background: none;
        border: 0;
    }

    :where(.page-article) .title-icons,
    :where(.page-article) .info-panel .info-tools {
        display: none;
    }
}

/* The page tools, after the source note */
:where(.page-article) .info-tools {
    margin: 0.5rem -1.1rem 0;
    font-size: 0.9rem;
}

:where(.page-article) .info-tools p.info-tools-heading {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0.65rem 1rem 0.2rem;
    text-indent: 0;
    text-align: left;
    font-size: 0.68rem;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tufte-muted);
    border-top: 1px solid var(--tufte-panel-edge);
}

:where(.page-article) .info-tools p.info-tools-heading:not(:first-child) {
    margin-top: 0.3rem;
}

:where(.page-article) .info-tools ul {
    list-style: none;
    font-size: inherit;
    line-height: 1.4;
    width: auto;
    margin: 0;
    padding: 0;
}

:where(.page-article) .info-tools li {
    margin: 0;
    padding: 0;
    font-size: inherit;
}

/* One row: a plain link, or the summary of a disclosure (chevron on the right) */
:where(.page-article) .info-tools .info-tool {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 1rem;
    color: var(--tufte-ink);
    text-decoration: none;
    background: none;
    text-shadow: none;
    list-style: none;
    cursor: pointer;
}

:where(.page-article) .info-tools .info-tool::-webkit-details-marker {
    display: none;
}

:where(.page-article) .info-tools .info-tool:hover,
:where(.page-article) .info-tools .info-tool:focus-visible {
    background: var(--tufte-panel-hover);
    outline: none;
}

:where(.page-article) .info-disclosure > summary::after {
    content: "";
    width: 0.38em;
    height: 0.38em;
    margin-right: 0.15em;
    border-right: 1.5px solid var(--tufte-muted);
    border-bottom: 1.5px solid var(--tufte-muted);
    transform: translateY(-0.1em) rotate(45deg);
    transition: transform 0.15s ease;
}

:where(.page-article) .info-disclosure[open] > summary::after {
    transform: translateY(0.12em) rotate(-135deg);
}

/* What a disclosure reveals: the source URL, or where to send a correction */
:where(.page-article) .info-tools .info-reveal {
    width: auto;
    max-width: none;
    margin: 0 1rem 0.5rem;
    padding: 0.5rem 0.65rem;
    text-indent: 0;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.45;
    letter-spacing: 0;
    font-kerning: auto;
    color: var(--tufte-ink-soft);
    background: var(--tufte-paper);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 4px;
}

:where(.page-article) .info-tools .source-link {
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    background: none;
    text-shadow: none;
}

/* ---- Citation: the quotation mark beside the title opens it under the dateline (toggles.js; :target without JS) ---- */
:where(.page-article) .title-citation:not(.open):not(:target) {
    display: none;
}

:where(.page-article) .title-citation {
    max-width: 500px;
    margin: 0 0 1.5rem;
    padding: 0.7rem 0.9rem 0.6rem;
    background: var(--tufte-panel);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
}

:where(.page-article) .title-citation p {
    width: auto;
    margin: 0;
    text-align: left;
    text-indent: 0;
    hyphens: none;
    font-size: inherit;
    line-height: inherit;
}

:where(.page-article) .title-citation a {
    color: inherit;
    overflow-wrap: anywhere;
    background: none;
    text-shadow: none;
}

:where(.page-article) .title-citation .cite-copy {
    display: block;
    margin: 0.5rem 0 0 auto;
    font: inherit;
    font-size: 0.8rem;
    color: var(--tufte-ink);
    background: var(--tufte-paper);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 999px;
    padding: 0.15rem 0.8rem;
    cursor: pointer;
}

:where(.page-article) .title-citation .cite-copy:hover {
    border-color: var(--tufte-muted);
}

:where(.page-article) .title-citation .cite-copy[hidden] {
    display: none;
}

/* ---- Dateline under the title: publication, date and page ---- */
:where(.page-article) p.dateline {
    max-width: 500px;
    margin: 1rem 0 1.25rem;
    padding: 0.35rem 0;
    border-top: 1px solid var(--tufte-ink);
    border-bottom: 1px solid var(--tufte-ink);
    text-indent: 0;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.5;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tufte-muted);
}

:where(.page-article) .dateline-pub {
    color: var(--tufte-ink);
}

:where(.page-article) .dateline-sep {
    margin: 0 0.5rem;
}

/* ---- Editor's notes (notes.php): Tufte sidenotes, lettered a, b, c… so they don't look like the
        author's own numbered footnotes ---- */
:where(.page-article) > article {
    counter-reset: editor-note-counter translation-note-counter;
}

:where(.page-article) label.editor-note-number {
    counter-increment: editor-note-counter;
}

/* The works the editor's notes cite, after the text: a hanging indent, no bullets */
:where(.page-article) .editor-references ul {
    list-style: none;
    padding-left: 0;
}
:where(.page-article) .editor-references li {
    padding-left: 2rem;
    text-indent: -2rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* An author's footnote marker straight after a note's letter */
:where(.page-article) .editor-note + .footnote-ref {
    margin-left: 0.15rem;
}

:where(.page-article) label.editor-note-number::after,
:where(.page-article) .editor-note::before {
    content: counter(editor-note-counter, lower-alpha);
    color: var(--tufte-accent);
    font-style: italic;
}

:where(.page-article) .editor-note::before {
    content: counter(editor-note-counter, lower-alpha) "\00a0\00a0";
}

:where(.page-article) .editor-note {
    color: var(--tufte-ink-soft);
    font-style: normal;
    text-align: left;
    text-indent: 0;
    hyphens: none;
}

/* A note anchored in italic text (a quotation) is still set in roman */
:where(.page-article) .editor-note em {
    font-style: italic;
}

/* In verse (an indented blockquote), line the note up with those beside paragraphs: Tufte places blockquote
   sidenotes for a full-width quotation, which here would push them off the page. Phones use Tufte's toggles. */
@media (min-width: 761px) {
    :where(.page-article) blockquote:has(.editor-note) {
        max-width: 460px;
    }

    :where(.page-article) blockquote .editor-note {
        width: 250px;
        min-width: 0;
        margin-right: -300px;
        font-size: 1.1rem;
    }
}

/* ---- Collections: "Part of" under the dateline, the parts' navigation and the contents page ---- */
:where(.page-article) p.collection-line {
    max-width: 500px;
    margin: -0.75rem 0 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--tufte-muted);
}

:where(.page-article) nav.part-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    max-width: 500px;
    margin: 3rem 0 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--tufte-ink);
    font-size: 0.9rem;
}

:where(.page-article) .part-next {
    text-align: right;
}

:where(.page-collection) ol.collection-contents {
    padding-left: 0;
    list-style: none;
}

:where(.page-collection) .collection-contents li {
    margin-bottom: 1.25rem;
}

:where(.page-collection) .collection-contents p {
    margin: 0;
    text-indent: 0;
}

:where(.page-collection) .contents-entry {
    font-size: 1.3rem;
}

:where(.page-collection) .contents-page {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--tufte-muted);
}

/* A letter's writer and addressee, and its page in the edition (contents_reference) */
:where(.page-collection) p.contents-reference {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--tufte-muted);
}

/* By date · Edition order, above the contents of a collection in date order */
:where(.page-collection) p.contents-order {
    margin: -0.5rem 0 1.25rem;
    text-indent: 0;
    font-size: 0.85rem;
    color: var(--tufte-muted);
}

:where(.page-collection) .contents-order [aria-current] {
    color: var(--tufte-ink);
}

:where(.page-collection) .contents-summary {
    font-size: 1.05rem;
    color: var(--tufte-muted);
}

/* ---- Original scans: beside the text on wide screens (open by default: body.scans-auto),
        and in place of the text on narrow screens at /<slug>/scans (body.show-scans) ---- */
body:where(.page-article):not(.show-scans):not(.scans-auto) .scan-panel {
    display: none;
}

@media (max-width: 999px) {
    body:where(.page-article).scans-auto:not(.show-scans) .scan-panel {
        display: none;
    }
}

@media (min-width: 1000px) {
    /* Fill the space left of the scans, with the 500px text column pushed right so
       only a 2.5rem gap separates it from the panel */
    body:where(.page-article):is(.show-scans, .scans-auto) {
        width: 52vw;
        max-width: none;
        margin-left: 0;
        padding-left: max(3vw, calc(52vw - 500px - 2.5rem));
        padding-right: 2.5rem;
    }

    /* --scan-top: just above where the text starts (set by article.js), so the scans begin below the title */
    :where(.page-article) .scan-panel {
        position: fixed;
        top: var(--scan-top, 0);
        right: 0;
        bottom: 0;
        width: 48vw;
        overflow-y: auto;
        padding: 0 1.5rem 2rem;
        box-sizing: border-box;
        background: var(--tufte-panel);
        border-left: 1px solid var(--tufte-rule);
        z-index: 10;
    }

    :where(.page-article) .scan-panel-bar {
        position: sticky;
        top: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: auto;
        max-width: none;
        margin: 0 -1.5rem 1rem;
        padding: 0.6rem 1.5rem;
        background: var(--tufte-panel);
        border-bottom: 1px solid var(--tufte-rule);
        font-size: 0.85rem;
        text-indent: 0;
    }
}

:where(.page-article) .scan-panel-bar button {
    font: inherit;
    color: var(--tufte-muted);
    background: none;
    border: 0;
    cursor: pointer;
}

:where(.page-article) .scan-panel-bar button:hover {
    color: var(--tufte-ink);
}

:where(.page-article) .scan-panel img {
    display: block;
    filter: var(--tufte-img-dim);
    width: 100%;
    margin: 0 0 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

@media (max-width: 999px) {
    body:where(.page-article).show-scans article > section:not(.article-head) {
        display: none;
    }

    :where(.page-article) .scan-panel-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 500px;
        margin: 0 0 1rem;
        text-indent: 0;
        font-size: 0.85rem;
        color: var(--tufte-muted);
    }
}

/* On paper the scans are left out, and the text always prints. (A printed page is under 1000px wide, so the
   narrow-screen rule above would otherwise hide the text whenever the scans are open.) */
@media print {
    :where(.page-article) .scan-panel,
    :where(.page-article) .scans-toggle,
    :where(.page-article) .scans-toggle + .sep,
    :where(.page-article) p.article-actions:has(.scans-toggle):not(:has(.commentary-link)) #marginalia-item > .sep {
        display: none !important;
    }

    /* With nothing else in it, the row of buttons goes too */
    :where(.page-article) p.article-actions:not(:has(.commentary-link, .marginalia-toggle)) {
        display: none;
    }

    body:where(.page-article).show-scans article > section:not(.article-head) {
        display: block;
    }
}

/* ---- The scans button under the dateline ---- */
:where(.page-article) p.article-actions {
    max-width: 500px;
    margin: 0 0 1rem;
    text-indent: 0;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.5;
    letter-spacing: 0;
}

:where(.page-article) .scans-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--tufte-ink);
    text-decoration: none;
    background: var(--tufte-panel);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    text-shadow: none;
}

:where(.page-article) .scans-toggle::before {
    content: "";
    width: 0.75em;
    height: 0.9em;
    border: 1.5px solid currentColor;
    border-radius: 1px;
    box-shadow: 2px 2px 0 -0.5px var(--tufte-panel), 2px 2px 0 1px currentColor;
}

:where(.page-article) .scans-toggle:hover {
    border-color: var(--tufte-muted);
}

:where(.page-article) .scans-toggle:focus-visible {
    outline: 2px solid var(--tufte-accent);
    outline-offset: 2px;
}

/* ---- "Hide marginalia" (toggles.js): page numbers, the paragraph tools and what they open, and sidenotes. Important
        because the rules that open a sidenote or a paragraph's panel are more specific ---- */
:where(.page-article) .marginalia-toggle {
    padding: 0;
    font: inherit;
    color: var(--tufte-muted);
    text-decoration: underline;
    background: none;
    border: 0;
    cursor: pointer;
}

:where(.page-article) .marginalia-toggle:hover {
    color: var(--tufte-ink);
}

:where(.page-article) .marginalia-toggle:focus-visible {
    outline: 2px solid var(--tufte-accent);
    outline-offset: 2px;
}

html[data-marginalia="off"] .page-article :is(span.page, .sidenote, .marginnote, .margin-toggle, .para-toggle, .para-tool, .original-text, .para-cite) {
    display: none !important;
}

/* ---- Editions (e.g. reading and diplomatic) of one source ---- */
:where(.page-article) p.edition-switch {
    max-width: 500px;
    margin: 0 0 0.75rem;
    text-indent: 0;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--tufte-muted);
}

:where(.page-article) .edition-switch a {
    color: var(--tufte-muted);
}

:where(.page-article) .edition-switch strong {
    color: var(--tufte-ink);
    font-weight: normal;
}

/* ---- Editorial notes in a transcription (source, conventions) ---- */
:where(.page-article) .editorial-note {
    max-width: 500px;
    margin: 0 0 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--tufte-rule);
}

:where(.page-article) .editorial-note p {
    text-indent: 0;
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.45;
    color: var(--tufte-muted);
}

/* ---- Scans as a PDF: embedded on wide screens, a link on narrow ones ---- */
:where(.page-article) .scan-pdf {
    display: block;
    width: 100%;
    height: calc(100vh - 4.5rem);
    border: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

:where(.page-article) .scan-pdf-link {
    display: none;
}

@media (max-width: 999px) {
    :where(.page-article) .scan-pdf {
        display: none;
    }

    :where(.page-article) .scan-pdf-link {
        display: block;
        text-indent: 0;
        text-align: center;
        font-size: 1rem;
    }
}

@media (max-width: 760px) {
    :where(.page-article) .article-top > h1,
    :where(.page-article) .article-top > h2,
    :where(.page-article) .article-top > h3 {
        font-size: 1.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(.page-article) .info-disclosure > summary::after {
        transition: none;
    }
}

.toc { list-style: none; padding-left: 0; font-size: 1.1rem; }
.toc li { margin: 0.2rem 0; }
/* ---- An English translation beside the text (?view=both, body.show-translation): a row per paragraph, the
        text left and the translation right on wide screens, the translation under the text on narrow ones ---- */
:where(.page-article) .parallel-translation {
    color: var(--tufte-ink-soft);
    padding-left: 1rem;
    border-left: 2px solid var(--tufte-rule);
}

@media (min-width: 1000px) {
    body:where(.page-article).show-translation:not(.show-scans) {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0 2.5rem;
    }

    /* The header, the title block, the editorial notes and what follows the rows stay a centred 500px column */
    body:where(.page-article).show-translation:not(.show-scans) > header {
        margin-left: auto;
        margin-right: auto;
    }

    body:where(.page-article).show-translation:not(.show-scans) article > section > :not(.parallel) {
        margin-left: auto;
        margin-right: auto;
    }

    body:where(.page-article).show-translation:not(.show-scans) .footnotes {
        max-width: 500px;
    }

    body:where(.page-article).show-translation:not(.show-scans) .parallel-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 500px));
        justify-content: center;
        column-gap: 3rem;
    }

    body:where(.page-article).show-translation:not(.show-scans) .parallel-translation {
        padding-left: 0;
        border-left: 0;
    }
}

/* ---- "Show Latin" and "Cite" beside a paragraph (paragraph_tools()), which open under it: in the left margin on wide
        screens, in a row under the paragraph on narrow ones. A checkbox and label each, like the sidenotes ---- */
:where(.page-article) .para {
    position: relative;
    max-width: 500px;
}

:where(.page-article) .para-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

:where(.page-article) label.para-tool {
    cursor: pointer;
    font-size: 0.72rem;
    line-height: 1.3;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--tufte-muted);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

:where(.page-article) label.para-tool:hover,
:where(.page-article) .para-toggle:checked + label.para-tool {
    color: var(--tufte-ink);
}

:where(.page-article) .para-toggle:focus-visible + label.para-tool {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

:where(.page-article) .para-toggle:checked + label .tool-show,
:where(.page-article) .para-toggle:not(:checked) + label .tool-hide {
    display: none;
}

:where(.page-article) .original-text,
:where(.page-article) .para-cite {
    display: none;
    margin: 0 0 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--tufte-rule);
    color: var(--tufte-ink-soft);
}

:where(.page-article) .toggle-original:checked ~ .original-text,
:where(.page-article) .toggle-cite:checked ~ .para-cite {
    display: block;
}

/* The article's paragraphs have a fixed width, which would run past the indent */
:where(.page-article) .original-text > * {
    width: auto;
    max-width: 100%;
}

:where(.page-article) .original-footnotes {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.85em;
}

:where(.page-article) .para-cite {
    font-size: 0.85rem;
    line-height: 1.5;
}

:where(.page-article) .para-cite p {
    width: auto;
    margin: 0;
    text-align: left;
    text-indent: 0;
    hyphens: none;
    font-size: inherit;
    line-height: inherit;
}

:where(.page-article) .para-cite .cite-copy {
    display: block;
    margin: 0.5rem 0 0 auto;
    font: inherit;
    font-size: 0.8rem;
    color: var(--tufte-ink);
    background: var(--tufte-paper);
    border: 1px solid var(--tufte-panel-edge);
    border-radius: 999px;
    padding: 0.15rem 0.8rem;
    cursor: pointer;
}

:where(.page-article) .para-cite .cite-copy[hidden] {
    display: none;
}

@media (min-width: 1000px) {
    :where(.page-article) label.para-tool {
        position: absolute;
        top: 0.25rem;
        right: calc(100% + 2.75rem);
    }

    :where(.page-article) label.para-tool ~ label.para-tool {
        top: 1.6rem;
    }
}

@media (max-width: 999.98px) {
    :where(.page-article) .para {
        display: flex;
        flex-wrap: wrap;
        column-gap: 1rem;
    }

    :where(.page-article) .para > * {
        flex: 0 0 100%;
    }

    /* A flex item's margins don't collapse */
    :where(.page-article) .para > :is(p, blockquote) {
        margin-top: 0;
        margin-bottom: 0.4rem;
    }

    :where(.page-article) .para > label.para-tool {
        flex: 0 0 auto;
        order: 1;
        margin: 0 0 1rem;
    }

    :where(.page-article) .para > .para-toggle {
        flex: none;
    }

    :where(.page-article) .para > .original-text,
    :where(.page-article) .para > .para-cite {
        order: 2;
    }
}

/* ---- The source's page numbers ([]{.page n=10} in the Markdown): a small bar where the page turns and the number in
        the left margin on wide screens, the number in brackets in the text on narrow ones. A number the source doesn't print
        is in brackets either way (.unprinted) ---- */
:where(.page-article) .page::after {
    content: "|";
    margin-right: 0.15em;
    color: var(--tufte-muted);
    font-style: normal;
}

/* Nothing to divide at the start of a heading or the title page */
:where(.page-article) :is(h2, h3) .page::after,
:where(.page-article) .page.unprinted::after {
    content: none;
}

:where(.page-article) .page::before {
    content: "p." attr(data-n);
    font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
    font-size: 0.72rem;
    font-weight: normal;
    font-style: normal;
    letter-spacing: 0.02em;
    color: var(--tufte-muted);
}

:where(.page-article) .page.unprinted::before {
    content: "[p." attr(data-n) "]";
}

@media (min-width: 1000px) {
    :where(.page-article) section > p,
    :where(.page-article) section > h2,
    :where(.page-article) section > h3,
    :where(.page-article) .parallel-text,
    :where(.page-article) .parallel-translation {
        position: relative;
    }

    :where(.page-article) .page::before {
        position: absolute;
        right: calc(100% + 0.75rem);
        margin-top: 0.3em;
    }
}

@media (max-width: 999.98px) {
    :where(.page-article) .page::before {
        content: "[p." attr(data-n) "]";
        margin-right: 0.15em;
    }

    :where(.page-article) .page::after {
        content: none;
    }
}

/* A folio or scan of a facsimile ([](url){.page .folio n=84v} or {.page .scan n=2} in the Markdown): the same marker,
   labelled "f.84v" or "scan 2", and a link to that page of the facsimile from the margin rather than the sentence */
:where(.page-article) a.page {
    color: inherit;
    text-decoration: none;
}

:where(.page-article) a.page:hover::before {
    color: var(--tufte-ink);
}

:where(.page-article) .page.folio::before {
    content: "f." attr(data-n);
}

:where(.page-article) .page.scan::before {
    content: "scan " attr(data-n);
}

@media (max-width: 999.98px) {
    :where(.page-article) .page.folio::before {
        content: "[f." attr(data-n) "]";
    }

    :where(.page-article) .page.scan::before {
        content: "[scan " attr(data-n) "]";
    }
}

/* There's no margin for editor's notes beside two columns: a note opens under its line when its letter is clicked */
body:where(.page-article).show-translation .sidenote {
    display: none;
}

body:where(.page-article).show-translation .margin-toggle:checked + .sidenote {
    display: block;
    float: none;
    clear: none;
    position: static;
    width: auto;
    max-width: 500px;
    min-width: 0;
    margin: 0.5rem 0 0.75rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

body:where(.page-article).show-translation label.margin-toggle {
    cursor: pointer;
}

/* ---- A collection's contents page ---- */
:where(.page-collection) .contents-entry {
    text-align: left;
}

/* ---- Commentary: an essay on one or more articles (commentary.php) ---- */
:where(.page-commentary) p.commentary-kind {
    max-width: 500px;
    margin: 0 0 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

:where(.page-commentary) p.commentary-kind a {
    color: var(--tufte-muted);
    text-decoration: none;
}

:where(.page-commentary) h1 {
    max-width: 500px;
    text-align: center;
}

:where(.page-commentary) p.commentary-about {
    max-width: 500px;
    margin: -0.75rem 0 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--tufte-muted);
}

:where(.page-commentary) .commentary-draft {
    color: var(--tufte-accent);
}

:where(.page-commentary) ul.commentary-list {
    padding: 0;
    list-style: none;
}

:where(.page-commentary) ul.commentary-list li {
    margin-bottom: 2rem;
}

:where(.page-commentary) p.commentary-entry {
    margin-bottom: 0;
    font-size: 1.4rem;
}

:where(.page-commentary) ul.commentary-list p.commentary-about {
    margin-top: -0.75rem;
}


/* ---- Diagrams (figures.js): a paragraph holding only an image. In the text by default; on wide screens with room
        beside the text (body.figures-docked) the one for the passage being read is shown in a panel fixed to the
        right of the text, and in the text each leaves a marker; on phones (body.figures-folded) each is folded
        behind a button ---- */
:where(.page-article) p.figure img {
    display: block;
    filter: var(--tufte-img-dim);
}

:where(.page-article) .figure-marker,
:where(.page-article) .figure-toggle,
.figure-dock {
    display: none;
}

body.figures-docked p.figure img {
    display: none;
}

body.figures-docked .figure-marker {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--tufte-muted);
    border-left: 2px solid var(--tufte-rule);
    padding-left: 0.6rem;
}

body.figures-docked p.figure.figure-current .figure-marker {
    color: var(--tufte-accent);
    border-left-color: var(--tufte-accent);
}

body.figures-docked .figure-dock {
    display: block;
    position: fixed;
    top: 2rem;
    left: var(--figure-dock-left);
    width: var(--figure-dock-width);
    max-height: calc(100vh - 4rem);
    margin: 0;
    z-index: 5;
    transition: opacity 0.2s;
}

body.figures-docked .figure-dock.figure-dock-empty {
    opacity: 0;
    pointer-events: none;
}

.figure-dock img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    width: auto;
    height: auto;
    filter: var(--tufte-img-dim);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.figure-dock-label {
    width: auto;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    line-height: 1.3;
    color: var(--tufte-muted);
}

body.figures-folded .figure-toggle {
    display: inline-block;
    font: inherit;
    font-size: 0.9rem;
    color: var(--tufte-muted);
    background: none;
    border: 1px solid var(--tufte-rule);
    border-radius: 3px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
}

body.figures-folded p.figure:not(.figure-open) img {
    display: none;
}

body.figures-folded p.figure.figure-open img {
    margin-top: 0.75rem;
}
:where(.page-article) p.figure { text-indent: 0; }

/* In the text, no taller than the window (the fold-out Schema XVIII is very tall); beside the Latin in the
   side-by-side view, once only, in the Latin column */
:where(.page-article) p.figure img {
    max-height: 90vh;
    width: auto;
}

body:where(.page-article).show-translation .parallel-translation p.figure {
    display: none;
}

/* Side by side (?view=both), the translation's notes are lettered on their own, so a note in the English has the same
   letter as its counterpart in the text beside it */
body:where(.page-article).show-translation .parallel-translation label.editor-note-number {
    counter-increment: translation-note-counter;
}

body:where(.page-article).show-translation .parallel-translation label.editor-note-number::after {
    content: counter(translation-note-counter, lower-alpha);
}

body:where(.page-article).show-translation .parallel-translation .editor-note::before {
    content: counter(translation-note-counter, lower-alpha) "\00a0\00a0";
}

/* ---- A photograph of a printed table with its transcription (::: {.figure-pair} in the Markdown): the photograph
        directly above the table, in the text column (the margin to the right is the diagrams' panel) ---- */
:where(.page-article) .figure-pair {
    max-width: 500px;
    margin: 1.4rem 0;
}

:where(.page-article) .figure-pair > p:first-child {
    margin: 0 0 0.75rem;
    text-indent: 0;
}

:where(.page-article) .figure-pair img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    filter: var(--tufte-img-dim);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

:where(.page-article) .figure-pair table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    margin-top: 0;
}

:where(.page-article) .figure-pair :is(th, td) {
    padding: 0.1rem 0.5rem;
    vertical-align: top;
}

/* ---- A month of a printed calendar (::: {.calendar}): a table of five narrow columns, kept to the text column
        so it doesn't run under the docked diagram beside it ---- */
:where(.page-article) .calendar {
    max-width: 500px;
    overflow-x: auto;
    margin: 1.4rem 0;
}

:where(.page-article) .calendar table {
    width: 100%;
    margin: 0;
    font-size: 0.85rem;
}

:where(.page-article) .calendar :is(th, td) {
    padding: 0.1rem 0.4rem;
    vertical-align: top;
}

:where(.page-article) .calendar td:last-child {
    min-width: 7rem;
}

/* Side by side with the translation, the photograph is shown once, beside the original */
body:where(.page-article).show-translation .parallel-translation .figure-pair > p:first-child {
    display: none;
}
