/* Kyle UMC community app — one stylesheet, no framework.
   Accessibility rules this file keeps (see docs/ACCESSIBILITY.md):
   - All sizes in rem so the text-size setting and browser zoom scale everything.
   - Reading text always sits on a solid surface; decoration never sits behind text.
   - Controls are at least 3rem (48px at default size) tall and wide.
   - Focus is a two-colour ring that shows on light and dark backgrounds.
   - No motion when the visitor asks for reduced motion. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.e8da57bc0c3d.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.617b4197a93a.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-italic.9b70e98b04c2.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --c-bg: #eef3f9;
  --c-surface: #ffffff;
  --c-surface-2: #f5f8fc;
  --c-text: #10213a;
  --c-text-muted: #3a4d66;
  --c-heading: #0c2547;
  --c-primary: #1a4f8b;
  --c-primary-hover: #113a69;
  --c-on-primary: #ffffff;
  --c-primary-soft: #dde9f7;
  --c-link: #1a4f8b;
  --c-link-visited: #4b3a8f;
  --c-border: #647a96;
  --c-border-soft: #c5d3e4;
  --c-header: #0d2748;
  --c-on-header: #ffffff;
  --c-focus-halo: #ffbf47;
  --c-focus-ring: #10213a;
  --c-danger: #a3231b;
  --c-danger-soft: #fcebea;
  --c-success: #1c6636;
  --c-success-soft: #e5f3e9;
  --c-warning: #6b4d00;
  --c-warning-soft: #fff4d1;
  --c-info-soft: #e4eefa;
  --c-staff: #4a2377;
  --c-on-staff: #ffffff;
  --shadow: 0 1px 2px rgb(16 33 58 / 12%), 0 2px 8px rgb(16 33 58 / 8%);

  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --tap: 3rem;
  --gap: 1rem;
  --measure: 42rem;
  --nav-height: 4.5rem;
  --nav-row: 3.25rem; /* one row of the two-row phone menu */
  /* The More tab down the right edge: 60px at the standard text size, and always a little
     wider than a 48px target; its word runs upright, so it needn't grow much with the text. */
  --nav-more: max(3rem + 8px, 60px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0a1321;
    --c-surface: #122038;
    --c-surface-2: #172a47;
    --c-text: #eef3fa;
    --c-text-muted: #c1cee0;
    --c-heading: #f5f8fd;
    --c-primary: #a8cbf5;
    --c-primary-hover: #cfe2fa;
    --c-on-primary: #0a1321;
    --c-primary-soft: #1f3a60;
    --c-link: #a8cdfa;
    --c-link-visited: #cdb8f5;
    --c-border: #8aa1bf;
    --c-border-soft: #2f4566;
    --c-header: #06101d;
    --c-focus-ring: #ffffff;
    --c-danger: #ffb4ab;
    --c-danger-soft: #3d1614;
    --c-success: #9fdcb0;
    --c-success-soft: #12301d;
    --c-warning: #ffd978;
    --c-warning-soft: #332805;
    --c-info-soft: #16304f;
    --c-staff: #d9c2fa;
    --c-on-staff: #1d0b33;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}

html[data-text-size="large"] { font-size: 118.75%; }
html[data-text-size="largest"] { font-size: 137.5%; }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
  scroll-padding-bottom: calc(var(--nav-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.1875rem; /* 19px at default size */
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { color: var(--c-heading); line-height: 1.25; margin: 1.5rem 0 0.75rem; }
h1 { font-size: 1.75rem; margin-top: 0.5rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li + li { margin-top: 0.35rem; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--c-border-soft); margin: 1.5rem 0; }
small, .small { font-size: 0.9rem; }
strong, b { font-weight: 700; }

a { color: var(--c-link); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 0.08em; }
a:visited { color: var(--c-link-visited); }
a:hover { text-decoration-thickness: 0.16em; }

:focus-visible {
  outline: 3px solid var(--c-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--c-focus-halo);
}
main:focus, main:focus-visible, [tabindex="-1"]:focus:not(:focus-visible) { outline: none; box-shadow: none; }

.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: 0.5rem; top: -10rem; z-index: 100;
  background: var(--c-surface); color: var(--c-text); padding: 0.75rem 1rem;
  border: 3px solid var(--c-text); border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: 0.5rem; }

/* ---------- Header with stained-glass band ---------- */
.site-header { background: var(--c-header); color: var(--c-on-header); }
.glass-band {
  height: 0.9rem;
  background: url("../img/glass-band.afb3da22f481.svg") repeat-x left center / auto 100%;
  border-bottom: 2px solid #06101d;
}
/* The brand keeps the left; everything else packs to the right and wraps under it
   on narrow screens. */
.header-inner {
  max-width: 64rem; margin: 0 auto; padding: 0.5rem 1rem;
  display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem 1rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.75rem; min-height: var(--tap); margin-right: auto;
  color: var(--c-on-header); text-decoration: none; font-weight: 700; font-size: 1.2rem;
}
.brand:visited { color: var(--c-on-header); }
.brand img { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; }
.brand small { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.95; }
.header-link {
  color: var(--c-on-header); font-weight: 700; min-height: var(--tap);
  display: inline-flex; align-items: center; padding: 0 0.5rem;
}
.header-link:visited { color: var(--c-on-header); }
.site-header :focus-visible { outline-color: #ffffff; }

/* ---------- Text size control (header) ----------
   Three buttons: the letter A, small to big. Sized in px, not rem, so the control
   stays the same size at every text size. It needs JavaScript, so it only shows
   when the <head> script has marked the page with .js. The "Text size" words hide
   (still read out) when showing them would make the header wrap onto another row
   (app.js adds .is-compact). The chosen size follows html[data-text-size], so it
   is right before app.js runs; aria-pressed tells assistive technology. */
.text-size-control { display: none; }
.js .text-size-control {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.25rem 0.6rem;
}
.ts-label { font-weight: 700; font-size: 1rem; white-space: nowrap; color: var(--c-on-header); }
.text-size-control.is-compact .ts-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ts-buttons { display: flex; flex: none; border: 2px solid var(--c-on-header); border-radius: 10px; }
.ts-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin: 0; padding: 0 0 3px;
  font-family: var(--font); font-weight: 700; line-height: 1; cursor: pointer;
  color: var(--c-on-header); background: transparent;
  border: 0; border-left: 1px solid rgb(255 255 255 / 55%); border-radius: 0;
}
.ts-button:first-child { border-left: 0; border-radius: 8px 0 0 8px; }
.ts-button:last-child { border-radius: 0 8px 8px 0; }
.ts-button[data-text-size-button="standard"] { font-size: 16px; }
.ts-button[data-text-size-button="large"] { font-size: 21px; }
.ts-button[data-text-size-button="largest"] { font-size: 27px; }
.ts-button:hover { background: rgb(255 255 255 / 16%); }
.ts-button:focus-visible { z-index: 1; }
/* Selected: filled, plus a bar under the letter (not colour alone). */
html[data-text-size="standard"] .ts-button[data-text-size-button="standard"],
html[data-text-size="large"] .ts-button[data-text-size-button="large"],
html[data-text-size="largest"] .ts-button[data-text-size-button="largest"] {
  background: var(--c-on-header); color: var(--c-header);
}
html[data-text-size="standard"] .ts-button[data-text-size-button="standard"]::after,
html[data-text-size="large"] .ts-button[data-text-size-button="large"]::after,
html[data-text-size="largest"] .ts-button[data-text-size-button="largest"]::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 4px;
  border-radius: 2px; background: currentColor;
}

/* ---------- Main navigation ----------
   Six places, separated by hairlines. Home is one big button down the left
   edge; More is a narrow tab down the right edge with its word set upright.
   Between them: Talk, Events, Wiki, Newsletter — two rows of two on phones,
   one row on wide screens. Those four are placed by the grid itself, in the
   order they appear in the HTML, around the two that are placed by hand. */
.main-nav { background: var(--c-surface); border-bottom: 1px solid var(--c-border-soft); }
.main-nav ul {
  list-style: none; margin: 0 auto; padding: 0; max-width: 64rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) var(--nav-more);
  gap: 1px; background: var(--c-border-soft); /* shows through the gaps as the lines */
}
.main-nav li { margin: 0; display: flex; }
.main-nav .nav-home { grid-column: 1; grid-row: 1 / span 2; }
.main-nav .nav-more { grid-column: 4; grid-row: 1 / span 2; }
/* The current page is outlined and filled (an outline, not just a colour). */
.main-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.1rem; min-height: var(--nav-row); padding: 0 0.15rem; /* no vertical padding: the rows stay 52px */
  color: var(--c-text); background: var(--c-surface); text-decoration: none;
  font-size: 0.95rem; font-weight: 700; line-height: 1.2; text-align: center;
  border: 2px solid transparent;
}
.main-nav a:visited { color: var(--c-text); }
.main-nav a svg { width: 1.5rem; height: 1.5rem; }
.main-nav a:hover { background: var(--c-surface-2); }
.main-nav a[aria-current="page"] { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-soft); }
.main-nav .nav-home a { gap: 0.3rem; font-size: 1.05rem; }
.main-nav .nav-home a svg { width: 2.1rem; height: 2.1rem; }
.main-nav .nav-more a { gap: 0.25rem; padding: 0.35rem 0; }
.main-nav .nav-more a span { writing-mode: vertical-rl; }
@media (min-width: 48em) {
  .main-nav ul { grid-template-columns: minmax(0, 1.2fr) repeat(4, minmax(0, 1fr)) var(--nav-more); }
  .main-nav .nav-home { grid-column: 1; grid-row: 1; }
  .main-nav .nav-more { grid-column: 6; grid-row: 1; }
  .main-nav a { min-height: var(--nav-height); gap: 0.15rem; padding: 0.3rem 0.15rem; }
  .main-nav a svg { width: 1.6rem; height: 1.6rem; }
  .main-nav .nav-home a svg { width: 2.2rem; height: 2.2rem; }
  /* One row is too short for an icon above the upright word. */
  .main-nav .nav-more a svg { display: none; }
}

