/* ==========================================================================
   CHURCH BLOCKS · template `church/v1` — ARCHIVE / BROWSE render targets
   CDL-411 · Owned wholly by the browse ticket (not part of the mechanical
   skins/base/blocks merge in main.css). Every rule is token-driven so it
   re-clothes under all five skins + switchable accent with zero per-skin
   overrides. Layout-mode switching (?layout=) toggles presentation only —
   same listing IA, different arrangement (audit §5 variant-vs-config test).
   All classes are `br-*` namespaced so they never collide with the C01–C18
   block families (CDL-410) that own main.css component classes.
   ========================================================================== */

/* --- button colour repair ---------------------------------------------
   main.css ships `.church-template button { color: inherit }` (specificity
   0,1,1) which out-specifies `.btn-solid`/`.btn-accent` (0,1,0), so a <button>
   styled solid/accent inherits the page ink and its label vanishes on the
   dark/accent fill. Restore the intended label colour, scoped to the browse
   wrapper (0,2,0 wins) so nothing outside CDL-411 is touched. */
.church-browse button.btn-solid { color: var(--surface); }
.church-browse button.btn-accent { color: var(--on-accent); }
.church-browse button.btn-outline,
.church-browse button.btn-ghost { color: var(--ink); }

/* --- page head + breadcrumbs ------------------------------------------- */
.br-head { border-bottom: 1px solid var(--border); }
.br-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.br-crumbs a { color: var(--muted); }
.br-crumbs a:hover { color: var(--accent); }
.br-crumbs .br-sep { color: var(--faint); }
.br-crumbs .br-here { color: var(--ink); }
/* Editable `listing_intro.eyebrow` label — same treatment as the
   listing_intro/header_band block (mono, uppercase, accent), with the short
   accent rule the browse head uses to seat it above the title. */
.br-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); }
.br-eyebrow::after { content: ""; width: 34px; height: 1px;
  background: var(--accent); flex: none; }
.br-title { margin: 0; font-size: clamp(30px, 4.2vw, 52px); }
.br-lede { margin-top: 16px; }
.br-count { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase; }

/* --- layout-mode switch (segmented) ------------------------------------ */
/* CDL-861 · owner-ratified F2 "underline tabs". ONE idiom for every control:
   an accent underline means active. No fills, no borders, no pills — the two
   controls used to differ on six axes (border weight, item spacing, typeface,
   size, case, active fill) and both were 999px pills, the vocabulary ruled
   away from on 2026-07-29.

   The control row's own baseline rule REPLACES the head's bottom border, so
   one horizontal line leaves the page entirely. */
.br-head--ruled { border-bottom: 0; }
.br-count--line { margin: 18px 0 0; }
.br-head-controls { display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 16px; margin-top: 22px;
  border-bottom: 1px solid var(--border); }
.br-tabset { display: inline-flex; gap: 26px; flex-wrap: wrap; }
.br-tabset a, .br-head-controls .br-modes a {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 0 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.br-tabset a:hover, .br-head-controls .br-modes a:hover { color: var(--ink); }
.br-tabset a[aria-current="true"],
.br-head-controls .br-modes a[aria-current="true"] {
  color: var(--ink); border-bottom-color: var(--accent); background: none; }
.br-tabset .br-fc-n { font-variant-numeric: tabular-nums; color: var(--faint); }
/* The view switch sheds its pill chrome inside the header row. */
.br-head-controls .br-modes { display: inline-flex; gap: 14px; padding: 0;
  border: 0; background: none; border-radius: 0; }
.br-head-controls .br-modes a.br-m-icon { width: auto; height: auto;
  padding: 0 2px 12px; border-radius: 0; }
/* Retained for any surface still emitting its own in-content toolbar. */
.br-toolbar { display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.br-modes { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); }
.br-modes a { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); padding: 7px 13px; border-radius: 999px; }
.br-modes a:hover { color: var(--ink); }
.br-modes a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
/* Icon-only list/grid toggles — mirrors the shipped listing toolbar's
   `.ch-lbar-view a` sizing so both surfaces read as the same control. */
.br-modes a.br-m-icon { width: 34px; height: 30px; padding: 0;
  display: grid; place-items: center; }
.br-modes a.br-m-icon svg { display: block; }

