/* ==========================================================================
   St. Theresa — design system
   Brand tokens: Navy #090945 · Gold #FFC30B · Red #B40010 · Ink #333 · Mist #EEE
   Type: Playfair Display (headlines) · Barlow (labels + body)
   Light grounds, two–three colors per layout, WCAG 2.1 AA.
   ========================================================================== */

:root {
  --navy: #090945;
  --navy-90: #1a1a5c;
  --gold: #ffc30b;
  --gold-soft: #fff3cf;
  --red: #b40010;
  --ink: #333333;
  --mist: #eeeeee;
  --paper: #ffffff;
  --paper-2: #f7f7fb;
  --line: #e2e2ec;
  --muted: #5b5b68;

  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 1.9375rem;
  --step-4: 2.5rem;
  --step-5: 3.25rem;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgba(9, 9, 69, 0.06), 0 2px 8px rgba(9, 9, 69, 0.06);
  --shadow-2: 0 6px 24px rgba(9, 9, 69, 0.12);
  --container: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.15; margin: 0 0 var(--sp-4); font-weight: 700; }
h1 { font-size: var(--step-4); letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { margin: 0 0 var(--sp-4); max-width: 68ch; }
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--red); }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.25rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-6) 0; }

/* Accessibility --------------------------------------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--navy); color: #fff; padding: var(--sp-3) var(--sp-4); border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.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;
}

/* Layout ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--sp-5); }
.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-7); }
.section--mist { background: var(--paper-2); }
.stack > * + * { margin-top: var(--sp-4); }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 60ch; }
.eyebrow { font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8125rem; color: var(--red); margin: 0 0 var(--sp-2); }
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-body); font-weight: 600; font-size: var(--step-0);
  padding: 0.7rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform 0.15s var(--ease), background 0.15s, color 0.15s, border-color 0.15s;
  min-height: 44px; line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-90); color: #fff; }
.btn-cta { background: var(--gold); color: var(--navy); }
.btn-cta:hover { background: #ffce3d; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.9rem; min-height: 38px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Cards ----------------------------------------------------------------- */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--sp-5); box-shadow: var(--shadow-1); transition: box-shadow 0.2s, transform 0.2s var(--ease);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
a.card, .card--link { text-decoration: none; color: inherit; }
a.card:hover, .card--link:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card .tag-row { margin-top: auto; }

.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--gold-soft); color: var(--navy); border: 1px solid #f0dfa0; }
.tag--muted { background: var(--mist); border-color: var(--line); color: var(--muted); }