/* On phones with room to spare, the menu sits at the bottom like an app, and
   app.js slides it away while the reader scrolls down (.is-hidden) and brings it
   back on the way up. With large text or zoom (short viewport in CSS pixels) it
   stays in the page flow at the top, so it never covers content. */
@media (max-width: 47.99em) and (min-height: 34em) {
  html[data-text-size="standard"] {
    scroll-padding-bottom: calc(2 * var(--nav-row) + env(safe-area-inset-bottom) + 1rem);
  }
  html[data-text-size="standard"] .main-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    border-top: 1px solid var(--c-border); border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 8px rgb(16 33 58 / 12%);
    transition: transform 200ms ease-out;
  }
  html[data-text-size="standard"] .main-nav.is-hidden { transform: translateY(calc(100% + 12px)); transition-timing-function: ease-in; }
  html[data-text-size="standard"] .main-nav.no-motion { transition: none; }
  html[data-text-size="standard"] body { padding-bottom: calc(2 * var(--nav-row) + 2px + env(safe-area-inset-bottom)); }
}
@media (max-width: 22em) {
  /* Narrow phones: the four middle words need every pixel, so Home gives some back. */
  .main-nav ul { grid-template-columns: minmax(0, 0.9fr) repeat(2, minmax(0, 1fr)) var(--nav-more); }
  .main-nav a { font-size: 0.8rem; }
  .main-nav .nav-home a { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .main-nav { transition: none !important; }
}

/* ---------- Layout ---------- */
main { display: block; max-width: 64rem; margin: 0 auto; padding: 1rem 1rem 2.5rem; }
.narrow { max-width: var(--measure); }
.stack > * + * { margin-top: var(--gap); }
.cluster { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.page-header { margin-bottom: 1.25rem; }
.page-header p { color: var(--c-text-muted); margin-bottom: 0; }
.breadcrumbs { font-size: 0.95rem; margin: 0 0 0.5rem; }
.breadcrumbs a { display: inline-block; padding: 0.6rem 0; }
.muted { color: var(--c-text-muted); }
.section { margin: 2rem 0; }
.section > h2:first-child { margin-top: 0; }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border-soft); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card h2, .card h3 { margin-top: 0; }
.card-glass { padding-top: 1.9rem; overflow: hidden; }
.card-glass::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 0.65rem;
  background: url("../img/glass-band.afb3da22f481.svg") repeat-x left center / auto 100%;
  border-bottom: 1px solid #06101d;
}
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:visited { color: inherit; }
.card-link:hover { border-color: var(--c-primary); }
.card-link .card-title { color: var(--c-link); text-decoration: underline; font-weight: 700; font-size: 1.2rem; }
.card-meta { color: var(--c-text-muted); font-size: 0.95rem; }