/* --- filter bar -------------------------------------------------------- */
.br-filters { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 12px; align-items: end; margin-bottom: 30px; }
.br-filters .br-f { display: flex; flex-direction: column; gap: 6px; }
.br-filters label { font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.br-select { border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius); padding: 11px 12px; font: inherit; color: var(--ink);
  width: 100%; appearance: none; }
.br-select:focus { outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.br-filter-actions { display: flex; gap: 10px; align-items: center; margin: -10px 0 30px; }
.br-active { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* --- segmented type pills --------------------------------------------- */
.br-seg { display: inline-flex; gap: 0; border: 1px solid var(--border-strong);
  border-radius: 999px; overflow: hidden; }
.br-seg a { font-size: 13px; padding: 8px 15px; color: var(--ink); }
.br-seg a[aria-current="true"] { background: var(--ink); color: var(--surface); }

/* --- grids ------------------------------------------------------------- */
.br-grid { display: grid; gap: clamp(22px, 2.4vw, 40px); row-gap: clamp(30px, 3vw, 52px);
  grid-template-columns: repeat(3, 1fr); }
[data-layout-mode="grid"] .br-grid { grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); }
[data-layout-mode="grid"] .br-card { border: 0; border-radius: 0; background: var(--surface); }

/* --- content / sermon cards ------------------------------------------- */
.br-card { display: flex; flex-direction: column; gap: 12px; }
.br-card .br-thumb { aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.br-card .br-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.br-card h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(17px, 1.8vw, 21px); letter-spacing: var(--display-tracking); line-height: 1.2; }
.br-card:hover h3 { color: var(--accent); }
.br-card .br-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 10px; }
.br-card .br-meta .br-m-ref { color: var(--accent); }
.br-card .br-excerpt { font-size: 14px; color: var(--ink-2); line-height: 1.55; margin: 0; }

/* --- index (dense list) layout ---------------------------------------- */
.br-index { display: flex; flex-direction: column; }
.br-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 20px;
  align-items: baseline; padding: 18px 4px; border-top: 1px solid var(--border); }
.br-index .br-row:last-child { border-bottom: 1px solid var(--border); }
.br-row .br-r-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.br-row h3 { margin: 0 0 3px; font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(17px, 1.9vw, 22px); letter-spacing: var(--display-tracking); transition: color .14s; }
.br-row:hover h3 { color: var(--accent); }
.br-row .br-r-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 12px; }
.br-row .br-r-sub .br-r-ref { color: var(--accent); }
.br-row .br-r-aside { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }

/* --- faceted split (detail pages) ------------------------------------- */
[data-layout-mode="faceted"] .br-split { display: grid;
  grid-template-columns: 220px 1fr; gap: clamp(28px, 3vw, 56px); align-items: start; }
.br-split { display: block; }
.br-facets { display: none; }
[data-layout-mode="faceted"] .br-facets { display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 90px; }
.br-facet-group h4 { margin: 0 0 10px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.br-facet-group ul { list-style: none; margin: 0; padding: 0; display: flex;
  flex-direction: column; gap: 7px; }
.br-facet-group a { font-size: 13.5px; color: var(--ink-2); display: flex;
  justify-content: space-between; gap: 10px; }
.br-facet-group a:hover { color: var(--accent); }
.br-facet-group a[aria-current="true"] { color: var(--accent); font-weight: 600; }
.br-facet-group .br-fc-n { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

/* --- people directory: A-Z + split ------------------------------------ */
.br-people { display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 2.4vw, 40px) clamp(20px, 2vw, 32px); }
[data-layout-mode="split"] .br-people { grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 2vw, 32px); }
.br-person { display: flex; flex-direction: column; gap: 12px; }
[data-layout-mode="split"] .br-person { flex-direction: row; align-items: center;
  gap: 18px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); }
.br-person .br-ph { aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); }
[data-layout-mode="split"] .br-person .br-ph { width: 76px; height: 76px; flex: none; aspect-ratio: 1/1; }
.br-person .br-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.br-person .br-p-name { margin: 0; font-family: var(--font-display);
  font-weight: var(--display-weight); font-size: 19px; letter-spacing: var(--display-tracking); }