/* Utility bar ----------------------------------------------------------- */
.utilitybar { background: var(--navy); color: #fff; font-size: 0.9rem; }
.utilitybar .container { display: flex; align-items: center; gap: var(--sp-4); min-height: 42px; flex-wrap: wrap; }
.utilitybar a { color: #e9e9f5; text-decoration: none; font-weight: 500; }
.utilitybar a:hover { color: #fff; text-decoration: underline; }
.utilitybar .util-give { margin-left: auto; background: var(--gold); color: var(--navy); padding: 0.3rem 0.9rem; border-radius: 999px; font-weight: 700; }
.utilitybar .util-give:hover { text-decoration: none; background: #ffce3d; }
@media (max-width: 620px) { .utilitybar { display: none; } }

/* Header + nav ---------------------------------------------------------- */
.masthead { position: sticky; top: 0; z-index: 60; background: rgba(255,255,255,0.96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.masthead .container { display: flex; align-items: center; gap: var(--sp-4); min-height: 68px; }
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; }
.brand__mark { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; flex: none; }
.brand__name { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name b { font-family: var(--font-head); color: var(--navy); font-size: 1.2rem; font-weight: 700; }
.brand__name span { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.nav { margin-left: auto; }
.nav__list { list-style: none; display: flex; gap: var(--sp-2); margin: 0; padding: 0; align-items: center; }
.nav__list > li { position: relative; }
.nav__link { display: inline-block; padding: 0.6rem 0.75rem; text-decoration: none; color: var(--navy); font-weight: 600; border-radius: 8px; }
.nav__link[aria-current="true"] { color: var(--red); }
.nav__list > li:hover .nav__link, .nav__link:focus-visible { background: var(--paper-2); }
.submenu {
  position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: var(--sp-2); margin: 0; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.15s, transform 0.15s var(--ease), visibility 0.15s;
}
.nav__list > li:hover .submenu, .nav__list > li:focus-within .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a { display: block; padding: 0.5rem 0.7rem; text-decoration: none; color: var(--ink); border-radius: 6px; font-weight: 500; }
.submenu a:hover { background: var(--paper-2); color: var(--navy); }

.nav__ask { margin-left: var(--sp-2); }
.nav-toggle { display: none; }

/* Mobile nav */
@media (max-width: 940px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 20px; height: 2px; background: var(--navy); position: relative; transition: 0.2s;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(88vw, 360px); background: #fff; margin: 0;
    transform: translateX(100%); transition: transform 0.25s var(--ease); box-shadow: var(--shadow-2);
    padding: var(--sp-6) var(--sp-4); overflow-y: auto; z-index: 70;
  }
  .nav[data-open="true"] { transform: translateX(0); }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list > li { border-bottom: 1px solid var(--line); }
  .nav__link { padding: 0.85rem 0.5rem; display: block; }
  .submenu {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0;
    padding: 0 0 var(--sp-3) var(--sp-4); min-width: 0;
  }
  .nav__ask { margin: var(--sp-4) 0 0; width: 100%; justify-content: center; }
  body[data-navopen="true"] { overflow: hidden; }
  .nav-scrim { position: fixed; inset: 0; background: rgba(9,9,69,0.35); z-index: 65; }
}

/* Schedule rail --------------------------------------------------------- */
.rail { background: var(--gold-soft); border-bottom: 1px solid #f0dfa0; }
.rail .container { display: flex; align-items: center; gap: var(--sp-4); min-height: 46px; flex-wrap: wrap; }
.rail__label { flex-shrink: 0; font-weight: 700; color: var(--navy); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: var(--sp-2); }
.rail__live { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(180,0,16,0.5); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180,0,16,0.5); } 70% { box-shadow: 0 0 0 8px rgba(180,0,16,0); } 100% { box-shadow: 0 0 0 0 rgba(180,0,16,0); } }
.rail__items { display: flex; flex: 1 1 auto; min-width: 0; gap: var(--sp-2) var(--sp-5); flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.rail__items li { color: var(--ink); min-width: 0; max-width: 100%; overflow-wrap: break-word; }
.rail__items b { color: var(--navy); }
.rail__more { flex-shrink: 0; margin-left: auto; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

/* Illuminated masthead (homepage hero, Option 1c) ------------------------ */
.illuminated {
  --parchment: #f6f1e4;
  --parchment-line: #ddd3ba;
  --parchment-gold-ink: #9a7a0f;
  --parchment-red-ink: #7a1520;
  background: var(--parchment);
  border-bottom: 3px double var(--navy);
}
.illuminated .container { padding-block: 3rem 1.25rem; }
.illuminated__kicker {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem var(--sp-4);
  color: var(--parchment-gold-ink); font-size: 0.78rem; letter-spacing: 0.3em; text-transform: uppercase;
  margin-bottom: var(--sp-2); text-align: center;
}
.illuminated__kicker .sep { color: var(--gold); }
.illuminated__title {
  font-family: var(--font-head); color: var(--navy); font-weight: 800; text-align: center;
  font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.05; margin: 0;
}
.illuminated__tagline {
  font-family: "Cormorant Garamond", var(--font-head); font-style: italic; color: var(--parchment-red-ink);
  font-size: 1.25rem; text-align: center; margin: var(--sp-2) auto 0; max-width: 46ch;
}

.stained-glass-band {
  height: 8px;
  background: linear-gradient(90deg, var(--red) 0 20%, var(--gold) 20% 40%, var(--navy) 40% 60%, #1b7a4b 60% 80%, #6a3fa0 80% 100%);
}

.illuminated-hero { background: var(--parchment); padding-block: var(--sp-7); }
.illuminated-hero .grid-lead-rail { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-6); align-items: start; }
@media (max-width: 860px) { .illuminated-hero .grid-lead-rail { grid-template-columns: 1fr; } }
.illuminated-hero__photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--parchment-line); margin-bottom: var(--sp-4); aspect-ratio: 16/10.5; }
.illuminated-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.illuminated-hero h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.14; text-wrap: balance; margin: 0 0 var(--sp-3);
}
.illuminated-dropcap {
  font-family: "Cormorant Garamond", var(--font-head); font-size: 1.2rem; line-height: 1.55; color: #33302a; margin: 0;
}
.illuminated-dropcap::first-letter {
  float: left; font-family: var(--font-head); font-weight: 800; font-size: 3.6rem; line-height: 0.78;
  color: var(--red); padding: 0.3rem 0.6rem 0 0;
}
.illuminated-hero__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }

.illuminated-rail { display: flex; flex-direction: column; gap: var(--sp-4); }
.illuminated-ask { background: var(--navy); border-radius: var(--radius); padding: var(--sp-5); }
.illuminated-ask__label { font-family: var(--font-head); color: var(--gold); font-size: 1.15rem; margin: 0 0 0.2rem; }
.illuminated-ask__sub { color: #c8c6df; font-size: 0.82rem; margin: 0 0 var(--sp-3); line-height: 1.5; }
.illuminated-ask form { display: flex; flex-direction: column; gap: var(--sp-2); }
.illuminated-ask input {
  width: 100%; font-family: var(--font-body); font-size: 0.95rem; border: none; border-radius: 5px;
  padding: 0.8rem 0.9rem; color: var(--navy); outline: none; min-height: 44px;
}
.illuminated-ask button { border: none; }

.illuminated-thisweek { background: var(--parchment); padding-bottom: var(--sp-7); }
.illuminated-thisweek__head {
  border-top: 3px double var(--navy); padding-top: var(--sp-2); margin-bottom: var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-3);
}
.illuminated-thisweek__head h2 { font-size: 1.4rem; margin: 0; }
.illuminated-thisweek__rule { flex: 1; height: 1px; background: var(--parchment-line); }
.illuminated-thisweek__label { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--parchment-gold-ink); font-weight: 700; white-space: nowrap; }
.illuminated-thisweek__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
@media (max-width: 760px) { .illuminated-thisweek__grid { grid-template-columns: 1fr; } }
.illuminated-thisweek__item { border-left: 3px solid var(--gold); padding-left: var(--sp-4); }
.illuminated-thisweek__item--red { border-left-color: var(--red); }
.illuminated-thisweek__item--navy { border-left-color: var(--navy); }
.illuminated-thisweek__item h3 { font-size: 1.15rem; margin: 0 0 var(--sp-2); }
.illuminated-thisweek__item p { font-family: "Cormorant Garamond", var(--font-body); font-size: 1.05rem; line-height: 1.5; color: #4a4636; margin: 0; }

/* Hero + question box --------------------------------------------------- */
.hero { background: linear-gradient(180deg, #fff 0%, var(--paper-2) 100%); border-bottom: 1px solid var(--line); }
.hero .container { padding-block: var(--sp-8); }
.hero h1 { font-size: var(--step-5); max-width: 16ch; }
@media (max-width: 640px) { .hero h1 { font-size: var(--step-4); } }
.askbox { display: flex; gap: var(--sp-2); max-width: 620px; margin-top: var(--sp-5); }
.askbox input {
  flex: 1; font-family: var(--font-body); font-size: var(--step-0); padding: 0.85rem 1.1rem;
  border: 2px solid var(--navy); border-radius: 999px; background: #fff; min-height: 52px;
}
.askbox input:focus-visible { outline-offset: 3px; }
.hero__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }

/* Quick tiles ----------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .tiles { grid-template-columns: 1fr; } }
.tile { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-5); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: var(--navy); box-shadow: var(--shadow-1); transition: transform 0.18s var(--ease), box-shadow 0.18s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); color: var(--navy); }
.tile b { font-family: var(--font-head); font-size: var(--step-1); }
.tile span { color: var(--muted); font-size: 0.95rem; }

/* Photo components ------------------------------------------------------ */
.hero-photo { position: relative; isolation: isolate; background: var(--navy); }
.hero-photo img.hero-photo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,9,69,0.55) 0%, rgba(9,9,69,0.78) 100%); z-index: -1; }
.hero-photo .container { padding-block: var(--sp-8); }
.hero-photo h1, .hero-photo .lede { color: #fff; }
.hero-photo .lede { color: #e7e7f5; }
.hero-photo .eyebrow { color: var(--gold); }
.hero-photo .breadcrumb, .hero-photo .breadcrumb a { color: #c9c9e0; }

.photo-card { padding: 0; overflow: hidden; }
.photo-card .photo-card__img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; display: block; }
.photo-card .photo-card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.photo-card .photo-card__body h3 { margin: 0; }
.photo-card .photo-card__body p { margin: 0; color: var(--muted); }

.media-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-6); align-items: center; }
.media-split img { border-radius: var(--radius-lg); box-shadow: var(--shadow-2); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.media-split--flip { grid-template-columns: 0.9fr 1.1fr; }
.media-split--flip img { order: -1; }
@media (max-width: 760px) { .media-split, .media-split--flip { grid-template-columns: 1fr; } .media-split--flip img { order: 0; } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-4); }
.stat { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); text-align: center; }
.stat b { display: block; font-family: var(--font-head); font-size: var(--step-3); color: var(--navy); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.9rem; }

