/* New Hope Baptist Church. Modern, accessible, and fast. */
:root {
  --brand: #8c0b12;
  --brand-deep: #65070c;
  --brand-soft: #f8e9e8;
  --gold: #c79b4a;
  --gold-soft: #f5ead4;
  --ink: #172022;
  --body: #4d5859;
  --muted: #748081;
  --line: #dfe3df;
  --paper: #ffffff;
  --canvas: #f7f6f2;
  --dark: #172224;
  --dark-soft: #243032;
  --success: #18764b;
  --success-soft: #edf8f2;
  --danger-soft: #fff0ef;
  --shadow-sm: 0 8px 24px rgba(23, 32, 34, 0.07);
  --shadow-lg: 0 28px 70px rgba(23, 32, 34, 0.16);
  --wrap: 1180px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --sans: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h1 { font-size: clamp(2.35rem, 5vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 3.5vw, 3rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.018em; }

p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-deep); }
img { display: block; max-width: 100%; height: auto; }

.wrap {
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding-inline: 24px;
}

.small { font-size: 0.86rem; color: var(--muted); }
.muted { color: var(--muted); }
.center { justify-content: center; text-align: center; }

:where(.sr-only) {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}

.skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
}
.skip:focus { top: 12px; }

/* Header ---------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(23, 32, 34, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.head-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img { width: 50px; height: 50px; flex: 0 0 auto; }
.brand-text { min-width: 0; display: grid; line-height: 1.15; }
.brand-text b {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-text > span {
  margin-top: 5px;
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* The masthead name has a long form and a short one. Both are in the markup and
   CSS picks; swapping text in JavaScript is not an option on a site that ships
   none, and truncating with an ellipsis loses the word that identifies us. */
.on-narrow { display: none; }

.site-head nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.site-head nav > a,
button.link {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--body);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  padding: 10px 12px;
  text-decoration: none;
  cursor: pointer;
}

.site-head nav > a:hover,
button.link:hover,
.site-head nav > a[aria-current="page"] {
  background: var(--canvas);
  color: var(--brand);
}

.inline { display: inline; margin: 0; }

.btn-sm,
.site-head nav > a.btn-sm {
  margin-left: 6px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 10px 17px;
}
.btn-sm:hover,
.site-head nav > a.btn-sm:hover {
  background: var(--brand-deep);
  color: #fff;
}

/* The site ships no JavaScript, so the phone menu is a checkbox the label
   toggles. Both are hidden on desktop, where the nav is a plain row. */
.menu-check,
.menu-btn { display: none; }

/* Buttons ---------------------------------------------------------------- */

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 740;
  line-height: 1.2;
  padding: 13px 21px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff;
  transform: translateY(-1px);
}

.btn.secondary,
.btn.ghost {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}
.btn.secondary:hover,
.btn.ghost:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.btn.light { border-color: #fff; background: #fff; color: var(--brand-deep); }
.btn.light:hover { border-color: var(--gold-soft); background: var(--gold-soft); color: var(--brand-deep); }
.btn.outline-light { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); color: #fff; }
.btn.outline-light:hover { border-color: #fff; background: rgba(255,255,255,.14); }
.btn.wide { width: 100%; }

/* Shared layout ---------------------------------------------------------- */

main { min-height: 62vh; }
.section { padding: 88px 0; }
.section.no-top { padding-top: 0; }
.section.tint { border-block: 1px solid var(--line); background: var(--canvas); }

.section-label,
.card-kicker {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1.3;
  text-transform: uppercase;
}


.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 36px;
}
.section-head h2 { max-width: 14ch; }
.section-head > p { max-width: 43ch; margin: 0; justify-self: end; color: var(--muted); }

.panel {
  width: min(100%, 680px);
  margin: 72px auto 96px;
  padding-inline: 24px;
}
main.wide .panel,
.panel.admin-panel { width: min(100%, 1240px); max-width: none; }

/* Homepage hero ---------------------------------------------------------- */

.hero {
  padding: 52px 0 66px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: clamp(36px, 5vw, 74px);
  align-items: center;
}

.hero-copy h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 5.2vw, 4.7rem);
  letter-spacing: -0.05em;
}

.hero-copy > p {
  max-width: 45ch;
  margin-top: 14px;
  font-size: 1.08rem;
}

/* Sized close to the photograph's own landscape ratio, so the congregation is
   trimmed at the edges rather than cropped down to a portrait slot. */