.br-person:hover .br-p-name { color: var(--accent); }
.br-person .br-p-role { font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  margin: 3px 0 0; }
.br-azgroup { margin-bottom: 44px; }
.br-azletter { font-family: var(--font-display); font-size: 28px; color: var(--faint);
  margin: 0 0 20px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* --- pagination -------------------------------------------------------- */
.br-pager { display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: clamp(40px, 5vw, 72px); }
.br-pager .br-p-info { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* --- empty state ------------------------------------------------------- */
/* CDL-857 · the empty state, owner-ratified Variant A ("quiet line").
   No box: the toolbar's hairline binds the control row to the message and the
   message sits on the WRAP EDGE, so title / count / message share one left
   edge. The dashed 6px-radius box it replaces was the only centred element on
   the page and read as an authoring drop-zone. */
/* The fourth of the four stacked paddings the deck measured: the content
   band opened with clamp(40px,6vw,88px) directly under the head divider.
   Tighten the TOP only — the band still breathes at the bottom, and a
   populated listing gains the same rhythm the empty one does. */
.church-browse .br-head + section.band { padding-top: clamp(26px, 3vw, 40px); }
.br-empty { padding: clamp(40px, 5vw, 64px) 0 clamp(28px, 3vw, 40px); }
.br-empty-label { margin: 0 0 12px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); }
/* Owner ruling: this line was set in the display face at the skin's display
   weight and competed with the page title for the reader's attention. An
   empty state is an aside, not a headline — so it is quiet body copy and the
   accent label above it carries the state. */
.br-empty-line { margin: 0; max-width: 52ch; color: var(--muted);
  font-size: 16px; line-height: 1.6; text-wrap: pretty; }
/* Only the FILTERED-empty state renders this — "nothing here yet" has
   nothing to clear. */
.br-empty-act { display: inline-flex; align-items: center; margin-top: 20px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  border-bottom: 1px solid currentColor; padding-bottom: 3px; }

/* --- responsive -------------------------------------------------------- */
@media (max-width: 960px) {
  .br-filters { grid-template-columns: 1fr 1fr; }
  .br-grid, [data-layout-mode="grid"] .br-grid { grid-template-columns: repeat(2, 1fr); }
  .br-people { grid-template-columns: repeat(2, 1fr); }
  [data-layout-mode="faceted"] .br-split { grid-template-columns: 1fr; }
  [data-layout-mode="faceted"] .br-facets { position: static; flex-direction: row;
    flex-wrap: wrap; gap: 28px; }
}
@media (max-width: 560px) {
  .br-filters { grid-template-columns: 1fr; }
  .br-grid, [data-layout-mode="grid"] .br-grid { grid-template-columns: 1fr; }
  .br-people, [data-layout-mode="split"] .br-people { grid-template-columns: 1fr; }
  .br-row { grid-template-columns: 1fr; gap: 4px; }
  .br-row .br-r-aside { text-align: left; }
  .br-toolbar { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   CDL-812 · LISTING-ROUTE SHAPES — appended for the nine church/v1 listing +
   detail render targets (events / series / sermon-notes / paths / programs /
   groups / campuses, plus group & campus leaves). Same contract as the rules
   above: `br-*` namespaced, token-driven, zero per-skin overrides, layout-mode
   switching is presentation-only. Nothing here introduces a colour, a font, or
   a radius that the token set does not already own.
   ========================================================================== */

/* --- time tab-bar row (upcoming / past / all) --------------------------
   Reuses the existing `.br-seg` segmented pill; this is only its row slot. */
.br-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 26px; }
.br-tabs .br-seg a { display: inline-flex; align-items: center; gap: 8px; }
.br-tabs .br-seg .br-fc-n { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.br-tabs .br-seg a[aria-current="true"] .br-fc-n { color: color-mix(in oklab, var(--surface) 78%, transparent); }

/* --- intro `secondary` note (listing_intro payload) --------------------- */
.br-headnote { padding-top: 0; }
.br-headnote-body { margin: 0; max-width: 62ch; font-family: var(--font-display);
  font-size: 15px; font-style: italic; color: var(--muted); line-height: 1.55; }

/* --- register rows: left rail + body + trailing meta -------------------
   One shape serves the events date-block register, the groups day/time
   register, the campuses list and the paths/series list. `.br-reg-rail` is the
   only part that changes contents between them. */
.br-reg { display: flex; flex-direction: column; }
.br-regrow { display: grid; grid-template-columns: 88px 1fr auto; gap: 20px;
  align-items: start; padding: 20px 4px; border-top: 1px solid var(--border); }
.br-regrow--wide { grid-template-columns: 120px 1fr auto; }
/* Rail-less variant — for an entity with neither a date nor an ordinal (a
   series), so the row never reserves an empty left column. */
.br-regrow--norail { grid-template-columns: 1fr auto; }
.br-reg .br-regrow:last-child { border-bottom: 1px solid var(--border); }
.br-reg-rail { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.br-reg-rail .br-d-day { font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 30px; line-height: 1; letter-spacing: var(--display-tracking); color: var(--ink); }
.br-reg-rail .br-d-time { font-size: 22px; }
.br-reg-rail .br-d-year,
.br-reg-rail .br-d-when { font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .06em; color: var(--muted); overflow-wrap: anywhere; }
.br-regrow h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(17px, 1.9vw, 22px); letter-spacing: var(--display-tracking);
  line-height: 1.18; transition: color .14s; }
.br-regrow:hover h3 { color: var(--accent); }
.br-reg-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 12px; }
.br-reg-meta .br-m-ref { color: var(--accent); }
.br-reg-note { margin: 8px 0 0; max-width: 64ch; font-size: 14px;
  color: var(--ink-2); line-height: 1.55; }
.br-reg-aside { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  text-align: right; overflow-wrap: anywhere; }

/* --- cover grid (series): 4-up on 4:5 media ----------------------------
   Mirrors the shipped `listing/grid.html` series treatment so the composed
   /series landing and this archive present the same shelf. */
.br-covers { display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 2.2vw, 34px); row-gap: clamp(26px, 2.8vw, 46px); }
.br-covers .br-card .br-thumb { aspect-ratio: 4 / 5; }

/* --- media-less tiles (sermon notes; groups in tile mode) --------------
   A document and a Group have no image column — the tile carries type and
   meta instead of an empty frame. */
.br-docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2vw, 28px); }
.br-doc { display: flex; flex-direction: column; gap: 10px;
  padding: clamp(18px, 2vw, 26px); border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface); }
