/* =========================================================
   BOOK PAGE TYPOGRAPHY
   Shared by the reader and the admin page preview.
========================================================= */

.page-text {
    --red: #9a3f2f;
    --muted: #7d7262;
    position: relative;
    min-height: 100%;
    font-family: "EB Garamond", Georgia, serif;
    font-size: calc(var(--page-fs, 17px) * var(--page-scale, 1));
    line-height: 1.72;
    color: #2b251e;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    font-kerning: normal;
    font-variant-ligatures: common-ligatures;
    hyphens: auto;
    overflow-wrap: break-word;
}
.page-text p { margin: 0 0 .9em; }
.page-text p:last-child { margin-bottom: 0; }
.page-text h1, .page-text h2, .page-text h3, .page-text h4 {
    font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
    font-weight: 600;
    line-height: 1.05;
    margin: 0 0 .5em;
}
.page-text h2 { font-size: 1.7em; }
.page-text h3 { font-size: 1.35em; }
.page-text h4 { font-size: 1.1em; letter-spacing: .02em; }
.page-text ul, .page-text ol { margin: 0 0 1em 1.3em; }
.page-text li { margin-bottom: .3em; }
.page-text hr {
    border: 0; height: 1.6em; margin: 1.2em 0; text-align: center; overflow: visible;
}
.page-text hr::after { content: "❦"; color: var(--red); font-size: 1.1em; opacity: .8; }
.page-text blockquote {
    margin: 1.2em 0; padding: .1em 0 .1em 1em; border-left: 2px solid var(--red);
    font-style: italic; color: #4a4238;
}

.chapter-label {
    font-family: "Courier Prime", "Courier New", monospace;
    font-size: .64em; letter-spacing: .24em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 1.4em;
}
.episode-script {
    font-family: "Caveat", cursive; font-size: 1.9em; line-height: 1;
    color: var(--red); transform: rotate(-2deg); transform-origin: left;
    margin-bottom: .25em;
}
.book-heading {
    font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
    font-weight: 600; font-size: 3.1em; line-height: .96; letter-spacing: -.01em;
    color: #211c16; margin: 0 0 .1em;
}
.book-subheading {
    font-family: "Cormorant Garamond", Georgia, serif; font-style: italic;
    font-size: 1.45em; color: #4a4238; margin-bottom: .6em;
}
.book-body { margin-top: 1.6em; }
.book-heading + .book-body, .episode-script + .book-body { margin-top: 1.3em; }

.dropcap::first-letter {
    float: left;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600; font-size: 3.6em; line-height: .78;
    padding: .06em .09em 0 0; color: var(--red);
}

.book-quote {
    margin: 1.5em 0; padding: .2em 0 .2em 1.1em;
    border-left: 2px solid var(--red);
    font-family: "Cormorant Garamond", Georgia, serif; font-style: italic;
    font-size: 1.3em; line-height: 1.45; color: #3a332a;
}

.poem { white-space: pre-line; font-style: italic; }
.center { text-align: center; }
.right { text-align: right; }
.small-caps { font-variant: small-caps; letter-spacing: .04em; }
.ornament { text-align: center; color: var(--red); margin: 1em 0; letter-spacing: .6em; }
.ornament:empty::before { content: "❦"; letter-spacing: 0; }

/* Handwritten margin notes */
.hand-note {
    position: absolute; z-index: 2;
    font-family: "Caveat", cursive; color: var(--red);
    font-size: 1.45em; line-height: 1; max-width: 9em;
    pointer-events: none;
}
.note-top-right { top: -1.7em; right: -1.1em; transform: rotate(5deg); text-align: right; }
.note-top-left { top: -1.7em; left: -1.1em; transform: rotate(-5deg); }
.note-bottom-left { bottom: -1.6em; left: -.8em; transform: rotate(-4deg); }
.note-bottom-right { bottom: -1.6em; right: -.8em; transform: rotate(4deg); text-align: right; }
.hand-note:not(.note-top-right):not(.note-top-left):not(.note-bottom-left):not(.note-bottom-right) {
    position: static; display: block; margin: .8em 0; transform: rotate(-2deg);
}