.hero-figure {
  position: relative;
  height: clamp(420px, 44vw, 520px);
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--dark);
  box-shadow: var(--shadow-lg);
}

.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
}

/* Grounds the service card so it never sits on busy photo detail. */
.hero-figure::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(23, 34, 36, .66), transparent);
  pointer-events: none;
}

.hero-service {
  position: absolute;
  z-index: 1;
  left: 22px;
  bottom: 22px;
  min-width: 194px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  padding: 17px 20px;
}
.hero-service span { display: block; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-service b { display: block; margin-top: 3px; font-size: 1.06rem; }

.service-section { padding-bottom: 58px; }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
/* Two rows: the index sits alone on top, then the service name and its time
   sit on one baseline at opposite edges, so a wide card reads as a schedule
   line instead of leaving a hole in the middle. */
.service-card {
  position: relative;
  min-height: 172px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 24px;
  row-gap: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--brand);
}
.service-number {
  grid-column: 1 / -1;
  align-self: start;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.service-card h3 { margin-bottom: 0; font-size: 1.55rem; }
.service-card .card-kicker { margin-bottom: 7px; }
.service-time {
  margin: 0;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 700;
  white-space: nowrap;
}

.next-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.next-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  padding: 30px;
}
.next-card.primary { border-color: var(--brand); background: var(--brand); color: rgba(255,255,255,.82); }
.next-card.primary h3,
.next-card.primary .card-kicker,
.next-card.primary a { color: #fff; }
.next-card.primary .card-kicker { opacity: .78; }
.next-card h3 { font-size: 1.55rem; }
.next-card p:not(.card-kicker) { color: inherit; }
.next-card a { margin-top: auto; font-weight: 750; text-decoration: none; }

.dark-section { overflow: hidden; background: var(--dark); color: rgba(255,255,255,.72); }
.life-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 76px; align-items: center; }
.life-copy h2 { color: #fff; }
.life-copy > p:not(.section-label) { max-width: 44ch; font-size: 1.03rem; }
.ministry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 30px;
  padding: 0;
  list-style: none;
}
.ministry-list li {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.9);
  font-size: .82rem;
  padding: 7px 12px;
}
.text-link-light { color: #fff; font-weight: 750; text-decoration: none; }
.text-link-light:hover { color: #e8c47c; }

.photo-stack { position: relative; min-height: 560px; }
.photo-stack figure { margin: 0; overflow: hidden; border-radius: 18px; box-shadow: var(--shadow-lg); }
.photo-stack img { width: 100%; height: 100%; object-fit: cover; }
.photo-main { position: absolute; inset: 0 12% 0 0; }
.photo-main img { object-position: 50% 35%; }
.photo-inset { position: absolute; right: 0; bottom: -22px; width: 38%; height: 68%; border: 7px solid var(--dark); }
.photo-inset img { object-position: 50% 25%; }

.welcome-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--gold-soft);
  padding: clamp(30px,5vw,56px);
}
.welcome-band h2 { margin-bottom: 8px; }
.welcome-band p:last-child { margin-bottom: 0; }
.welcome-actions { display: grid; gap: 12px; justify-items: end; }
.welcome-actions span { color: var(--ink); font-size: .85rem; font-weight: 700; }

/* About ------------------------------------------------------------------ */

