/* The Anglican Ledger
 * Black and copper on white (see artifacts/brand/.../BRAND-GUIDE.md), with
 * an ink masthead band, warm parchment panels and copper section rules.
 * Every color is the brand palette or a tint/shade of it; no shadows,
 * gradients or animations.
 *
 * Light theme only: pages set <html data-theme="light">, which keeps the
 * brand tokens in their light values even when the OS is in dark mode.
 *
 * Brand tokens (--paper, --ink, --ink-soft, --rule, --copper) come from
 * tokens.css, copied unchanged from the brand package. Copper is ~3.8:1 on
 * white, so it is used only for rules, link underlines, focus rings and chart
 * marks, never for body text or small labels.
 */
@import url("tokens.css");

:root {
  color-scheme: light;
  /* Roles, mapped onto the brand tokens (contrast on paper in comments). */
  --bg: var(--paper);
  --text: var(--ink);                 /* 18.9:1 */
  --text-2: var(--ink-soft);          /* 11.8:1 */
  --accent: var(--copper);            /* rules and graphics only */
  --button-bg: var(--ink);
  --button-text: var(--paper);        /* 18.9:1 */
  --focus: var(--copper);             /* 3.8:1 (UI needs ≥ 3:1) */

  /* Derived from the palette: a light warm grey for panels, bands and chart
     boxes (named parchment from when it was a copper tint), and a deeper
     copper that is dark enough for small text (6.2:1 on paper) where the
     brand copper is not. */
  --parchment: #F4F2EE;
  --parchment-rule: #DDD8CF;
  --copper-text: #8A5424;

  /* Header band: ink with light text. */
  --header-bg: #121110;
  --header-text: #F4F1EC;             /* 16.7:1 */
  --header-text-2: #CFC9C0;           /* 11.5:1 */
  --header-accent: #DDA06A;           /* 8.4:1 */

  /* Footer band: ink with light text. */
  --footer-bg: #121110;
  --footer-text: #F4F1EC;             /* 16.7:1 */
  --footer-text-2: #CFC9C0;           /* 11.5:1 */
  --footer-accent: #DDA06A;

  --serif: var(--font-display);
  --sans: "Source Sans 3", var(--font-ui);

  /* The only four text styles on the site. */
  --font-title: 500 clamp(2rem, 4.5vw, 2.75rem)/1.12 var(--serif);   /* page titles, top story, figures */
  --font-heading: 500 1.3rem/1.3 var(--serif);                       /* section headings and headlines */
  --font-body: 400 1rem/1.6 var(--sans);                              /* every sentence */
  --font-label: 600 12px/1.4 var(--sans);                             /* short labels, in capitals */
  --measure: 68ch;
  --gutter: 16px;
}

/* ---- Base ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--font-body);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--copper-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
/* Two typefaces only: EB Garamond for headings and headlines, Source Sans 3
   for everything else; one style for all small capital labels. */
