/* =========================================================================
   A reading page: one book of a work, the original over our translation,
   every word a tap away, every line read aloud. Dressed by work.css's
   palette; the verse sets in the work's own face.
   ========================================================================= */
.reader .page { display: block; }
.book { max-width: 780px; padding-block: 4vh var(--space-3xl); }
.book__head { margin-bottom: var(--space-lg); }
.book__head h1 { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-weight: 400; }
.book__grc { font-family: var(--face); font-weight: var(--wt, 400); font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.05; margin-bottom: 12px; }
.book__n { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--ink-soft); }
.book__summary { font-size: var(--t-md); line-height: 1.5; max-width: 32em; margin-top: 4px; margin-bottom: var(--space-sm); }
.book__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs); margin-top: var(--space-sm); }
.book__count { font-size: var(--t-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.book__tools + .book__hint { margin-top: 2px; }
.book__hint { font-size: 1rem; font-style: italic; color: var(--ink-soft); margin-top: 10px; }
p.book__count { margin-top: var(--space-xs); }
.book .btns { margin-top: var(--space-sm); }

.turnpages { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-xs); margin-top: var(--space-sm); padding: 10px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); font-size: var(--t-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.turnpages a { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: var(--ink-soft); }
.turnpages a:hover { color: var(--spruce); }
.turnpages span:last-child { text-align: right; }
.verse + .turnpages { margin-top: var(--space-lg); }
.turnpages--head { margin: 0 0 var(--space-sm); }
.turnpages a[href]:not(.turnpage) { color: var(--ink); }

/* the verse: a number in the margin, the mark that plays, the line */
.verse { list-style: none; margin: 0; padding: 0; }
.v { display: grid; grid-template-columns: 3rem 44px minmax(0, 1fr); column-gap: 6px; align-items: start; padding: 8px 0; border-top: 1px solid var(--hairline); scroll-margin-top: 20px; }
.v:first-child { border-top: 0; }
.v:target { background: color-mix(in srgb, var(--spruce) 7%, transparent); box-shadow: -12px 0 0 color-mix(in srgb, var(--spruce) 7%, transparent), 12px 0 0 color-mix(in srgb, var(--spruce) 7%, transparent); }
.v__n { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; padding-right: 4px; font-size: var(--t-small); color: var(--ink-soft); font-variant-numeric: tabular-nums; text-decoration: none; }
.v__n:hover { color: var(--spruce); }
.v__play { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--ink-soft); opacity: .55; }
.v__play svg { width: 10px; height: 10px; fill: currentColor; }
.v__play--none { opacity: 0; pointer-events: none; }
.v__play:hover, .v.is-playing .v__play { color: var(--spruce); opacity: 1; }
.v__body { min-width: 0; }
.v__src { display: block; width: 100%; min-height: 44px; padding-block: 4px; text-align: left; font-family: var(--verse-face, var(--face)); font-weight: var(--wt, 400); font-size: clamp(1.2rem, 2.3vw, 1.5rem); line-height: 1.42; color: var(--ink); transition: color .2s ease-in-out; }
.v__src:active { opacity: 1; transform: none; }
.v.is-playing .v__src { color: var(--spruce); }
.v__en { font-style: italic; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.5; margin-top: 2px; }
.v__note { margin-top: 10px; padding-top: 8px; border-top: 1px dotted var(--hairline); font-size: 1rem; line-height: 1.55; color: var(--ink-soft); max-width: 36em; }
.v__note b { font-weight: 400; color: var(--ink); }
.v__note-kind { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--spruce); margin-right: 8px; }

/* Latin keeps its u: EB Garamond's Latin localization would set it as v */
.v__src:lang(la), .p__w:lang(la), .p__m i:lang(la) { font-feature-settings: "locl" 0; }

/* a work with no narration has no play column */
.book--silent .v { grid-template-columns: 3rem minmax(0, 1fr); }
.book--silent .v__play { display: none; }

/* prose: sentences run on; a paragraph opens with a gap, a rule and its number */
.book--prose .v { border-top: 0; padding: 5px 0; }
.book--prose .v--stanza { border-top: 1px solid var(--hairline); margin-top: 12px; padding-top: 14px; }
.book--prose .v__src, .book--prose .p__w { font-weight: 400; }
.book--prose .v__src { font-size: 1.2rem; line-height: 1.5; }
.book--prose .v__en { font-size: 1rem; }

