@font-face {
    font-family: 'Crimson Pro';
    src: url('crimson-pro-latin.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'IM Fell English';
    src: url('im-fell-english-italic-latin.woff2') format('woff2');
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #251e19;
    --muted: #58524b;
    --link: #21604d;
    --accent: #922d24;
    --line: #d8cbbc;
    --paper: #faf7f0;
    --sans: system-ui, sans-serif;
    --serif: 'Crimson Pro', 'Iowan Old Style', Georgia, serif;
    --display: 'IM Fell English', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1.26rem/1.57 var(--serif); }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
[id] { scroll-margin-top: 5rem; }
.skip-link { position: fixed; inset: .5rem auto auto .5rem; padding: .5rem .75rem; background: white; z-index: 5; }
.skip-link:not(:focus) { clip-path: inset(50%); }

.reading-nav { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--line); }
.reading-nav ul {
    max-width: 61rem; margin: 0 auto; padding: .65rem 1rem; list-style: none;
    display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1rem; font: 500 .875rem/1.5 var(--sans);
}
.reading-nav li:first-child { margin-right: auto; }
.reading-nav a { display: inline-flex; align-items: center; gap: .45rem; min-height: 2rem; }
.site-mark { width: 1.75rem; height: 1.75rem; }

article { padding: 0 1rem 4rem; overflow-wrap: anywhere; }
.edition-header, .contents { max-width: 57rem; margin-inline: auto; }
.edition-header { padding-block: 2.75rem 1.5rem; }
.edition-meta, .editor, .numeral, .stage, figcaption { font: 500 .8125rem/1.5 var(--sans); color: var(--muted); }
.edition-meta { margin: 0 0 .75rem; }
.edition-credit { border-top: 1px solid var(--line); padding-top: .85rem; max-width: 35rem; }
.edition-subtitle { margin: 0 0 .75rem; font-style: italic; }
h1, h2, h3 { line-height: 1.18; text-wrap: pretty; }
h1, h2 { font-family: var(--display); font-style: italic; font-weight: 400; }
h1 { font-size: 3.75rem; line-height: 1; margin: 0 0 .65rem; max-width: 23ch; }
h2 { font-size: 2rem; margin: 0 0 .7rem; }
h3 { font-size: 1.25rem; margin: 1.8rem 0 .55rem; }
.standfirst { max-width: 36rem; font-size: 1.34rem; line-height: 1.42; margin: 1.15rem 0; }
.speaker { color: var(--accent); font-variant-caps: small-caps; font-weight: 700; margin: 0 0 .35rem; }
.edition-links { display: flex; gap: .5rem 1.1rem; flex-wrap: wrap; font: 500 .875rem/1.5 var(--sans); }
.eco-intro { max-width: 39rem; margin: 1rem auto 2rem; }

.contents { border-block: 1px solid var(--line); padding-block: 1.3rem; }
.contents h2 { margin: 0 0 .75rem; font: 650 1rem/1.4 var(--sans); }
.contents ol { list-style: none; margin: 0; padding: 0; column-count: 2; column-gap: 2rem; }
.contents li { break-inside: avoid; display: flex; align-items: baseline; gap: .6rem; padding-block: .35rem; }
.toc-link { display: flex; align-items: baseline; gap: .55rem; flex: 1; }
.toc-num, .toc-ts, .ts, .tsi { font: 500 .75rem/1.45 var(--sans); font-variant-numeric: tabular-nums; }
.toc-num { min-width: 1.8rem; color: var(--accent); }
.toc-ts, .ts, .tsi { white-space: nowrap; }

