/* The canonical Síonæiya documents (Faerish), set from their source manuscripts.
   On screen they read like the rest of the site: one column, the site's type,
   the manuscript's alignments and indents kept. Printed, they become the
   manuscript again: Letter pages, running heads, double spacing. */

/* ── Screen ─────────────────────────────────────────────── */
.canonical-document .work-section + .work-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--rule);
}

.canonical-document .title-page { margin: 0 0 3rem; text-align: center; }
.canonical-document .title-page[id] { scroll-margin-top: 1.5rem; }
.canonical-document .title-furniture { margin: 0 0 1.5rem; color: var(--muted); font-variant-caps: all-small-caps; letter-spacing: 0.06em; }
.canonical-document .title-furniture.footer { margin: 1.5rem 0 0; }
.canonical-document .title-page .source-paragraph { margin: 0 0 0.4rem; }
.canonical-document .title-page h1 { margin: 0 0 0.75rem; line-height: 1.1; }

.source-paragraph {
    margin: 0 0 0.85em;
    line-height: 1.7;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}
.source-paragraph.blank { line-height: 0.9; margin: 0; }
.source-paragraph.page-top { margin-top: 2.5rem; }
.title-page .source-paragraph.page-top { margin-top: 0; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.align-left { text-align: left; }
.first-line-indent { text-indent: 1.5em; }
.align-center.first-line-indent { text-indent: 0; }
.hanging-indent { padding-left: 2.5em; text-indent: -1.5em; }
@media (min-width: 36rem) {
    .align-justify { text-align: justify; }
}

/* Point sizes from the manuscript's title pages, scaled to the screen. */
.pt-48 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem); }
.pt-24 { font-size: 1.45rem; }
.pt-16 { font-size: 1.1rem; }

/* ★, which comes from the companion font (style.css), set a little smaller. */
.sym { font-size: 0.85em; }

/* The reference documents (Guideworde, Not Non-Rules, Storywarders). */
.ref-body h2 { font-size: 1rem; color: var(--muted); font-variant-caps: all-small-caps; letter-spacing: 0.06em; margin: 2.5rem 0 0.75rem; }
.ref-body h3 { font-size: 1.15rem; font-style: italic; margin: 2rem 0 0.6rem; }
.ref-body ul { margin: 0.75em 0; padding-left: 1.15em; }
.ref-body li { margin: 0.45em 0; }
.ref-body hr.part-seam { width: 4rem; margin: 3rem auto; }
.ref-body h3[id] { scroll-margin-top: 1rem; }

/* A–Z jumps for the dictionary. */
.letters { display: flex; flex-wrap: wrap; gap: 0.1rem 0.15rem; margin: 0.75rem 0 2rem; font-variant-caps: all-small-caps; letter-spacing: 0.04em; }
.letters a { min-width: 2rem; padding: 0.3rem 0.35rem; text-align: center; text-decoration: none; color: var(--muted); border-radius: 2px; }
.letters a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ── Print: the manuscript ──────────────────────────────── */
@page {
    size: Letter portrait;
    margin: 1in;
}
@page :right {
    @top-center { content: "Lyre · Síonæiya"; font-family: 'EB Garamond', serif; font-size: 9pt; }
    @bottom-center { content: "… " counter(page) " …"; font-family: 'EB Garamond', serif; font-size: 9pt; }
}
@page :first {
    @top-center { content: ""; }
    @bottom-center { content: ""; }
}

@media print {
    .canonical-document { font-size: 12pt; }
    .canonical-document .work-section + .work-section { margin: 0; padding: 0; border: 0; }
    .canonical-document .title-page { break-after: page; padding-top: 2.5in; }
    .canonical-document .work-section + .work-section > .title-page { break-before: page; }
    .canonical-document .title-furniture { display: none; }
    .source-paragraph { line-height: 2; margin: 12pt 0; orphans: 2; widows: 2; }
    .source-paragraph.blank { line-height: 2; margin: 0; }
    .first-line-indent { text-indent: 0.5in; }
    .hanging-indent { padding-left: 0.7361in; text-indent: -0.2361in; }
    .align-justify { text-align: justify; }
    .body-section > .source-paragraph.page-top:first-child { margin-top: 0; }
    .pt-48 { font-size: 48pt; }
    .pt-24 { font-size: 24pt; }
    .pt-16 { font-size: 16pt; }
}