figure { margin: 0; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: var(--sp-2); }

/* Ministry stats: stacked bar + sort/range controls (progressive: default view
   is server-rendered; range filtering, re-sorting, and the mention popups are
   powered by assets/js/ministry-stats.js) --------------------------------- */
.metric-toggle { position: relative; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; }
.metric-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.metric-toggle label { font-size: 0.9rem; font-weight: 600; padding: 0.45rem 1rem; border-radius: 999px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.metric-toggle input:checked + label { background: var(--navy); color: #fff; }
.metric-toggle input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 1px; }
.sort-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.sort-controls .field-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-right: 0.4rem; }

.chart-legend { display: flex; gap: 1.25rem; align-items: center; margin: 1rem 0 1.25rem; font-size: 0.88rem; color: var(--ink); }
.chart-legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 0.4rem; vertical-align: -1px; }
.chart-legend .swatch--events { background: var(--navy); }
.chart-legend .swatch--other { background: var(--gold); }

.stack-bar { display: flex; align-items: stretch; height: 16px; min-width: 3px; }
.stack-bar .seg { height: 100%; min-width: 0; }
.stack-bar .seg--events { background: var(--navy); border-radius: 0 0 0 0; margin-right: 2px; }
.stack-bar .seg--events:last-child { border-radius: 0 4px 4px 0; margin-right: 0; }
.stack-bar .seg--other { background: var(--gold); border-radius: 0 4px 4px 0; }
.stack-bar .seg--other:only-child { border-radius: 0 4px 4px 0; }