.chapter, .editorial, .colophon, .annotations { max-width: 39rem; margin: 3.4rem auto 0; }
.chapter-head { margin-bottom: 1.15rem; }
.numeral { color: var(--accent); margin-bottom: .35rem; }
p { margin: 0 0 1em; }
.editorial, .colophon, .annotations { padding-top: 1.4rem; border-top: 1px solid var(--line); }
.editorial figure { margin: 1.4rem 0; max-width: 15rem; }
.editorial figure img { display: block; width: 100%; height: auto; }
figcaption { margin-top: .5rem; }
.tri, .fleuron { padding-right: .18em; }
.ts { display: inline-block; margin-right: .5rem; }
.first .ts { display: block; width: fit-content; margin-bottom: .22rem; }
.tsi { vertical-align: .18em; }
.ed, .unclear { color: var(--muted); }
.unclear { font-size: .9em; }
.dropcap { float: left; padding: .02em .12em 0 0; font: italic 3.3em/.83 var(--display); color: var(--accent); }
.first { display: flow-root; }
.pull { margin: 1.5rem 0; padding: .85rem 0; border-block: 1px solid var(--line); font: italic 1.53rem/1.22 var(--display); color: var(--accent); }
.pull p { margin: 0; }
.litany { margin: 1.35rem 0; padding-inline-start: 1rem; border-left: 1px solid var(--line); }
.reading { margin: 1.75rem 0; padding: 1rem 1.25rem 1.15rem; background: #eef2ea; border-inline-start: 3px solid var(--link); }
.reading > h3 { margin: 0 0 .85rem; color: var(--link); }
.reading > p:last-child { margin-bottom: 0; }
.reading figcaption { margin: 0 0 .85rem; padding-bottom: .65rem; border-bottom: 1px solid #cbd6c8; break-after: avoid; }
.reading figcaption strong { display: block; color: var(--link); text-transform: uppercase; margin-bottom: .2rem; }
.reading blockquote { margin: 0; font-style: italic; }
.reading blockquote p:last-child { margin-bottom: 0; }
.end { text-align: center; color: var(--accent); }

.annotations ol { padding-inline-start: 1.75rem; }
.annotations li { margin-bottom: .85rem; }
.annotations li::marker { color: var(--accent); font-family: var(--sans); font-size: .8rem; }
.annotations li:target { background: #e8f0e9; }
.annotations p, .annotation-body p { margin: .25rem 0; }
.gloss-source, .note-return { font: 500 .8125rem/1.5 var(--sans); }
.gloss-source { display: inline-block; margin-right: .5rem; }

.gl { text-decoration-style: dotted; }
.gl[aria-expanded='true'] { color: var(--accent); }
#annotation-popover {
    position: fixed; inset: auto; margin: 0; width: min(24rem, calc(100% - 24px)); max-height: min(65vh, 25rem);
    overflow: auto; color: var(--ink); background: #fffdf8; border: 1px solid var(--line); border-top: 2px solid var(--accent);
    border-radius: 4px; padding: 1rem; box-shadow: 0 8px 26px rgb(43 30 20 / 20%);
    font: 1.12rem/1.42 var(--serif); overflow-wrap: anywhere;
}
#annotation-popover:not(:popover-open) { display: none; }
#annotation-popover h2 { font-size: 1.37rem; margin-right: 2rem; }
#annotation-popover .icon-button { position: absolute; top: .4rem; right: .4rem; }
.icon-button { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--link); background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.icon-button:hover { border-color: var(--line); }

.reading-layout { max-width: 88rem; margin-inline: auto; }
.lecture-player { background: #f3eee4; padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
.lecture-player[hidden] { display: none; }
.player-heading, .player-links { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.player-heading h2 { font: 600 .9rem/1.35 var(--sans); margin: 0; }
.player-frame iframe { display: block; width: 100%; aspect-ratio: 16/9; min-height: 200px; border: 0; background: #151712; }
.player-links { font: 500 .75rem/1.35 var(--sans); padding-top: .35rem; }
.player-links a { margin-left: auto; white-space: nowrap; }
.reading-layout main { min-width: 0; }

@media (min-width: 64rem) {
    .reading-layout:has(.lecture-player:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(21rem, 36%); }
    .lecture-player { grid-column: 2; grid-row: 1; align-self: start; position: sticky; top: 4rem; margin: .75rem 1rem 0 0; border: 1px solid var(--line); }
    .reading-layout main { grid-column: 1; grid-row: 1; }
}
@media (max-width: 63.99rem) {
    .lecture-player { position: sticky; top: 3.6rem; z-index: 1; }
    .player-frame { max-width: 29rem; margin-inline: auto; }
    body:has(.lecture-player:not([hidden])) main [id] { scroll-margin-top: 24rem; }
    @media (max-height: 33rem) {
        .player-frame { max-width: 22rem; }
        body:has(.lecture-player:not([hidden])) main [id] { scroll-margin-top: 20rem; }
    }
}

.reading-footer { max-width: 39rem; margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid var(--line); font: 500 .875rem/1.5 var(--sans); }
@media screen and (min-width: 61rem) {
    .reading-layout:not(:has(.lecture-player:not([hidden]))) .chapter p { position: relative; }
    .reading-layout:not(:has(.lecture-player:not([hidden]))) .chapter .ts:not(:is(.reading, .litany) .ts) { position: absolute; right: calc(100% + .7rem); top: .45em; margin: 0; }
}
@media (max-width: 42rem) {
    body { font-size: 1.19rem; }
    .edition-header { padding-top: 1.75rem; }
    h1 { font-size: 2.65rem; }
    .contents ol { column-count: 1; }
}
@media print {
    .reading-nav, .skip-link, .reading-footer, .edition-links, #annotation-popover, .lecture-player { display: none; }
    .reading-layout:has(.lecture-player:not([hidden])) { display: block; }
    [id] { scroll-margin-top: 0; }
}