.page-hero { padding: 58px 0; background: var(--canvas); }
.page-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.page-hero-grid h1 { max-width: 12ch; font-size: clamp(2.8rem,5vw,4.5rem); }
.lead { max-width: 55ch; color: var(--body); font-size: 1.12rem; }
.page-hero figure { height: 500px; margin: 0; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.page-hero figure img { width:100%; height:100%; object-fit:cover; object-position: 48% 35%; }

.about-grid,
.split-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; align-items: start; }
.about-grid { margin-bottom: 46px; }
.belief-copy { font-size: 1.06rem; }
.belief-copy p:last-child { margin-bottom: 0; }
.belief-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.belief-grid article {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.belief-grid span { color: var(--brand); font-size: .74rem; font-weight: 800; }
.belief-grid h3 { margin-top: 38px; }
.belief-grid p { margin:0; color: var(--muted); }
.service-grid.compact { grid-template-columns: 1fr; }
.service-grid.compact .service-card { min-height: 145px; }

.ministry-cards {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ministry-cards li {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  font-weight: 700;
  padding: 18px;
}

/* Public contact form ---------------------------------------------------- */

.form-page { padding: 72px 0 100px; background: var(--canvas); }
.form-page-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 76px; align-items: start; }
.form-intro { position: sticky; top: 120px; padding-top: 24px; }
.form-intro h1 { max-width: 11ch; font-size: clamp(2.65rem,5vw,4.25rem); }

/* Forms ------------------------------------------------------------------ */

.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: clamp(22px,4vw,36px);
}
.form-card.elevated { box-shadow: var(--shadow-sm); }
.form-card-head { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.form-card-head h2 { margin-bottom: 6px; font-size: 1.55rem; }
.form-card-head p { margin: 0; color: var(--muted); font-size: .9rem; }

.field { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.field-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.field > label,
.field > legend {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 750;
}
.field .opt { color: var(--muted); font-weight: 500; }
.field .hint { margin: -2px 0 8px; color: var(--muted); font-size: .79rem; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd5d1;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  padding: 11px 13px;
}
textarea { min-height: auto; resize: vertical; }
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(140, 11, 18, .12);
  border-color: var(--brand);
}

.radios { display: flex; flex-wrap: wrap; gap: 9px; }
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cfd5d1;
  border-radius: 9px;
  color: var(--body);
  font-size: .88rem;
  padding: 10px 13px;
  cursor: pointer;
}
.radio:hover,
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.radio input { margin:0; accent-color: var(--brand); }
.form-note,
.form-links { display:flex; justify-content:space-between; gap:12px; margin-top:16px; font-size:.84rem; font-weight:650; }

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

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 9px;
  background: var(--canvas);
  color: var(--body);
  padding: 13px 15px;
  margin: 0 0 22px;
  font-size: .9rem;
}
.notice.error { border-left-color: var(--brand); background: var(--danger-soft); color: var(--brand-deep); }
.notice.ok { border-left-color: var(--success); background: var(--success-soft); color: #125f3c; }

/* Member access and authentication -------------------------------------- */

.access-page { min-height: 72vh; padding: 72px 0 94px; background: var(--canvas); }
.access-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 70px; align-items: center; }
.access-copy h1 { max-width: 12ch; font-size: clamp(2.7rem,5vw,4.25rem); }
.access-copy > p { max-width: 48ch; }

.portal-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.portal-choice {
  min-height: 370px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}
.portal-choice.featured { border-top: 5px solid var(--brand); }
.choice-number { color: var(--gold); font-size: .75rem; font-weight: 800; }
.portal-choice h2 { font-size: 1.75rem; }
.portal-choice .btn { margin-top: 24px; }
.visitor-route { grid-column:1/-1; margin:6px 0 0; color:var(--muted); font-size:.88rem; text-align:center; }

.auth-page { padding: 44px 0 84px; background: var(--canvas); }
.auth-grid { display:grid; grid-template-columns: .9fr 1.1fr; gap: 62px; align-items: stretch; }
.auth-visual { position:relative; min-height:680px; overflow:hidden; border-radius:var(--radius-lg); background:var(--dark); }
.auth-visual > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:45% 38%; filter:saturate(.8); }
.auth-visual::after { content:""; position:absolute; inset:0; background:linear-gradient(0deg,rgba(14,22,23,.88),rgba(14,22,23,.04) 65%); }
.auth-visual > div { position:absolute; z-index:1; left:38px; right:38px; bottom:36px; }
.auth-visual h1 { max-width:10ch; color:#fff; font-size:3rem; }
.auth-form-wrap { align-self:center; max-width:560px; width:100%; padding:28px 0; }
.auth-form-wrap > h1 { font-size:2.65rem; }
/* Breadcrumbs. The last item is the current page and is not a link, so the
   trail reads as a position rather than a row of things to click. */
.crumbs {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:26px;
  font-size:.83rem;
  font-weight:650;
}
.crumbs a { color:var(--muted); text-decoration:none; }
.crumbs a:hover { color:var(--brand); text-decoration:underline; }
.crumbs [aria-current="page"] { color:var(--ink); }
.crumb-sep { color:var(--line); }

.back { display:inline-block; margin-bottom:30px; color:var(--muted); font-size:.83rem; font-weight:650; text-decoration:none; }
.back:hover { color:var(--brand); }

/* Member portal ---------------------------------------------------------- */

.panel.portal-panel { width:min(100%,1120px); max-width:none; }

.portal-section-head {
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:30px;
  margin:48px 0 18px;
}
.portal-section-head h2 { margin:0; font-size:1.9rem; }
.portal-section-head .section-label { margin-bottom:7px; }
.portal-section-head > p { max-width:44ch; margin:0; color:var(--muted); font-size:.87rem; }
.profile-form { max-width:none; }
.password-head { margin-top:60px; }

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

.page-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:28px;
  flex-wrap:wrap;
  margin-bottom:28px;
}
.page-head h1 { font-size:clamp(2.2rem,4vw,3.4rem); margin-bottom:7px; }
.page-head .actions { margin:0; }
/* One row that is both the tally and the filter: reading a count and acting on
   it were previously two separate controls saying the same five words.
   On a phone the five cards are folded behind the button below; see the 720px
   block. The checkbox that opens them is hidden here and revealed there. */