/* a poem: stanzas keep their gap, a part numeral is a heading row */
.v--stanza { margin-top: 22px; }
.v--part { border-top: 0; padding-top: 28px; }
.v__part { font-family: var(--verse-face, var(--face)); font-size: 1.1rem; letter-spacing: .08em; color: var(--ink-soft); }
.contents__poem { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 0; border-top: 1px solid var(--hairline); color: var(--ink); }
.contents__poem:hover .contents__t { color: var(--spruce); }
.contents__poem .contents__t { font-family: var(--face); font-weight: var(--wt, 400); font-size: 1.3rem; }
.contents__poem .contents__s { grid-column: 1; margin-top: 2px; font-style: italic; }

/* the metre: the line in its feet, each syllable's quantity above it, the caesura */
.scan { padding: 6px 0 10px; }
.scan__label { font-size: var(--t-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.scan__line { display: flex; flex-wrap: wrap; row-gap: 6px; font-family: var(--verse-face, var(--face)); font-size: 1.1rem; line-height: 1.2; color: var(--ink); }
.ft { display: inline-flex; align-items: flex-end; padding: 0 .45em; border-left: 1px solid var(--hairline-bold); }
.ft:first-child { padding-left: 0; border-left: 0; }
.sy { display: inline-flex; flex-direction: column; align-items: center; }
.sy::before { font-family: var(--font-text); font-size: 1.15rem; line-height: 1.25; color: var(--spruce); }
.sy + .sy:not(.sy--w) { margin-left: .14em; }
.sy--L::before { content: "—"; }
.sy--S::before { content: "⏑"; }
.sy--X::before { content: "×"; }
.sy--w { margin-left: .42em; }
.cz { align-self: flex-end; margin: 0 .2em; color: var(--spruce); }

/* the words, one by one: unfolds under the line and only ever adds */
.v__words { margin-top: 10px; display: grid; gap: 6px; }
.v__words[hidden] { display: none; }
.p { display: grid; grid-template-columns: minmax(6rem, auto) minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: baseline; font-size: 1rem; line-height: 1.5; padding: 6px 0; border-top: 1px dotted var(--hairline); }
.p__w { font-family: var(--verse-face, var(--face)); font-size: 1.1rem; color: var(--ink); }
.p__g { color: var(--ink); }
.p__m, .p__r, .p__note { grid-column: 2; color: var(--ink-soft); }
.p__m i { font-style: normal; }
.p__note { font-style: italic; }

.contents__section { font-family: var(--font-display); font-weight: 400; font-size: var(--t-lg); margin: var(--space-lg) 0 var(--space-xs); padding-top: var(--space-sm); border-top: 1px solid var(--hairline-bold); }
.contents__book { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 16px; padding: 14px 0; border-top: 1px solid var(--hairline); color: var(--ink); }
.contents__book:hover .contents__t { color: var(--spruce); }
.contents__n { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.contents__t { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; transition: color .2s ease-in-out; }
.contents__s { grid-column: 2; margin-top: 4px; color: var(--ink-soft); font-size: .95rem; line-height: 1.5; max-width: 36em; }
.book__particulars { margin-top: var(--space-xl); }
.book__particulars .btns { margin-top: 10px; }

@media (max-width: 640px) {
  .v { grid-template-columns: 2rem 44px minmax(0, 1fr); column-gap: 2px; }
  .book--silent .v { grid-template-columns: 2rem minmax(0, 1fr); column-gap: 8px; }
  .p { grid-template-columns: 1fr; }
  .p__m, .p__r, .p__note { grid-column: 1; }
  .contents__s { grid-column: 2; }
  .turnpages { font-size: .68rem; }
}

/* ---- the app, as the book itself: its front cover, a line, the price, the stores.
   Beside the page on a wide screen, travelling with the reader; under the title
   on a narrow one. The cover is the shelf's own (site.css .cover). */
.plate { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 20px; align-items: center;
  margin: 0 0 var(--space-md); padding: var(--space-sm) 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.plate__book { position: relative; width: 100%; aspect-ratio: .66; align-self: start; font-size: calc(96px / .66 / 30);
  border-radius: 1px 3px 3px 1px; overflow: hidden;
  box-shadow: 0 14px 22px -12px var(--shadow-deep), 0 1px 3px rgba(0, 0, 0, .2); }
.plate__book .cover { padding: 12% 8% 9%; }
.plate__book .cover__author { font-size: .9em; letter-spacing: .2em; }
.plate__book .cover__imprint { font-size: .8em; letter-spacing: .2em; }
.plate__text .label { margin-bottom: 4px; color: var(--spruce); }
.plate__line { font-size: 1rem; line-height: 1.5; color: var(--ink); }
.plate__note { font-size: 1rem; line-height: 1.5; color: var(--ink-soft); }
.plate .btns { margin-top: 12px; gap: 8px; }
.plate .btn { padding: 10px 14px; font-size: .92rem; }

@media (min-width: 1120px) {
  .book--plated { max-width: none; display: grid; grid-template-columns: minmax(0, 780px) 220px; column-gap: clamp(56px, 6vw, 104px); justify-content: start; }
  .book--plated > * { grid-column: 1; min-width: 0; }
  .book--plated > .plate { grid-column: 2; grid-row: 1 / span 300; align-self: start; position: sticky; top: 28px;
    grid-template-columns: 1fr; row-gap: 18px; margin: 10px 0 0; padding: 0; border: 0; }
  .plate__book { width: 150px; font-size: calc(150px / .66 / 30); transform: rotate(-1.5deg); transform-origin: 30% 100%;
    transition: transform .3s cubic-bezier(.3, .7, .2, 1); }
  .plate:hover .plate__book { transform: rotate(0) translateY(-4px); }
  .plate .btn { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 1119px) {
  .plate + .turnpages--head { border-top: 0; margin-top: calc(-1 * var(--space-md)); }
}
@media (prefers-reduced-motion: reduce) { .plate__book, .plate:hover .plate__book { transition: none; transform: none; } }

/* ---- a course unit: sections, teaching pages, the book's rules verbatim, vocabulary */
.book__grc--en { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; }
.lesson { margin-top: var(--space-xl); }
.lesson__title { font-family: var(--font-display); font-weight: 400; font-size: var(--t-lg); line-height: 1.2; padding-top: var(--space-sm); border-top: 1px solid var(--hairline-bold); margin-bottom: var(--space-sm); }
.teach { max-width: 36em; margin: var(--space-sm) 0; }
.teach h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; margin-bottom: 6px; }
.teach p { line-height: 1.6; margin-bottom: 8px; }
.book--course .verse { margin: var(--space-sm) 0; }
.v__src--plain { cursor: default; }
.v__reading { color: var(--ink-soft); font-size: 1rem; margin-top: 2px; }
.rule { margin: var(--space-sm) 0; }
.rule pre { white-space: pre-wrap; font-family: var(--font-text); font-size: 1rem; line-height: 1.55; color: var(--ink); tab-size: 4; max-width: 44em; }
.paradigm { margin: var(--space-sm) 0; border-collapse: collapse; font-size: 1rem; }
.paradigm caption { text-align: left; font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 6px; }
.paradigm th, .paradigm td { text-align: left; padding: 4px 18px 4px 0; border-top: 1px dotted var(--hairline); font-weight: 400; }
.paradigm th { color: var(--ink-soft); }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(16em, 1fr)); gap: 4px 24px; margin: var(--space-sm) 0; font-size: 1rem; }
.vocab div { display: grid; grid-template-columns: minmax(6em, auto) 1fr; column-gap: 10px; padding: 4px 0; border-top: 1px dotted var(--hairline); }
.vocab dd { color: var(--ink-soft); }

/* ---- the words, by letter */
.letters { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: var(--space-sm) 0 var(--space-md); }
.letters a { min-width: 2.2rem; min-height: 44px; display: inline-grid; place-items: center; font-family: var(--face); font-size: 1.1rem; color: var(--ink-soft); border-bottom: 1px solid transparent; }
.letters a:hover { color: var(--spruce); border-bottom-color: var(--spruce); }
.w { padding: 12px 0; border-top: 1px solid var(--hairline); max-width: 40em; }
.w--brief { padding: 6px 0; border-top: 1px dotted var(--hairline); }
.w__lemma { display: inline; font-family: var(--face); font-weight: var(--wt, 400); font-size: 1.35rem; margin-right: 10px; }
.w--brief .w__lemma { font-size: 1.1rem; }
.w__gloss { display: inline; font-size: 1rem; }
.w__count { color: var(--ink-soft); font-size: var(--t-small); margin-left: 6px; }
.w__forms, .w__morph { color: var(--ink-soft); font-size: 1rem; margin-top: 4px; }
.w__forms span { color: var(--ink); }
.w__note { font-style: italic; color: var(--ink-soft); font-size: 1rem; margin-top: 4px; }
.w__ex { list-style: none; padding: 0; margin-top: 6px; }
.w__ex li { font-size: 1rem; line-height: 1.5; }
.w__ex a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hairline-bold); text-underline-offset: 3px; }
.w__ex a:hover { color: var(--spruce); }
.lexicon .contents__n { font-family: var(--face); font-size: 1.4rem; }