h1 { font: var(--font-title); margin: 0 0 0.5em; }
h2, h3, .headline, .church-name { font: var(--font-heading); margin: 0 0 0.5em; }
.church-name { margin: 0; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.sans { font-family: var(--sans); }
.muted { color: var(--text-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--button-bg); color: var(--button-text);
  font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; padding: 0.6rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* Small functional text: source tags, dates, navigation, buttons, fields. */
/* Source labels: plain warm-grey type, no box, like a newspaper dateline
   (5.6:1), so the headlines lead and the black category blocks stay the
   strongest marks. */
.tag {
  display: inline-block;
  font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em;
  color: #6B675F;
}
.when { font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.eyebrow { font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--copper-text); margin: 0 0 0.75rem; }
.section-title { border-bottom: 3px solid var(--accent); padding-bottom: 0.35rem; }
.section-title::before, .section-head h2::before {
  content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-right: 0.45em;
  background: var(--accent); vertical-align: 0.08em;
}

/* ---- Masthead & navigation -------------------------------------------- */

.site-header { background: var(--bg); border-top: 1px solid var(--accent); }
.masthead { padding: 2rem 0 0.75rem; text-align: center; }
.masthead a.brand { display: inline-block; }
.masthead .wide img { width: min(560px, 100%); height: auto; }
.masthead .narrow { display: none; }
.masthead .narrow img { width: 200px; height: auto; }
@media (max-width: 560px) {
  .masthead .wide { display: none; }
  .masthead .narrow { display: inline; }
}

/* "An experimental project": a rubber-stamp imprint under the logo, tilted,
   in copper ink, worn by a noise mask so it reads as pressed, not drawn. */
.stamp-wrap { margin: 0; padding: 0.25rem 0 1.25rem; text-align: center; line-height: 1; }
.masthead + .stamp-wrap { margin-top: -0.75rem; }
.stamp-wrap:first-child { padding-top: 1.25rem; }
.stamp {
  display: inline-block; transform: rotate(-5deg);
  padding: 0.45rem 0.85rem 0.4rem;
  border: 3px solid currentColor; border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 3px currentColor;
  color: #8A4F1E;
  font: 700 12px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0.92;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.5 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.5 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: 240px 80px; mask-size: 240px 80px;
}
.site-nav { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--accent); }
.site-nav ul {
  list-style: none; margin: 0 auto; padding: 0.6rem var(--gutter); max-width: 1160px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.75rem;
}
.site-nav a {
  font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none; color: var(--text-2); padding: 0.2rem 0;
}
.site-nav a:hover { color: var(--copper-text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }

main { padding: 2.5rem 0 3.5rem; }

/* ---- Headlines -------------------------------------------------------- */

.headline-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6rem; margin-top: 0.3rem; }
.headline a { text-decoration: none; }
.headline a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.top-story { text-align: center; padding: 2rem 1.5rem 2.25rem; background: var(--parchment); margin-bottom: 2.5rem; }
.top-story h2 { font: var(--font-title); max-width: 22ch; margin: 0 auto 0.6rem; }
.top-story .headline-meta { justify-content: center; }

.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.columns > section { padding: 0 1.75rem; border-left: 1px solid var(--rule); }
.columns > section:first-child { padding-left: 0; border-left: 0; }
.columns > section:last-child { padding-right: 0; }
/* Landing page: a copper bar over each column. Equal columns with equal gaps,
   so the bars are the same width and line up; dividers sit mid-gap. */
.columns.barred { column-gap: 3.5rem; }
.columns.barred > section, .columns.barred > section:first-child, .columns.barred > section:last-child {
  position: relative; padding: 1rem 0 0; border-left: 0; border-top: 4px solid var(--accent);
}
.columns.barred > section + section::before { content: ""; position: absolute; top: -4px; bottom: 0; left: -1.75rem; border-left: 1px solid var(--rule); }
/* The heading block: a black rounded rectangle (the black of the logo's
   circle) with white bold heading type. The site's one strong heading device,
   kept to two places: the front page's category and section heads, and the
   title at the top of each page in the menu. Headings inside a page stay
   plain. */
.column-title, .page-title {
  display: flex; align-items: center; margin: 0 0 1rem;
  background: #121110; color: #FFFFFF; font-weight: 600; border-radius: 6px;
}
.column-title { min-height: 3.25rem; padding: 0.5rem 1rem; }
.page-title { padding: 0.55rem 1.1rem 0.6rem; margin-bottom: 1.25rem; }
.columns.barred > section, .columns.barred > section:first-child, .columns.barred > section:last-child { border-top: 0; padding-top: 0; }
.headline-list { list-style: none; margin: 0; padding: 0; }
/* The model's one-sentence note under a headline (body style, muted). */
.headline-note { margin: 0.2rem 0 0.35rem; color: var(--text-2); }
.headline-list li { padding: 0.85rem 0; border-top: 1px solid var(--rule); }
.headline-list li:first-child { border-top: 0; padding-top: 0; }

/* Image and Homily of the Week: a small teaser in the fixed slot above the
   first two news columns (The Conversation runs alongside from the top).
   Kept to about 180px high so the news stays the main content. */
.has-month > .homily-teaser { grid-area: month; }
.homily-teaser { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.1rem; align-items: start; background: #FFFFFF; margin: 0 0 1.75rem; max-height: 180px; overflow: hidden; }
.homily-teaser .homily-thumb img { display: block; width: 120px; height: 160px; object-fit: cover; object-position: top; border-radius: 4px; }
.homily-teaser .eyebrow { margin: 0 0 0.2rem; }
.homily-title { font-family: "EB Garamond", Georgia, serif; font-size: 1.3rem; line-height: 1.2; font-weight: 500; margin: 0 0 0.15rem; }
.homily-title a { color: var(--text); text-decoration: none; }
.homily-title a:hover { text-decoration: underline; }
.homily-source { font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 0 0 0.35rem; }
.homily-excerpt { font: var(--font-body); font-size: 0.92rem; line-height: 1.45; color: var(--text); margin: 0 0 0.3rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.homily-more { margin: 0; font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; }
/* The homily's own page. */
.homily-page .homily-source { margin-top: -0.5rem; }
.homily-figure { margin: 1.5rem 0 2rem; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.homily-figure img { display: block; width: 100%; height: auto; border-radius: 6px; }
.homily-figure figcaption { font: var(--font-body); color: var(--text-2); }
.homily-figure figcaption p { margin: 0 0 0.75rem; }
.homily-figure .credit, .homily-figure .rights { font-size: 0.85rem; }
.homily-body { max-width: 68ch; }
.homily-part h2 { margin-top: 2rem; }
.homily-body sup { font-size: 0.7em; line-height: 0; }
.homily-body .footnote-definition { font-size: 0.85rem; color: var(--text-2); margin: 0.2rem 0; }
.homily-body .footnote-definition p { display: inline; margin: 0; }
.homily-body .footnote-definition-label { margin-right: 0.4rem; }
.homily-text-source, .homily-back { font: var(--font-body); color: var(--text-2); max-width: 68ch; }
/* /homilies/ */
.homily-list { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.homily-list li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.homily-list li:first-child { border-top: 0; }
.homily-thumb img { display: block; width: 100%; height: auto; border-radius: 4px; }
.homily-list .homily-title { font-size: 1.3rem; }

/* The Image of the Month at the top of the first news column, under its
   heading: the picture, then the label and attribution. */
.month-col { margin: 0 0 1.5rem; }
.month-col img { display: block; width: 100%; height: auto; border-radius: 6px; }
.month-col figcaption { margin-top: 0.6rem; font: var(--font-body); color: var(--text-2); }
.month-col figcaption p { margin: 0 0 0.3rem; }
.month-col .credit { font-size: 0.88rem; line-height: 1.45; }

/* The Image of the Month: above the first two columns, with the third
   running alongside from the top. */
.columns.has-month { grid-template-areas: "month month c3" "c1 c2 c3"; grid-template-rows: auto 1fr; }
.has-month > .month { grid-area: month; margin-bottom: 2.25rem; }
.has-month > .col-1 { grid-area: c1; }
.has-month > .col-2 { grid-area: c2; }
.has-month > .col-3 { grid-area: c3; }
.has-month > .col-1::before { display: none; }
.month figure { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem; align-items: start; }
.month img { display: block; width: 100%; height: auto; max-height: 480px; object-fit: cover; object-position: top; border-radius: 6px; }
.month figcaption { font: var(--font-body); color: var(--text-2); }
.month figcaption p { margin: 0 0 0.8rem; }
.month figcaption .eyebrow { margin-bottom: 0.4rem; }
.month .month-title { font-family: "EB Garamond", Georgia, serif; font-size: 1.6rem; line-height: 1.2; font-weight: 500; color: var(--text); }
.month .credit { font-size: 0.92rem; }


/* The three column headings sit level: the columns share three rows (the
   box at the top of each, the heading, the headlines), so each heading
   starts below the tallest box. The collect's and the passage's panels
   stretch to that height, so the boxes end level too. */
@media (min-width: 821px) {
  .columns.barred { grid-template-rows: auto auto 1fr; }
  .columns.barred > section { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; }
  .col-top { display: flex; flex-direction: column; }
  .col-top > .panel { flex: 1; }
  .col-top:empty { display: none; }
}

@media (max-width: 820px) {
  .columns { grid-template-columns: 1fr; }
  .columns > section { padding: 0; border-left: 0; }
  .columns > section + section { border-top: 1px solid var(--rule); margin-top: 0.85rem; padding-top: 0.85rem; }
  .columns.barred > section + section { margin-top: 1.5rem; padding-top: 0; border-top: 0; }
  .columns.barred > section + section::before { display: none; }
  .columns.has-month { grid-template-areas: "month" "c1" "c2" "c3"; grid-template-rows: auto; }
  .month figure { grid-template-columns: 1fr; }
  .homily-figure { grid-template-columns: 1fr; }
  .homily-teaser { grid-template-columns: 84px minmax(0, 1fr); gap: 0.85rem; max-height: none; }
  .homily-teaser .homily-thumb img { width: 84px; height: 112px; }
}

/* ---- Front-page lower row --------------------------------------------- */

.lower { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
@media (max-width: 900px) { .lower { grid-template-columns: 1fr; } }
.panel { background: var(--parchment); border: 1px solid var(--parchment-rule); border-top: 3px solid var(--accent); padding: 1.5rem; }
.panel .plain-list li, .panel .headline-list li { border-top-color: var(--parchment-rule); }
.lower > .panel { align-self: start; }
.ranked { margin: 0; padding-left: 1.4rem; }
.ranked li { padding: 0.45rem 0; }
.ranked li::marker { font: var(--font-label); color: var(--copper-text); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 0.4rem 0; border-top: 1px solid var(--rule); }
.plain-list li:first-child { border-top: 0; }

/* The publisher's favicon as a link's bullet (see src/favicons.rs), hanging
   left of the headline so wrapped lines and the meta line align with its
   text. Centred on the first line of a headline. */
li.with-fav { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 0.6rem; align-items: start; }
li.with-fav > * { grid-column: 2; }
li.with-fav > .fav { grid-column: 1; grid-row: 1; width: 16px; height: 16px; margin-top: calc((1.3rem * 1.3 - 16px) / 2); border-radius: 2px; }
.plain-list li.with-fav > .fav { margin-top: calc((1lh - 16px) / 2); }
/* A church's or diocese's own icon, inline before its name. */
.church-name .fav, td .fav { display: inline-block; vertical-align: -2px; margin-right: 0.5rem; width: 16px; height: 16px; border-radius: 2px; }
h1 .fav-title { display: inline-block; width: 0.8em; height: 0.8em; vertical-align: baseline; margin-right: 0.35em; border-radius: 3px; }

/* ---- Buttons & forms -------------------------------------------------- */

.button, button {
  display: inline-block; cursor: pointer;
  font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--button-bg); color: var(--button-text);
  border: 1px solid var(--button-bg); border-radius: 2px;
  padding: 0.8rem 1.2rem; text-decoration: none;
}
.button:hover, button:hover { background: var(--copper-text); border-color: var(--copper-text); }
.button.secondary { background: transparent; color: var(--text); border-color: var(--text); }
.signup { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 30rem; }
.signup label { flex-basis: 100%; font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; }
.signup input[type="email"] {
  flex: 1 1 14rem; min-width: 0;
  font: var(--font-body); color: var(--text); background: var(--bg);
  border: 1px solid var(--text-2); border-radius: 2px; padding: 0.7rem 0.8rem;
}
.signup .hint { flex-basis: 100%; font: var(--font-body); color: var(--text-2); margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.submissions { margin-top: 2rem; }
/* On the front page it heads its own column, level with Most-clicked. */
.lower .submissions { margin-top: 0; }
.submissions p { margin: 0; }
.submissions a { overflow-wrap: anywhere; }
.submit-form { display: grid; gap: 0.6rem; margin: 0.9rem 0 0.4rem; }
.submit-form label { display: grid; gap: 0.2rem; font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.submit-form input, .submit-form select { font: var(--font-body); color: var(--text); background: var(--bg); border: 1px solid var(--text-2); border-radius: 2px; padding: 0.5rem 0.6rem; text-transform: none; letter-spacing: 0; }
.submit-form .button { justify-self: start; }
.submissions .hint { margin-top: 0.4rem; color: var(--text-2); }

/* ---- Essays, podcasts, video ------------------------------------------ */
.media-day { margin-top: 2rem; }
.small-note { font-size: 0.85rem; margin-top: -0.5rem; }
.media-excerpt { margin: 0.2rem 0 0; color: var(--text-2); font-size: 0.95rem; max-width: var(--measure); }
.media-source a { color: var(--text-2); }

/* ---- Archive ----------------------------------------------------------- */
.archive-banner { background: var(--parchment); border-bottom: 1px solid var(--parchment-rule); border-left: 3px solid var(--accent); padding: 0.6rem var(--gutter); margin: 0 0 1rem; font: var(--font-body); }
.archive-month h2 { margin-top: 2rem; }
.archive-days, .archive-hours { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.archive-days a, .archive-hours a { display: inline-block; min-width: 4.5rem; padding: 0.45rem 0.6rem; border: 1px solid var(--rule); text-decoration: none; text-align: center; font-family: var(--sans); }
.archive-days a:hover, .archive-hours a:hover { border-color: var(--accent); }
.archive-days .dow { color: var(--text-2); font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; }
.archive-step { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.archive-step .next { margin-left: auto; }

/* ---- Landing page ----------------------------------------------------- */

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1rem; margin: 3.5rem 0 1.5rem; border-bottom: 3px solid var(--accent); padding-bottom: 0.5rem; }
.section-head h2 { margin: 0; }

.band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 3.5rem; }
@media (max-width: 720px) { .band { grid-template-columns: 1fr; } }

/* ---- Editorial & prose ------------------------------------------------ */

.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3.5rem; }
@media (max-width: 900px) { .with-sidebar { grid-template-columns: 1fr; } }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.6em; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2rem; border-left: 2px solid var(--accent); color: var(--text-2); }
.byline { font: var(--font-body); color: var(--text-2); margin-bottom: 2rem; }
.sidebar > section { background: var(--parchment); border-top: 3px solid var(--accent); padding: 1.25rem 1.4rem; }
.sidebar > * + * { margin-top: 2rem; }

/* ---- Stats ------------------------------------------------------------ */

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 3rem; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
figure.chart { margin: 0; min-width: 0; background: var(--parchment); border: 1px solid var(--parchment-rule); border-radius: 4px; padding: 1rem 1.1rem 0.9rem; }
figure.chart h2 { margin-bottom: 0.2rem; }
figure.chart table.data th { background: #E9E6E0; }
figure.chart .sub { font: var(--font-body); color: var(--text-2); margin: 0 0 1rem; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .mark { fill: var(--accent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis-label { font: var(--font-label); fill: var(--text-2); }
.chart .value-label { font: var(--font-label); fill: var(--text); }
.chart .hit { fill: transparent; }
.chart g.datum:hover .mark { opacity: 0.8; }
.chart .avg-marker { fill: var(--bg); stroke: var(--ink); stroke-width: 2; }
.badge { display: inline-block; vertical-align: middle; margin-left: 0.4rem; padding: 0.1rem 0.45rem; border: 1px solid var(--rule); border-radius: 2px; font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.compare { font: var(--font-body); color: var(--text-2); margin: 0.6rem 0 0; }
.compare strong { color: var(--text); font-weight: 600; }
.chart .empty { font: var(--font-body); fill: var(--text-2); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; margin-top: 0.6rem; font: var(--font-body); }
table.data th, table.data td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--rule); }
table.data th { font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); background: var(--parchment); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Church directory ------------------------------------------------- */

.stat-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: #3A3733; border-radius: 6px; overflow: hidden; margin: 1.5rem 0 1rem; }
.stat { background: #121110; color: #FFFFFF; padding: 1.4rem 1.25rem; text-align: center; }
.stat .num { display: block; font: var(--font-title); color: #FFFFFF; margin-bottom: 0.45rem; font-variant-numeric: lining-nums; }
.stat .label { display: block; font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: #DCD7CF; }
.stat-note { font: var(--font-body); color: var(--text-2); margin: 0 0 1rem; }

.jump ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font: var(--font-body); }
.church-group { scroll-margin-top: 1rem; }
.church-group .group-bishops { font: var(--font-body); color: var(--text-2); background: var(--parchment); border-left: 3px solid var(--accent); padding: 0.6rem 0.9rem; margin: 0 0 0.75rem; }

/* Churches by diocese: one table per diocese, the same fixed columns in all
   of them so everything lines up down the page. No rules; alignment only. */
.church-table { width: 100%; table-layout: fixed; border-collapse: collapse; font: var(--font-body); margin-bottom: 0.5rem; }
.church-table .c-name { width: 27%; }
.church-table .c-clergy { width: 25%; }
.church-table .c-place { width: 15%; }
.church-table .c-email { width: 22%; }
.church-table .c-acna { width: 11%; }
.church-table th, .church-table td { text-align: left; vertical-align: top; padding: 0.4rem 1rem 0.4rem 0; overflow-wrap: anywhere; }
.church-table thead th { font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); padding-bottom: 0.5rem; }
.church-table tbody th.church-name { font: 500 1.05rem/1.35 var(--serif); position: relative; padding-left: 26px; }
/* The icon hangs in its own slot, so every name starts at the same place. */
.church-table .church-name .fav { position: absolute; left: 0; top: calc(0.4rem + (1.05rem * 1.35 - 16px) / 2); margin: 0; }
.church-table thead th:first-child { padding-left: 26px; }
.church-table .church-email { overflow-wrap: normal; }
.church-table .church-name a { text-decoration: none; }
.church-table .church-name a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.church-table .church-place, .church-table .church-email a, .church-table .acna { color: var(--text-2); }
.church-table .church-acna { white-space: nowrap; }
@media (max-width: 720px) {
  /* Too narrow for five columns: each church becomes a short block. */
  .church-table, .church-table tbody, .church-table tr, .church-table th, .church-table td { display: block; width: auto; }
  .church-table thead, .church-table colgroup { display: none; }
  .church-table tr { padding: 0.55rem 0; }
  .church-table th, .church-table td { padding: 0.05rem 0; }
  .church-table tbody th.church-name { padding-left: 26px; }
  .church-table .church-name .fav { top: calc(0.05rem + (1.05rem * 1.35 - 16px) / 2); }
  .church-table td:empty { display: none; }
}
.role { font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--copper-text); }
.sep { color: var(--rule); padding: 0 0.25rem; }
.archbishop { margin: 0 0 1.5rem; padding: 1rem 1.25rem; background: var(--parchment); }
.archbishop .eyebrow { margin: 0; }
.status-note { margin: -1.5rem 0 1.5rem; padding: 0.6rem 0.9rem; border-left: 3px solid var(--accent); background: var(--parchment); font: var(--font-body); }
.updates { list-style: none; margin: 0; padding: 0; font: var(--font-body); }
.updates li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0 1rem; padding: 0.45rem 0; border-top: 1px solid var(--parchment-rule); }
.updates li:first-child { border-top: 0; }
.updates time { font: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--copper-text); padding-top: 0.2rem; }
@media (max-width: 560px) { .updates li { grid-template-columns: 1fr; } }
.updates.events li { grid-template-columns: 9.5rem minmax(0, 1fr); }
.events-month { margin-top: 2.5rem; }
.updates-box { margin: -0.75rem 0 1.5rem; padding: 0.9rem 1.25rem 1rem; background: var(--parchment); border-left: 3px solid var(--accent); }
.province-offices { list-style: none; margin: 0 0 1.75rem; padding: 0; font: var(--font-body); }
.province-offices a, .status-note a { color: var(--text-2); }

/* ---- Notices ---------------------------------------------------------- */

.notice { background: var(--parchment); border: 1px solid var(--parchment-rule); border-left: 3px solid var(--accent); padding: 1rem 1.25rem; font: var(--font-body); }
.notice strong { font-weight: 600; }

/* ---- Footer ----------------------------------------------------------- */

.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 2.5rem 0; font: var(--font-body); border-top: 1px solid var(--footer-accent); }
.site-footer a { color: var(--footer-text); text-decoration-color: var(--footer-accent); }
.site-footer :focus-visible { outline-color: var(--footer-accent); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; }
.site-footer .footer-logo { width: 150px; height: auto; flex: none; }
.site-footer .footer-text { flex: 1 1 16rem; color: var(--footer-text-2); }
.site-footer .footer-text p { margin: 0; }
/* The copyright is centred on the page: the text area is padded on the right
   by the logo's width and the gap, so it sits as far from the right edge as
   from the left. When the two stack, both are centred. */
.site-footer .footer-text { text-align: center; padding-right: calc(150px + 2.5rem); }
@media (max-width: 700px) {
  .site-footer .wrap { justify-content: center; }
  .site-footer .footer-text { padding-right: 0; }
}
.site-footer .copyright { margin: 1.75rem 0 0; padding: 1.25rem var(--gutter) 0; border-top: 1px solid rgba(244, 241, 236, 0.14); text-align: center; color: var(--footer-text-2); }

/* ---- Admin ------------------------------------------------------------ */

.admin table.data td { vertical-align: top; }
.admin code { font: 400 13px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--rule); padding: 0.05rem 0.3rem; }

/* The Collect for Today: at the head of the first column, above The ACNA, set as
   the Prayer Book sets it. */
.collect { margin: 0 0 1.5rem; padding: 1.25rem 1.5rem; }
.collect .eyebrow { margin: 0.9rem 0 0.2rem; }
.collect-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; line-height: 1.3; margin: 0.9rem 0 0.35rem; }
.collect > .collect-title:first-child { margin-top: 0; }
.collect-text { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.5; margin: 0 0 0.6rem; }
.collect-opening { font-variant: small-caps; letter-spacing: 0.03em; }
.collect-also summary { font: var(--font-label); color: var(--text-2); cursor: pointer; margin: 0.4rem 0; }
.collect-source { font: var(--font-label); color: var(--text-2); margin: 0; }

/* The front page's heading boxes in the day's liturgical colour (from
   src/site/collect.rs). Black is the boxes' own colour, kept for Good Friday
   and Easter Even. On a white day the box is ivory with dark type and a gold
   edge, since white type cannot sit on white. */
[data-colour="violet"] .column-title { background: #4E2A6E; }
[data-colour="red"] .column-title { background: #9E1B22; }
[data-colour="green"] .column-title { background: #2E5E3A; }
[data-colour="white"] .column-title { background: #FBF8EF; color: #121110; box-shadow: inset 0 0 0 2px #B8963E; }
/* Under the collect: the season (or feast) and its colour, with a swatch. */
.collect-colour { display: flex; align-items: center; gap: 0.45rem; font: var(--font-label); color: var(--text-2); margin: 0.35rem 0 0; }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; background: #121110; }
.swatch-violet { background: #4E2A6E; }
.swatch-red { background: #9E1B22; }
.swatch-green { background: #2E5E3A; }
.swatch-white { background: #FBF8EF; box-shadow: inset 0 0 0 1.5px #B8963E; }
/* The Passage of the Month: at the head of the third column, beside the
   picture, set like the Collect for Today. */
.passage { margin: 0 0 1.5rem; padding: 1.25rem 1.5rem; }
.passage .collect-title { margin-top: 0; }
.passage-text { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.5; margin: 0 0 0.6rem; }
.passage-text sup { font: var(--font-label); color: var(--text-2); margin-right: 0.15rem; }
.passage .eyebrow { margin: 0.9rem 0 0.2rem; }
/* The collect's and the passage's panels have no heavy rule across the top:
   just the panel's own thin border. */
.col-top > .panel { border-top: 1px solid var(--parchment-rule); }