.br-doc h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(16px, 1.7vw, 20px); letter-spacing: var(--display-tracking); line-height: 1.2; }
.br-doc:hover h3 { color: var(--accent); }
.br-doc .br-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 10px; }
.br-doc .br-meta .br-m-ref { color: var(--accent); }
.br-doc .br-excerpt { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }

/* --- ordered cards (paths) — a path is a sequence, so it is numbered ---- */
.br-ordered { display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(22px, 2.4vw, 40px); row-gap: clamp(30px, 3vw, 52px); }
.br-ordinal { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em;
  color: var(--accent); }

/* --- closing band (listing_closing payload) ---------------------------- */
.br-closeband { border-top: 1px solid var(--border); }
.br-close-eyebrow { margin: 0 0 14px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.br-close-title { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(26px, 3.4vw, 42px); line-height: 1.08; letter-spacing: var(--display-tracking); }
.br-close-body { margin: 18px 0 0; max-width: 52ch; font-size: 16px;
  color: var(--ink-2); line-height: 1.6; }
.br-close-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* --- detail leaves (group / campus) ------------------------------------ */
.br-detail { display: grid; grid-template-columns: 280px 1fr;
  gap: clamp(28px, 3vw, 56px); align-items: start; }
.br-facts { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.br-fact { display: flex; flex-direction: column; gap: 4px; }
.br-fact dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); }
.br-fact dd { margin: 0; font-size: 14.5px; color: var(--ink); line-height: 1.5;
  overflow-wrap: anywhere; }
.br-fact dd a { color: var(--accent); }
.br-detail-hero { margin-bottom: 24px; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); }
.br-detail-hero img { width: 100%; height: auto; display: block; }
.br-detail-map { margin-bottom: 24px; }
.br-prose { max-width: 68ch; }

/* --- responsive: no new shape may push the body sideways ---------------- */
@media (max-width: 960px) {
  .br-covers { grid-template-columns: repeat(2, 1fr); }
  .br-docs, .br-ordered { grid-template-columns: repeat(2, 1fr); }
  .br-detail { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .br-covers, .br-docs, .br-ordered { grid-template-columns: 1fr; }
  .br-regrow, .br-regrow--wide, .br-regrow--norail { grid-template-columns: 1fr; gap: 6px; }
  .br-reg-rail { flex-direction: row; align-items: baseline; gap: 10px; }
  .br-reg-rail .br-d-day, .br-reg-rail .br-d-time { font-size: 20px; }
  .br-reg-aside { text-align: left; }
  .br-tabs { width: 100%; }
  .br-tabs .br-seg { flex-wrap: wrap; }
}
