/* Shared by compline-booklet.html and compline-print.html: the type, the
   apparatus and the measuring probe. Each page adds only its own paper -
   the booklet an A5 half-leaf, the print edition a whole A4 - so the two
   editions cannot drift apart typographically. */

/* EB Garamond, bundled so the page renders identically offline.
   SIL Open Font License 1.1 - see fonts/OFL.txt */
@font-face {
    font-family: 'EB Garamond';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ebgaramond-latin-ext-italic.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'EB Garamond';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ebgaramond-latin-italic.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'EB Garamond';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/ebgaramond-latin-ext-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'EB Garamond';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/ebgaramond-latin-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --rule: #cfcabc;
    --bg: #f4f1ea;
    --paper: #fffdf8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'EB Garamond', serif;
}

/* Offscreen twin used to measure how much fits on a page. */
.probe {
    position: absolute;
    left: -9999px;
    top: 0;
    height: auto;
    visibility: hidden;
}

.probe.nowrap .verse { white-space: nowrap; }

/* The paschal Alleluia may turn onto a second line; only sung text may not. */
.probe.nowrap .paschal { display: none; }

.folio {
    margin-top: auto;
    padding-top: 2mm;
    text-align: center;
    font-size: 0.76em;
    color: var(--muted);
}

.piece-title {
    font-size: 1.14em;
    font-weight: 700;
    font-variant: small-caps;
    letter-spacing: 0.5px;
    margin: 2mm 0 0.8mm;
}

.piece-title:first-child { margin-top: 0; }

.piece-title .kind {
    color: var(--muted);
    font-variant: normal;
    font-size: 0.67em;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-right: 6px;
}

.verse {
    margin: 0 0 0.2mm;
    padding-left: 2em;
    text-indent: -2em;
}

.verse.choir2 { margin-left: 1em; }

.mark {
    color: var(--muted);
    padding: 0 0.1em;
}

.gloria { margin-top: 1mm; }

.antiphon {
    margin: 1mm 0;
    font-style: italic;
}

.ant-label {
    color: var(--muted);
    font-size: 0.76em;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-right: 6px;
}

/* Season note inside a sung line; upright so it reads against the italic antiphon */
.season {
    font-style: normal;
    font-size: 0.78em;
    color: var(--muted);
}

.rubric {
    margin: 0 0 0.5mm;
    font-size: 0.8em;
    font-style: italic;
    color: var(--muted);
}

.said { margin: 0 0 0.8mm; }

/* Hymn stanzas stand apart from one another, unlike the verses of a psalm */
.stanza + .stanza { margin-top: 1.5mm; }

/* Apparatus - legend and credits - set below the prayer it surrounds */
.small { font-size: 0.82em; }
.piece-title.small { font-size: 0.72em; }

/* The sign sits in its own column so the glosses line up down the page */
.legend {
    display: grid;
    grid-template-columns: 9mm 1fr;
    gap: 0 2mm;
    margin: 0 0 1.2mm;
}

.legend .sign {
    font-weight: 700;
    text-align: center;
}

.alt {
    text-align: center;
    font-style: italic;
    color: var(--muted);
    margin: 1.5mm 0;
}

.vr-label {
    color: var(--muted);
    font-weight: 700;
    margin-right: 6px;
}

.absent {
    color: var(--muted);
    font-style: italic;
}

/* Title page */
.title-page {
    text-align: center;
    justify-content: center;
}

.title-page h1 {
    font-size: 16pt;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.3;
    margin: 0 0 4mm;
}

.title-page .rule {
    border-bottom: 2px double var(--ink);
    width: 60%;
    margin: 0 auto 8mm;
}

.title-page img {
    display: block;
    width: 45mm;
    margin: 0 auto 8mm;
}

.title-page h2 {
    font-size: 26pt;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
}

.colophon {
    justify-content: flex-end;
    text-align: center;
    font-size: 8.5pt;
    color: var(--muted);
}

.colophon p { margin: 0 0 2mm; }


/* Screen preview only: the furniture around the pages. Each edition adds the rules for
   its own paper - how a leaf or a sheet is separated from the next and trimmed. */
@media screen {
    body { padding: 20px; }
    .instructions {
        margin: 0 auto 20px;
        padding: 16px 20px;
        background: var(--paper);
        border: 1px solid var(--rule);
        font-size: 15px;
        line-height: 1.5;
    }
    .instructions h3 {
        margin: 0 0 8px;
        font-size: 13px;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: var(--muted);
    }
    .instructions ol { margin: 0; padding-left: 20px; }
    #setting { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
}
