/* Big Pulpit redesign. The page borrows from the altar missal:
   black text, red rubrics, and coloured ribbons that mark your place. */
:root {
  --paper: #ffffff;
  --wash: #f5f3ee;
  --ink: #000000;
  --muted: #5f6166;
  --rubric: #8a0000;   /* Big Pulpit red, from the logo and link colour */
  --navy: #002d70;     /* edition titles */
  --gold: #b39700;
  --green: #23a455;
  --violet: #5a3d86;
  --rose: #c06b84;
  --line: #d9d6cf;
  --text: "Lora", Georgia, serif;
  --ui: "Roboto", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--rubric); outline-offset: 3px; border-radius: 2px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* Header: centred logo over a ruled menu, as on the current site */
.site-header { max-width: 82rem; margin: 0 auto; padding: 1.25rem 1.5rem 0; font-family: var(--ui); }
.logo { display: block; width: min(22rem, 70%); margin: 0 auto 1rem; aspect-ratio: 1200 / 200; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-header nav { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.site-header nav ul { display: flex; justify-content: center; align-items: center; gap: 2rem; padding: 0.45rem 0; }
.site-header nav a:not(.button) { font-size: 0.9375rem; font-weight: 500; text-decoration: none; padding: 0.4rem 0; display: block; }
.site-header nav a:not(.button):hover { color: var(--rubric); }
.site-header nav a[aria-current] { box-shadow: 0 2px 0 var(--rubric); }
.site-header nav .button { padding: 0.55rem 1rem; }
.button {
  display: inline-block; font: 600 0.9375rem/1 var(--ui);
  background: var(--rubric); color: #fff; text-decoration: none;
  padding: 0.75rem 1.15rem; border-radius: 3px;
}
.button:hover { filter: brightness(0.92); }

/* Rubrics and ribbons */
.rubric { color: var(--muted); font-style: italic; font-size: 1rem; }
.ribbon {
  display: inline-block; width: 0.5rem; height: 1.25em; flex: none;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.ribbon.red { background: var(--rubric); }
.ribbon.green { background: var(--green); }
.ribbon.violet { background: var(--violet); }
.ribbon.rose { background: var(--rose); }
.ribbon.black { background: var(--navy); }
.ribbon.white { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--gold); clip-path: none; height: 1.05em; }

/* Masthead */
.masthead { max-width: 82rem; margin: 0 auto; padding: 2.5rem 1.5rem 2rem; }
.masthead h1 {
  font: 600 clamp(2.25rem, 7vw, 5rem)/1 var(--text);
  color: var(--navy); text-transform: uppercase;
  margin: 0.5rem 0 1rem;
}
.dateline { font-family: var(--ui); font-size: 0.9375rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.dateline time { font-weight: 600; }
.dateline span { color: var(--muted); }
.week { margin-top: 2rem; overflow-x: auto; }
.week ul { display: flex; gap: 0.5rem; }
.week a {
  display: grid; justify-items: center; gap: 0.15rem; min-width: 3.25rem;
  padding: 0.5rem 0.6rem; border-radius: 3px; text-decoration: none;
  font-family: var(--ui); font-size: 0.75rem; color: var(--muted);
}
.week b { font: 500 1.25rem/1 var(--text); color: var(--ink); }
.week a:hover { background: var(--wash); }
.week a[aria-current] { background: var(--navy); color: var(--paper); }
.week a[aria-current] b { color: var(--paper); }

/* Filter */
.toolbar {
  position: sticky; top: 0; z-index: 5; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.toolbar > * { max-width: 82rem; margin: 0 auto; padding: 0 1.5rem; }
.filter { display: flex; align-items: center; gap: 0.75rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.filter input {
  flex: 1; min-width: 0; font: 400 1rem/1.4 var(--ui); color: var(--ink);
  background: var(--wash); border: 1px solid transparent; border-radius: 3px;
  padding: 0.7rem 0.9rem;
}
.filter input::placeholder { color: var(--muted); }
.filter input:focus { outline: none; border-color: var(--rubric); background: var(--paper); }
.filter kbd { font: 500 0.8125rem/1 var(--ui); color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0.3rem 0.5rem; }
.status { font: 400 0.875rem/1.4 var(--ui); color: var(--muted); }
.status:not(:empty) { padding-bottom: 0.6rem; }

/* Edition grid */
.edition {
  max-width: 82rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem;
  display: grid; gap: 3rem;
  grid-template-columns: 13rem minmax(0, 1fr) 20rem;
  align-items: start;
}
.rail { position: sticky; top: 5.5rem; font-family: var(--ui); font-size: 0.9375rem; }
.rail a { display: flex; align-items: center; gap: 0.65rem; padding: 0.4rem 0; text-decoration: none; }
.rail a:hover { text-decoration: underline; }
.rail .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.8125rem; }
.rail .ribbon { height: 1.1rem; }

.block { margin-bottom: 3.5rem; }
.block h2, .panel h2 {
  display: flex; align-items: center; gap: 0.7rem;
  font: 700 1.375rem/1.2 var(--text);
}
.block .rubric { margin: 0.2rem 0 0 1.2rem; }
.links { margin-top: 1.1rem; max-width: 42rem; }
.links.wide { max-width: 46rem; }
.links li { padding: 0.7rem 0; }
.links li + li { border-top: 1px solid var(--line); }
.links a, .ranked a { display: block; color: var(--rubric); font-weight: 600; font-size: 1.125rem; line-height: 1.35; text-decoration: none; }
.links a:hover, .ranked a:hover, .plain a:hover { text-decoration: underline; }
.links a:visited, .ranked a:visited { color: #6b4a4a; }
.meta { display: block; margin-top: 0.2rem; font: 400 0.875rem/1.4 var(--ui); color: var(--muted); }
.src { color: var(--ink); }

.lead .links { max-width: none; }
.lead .links li { padding: 1rem 0; }
.lead .links a { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.22; }

.archive, .empty { font-family: var(--ui); font-size: 0.9375rem; }
.empty { padding: 2rem 0; }
.empty button { font: inherit; color: var(--rubric); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* Aside */
.aside { display: grid; gap: 1.25rem; }
.panel { background: var(--wash); padding: 1.5rem; border-radius: 3px; }
.panel h2 { font-size: 1.25rem; }
.panel .rubric { font-size: 0.9375rem; margin-top: 0.2rem; }
.ranked { counter-reset: rank; margin-top: 1rem; }
.ranked li { counter-increment: rank; display: grid; grid-template-columns: 2rem 1fr; padding: 0.6rem 0; }
.ranked li::before { content: counter(rank); grid-row: span 2; font: 600 1.25rem/1.25 var(--text); color: var(--ink); }
.ranked a { font-size: 1.0625rem; }
.ranked .meta { grid-column: 2; }
.plain { margin-top: 0.9rem; }
.plain li { padding: 0.45rem 0; }
.plain a { color: var(--rubric); font-weight: 600; text-decoration: none; line-height: 1.35; display: block; }
.give { background: var(--navy); color: var(--paper); }
.give p { margin: 0.5rem 0 1.1rem; font-size: 1rem; }

[hidden] { display: none !important; }

/* Simple pages */
.page { max-width: 46rem; margin: 0 auto; padding: 4rem 1.5rem 5rem; }
.page h1 { color: var(--navy); font: 600 clamp(2.25rem, 6vw, 3.5rem)/1.08 var(--text); margin: 0.4rem 0 1.25rem; }
.page p { margin-bottom: 1.1rem; }
.lede { font-size: 1.3125rem; line-height: 1.5; }
.fine { font: 400 0.875rem/1.5 var(--ui); color: var(--muted); }
.facts { margin: 2rem 0; font-family: var(--ui); }
.facts div { display: grid; grid-template-columns: 7rem 1fr; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 0.9375rem; }
.facts dd { margin: 0; }

/* Adoration: a quiet, dark chapel around the live stream */
body.dark { --paper: #0d1017; --wash: #171b26; --ink: #f1ede2; --muted: #a8a59b; --line: #2a2f3d; --navy: #f1ede2; }
body.dark .site-header { background: #fff; max-width: none; --ink: #000; color: #000; }
body.dark .site-header nav { max-width: 79rem; margin: 0 auto; }
.chapel { text-align: center; max-width: 60rem; }
.chapel .lede { margin-inline: auto; max-width: 38rem; }
.stream-frame { aspect-ratio: 16 / 9; margin: 2.5rem 0 1rem; background: #000; }
.stream-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Footer */
.site-footer { background: var(--wash); font-family: var(--ui); font-size: 0.9375rem; }
.directory, .colophon { max-width: 82rem; margin: 0 auto; padding: 3rem 1.5rem; }
.directory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.directory h3 { font: 600 1.125rem/1.3 var(--text); margin-bottom: 0.6rem; }
.directory li { padding: 0.2rem 0; }
.directory a { text-decoration: none; }
.directory a:hover { text-decoration: underline; }
.colophon { padding-top: 0; color: var(--muted); display: grid; gap: 0.5rem; }
.colophon strong { color: var(--ink); }
.mock { font-size: 0.8125rem; }

/* Smaller screens */
@media (max-width: 68rem) {
  .edition { grid-template-columns: 12rem minmax(0, 1fr); }
  .aside { grid-column: 2; }
}
@media (max-width: 48rem) {
  .site-header { padding: 1rem 0 0; }
  .site-header nav { overflow-x: auto; }
  .site-header nav ul { justify-content: flex-start; gap: 1.25rem; padding: 0.45rem 1rem; width: max-content; min-width: 100%; }
  .site-header nav a { white-space: nowrap; }
  .masthead { padding: 2rem 1rem 1.5rem; }
  .week ul { gap: 0.15rem; }
  .week li { flex: 1; }
  .week a { min-width: 0; padding: 0.5rem 0; }
  .toolbar > * { padding-left: 1rem; padding-right: 1rem; }
  .filter kbd { display: none; }
  .edition { display: block; padding: 0 1rem 3rem; }
  .rail {
    position: sticky; top: 4.05rem; z-index: 4; background: var(--paper);
    margin: 0 -1rem 2rem; padding: 0 1rem; overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }
  .rail ul { display: flex; gap: 1.25rem; }
  .rail a { white-space: nowrap; padding: 0.7rem 0; }
  .rail .n { margin-left: 0.1rem; }
  html { scroll-padding-top: 8rem; }
  .aside { margin-top: 1rem; }
  .directory { grid-template-columns: 1fr; padding: 2.5rem 1rem; }
  .colophon { padding: 0 1rem 2.5rem; }
  .page { padding: 2.5rem 1rem 3.5rem; }
  .facts div { grid-template-columns: 5.5rem 1fr; }
}