/* Big destination buttons on Home and Talk */
.destinations { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.destinations li { margin: 0; }
.destination {
  display: flex; align-items: center; gap: 1rem; min-height: 4.5rem; padding: 0.9rem 1rem;
  background: var(--c-surface); color: var(--c-text); text-decoration: none;
  border: 2px solid var(--c-border-soft); border-left: 0.5rem solid var(--c-primary);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.destination:visited { color: var(--c-text); }
.destination:hover { border-color: var(--c-primary); }
.destination svg { flex: none; width: 2rem; height: 2rem; color: var(--c-primary); }
.destination-text { display: flex; flex-direction: column; }
.destination-title { font-weight: 700; font-size: 1.15rem; color: var(--c-heading); }
.destination-sub { color: var(--c-text-muted); font-size: 0.95rem; }
/* The one place we most want people to go on a page (Prayer on Home, urgent
   work in Staff tools): a gold edge, not colour alone. */
.destination.highlight { border-left-color: #b8860b; border-left-width: 0.75rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap); min-width: var(--tap); padding: 0.6rem 1.25rem;
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  border: 2px solid var(--c-primary); border-radius: var(--radius-sm); cursor: pointer;
  background: var(--c-primary); color: var(--c-on-primary);
}
.btn:visited { color: var(--c-on-primary); }
.btn:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn-secondary { background: var(--c-surface); color: var(--c-primary); }
.btn-secondary:visited { color: var(--c-primary); }
.btn-secondary:hover { background: var(--c-primary-soft); color: var(--c-primary-hover); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: var(--c-surface); }
.btn-danger:visited { color: var(--c-surface); }
.btn-danger:hover { background: var(--c-text); border-color: var(--c-text); }
.btn-quiet {
  background: transparent; border-color: transparent; color: var(--c-link);
  text-decoration: underline; padding-left: 0.6rem; padding-right: 0.6rem;
}
.btn-quiet:visited { color: var(--c-link); }
.btn-quiet:hover { background: var(--c-primary-soft); border-color: transparent; color: var(--c-link); }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.65; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; align-items: center; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.25rem; }
.field > label, .field > .label, fieldset > legend {
  display: block; font-weight: 700; margin-bottom: 0.35rem; color: var(--c-heading);
}
.hint { display: block; color: var(--c-text-muted); font-size: 0.95rem; margin: -0.15rem 0 0.4rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="url"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"],
select, textarea {
  display: block; width: 100%; min-height: var(--tap); padding: 0.6rem 0.75rem;
  font: inherit; font-size: max(1rem, 16px); color: var(--c-text); background: var(--c-surface);
  border: 2px solid var(--c-border); border-radius: var(--radius-sm);
}
input[type="number"] { max-width: 10rem; }
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--c-focus-ring); }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.choice { display: flex; align-items: flex-start; gap: 0.75rem; min-height: var(--tap); padding: 0.35rem 0; }
.choice input { flex: none; width: 1.6rem; height: 1.6rem; margin: 0.2rem 0 0; accent-color: var(--c-primary); }
.choice label { font-weight: 400; padding-top: 0.1rem; }
.field-error { color: var(--c-danger); font-weight: 700; margin: 0.25rem 0 0.4rem; display: block; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--c-danger); border-width: 3px; }
.char-count { font-size: 0.9rem; color: var(--c-text-muted); text-align: right; margin-top: 0.25rem; }
.honeypot { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Alerts and states ---------- */
.alert {
  background: var(--c-info-soft); color: var(--c-text); border-left: 0.4rem solid var(--c-primary);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 0 0 1.25rem;
}
.alert > :last-child { margin-bottom: 0; }
.alert-title { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.alert-success { background: var(--c-success-soft); border-left-color: var(--c-success); }
.alert-warning { background: var(--c-warning-soft); border-left-color: var(--c-warning); }
.alert-danger, .error-summary { background: var(--c-danger-soft); border-left-color: var(--c-danger); }
.error-summary { border-left: 0.4rem solid var(--c-danger); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 0 0 1.25rem; }
.error-summary ul { margin: 0.5rem 0 0; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--c-text-muted); background: var(--c-surface); border: 2px dashed var(--c-border-soft); border-radius: var(--radius); }
.empty-state strong { display: block; color: var(--c-text); font-size: 1.15rem; margin-bottom: 0.25rem; }
.loading { display: inline-flex; align-items: center; gap: 0.5rem; }
.loading::before {
  content: ""; width: 1.1em; height: 1.1em; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.offline-banner {
  position: sticky; top: 0; z-index: 60; background: var(--c-warning-soft); color: var(--c-text);
  border-bottom: 3px solid var(--c-warning); padding: 0.75rem 1rem; font-weight: 700; text-align: center;
}
.offline-banner[hidden] { display: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.55rem;
  border-radius: 999px; font-size: 0.85rem; font-weight: 700; line-height: 1.5;
  border: 2px solid currentColor; vertical-align: middle; white-space: nowrap;
}
.badge svg { width: 1em; height: 1em; }
.badge-staff { background: var(--c-staff); border-color: var(--c-staff); color: var(--c-on-staff); }
.badge-guest { color: var(--c-text-muted); border-width: 1px; font-weight: 400; }
.badge-pinned { color: var(--c-warning); background: var(--c-warning-soft); }
.badge-archived { color: var(--c-text-muted); background: var(--c-surface-2); }
.badge-success { color: var(--c-success); background: var(--c-success-soft); }
.badge-danger { color: var(--c-danger); background: var(--c-danger-soft); }
.badge-info { color: var(--c-primary); background: var(--c-primary-soft); }

/* ---------- Conversation messages ---------- */
.message-list { list-style: none; margin: 0; padding: 0; }
.message-list > li { margin: 0 0 1rem; }
.message { background: var(--c-surface); border: 1px solid var(--c-border-soft); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.message.is-staff { border-left: 0.4rem solid var(--c-staff); }
.message.is-pinned { border-top: 0.3rem solid var(--c-warning); }
.message.is-held, .message.is-removed { background: var(--c-surface-2); border-style: dashed; }
.message-head { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; margin-bottom: 0.4rem; }
.message-author { font-weight: 700; color: var(--c-heading); }
.message-time { color: var(--c-text-muted); font-size: 0.9rem; }
.message-body p { margin: 0 0 0.6rem; }
.message-body > :last-child { margin-bottom: 0; }
.message-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin-top: 0.5rem; }
.message-actions .btn { min-height: var(--tap); padding: 0.3rem 0.7rem; font-size: 0.95rem; }
.replies { list-style: none; margin: 0.75rem 0 0; padding: 0 0 0 1rem; border-left: 3px solid var(--c-border-soft); }
.replies > li { margin: 0 0 0.75rem; }
.reply-context { font-size: 0.9rem; color: var(--c-text-muted); border-left: 3px solid var(--c-border-soft); padding-left: 0.6rem; margin-bottom: 0.4rem; }
.staff-answer-label { display: inline-block; font-weight: 700; color: var(--c-staff); }

/* ---------- Lists, tables, definition lists ---------- */
.plain-list { list-style: none; padding: 0; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0; border-bottom: 1px solid var(--c-border-soft); }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; padding: 0.6rem 0.25rem; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--c-border-soft); border-radius: var(--radius-sm); background: var(--c-surface); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--c-border-soft); vertical-align: top; }
th { background: var(--c-surface-2); font-weight: 700; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
dl.details dt { font-weight: 700; }
dl.details dd { margin: 0; }
@media (max-width: 30em) { dl.details { grid-template-columns: 1fr; } dl.details dd { margin-bottom: 0.5rem; } }

.progress { height: 1rem; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-primary); }