.ministry-stat-row { display: grid; grid-template-columns: minmax(190px,230px) 1fr auto; gap: 0.75rem; align-items: center; }
.ministry-stat-row__figs { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.ministry-stat-row__nums { white-space: nowrap; }
.ms-view-btn { background: none; border: none; padding: 0.3rem 0; font: inherit; font-weight: 600; font-size: 0.82rem; color: var(--navy); cursor: pointer; }
.ms-view-btn:hover, .ms-view-btn:focus-visible { text-decoration: underline; color: var(--gold); }
.issue-stat-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 0.75rem; align-items: center; font-size: 0.9rem; }
@media (max-width: 640px) {
  .ministry-stat-row { grid-template-columns: 1fr; gap: 0.35rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .ministry-stat-row__figs { white-space: normal; font-size: 0.88rem; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 0.75rem; }
  .issue-stat-row { grid-template-columns: 90px 1fr auto; font-size: 0.82rem; gap: 0.5rem; }
}

/* Times page ------------------------------------------------------------ */
.times-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
@media (max-width: 640px) { .times-grid { grid-template-columns: 1fr; } }
.times-card { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.times-card > header { background: var(--navy); color: #fff; padding: var(--sp-3) var(--sp-5); font-family: var(--font-head); font-size: var(--step-1); }
.times-card ul { list-style: none; margin: 0; padding: 0; }
.times-card li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--sp-2) var(--sp-4); padding: 0.7rem var(--sp-5); border-top: 1px solid var(--line); }
.times-card li:first-child { border-top: 0; }
.times-card .t-day { color: var(--muted); flex: 1 1 auto; min-width: 0; }
.times-card .t-time { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }

/* Directory ------------------------------------------------------------- */
.filters { display: grid; gap: var(--sp-4); background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); }
.filters__search input { width: 100%; padding: 0.75rem 1rem; border: 2px solid var(--line); border-radius: 999px; font-size: var(--step-0); font-family: var(--font-body); min-height: 48px; }
.filters__search input:focus-visible { border-color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { font: inherit; font-size: 0.9rem; font-weight: 600; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip:hover { border-color: var(--navy); }
.filter-legend { font-weight: 700; color: var(--navy); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--sp-2); display: block; }
.directory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-top: var(--sp-6); }
@media (max-width: 860px) { .directory-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .directory-grid { grid-template-columns: 1fr; } }
.ministry[hidden] { display: none; }
.ministry:target { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: var(--radius-lg); }
.result-count { color: var(--muted); font-weight: 600; margin-top: var(--sp-5); }
.empty-state { text-align: center; padding: var(--sp-7); color: var(--muted); background: var(--paper-2); border: 1px dashed var(--line); border-radius: var(--radius-lg); }