.reg-filter { margin:0 0 18px; }
.filter-check,
.filter-btn { display:none; }
.reg-tabs { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.reg-tab {
  display:grid;
  gap:4px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--paper);
  padding:14px 16px;
  text-decoration:none;
}
.reg-tab b { color:var(--ink); font-size:1.7rem; font-weight:760; line-height:1; }
.reg-tab span { color:var(--muted); font-size:.68rem; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.reg-tab:hover { border-color:var(--brand); }
/* Selected is carried by the border and the label colour, not a fill: the
   register already spends its red on the page's one primary action. */
.reg-tab.on { border-color:var(--brand); background:var(--paper); box-shadow:inset 0 0 0 1px var(--brand); }
.reg-tab.on b { color:var(--ink); }
.reg-tab.on span { color:var(--brand); }

.reg-search { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:0 0 20px; }
.reg-search input[type="search"] { flex:1 1 320px; margin:0; }
.reg-search .btn { flex:0 0 auto; }
.reg-clear { color:var(--muted); font-size:.85rem; }

.table-scroll { overflow-x:auto; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:var(--shadow-sm); }
table { width:100%; border-collapse:collapse; font-size:.87rem; }
th,
td { padding:13px 15px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; white-space:nowrap; }
th { background:var(--canvas); color:var(--muted); font-size:.68rem; font-weight:800; letter-spacing:.09em; text-transform:uppercase; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background:#fcfbf8; }
td.wrap-cell { min-width:220px; white-space:normal; }

.pill {
  display:inline-flex;
  align-items:center;
  width:max-content;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--body);
  font-size:.67rem;
  font-weight:750;
  letter-spacing:.04em;
  padding:4px 9px;
}
.pill.member { border-color:#9bd0b4; background:var(--success-soft); color:#14623f; }
.pill.joining { border-color:#e2b8b6; background:var(--brand-soft); color:var(--brand-deep); }
.pill.admin { border-color:rgba(255,255,255,.4); background:rgba(255,255,255,.1); color:#fff; }
.admin-panel .pill.admin,
.table-scroll .pill.admin { border-color:#aeb6b4; background:var(--dark); color:#fff; }

.rows { display:grid; gap:0; }
.rowline { display:grid; grid-template-columns:190px 1fr; gap:16px; padding:12px 0; border-bottom:1px solid var(--line); }
.rowline dt { color:var(--muted); font-size:.84rem; }
.rowline dd { margin:0; color:var(--ink); }
.reveal { display:block; overflow-wrap:anywhere; border:1px solid var(--line); border-radius:8px; background:#fff; font-family:Consolas,monospace; font-size:.78rem; padding:10px 12px; }
.danger { color:var(--brand); }

/* Phone-first portal and register controls -------------------------------- */
.back {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0 0 22px;
  color:var(--body);
  font-size:.9rem;
  font-weight:720;
  text-decoration:none;
}
.back span { color:var(--brand); font-size:1.15rem; line-height:1; }
.back:hover { color:var(--brand); text-decoration:none; }

.register-actions { margin:0; }

/* The register is the portal menu again, not a table: hairline rows, the whole
   row a link, two lines of text. A table of six columns needed a horizontal
   scroller on a phone and a second card layout to escape it; one list needs
   neither, and it is the same thing to read on both. */
.member-list { border-top:1px solid var(--line); }
.member-list > a {
  display:flex;
  align-items:center;
  gap:14px;
  border-bottom:1px solid var(--line);
  color:var(--ink);
  padding:16px 4px;
  text-decoration:none;
}
.member-list > a:hover { background:var(--canvas); }
.member-list > a:hover .m-name { color:var(--brand); }

/* The serial is the reading aid, not an identifier: it numbers what is on the
   screen right now, so it renumbers when the list is filtered. */
.m-sn {
  flex:none;
  width:30px;
  color:var(--muted);
  font-size:.82rem;
  font-variant-numeric:tabular-nums;
  text-align:right;
}
.m-who { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:3px; }
.m-name {
  color:inherit;
  font-size:1.02rem;
  font-weight:740;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.m-sub { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:.85rem; }
.m-sub .pill { font-size:.62rem; padding:3px 8px; }
.m-meta { flex:none; display:flex; align-items:center; gap:10px; }
.member-list > a::after {
  content:"";
  flex:none;
  width:7px;
  height:7px;
  border-top:2px solid var(--muted);
  border-right:2px solid var(--muted);
  transform:rotate(45deg);
}

.record-head { align-items:center; margin-bottom:18px; }
.record-head h1 { margin:0; }
.record-contact-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:0 0 18px;
}
.record-contact-actions:empty { display:none; }
.record-contact-actions > a {
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--canvas);
  padding:13px 15px;
  text-decoration:none;
}
.record-contact-actions span {
  color:var(--muted);
  font-size:.7rem;
  font-weight:780;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.record-contact-actions b {
  overflow:hidden;
  color:var(--ink);
  font-size:.91rem;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.record-contact-actions > a:hover { border-color:var(--brand); background:var(--brand-soft); }
.record-facts {
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:28px;
}
.record-facts .rowline { grid-template-columns:120px minmax(0,1fr); }
.record-facts dd { overflow-wrap:anywhere; }

/* One button under the facts. Editing is a page of its own, so the record
   itself stays something you read rather than something you scroll past. */
.record-actions { margin-top:28px; }

.admin-section { margin-top:52px; }
.admin-section-head {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:28px;
  margin-bottom:16px;
}
.admin-section-head h2 { margin:0; font-size:1.9rem; }
.admin-section-head p { max-width:38ch; margin:0; color:var(--muted); font-size:.86rem; }
.save-member { min-width:150px; }
.account-tools { margin-top:44px; }
.tool-stack { display:grid; gap:10px; }
.tool-card {
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--paper);
}
.tool-card summary {
  min-height:66px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:15px 18px;
  color:var(--ink);
  cursor:pointer;
  list-style:none;
}
.tool-card summary::-webkit-details-marker { display:none; }
.tool-card summary::after {
  content:"+";
  flex:none;
  color:var(--brand);
  font-size:1.35rem;
  font-weight:500;
  line-height:1;
}
.tool-card[open] summary::after { content:"\2212"; }
.tool-card summary span { display:flex; flex-direction:column; gap:2px; }
.tool-card summary b { font-size:1rem; }
.tool-card summary small { color:var(--muted); font-size:.8rem; font-weight:500; }
.tool-card-body { border-top:1px solid var(--line); padding:18px; }
.tool-card-body > .muted:first-child { margin-top:0; }
.danger-tool summary b { color:var(--brand); }
.password-tool { margin-top:48px; }

/* Completion and empty states ------------------------------------------- */

.success-panel,
.empty-state { max-width:680px; margin-block:110px; text-align:center; }
.success-mark {
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  margin:0 auto 24px;
  border-radius:50%;
  background:var(--success-soft);
  color:var(--success);
  font-size:1.7rem;
  font-weight:800;
}

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

.site-foot { margin-top:0; background:#111a1c; color:rgba(255,255,255,.65); }
.foot-inner {
  display:grid;
  grid-template-columns:1.5fr 1fr .7fr;
  gap:54px;
  padding-top:52px;
  padding-bottom:42px;
  font-size:.86rem;
}
.foot-inner > div > b { display:block; margin-bottom:12px; color:#fff; }
.foot-inner p { margin:0; }
.foot-inner a { color:rgba(255,255,255,.78); text-decoration:none; }
.foot-inner a:hover { color:#fff; }
.foot-brand { display:flex; align-items:center; gap:14px; }
.foot-brand img { width:52px; height:52px; }
.foot-brand b { color:#fff; }
.foot-brand span { font-size:.78rem; }
.foot-bottom { border-top:1px solid rgba(255,255,255,.1); padding-top:18px; padding-bottom:22px; font-size:.75rem; }

/* Portal dashboard -------------------------------------------------------- */

/* The portal's front door. Identity first, then a flat list of destinations
   separated by hairlines rather than boxed into cards, so the eye runs down
   the titles instead of stopping at every border. */
.portal-id {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 0 30px;
}
.portal-avatar {
  flex: none;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.3rem;
  font-weight: 800;
}
.portal-id h1 { margin: 0 0 3px; font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.portal-id p { margin: 0; color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }

.portal-menu { border-top: 1px solid var(--line); }
.portal-menu > a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  padding: 19px 4px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.portal-menu > a:hover { color: var(--brand); }
.portal-menu > a:hover b { color: var(--brand); }
.portal-menu > a:active { background: var(--canvas); }

.portal-menu span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.portal-menu b { color: inherit; font-size: 1.05rem; font-weight: 740; }
.portal-menu small { color: var(--muted); font-size: .85rem; line-height: 1.4; }

/* A chevron drawn from a rotated corner, so the list needs no icon asset. It
   is for destinations only; signing out is an action, so it carries none. */
.portal-menu > a:not(.sign-out)::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  transform: rotate(45deg);
}

.portal-menu > a.sign-out { color: var(--brand); }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 920px) {
  .section { padding:72px 0; }
  .hero { padding:36px 0 52px; }
  .hero-grid { grid-template-columns:1fr; gap:34px; }
  .hero-copy h1 { max-width:none; }
  .hero-figure { height:clamp(340px,50vw,430px); }
  .head-inner { gap:14px; }
  .site-head nav { gap:2px; }
  .site-head nav > a,
  button.link { padding-inline:9px; }

  .life-grid,
  .page-hero-grid,
  .about-grid,
  .split-section,
  .form-page-grid,
  .access-grid,
  .auth-grid { gap:42px; }

  .next-grid { grid-template-columns:1fr 1fr; }
  .next-card.primary { grid-column:1/-1; min-height:230px; }
  .life-grid { grid-template-columns:1fr; }
  .life-copy { max-width:680px; }
  .photo-stack { min-height:520px; }

  .reg-tabs { grid-template-columns:repeat(3,1fr); }
}

@media (max-width: 720px) {
  .wrap { padding-inline:18px; }
  .site-head { position:relative; }
  .head-inner { min-height:64px; padding-block:10px; }

  /* The seal alone does not say who we are to a first-time visitor, so the name
     stays on a phone in its short form: "New Hope" over "Baptist Church, Iwaya",
     which is no taller than the seal beside it. */
  .on-wide { display:none; }
  .on-narrow { display:inline; }
  .brand-text b { font-size:1rem; white-space:nowrap; }
  .brand-text > span { margin-top:2px; font-size:.6rem; letter-spacing:.1em; white-space:nowrap; }

  /* Present and focusable, but invisible: display:none would take it out of the
     tab order and the label would be mouse-only. */
  .menu-check {
    position:absolute;
    width:1px;
    height:1px;
    opacity:0;
    pointer-events:none;
    display:block;
  }

  .menu-btn {
    width:44px;
    height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-left:auto;
    margin-right:-10px;
    background:none;
    cursor:pointer;
  }

  /* Three hairlines that fold into a cross when the menu opens, so the button
     is its own close affordance. The middle bar is the element; the other two
     are its pseudo-elements, which is why only it fades out. */
  .menu-btn span,
  .menu-btn span::before,
  .menu-btn span::after {
    width:22px;
    height:1.5px;
    display:block;
    border-radius:2px;
    background:var(--ink);
    transition:transform 180ms ease, opacity 120ms ease;
  }
  .menu-btn span { position:relative; }
  .menu-btn span::before,
  .menu-btn span::after { content:""; position:absolute; left:0; }
  .menu-btn span::before { top:-7px; }
  .menu-btn span::after { top:7px; }

  .menu-check:checked + .menu-btn span { background:transparent; }
  .menu-check:checked + .menu-btn span::before { top:0; transform:rotate(45deg); }
  .menu-check:checked + .menu-btn span::after { top:0; transform:rotate(-45deg); }

  /* Focus lands on the checkbox, which is off-screen, so the ring is drawn on
     the label the user can actually see. */
  .menu-check:focus-visible + .menu-btn { border-radius:8px; outline:2px solid var(--brand); outline-offset:2px; }

  .site-head nav { display:none; }
  .menu-check:checked ~ nav {
    position:absolute;
    top:100%;
    left:0;
    right:0;
    z-index:30;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    border-bottom:1px solid var(--line);
    background:var(--paper);
    box-shadow:var(--shadow-lg);
    padding:4px 18px 14px;
  }
  .menu-check:checked ~ nav > a,
  .menu-check:checked ~ nav button.link {
    width:100%;
    border-radius:0;
    border-bottom:1px solid var(--line);
    background:none;
    font-size:1rem;
    font-weight:680;
    padding:15px 2px;
    text-align:left;
  }
  .menu-check:checked ~ nav > a[aria-current="page"] { background:none; color:var(--brand); }
  .menu-check:checked ~ nav .inline { display:block; }
  .menu-check:checked ~ nav button.link { color:var(--brand); }

  /* The portal call to action is the one row that stays a button. */
  .menu-check:checked ~ nav > a.btn-sm {
    border:1px solid var(--brand);
    border-radius:10px;
    margin:12px 0 2px;
    padding:13px 17px;
    text-align:center;
  }

  .portal-id { gap:14px; padding-bottom:24px; }
  .portal-avatar { width:54px; height:54px; font-size:1.1rem; }

  .hero { padding:42px 0 44px; }
  .hero-figure { height:320px; border-radius:20px; }
  .hero-figure img { object-position:50% 28%; }
  .hero-service { left:18px; bottom:18px; min-width:184px; padding:13px 15px; }

  .section { padding:60px 0; }
  .section-head { grid-template-columns:1fr; gap:10px; margin-bottom:24px; }
  .section-head > p { justify-self:start; }
  .service-grid,
  .next-grid,
  .belief-grid,
  .page-hero-grid,
  .about-grid,
  .split-section,
  .form-page-grid,
  .access-grid,
  .auth-grid { grid-template-columns:1fr; }

  .service-card { min-height:160px; padding:23px; }
  .next-card,
  .next-card.primary { grid-column:auto; min-height:250px; }
  .dark-section { padding-bottom:86px; }
  /* Two overlapping photos need room to read as a composition. On a phone the
     inset is a thumbnail covering the main shot, so only the main one stays. */
  .photo-stack { min-height:300px; }
  .photo-main { inset:0; }
  .photo-inset { display:none; }

  .welcome-band { align-items:flex-start; flex-direction:column; }
  .welcome-actions { justify-items:start; }
  .page-hero { padding:42px 0 46px; }
  .page-hero figure { height:360px; order:-1; }
  .belief-grid { gap:12px; }
  .belief-grid article { min-height:185px; }
  .ministry-cards { grid-template-columns:1fr; }

  .form-page { padding:50px 0 70px; }
  .form-intro { position:static; padding-top:0; }
  .field-pair { grid-template-columns:1fr; gap:0; }

  .access-page { padding:48px 0 70px; }
  .portal-choice-grid { grid-template-columns:1fr; }
  .portal-choice { min-height:300px; }
  .auth-page { padding:38px 0 64px; }
  .auth-visual { display:none; }
  .auth-form-wrap { padding:0; }

  .panel,
  main.wide .panel,
  .panel.admin-panel {
    margin:34px auto 64px;
    padding-inline:18px;
  }
  .back { margin-bottom:16px; }
  .page-head { gap:18px; margin-bottom:22px; }
  .page-head .muted { max-width:34ch; }
  .register-actions {
    width:100%;
    display:grid;
    grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);
    gap:9px;
  }
  .register-actions .btn { width:100%; padding-inline:12px; }
  /* Five cards stacked two-up pushed the list itself below the fold, and the
     register exists to show the list. So on a phone they fold into one button
     that names the filter in force, and open as a plain list of choices.
     The toggle is a checkbox and a label because the site ships no JavaScript;
     it is the same mechanism as the header menu. Picking a filter is a link, so
     the panel is never left hanging open. */
  .filter-check {
    position:absolute;
    width:1px;
    height:1px;
    opacity:0;
    pointer-events:none;
    display:block;
  }

  .filter-btn {
    width:100%;
    min-height:56px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--paper);
    padding:10px 16px;
    cursor:pointer;
  }
  .filter-btn span:not(.filter-count) { flex:1; min-width:0; display:flex; align-items:baseline; gap:8px; }
  .filter-btn small {
    color:var(--muted);
    font-size:.66rem;
    font-weight:800;
    letter-spacing:.14em;
    text-transform:uppercase;
  }
  .filter-btn b { color:var(--ink); font-size:1.02rem; font-weight:750; }
  .filter-count {
    flex:none;
    min-width:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:var(--brand-soft);
    color:var(--brand-deep);
    font-size:.92rem;
    font-weight:800;
    padding:4px 10px;
  }

  /* A chevron that turns over when the panel is open, so the button says which
     way it is about to go. */
  .filter-btn::after {
    content:"";
    flex:none;
    width:8px;
    height:8px;
    margin-left:-4px;
    border-right:2px solid var(--muted);
    border-bottom:2px solid var(--muted);
    transform:translateY(-3px) rotate(45deg);
  }
  .filter-check:focus-visible + .filter-btn { outline:2px solid var(--brand); outline-offset:2px; }
  .filter-check:checked + .filter-btn { border-color:var(--brand); }
  .filter-check:checked + .filter-btn::after { transform:translateY(2px) rotate(225deg); }

  .reg-tabs { display:none; }
  .filter-check:checked ~ .reg-tabs {
    display:grid;
    grid-template-columns:1fr;
    gap:0;
    margin-top:8px;
    border:1px solid var(--line);
    border-radius:12px;
    overflow:hidden;
  }
  .filter-check:checked ~ .reg-tabs .reg-tab {
    display:flex;
    align-items:center;
    gap:12px;
    border:0;
    border-bottom:1px solid var(--line);
    border-radius:0;
    padding:14px 16px;
  }
  .filter-check:checked ~ .reg-tabs .reg-tab:last-child { border-bottom:0; }
  .filter-check:checked ~ .reg-tabs .reg-tab b {
    order:2;
    min-width:32px;
    padding:3px 10px;
    border-radius:999px;
    background:var(--canvas);
    color:var(--muted);
    font-size:.88rem;
    text-align:center;
  }
  .filter-check:checked ~ .reg-tabs .reg-tab.on { background:var(--canvas); }
  .filter-check:checked ~ .reg-tabs .reg-tab.on b { background:var(--paper); color:var(--brand); }
  .filter-check:checked ~ .reg-tabs .reg-tab span {
    order:1;
    flex:1;
    font-size:.95rem;
    font-weight:650;
    letter-spacing:0;
    text-transform:none;
    color:var(--ink);
  }
  .filter-check:checked ~ .reg-tabs .reg-tab.on span { color:var(--brand); }

  .reg-search { gap:8px; }
  .reg-search input[type="search"] { flex-basis:100%; }
  .reg-clear { width:100%; padding:5px 2px 0; text-align:center; }

  /* Below this width the row carries the serial, the name and the phone only.
     Status and unit are one tap away in the record, and a row that tries to
     hold everything on a phone holds none of it legibly. */
  .member-list .m-meta { display:none; }
  .member-list > a { padding:15px 4px; }

  .record-head { align-items:flex-start; }
  .record-head .pill { margin-top:3px; }
  .record-contact-actions { grid-template-columns:1fr; }
  .record-facts { grid-template-columns:1fr; }
  .record-facts .rowline { grid-template-columns:1fr; }
  .admin-section { margin-top:42px; }
  .admin-section-head {
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }
  .admin-section-head h2 { font-size:1.7rem; }
  .record-actions .btn,
  .save-member,
  .tool-card .btn { width:100%; }
  .tool-card summary { min-height:62px; padding:14px 16px; }
  .tool-card-body { padding:16px; }
  .password-tool { margin-top:38px; }
  .profile-form > .btn { width:100%; }

  .portal-section-head { align-items:flex-start; flex-direction:column; }
  .portal-section-head { gap:5px; }
  .reg-tab b { font-size:1.45rem; }
  .reg-search .btn { width:100%; }

  .rowline { grid-template-columns:1fr; gap:2px; }
  .form-card { padding:22px; }
  .form-links { flex-direction:column; align-items:center; }

  .foot-inner { grid-template-columns:1fr; gap:30px; padding-top:42px; }
}

/* Below this the card is too narrow to hold a service name and its time on one
   line, so the time drops to its own row rather than squeezing the name. */
@media (max-width: 520px) {
  .service-card { grid-template-columns: 1fr; row-gap: 14px; }
  .service-time { justify-self: start; }
}

@media (max-width: 420px) {
  body { font-size:15px; }
  .brand img { width:44px; height:44px; }
  .hero .actions .btn { width:100%; }
  th, td { padding-inline:12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  .btn { transition:none; }
}
