/* Propria Missae O.P. — "Ring beside, Monastic" (design option 5):
   white, black ink, rubric red; Cormorant small capitals; the ring of the liturgical year at the side. */
@font-face { font-family: 'Crimson Text'; src: url('fonts/CrimsonText-Regular.ttf'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Crimson Text'; src: url('fonts/CrimsonText-Italic.ttf'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'Crimson Text'; src: url('fonts/CrimsonText-Bold.ttf'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Crimson Text'; src: url('fonts/CrimsonText-BoldItalic.ttf'); font-weight: 700; font-style: italic; }

:root {
  --paper: #ffffff;
  --ink: #0d0d0d;
  --muted: #575757;
  --line: #d4d4d4;
  --soft: #f5f5f5;
  --rubric: #9c1b26;
  --serif: 'Cormorant Garamond', 'Crimson Text', Georgia, serif;
  --caps: 'Cormorant SC', 'Cormorant Garamond', Georgia, serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font: 19px/1.45 var(--serif); }
a { color: var(--ink); }
button, select, input { font: inherit; font-size: 16px; color: var(--ink); }
select, input[type=date] { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--rubric); outline-offset: 2px; }

/* header */
.site { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 32px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.cross { color: var(--rubric); font-size: 26px; line-height: 1; }
.t1 { display: block; font-family: var(--caps); font-size: 26px; letter-spacing: .04em; line-height: 1; }
.t2 { display: block; font-style: italic; color: var(--muted); font-size: 15px; }
nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
nav button, nav a { font-family: var(--serif); font-size: 17px; background: none; border: 0; padding: 8px 10px; text-decoration: none; color: var(--ink); border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
nav button:hover, nav a:hover { background: var(--soft); }

/* two columns: the ring beside, the Mass scrolling */
.layout { display: grid; grid-template-columns: 440px minmax(0, 1fr); align-items: start; }
.hero { position: sticky; top: 74px; max-height: calc(100vh - 74px); overflow-y: auto; padding: 18px 22px 28px;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ringnav { display: flex; align-items: center; gap: 6px; }
.ring svg { display: block; width: 320px; height: 320px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 22px; line-height: 1; flex: none; }
.round:hover { border-color: var(--ink); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 16px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.dot.white { border: 1px solid #8a8a8a; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 17px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.small { min-height: 38px; font-size: 15px; padding: 6px 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.chips:empty { display: none; }
.chip { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px 12px; font-size: 16px; max-width: 100%; min-height: 44px; }
.chip small { font-family: var(--caps); color: var(--rubric); font-size: 12px; letter-spacing: .12em; }
.chip.win { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chips .hint { flex-basis: 100%; text-align: center; margin: 0; }
.panel { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-family: var(--caps); font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.panel .btn { grid-column: 1 / -1; }
.options { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 8px; }
.options summary { font-family: var(--caps); letter-spacing: .12em; font-size: 15px; color: var(--ink); min-height: 36px; display: flex; align-items: center; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding-top: 8px; }
.opt-grid .wide, .wide { grid-column: 1 / -1; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); min-height: 36px; }
.switch input { width: 18px; height: 18px; accent-color: var(--rubric); }
.incipit { font-style: italic; color: var(--ink); font-size: 18px; }
.mode { margin-left: auto; font-family: var(--caps); font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.source { margin-top: 30px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; font-style: italic; }
.source a { color: var(--muted); }
.r-cols { display: block; }
@media (min-width: 1180px) {
  .r-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
  .reading .la { margin: 0; }
}

/* the Mass */
main { padding: 22px 44px 60px; max-width: 920px; width: 100%; }
.caps-head { font-family: var(--caps); font-size: 15px; letter-spacing: .18em; color: var(--rubric); margin: 26px 0 4px; text-transform: uppercase; font-weight: 500; }
.mass-head { margin: 4px 0 4px; }
.mass-head { padding-bottom: 6px; }
.mass-head h1 { font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1.08; margin: 0; letter-spacing: .005em; }
.mass-head .en { margin: 2px 0 0; color: var(--muted); font-style: italic; font-size: 18px; }
.hint { color: var(--muted); font-size: 16px; font-style: italic; margin: 6px 0 0; }
.badge { display: inline-block; font-family: var(--caps); font-size: 12px; letter-spacing: .08em; padding: 1px 8px; border-radius: 10px; margin-left: 6px; vertical-align: 2px; border: 1px solid; font-style: normal; }
.badge.ok { color: #24613a; border-color: #9cc7aa; }
.badge.info { color: #34506e; border-color: #a9bdd2; }
.badge.warn { color: #7a5000; border-color: #d9b56a; }

.part { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.part:first-of-type { border-top: 0; }
.part-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.part-head h2 { margin: 0 4px 0 0; font-family: var(--caps); font-weight: 500; font-size: 19px; letter-spacing: .08em; color: var(--rubric); }
.chant-select { flex: 1; min-width: 200px; max-width: 440px; width: auto; font-size: 15px; padding: 5px 8px; }
.linkbtn { border: 0; background: none; padding: 4px 6px; color: var(--rubric); text-decoration: underline; font-size: 15px; min-height: 32px; }
.chant { margin: 8px 0 0; min-height: 40px; }
.chant svg { width: 100%; height: auto; display: block; }
.chant .line { break-inside: avoid; page-break-inside: avoid; }
.gabc { width: 100%; font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.meta { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.loading, .empty { color: var(--muted); font-style: italic; }
.error { color: var(--rubric); }

.reading { padding: 10px 0; border-top: 1px solid var(--line); }
.reading h3 { margin: 0 0 4px; font-family: var(--caps); font-weight: 500; font-size: 18px; letter-spacing: .08em; color: var(--rubric); }
.reading h3 .ref { font-family: var(--serif); font-style: italic; letter-spacing: 0; color: var(--muted); font-size: 17px; margin-left: 6px; }
.reading .la { margin: 0 0 6px; text-align: justify; }
.reading .en-text { margin: 0; text-align: justify; color: var(--muted); font-size: 17px; }

.add { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 16px; }
.add .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add select { width: auto; }
.extras { padding-left: 18px; }
details summary { cursor: pointer; color: var(--muted); }
.print-only { display: none; }

footer { padding: 18px 32px 34px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
footer a { color: var(--muted); }

/* tablet and phone: the ring becomes the hero above the Mass */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .hero { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 14px 18px 50px; }
  .site { padding: 10px 16px; position: static; }
  nav { width: 100%; justify-content: space-between; }
}
@media (max-width: 420px) {
  .ring svg { width: 270px; height: 270px; }
  .panel { grid-template-columns: 1fr; }
  .chant-select { max-width: none; flex-basis: 100%; order: 5; }
  .t1 { font-size: 22px; }
}

/* the congregation sheet exists only in print */
.cong { display: none; }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { font-size: 12pt; }
  .hide-print { display: none !important; }
  .print-only { display: block; }
  .layout { display: block; }
  main { padding: 0; max-width: none; }
  .badge, .hint, .source { display: none; }
  .part, .reading { break-inside: auto; page-break-inside: auto; }
  .part h2.print-only { break-after: avoid; page-break-after: avoid; }
  .part h2.print-only { margin: 0; font-family: var(--caps); font-weight: 500; font-size: 13pt; letter-spacing: .08em; color: var(--rubric); }
  footer { display: none; }

  /* choir sheet */
  .mass-head { display: none; }
  .choir-head { text-align: center; padding-bottom: 4mm; margin-bottom: 2mm; border-bottom: 0.6pt solid #000; }
  .choir-head .c-cross { color: var(--rubric); font-size: 14pt; }
  .ch-title { font-family: var(--serif); font-size: 20pt; font-weight: 500; line-height: 1.1; }
  .ch-sub { font-family: var(--caps); font-size: 9.5pt; letter-spacing: .12em; color: #333; margin-top: 1mm; }
  .caps-head#chants { display: none; }
  body[data-print=choir] .readings { display: none; }
  .part { padding-top: 4mm; border-top: 0; }
  .chant { margin-top: 1mm; }
  .meta { display: none; }

  /* congregation sheet */
  body[data-print=congregation] .layout > main { display: none; }
  body[data-print=congregation] .cong { display: block; }
  .cong { font-family: var(--serif); font-size: 10.5pt; line-height: 1.38; color: #000; }
  .c-head { text-align: center; margin-bottom: 5mm; padding-bottom: 4mm; border-bottom: 0.6pt solid #000; }
  .c-cross { color: var(--rubric); font-size: 15pt; line-height: 1; }
  .c-kicker { font-family: var(--caps); font-size: 9pt; letter-spacing: .2em; color: #333; margin: 1.5mm 0 1mm; }
  .c-head h1 { font-family: var(--serif); font-weight: 500; font-size: 22pt; line-height: 1.1; margin: 0; }
  .c-en { font-style: italic; font-size: 12.5pt; margin-top: 1mm; }
  .c-date { font-family: var(--caps); font-size: 9.5pt; letter-spacing: .1em; color: #333; margin-top: 2mm; }
  .c-sec { margin: 0 0 4mm; break-inside: avoid; page-break-inside: avoid; }
  .c-sec.c-read { break-inside: auto; page-break-inside: auto; }
  .c-sec h2 { break-after: avoid; page-break-after: avoid; }
  .c-sec h2 { display: flex; align-items: baseline; gap: 3mm; margin: 0 0 1.2mm; padding-bottom: 0.8mm; border-bottom: 0.4pt solid #bbb; font-weight: 500; }
  .c-lab { font-family: var(--caps); font-size: 11.5pt; letter-spacing: .1em; color: var(--rubric); }
  .c-lab-en { font-family: var(--caps); font-size: 9.5pt; letter-spacing: .1em; color: #555; }
  .c-ref { margin-left: auto; font-style: italic; font-size: 9.5pt; color: #444; }
  .c-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .c-la, .c-en-text { text-align: justify; hyphens: auto; }
  .c-la { -webkit-hyphens: auto; }
  .c-en-text { font-style: italic; }
  .c-missing { color: #777; font-size: 9pt; }
  .c-foot { margin-top: 6mm; padding-top: 2mm; border-top: 0.4pt solid #bbb; font-size: 8pt; color: #555; text-align: center; }
}