/* Staff ----------------------------------------------------------------- */
.staff-dept { margin-top: var(--sp-6); }
.staff-dept h3 { border-bottom: 2px solid var(--gold); padding-bottom: var(--sp-2); display: inline-block; }
.staff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 860px) { .staff-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .staff-grid { grid-template-columns: 1fr; } }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); background: #fff; }
.person__img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: var(--sp-3); border: 3px solid var(--gold-soft); }
.person b { color: var(--navy); font-size: var(--step-1); font-family: var(--font-head); }
.person .role { color: var(--muted); }
.person a { font-weight: 600; }
.person .hiring { color: var(--red); font-weight: 700; }

/* Breadcrumb + prose ---------------------------------------------------- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: var(--sp-3); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; }
.pagehead { padding-block: var(--sp-7) var(--sp-5); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--sp-6); }
.prose ul li, .prose ol li { margin-bottom: var(--sp-2); }

/* Callouts -------------------------------------------------------------- */
.callout { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: var(--sp-4) var(--sp-5); border-radius: 0 var(--radius) var(--radius) 0; }
.callout--info { border-color: var(--navy); background: var(--paper-2); }
.callout--alert { border-color: var(--red); background: #fbeaec; }
.needs-content { border: 1px dashed var(--red); background: #fbeaec; color: #7c000b; padding: var(--sp-4) var(--sp-5); border-radius: var(--radius); font-size: 0.95rem; }
.disclaimer { font-size: 0.85rem; color: var(--muted); font-style: italic; }

/* Footer ---------------------------------------------------------------- */
.footer { background: var(--navy); color: #d7d7ea; margin-top: var(--sp-8); }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { text-decoration: underline; color: var(--gold); }
.footer .container { padding-block: var(--sp-7); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-6); }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--sp-3); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: var(--sp-2); line-height: 1.35; }
.footer li b { white-space: nowrap; }
.footer__brand b { font-family: var(--font-head); color: #fff; font-size: var(--step-2); }
.footer__legal { border-top: 1px solid rgba(255,255,255,0.15); margin-top: var(--sp-6); padding-top: var(--sp-4); font-size: 0.82rem; display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }

/* Assistant panel ------------------------------------------------------- */
.assistant-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 60px; height: 60px; border-radius: 50%;
  background: var(--navy); color: var(--gold); border: none; cursor: pointer; box-shadow: var(--shadow-2);
  display: grid; place-items: center; transition: transform 0.15s var(--ease);
}
.assistant-fab:hover { transform: scale(1.06); }
.assistant-fab svg { width: 28px; height: 28px; }
.assistant-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; width: min(400px, calc(100vw - 24px));
  height: min(600px, calc(100vh - 40px)); background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
  display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--line);
}
.assistant-panel[data-open="true"] { display: flex; }
.assistant-panel__head { background: var(--navy); color: #fff; padding: var(--sp-4) var(--sp-5); display: flex; align-items: center; gap: var(--sp-3); }
.assistant-panel__head b { font-family: var(--font-head); font-size: var(--step-1); }
.assistant-panel__head .close { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; width: 36px; height: 36px; border-radius: 8px; }
.assistant-panel__head .close:hover { background: rgba(255,255,255,0.15); }
.assistant-log { flex: 1; overflow-y: auto; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); background: var(--paper-2); }
.msg { padding: 0.7rem 0.95rem; border-radius: 14px; max-width: 85%; line-height: 1.45; font-size: 0.98rem; }
.msg--user { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg--bot { background: #fff; color: var(--ink); align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg--bot.msg--crisis { border-color: var(--red); background: #fbeaec; }
.msg__sources { margin-top: var(--sp-2); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.msg__sources a { background: var(--gold-soft); border: 1px solid #f0dfa0; padding: 0.15rem 0.5rem; border-radius: 999px; text-decoration: none; color: var(--navy); }
.assistant-form { display: flex; gap: var(--sp-2); padding: var(--sp-3); border-top: 1px solid var(--line); background: #fff; }
.assistant-form input { flex: 1; padding: 0.65rem 0.9rem; border: 2px solid var(--line); border-radius: 999px; font: inherit; min-height: 44px; }
.assistant-form input:focus-visible { border-color: var(--navy); }
.assistant-form button { flex: none; }
.typing { display: inline-flex; gap: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* STTLog debug overlay -------------------------------------------------- */
.sttlog-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(9,9,69,0.55); display: none; padding: 4vh 4vw;
}
.sttlog-overlay[data-open="true"] { display: block; }
.sttlog-panel { background: #0f0f2a; color: #d7d7ea; border-radius: var(--radius-lg); max-width: 900px; margin: 0 auto; height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-2); }
.sttlog-panel header { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid rgba(255,255,255,0.15); }
.sttlog-panel header b { color: #fff; font-family: var(--font-head); }
.sttlog-panel .grow { margin-left: auto; }
.sttlog-panel pre { flex: 1; overflow: auto; margin: 0; padding: var(--sp-4); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; }
.sttlog-panel button { font: inherit; font-weight: 600; background: var(--gold); color: var(--navy); border: 0; border-radius: 8px; padding: 0.4rem 0.8rem; cursor: pointer; }
.sttlog-panel button.ghost { background: transparent; color: #d7d7ea; border: 1px solid rgba(255,255,255,0.3); }

/* Print ----------------------------------------------------------------- */
@media print {
  .masthead, .utilitybar, .rail, .footer, .assistant-fab, .assistant-panel, .sttlog-overlay { display: none !important; }
}