/* ---------- Newsletter reading view ---------- */
.newsletter-body { background: var(--c-surface); color: var(--c-text); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--c-border-soft); max-width: var(--measure); }
.newsletter-body img { display: block; margin: 1rem auto; height: auto; border-radius: 0.25rem; }
.newsletter-body a { word-break: break-word; }
.newsletter-body table { width: 100%; }
.newsletter-body td, .newsletter-body th { border: 1px solid var(--c-border-soft); }
.newsletter-body .nl-block { margin: 0 0 1rem; }
.newsletter-body h1, .newsletter-body h2, .newsletter-body h3 { margin-top: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-surface); border-top: 1px solid var(--c-border-soft); padding: 1.5rem 1rem 2rem; }
.footer-inner { max-width: 64rem; margin: 0 auto; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.site-footer h2 { font-size: 1.1rem; margin-top: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-block; padding: 0.55rem 0; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: 1rem; }
/* "Open in Google Maps" under the church's address (templates/core/_map_buttons.html) */
.map-buttons { margin: 0.75rem 0 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden-if-js .js &, [hidden] { display: none !important; }

@media (min-width: 48em) {
  h1 { font-size: 2rem; }
  main { padding: 1.5rem 1.5rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .btn, .card, .message, .destination, .badge { border: 2px solid CanvasText; }
  .glass-band, .card-glass::before { display: none; }
  :focus-visible { outline: 3px solid Highlight; box-shadow: none; }
  html[data-text-size="standard"] .ts-button[data-text-size-button="standard"],
  html[data-text-size="large"] .ts-button[data-text-size-button="large"],
  html[data-text-size="largest"] .ts-button[data-text-size-button="largest"] {
    forced-color-adjust: none; background: Highlight; color: HighlightText;
  }
}

@media print {
  .site-header, .main-nav, .site-footer, .message-actions, .offline-banner, .skip-link { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card, .newsletter-body { box-shadow: none; border: 0; }
}
.icon { width: 1.25em; height: 1.25em; vertical-align: -0.2em; flex: none; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0.25rem 0 0.75rem 3rem; min-height: 2.5rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1rem; width: 2.2rem; height: 2.2rem;
  border-radius: 50%; background: var(--c-primary); color: var(--c-on-primary); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.kbd-like { display: inline-block; border: 2px solid var(--c-border); border-radius: 0.4rem; padding: 0 0.4rem; font-weight: 700; background: var(--c-surface-2); }
details { background: var(--c-surface); border: 1px solid var(--c-border-soft); border-radius: var(--radius-sm); margin: 0 0 0.75rem; }
details > summary { cursor: pointer; font-weight: 700; padding: 0.75rem 1rem; min-height: var(--tap); list-style-position: inside; }
details[open] > summary { border-bottom: 1px solid var(--c-border-soft); }
details > :not(summary) { margin: 0.75rem 1rem; }
.hero { background: var(--c-surface); border-radius: var(--radius); border: 1px solid var(--c-border-soft); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.5rem; }
.hero h1 { margin-top: 0; }
.hero p { font-size: 1.05rem; }
.h3 { font-size: 1.2rem; }
/* ---------- Conversations ---------- */
.eyebrow { font-weight: 700; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; margin: 0 0 0.25rem; }
.live-notice { margin: 0 0 1rem; }
.composer { margin-bottom: 1.5rem; }
.btn-primary { background: var(--c-primary); color: var(--c-on-primary); }
.message-list .message-list { margin-top: 0.5rem; }

/* Poll result bars (no inline styles under the CSP) */
.bar-0 { width: 0%; }
.bar-1 { width: 1%; }
.bar-2 { width: 2%; }
.bar-3 { width: 3%; }
.bar-4 { width: 4%; }
.bar-5 { width: 5%; }
.bar-6 { width: 6%; }
.bar-7 { width: 7%; }
.bar-8 { width: 8%; }
.bar-9 { width: 9%; }
.bar-10 { width: 10%; }
.bar-11 { width: 11%; }
.bar-12 { width: 12%; }
.bar-13 { width: 13%; }
.bar-14 { width: 14%; }
.bar-15 { width: 15%; }
.bar-16 { width: 16%; }
.bar-17 { width: 17%; }
.bar-18 { width: 18%; }
.bar-19 { width: 19%; }
.bar-20 { width: 20%; }
.bar-21 { width: 21%; }
.bar-22 { width: 22%; }
.bar-23 { width: 23%; }
.bar-24 { width: 24%; }
.bar-25 { width: 25%; }
.bar-26 { width: 26%; }
.bar-27 { width: 27%; }
.bar-28 { width: 28%; }
.bar-29 { width: 29%; }
.bar-30 { width: 30%; }
.bar-31 { width: 31%; }
.bar-32 { width: 32%; }
.bar-33 { width: 33%; }
.bar-34 { width: 34%; }
.bar-35 { width: 35%; }
.bar-36 { width: 36%; }
.bar-37 { width: 37%; }
.bar-38 { width: 38%; }
.bar-39 { width: 39%; }
.bar-40 { width: 40%; }
.bar-41 { width: 41%; }
.bar-42 { width: 42%; }
.bar-43 { width: 43%; }
.bar-44 { width: 44%; }
.bar-45 { width: 45%; }
.bar-46 { width: 46%; }
.bar-47 { width: 47%; }
.bar-48 { width: 48%; }
.bar-49 { width: 49%; }
.bar-50 { width: 50%; }
.bar-51 { width: 51%; }
.bar-52 { width: 52%; }
.bar-53 { width: 53%; }
.bar-54 { width: 54%; }
.bar-55 { width: 55%; }
.bar-56 { width: 56%; }
.bar-57 { width: 57%; }
.bar-58 { width: 58%; }
.bar-59 { width: 59%; }
.bar-60 { width: 60%; }
.bar-61 { width: 61%; }
.bar-62 { width: 62%; }
.bar-63 { width: 63%; }
.bar-64 { width: 64%; }
.bar-65 { width: 65%; }
.bar-66 { width: 66%; }
.bar-67 { width: 67%; }
.bar-68 { width: 68%; }
.bar-69 { width: 69%; }
.bar-70 { width: 70%; }
.bar-71 { width: 71%; }
.bar-72 { width: 72%; }
.bar-73 { width: 73%; }
.bar-74 { width: 74%; }
.bar-75 { width: 75%; }
.bar-76 { width: 76%; }
.bar-77 { width: 77%; }
.bar-78 { width: 78%; }
.bar-79 { width: 79%; }
.bar-80 { width: 80%; }
.bar-81 { width: 81%; }
.bar-82 { width: 82%; }
.bar-83 { width: 83%; }
.bar-84 { width: 84%; }
.bar-85 { width: 85%; }
.bar-86 { width: 86%; }
.bar-87 { width: 87%; }
.bar-88 { width: 88%; }
.bar-89 { width: 89%; }
.bar-90 { width: 90%; }
.bar-91 { width: 91%; }
.bar-92 { width: 92%; }
.bar-93 { width: 93%; }
.bar-94 { width: 94%; }
.bar-95 { width: 95%; }
.bar-96 { width: 96%; }
.bar-97 { width: 97%; }
.bar-98 { width: 98%; }
.bar-99 { width: 99%; }
.bar-100 { width: 100%; }
/* Newsletter tables that are real data tables scroll inside themselves */
.newsletter-body table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; }
.newsletter-body .nl-block + .nl-block { margin-top: 0.75rem; }
.newsletter-body h2 { font-size: 1.35rem; }
.newsletter-body h3 { font-size: 1.15rem; }
@media (max-width: 30em) { .newsletter-body { padding: 1rem 0.85rem; } }

/* ---------- Trademark notice (Cross & Flame, required by GCFA) ---------- */
.trademark-note { font-size: 0.8rem; line-height: 1.45; color: var(--c-text-muted); margin: 1.5rem 0 0; max-width: var(--measure); }
/* ---------- Church wiki (apps/wiki) ---------- */
.wiki-search { padding: 1rem; margin-bottom: 1.5rem; }
.wiki-search-label { display: block; font-weight: 700; font-size: 1.15rem; margin-bottom: 0.4rem; }
.wiki-search-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.wiki-search-row input { flex: 1 1 12rem; min-width: 0; min-height: var(--tap); }
.wiki-search-row .btn { flex: none; }
.wiki-search [data-wiki-live] { margin-top: 1rem; }
.wiki-live-heading { font-size: 1.15rem; margin: 0 0 0.75rem; }
.wiki-groups { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.wiki-group h3 { font-size: 1.15rem; }
.wiki-group-list { list-style: none; padding: 0; margin: 0; }
.wiki-group-list li { border-top: 1px solid var(--c-border-soft); }
.wiki-group-list li:first-child { border-top: 0; }
.wiki-group-list a { display: flex; align-items: center; min-height: var(--tap); padding: 0.35rem 0; font-weight: 700; }
.wiki-unwritten { color: var(--c-text-muted); padding: 0.6rem 0; }
.wiki-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.wiki-result-title { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; font-size: 1.15rem; }
.wiki-snippet { color: var(--c-text-muted); }
.wiki-snippet mark, .wiki-body mark { background: #fde68a; color: #1a1a1a; padding: 0 0.1em; border-radius: 2px; }
.wiki-contents { margin-bottom: 1rem; }
.wiki-contents summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
.wiki-contents ul { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.wiki-contents li a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.wiki-contents .wiki-toc-3 { padding-left: 1rem; }
.wiki-contents .wiki-toc-4, .wiki-contents .wiki-toc-5, .wiki-contents .wiki-toc-6 { padding-left: 2rem; }
/* A page's own text is what people came for, so it stands out from everything around
   it (title, notes, links, buttons): bigger type on the plainest surface, framed by a
   strong border with a blue top edge (a shape, not colour alone). */
.wiki-body {
  padding: 1.5rem 1.4rem; overflow-wrap: anywhere;
  font-size: 1.3rem; line-height: 1.6; color: var(--c-text);
  border: 2px solid var(--c-border); border-top: 0.45rem solid var(--c-primary);
  box-shadow: 0 2px 4px rgb(16 33 58 / 14%), 0 8px 24px rgb(16 33 58 / 12%);
}
.wiki-body > :first-child { margin-top: 0; }
.wiki-body > :last-child { margin-bottom: 0; }
.wiki-body h2 { font-size: 1.6rem; margin-top: 1.75rem; }
.wiki-body h3 { font-size: 1.45rem; margin-top: 1.5rem; }
.wiki-body h4, .wiki-body h5, .wiki-body h6 { font-size: 1.3rem; margin-top: 1.25rem; }
.wiki-body h2, .wiki-body h3, .wiki-body h4, .wiki-body h5, .wiki-body h6 { scroll-margin-top: 1rem; }
.wiki-body img.wiki-img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.wiki-body pre { overflow-x: auto; max-width: 100%; }
.wiki-body .wiki-missing { color: var(--c-text-muted); }
.wiki-body .wiki-note { font-size: 0.9em; }
.wiki-body .wiki-ext-mark { font-size: 0.85em; }
.wiki-table { overflow-x: auto; max-width: 100%; margin: 1rem 0; }
.wiki-table table { border-collapse: collapse; }
.wiki-table th, .wiki-table td { border: 1px solid var(--c-border); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.wiki-footnotes { border-top: 1px solid var(--c-border-soft); margin-top: 1.5rem; padding-top: 0.75rem; font-size: 0.95rem; }
@media (max-width: 30em) { .wiki-body { padding: 1.1rem 0.9rem; } }
.wiki-body a.wiki-missing { color: var(--c-link); }

/* The wiki editor (templates wiki/edit.html, static/js/wiki-editor.js). Without JavaScript
   only the textarea shows. The toolbar wraps onto more rows at large text sizes and on
   small phones; every button keeps its word and a 48px target. */
.wiki-editor-field .wiki-rich > .label, [data-wiki-text-block] > label {
  display: block; font-weight: 700; margin-bottom: 0.35rem; color: var(--c-heading);
}
[data-wiki-source] { min-height: 20rem; font-size: max(1rem, 16px); }
.wiki-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.4rem; margin-bottom: 0.5rem;
  background: var(--c-surface-2); border: 2px solid var(--c-border); border-radius: var(--radius-sm);
}
.wiki-tool {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: var(--tap); min-width: var(--tap);
  padding: 0.35rem 0.65rem; font: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1.15;
  color: var(--c-primary); background: var(--c-surface); border: 2px solid var(--c-border-soft);
  border-radius: var(--radius-sm); cursor: pointer; touch-action: manipulation;
}
.wiki-tool svg { width: 1.2em; height: 1.2em; flex: none; }
.wiki-tool:hover { background: var(--c-primary-soft); border-color: var(--c-primary); }
.wiki-tool[aria-pressed="true"] { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.wiki-rich-area {
  min-height: 18rem; max-height: 70vh; overflow-y: auto; background: var(--c-surface); color: var(--c-text);
  border: 2px solid var(--c-border); border-radius: var(--radius-sm); line-height: 1.55; cursor: text;
}
.wiki-rich-area:focus-visible { border-color: var(--c-focus-ring); }
.wiki-rich-area img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.wiki-rich-area a { cursor: text; }
.wiki-panel { margin: 0.75rem 0; padding: 1rem; border: 2px solid var(--c-primary); }
.wiki-link-results { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.wiki-link-result { width: 100%; justify-content: flex-start; text-align: left; font-weight: 400; }
.wiki-mode-row { margin-top: 0.5rem; }
.wiki-edit-form [data-wiki-draft-status] { min-height: 1.5em; margin-top: 0.4rem; }
.wiki-conflict { margin-bottom: 1.25rem; }
.wiki-diff { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.wiki-diff li { padding: 0.35rem 0.5rem; border-left: 0.35rem solid; margin-bottom: 0.3rem; background: var(--c-surface); overflow-wrap: anywhere; }
.wiki-diff-added { border-color: var(--c-success) !important; }
.wiki-diff-removed { border-color: var(--c-danger) !important; }
.wiki-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.wiki-history-item { display: grid; gap: 0.3rem; overflow-wrap: anywhere; }
.wiki-history-item .btn { justify-self: start; }
.wiki-edits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.wiki-edit-row { overflow-wrap: anywhere; }
.wiki-edit-row .button-row { margin-top: 0.5rem; }
.wiki-edit-row form { display: inline; }
@media (min-width: 48em) {
  html[data-text-size="standard"] .wiki-toolbar { position: sticky; top: 0; z-index: 2; }
}
