/*
  ChurchOS public site.
  Signature: the "hymn board" — service times set like the slatted number board at the front of a sanctuary.
  Brand colours come from Admin → Settings (--brand, --accent), so every church looks like itself.
*/
:root {
  --brand: #7a2e3a;
  --accent: #c9a227;
  --ink: #1a1d24;
  --ink-soft: #4a505c;
  --paper: #ffffff;
  --mist: #eef1f4;
  --line: #dde2e8;
  --board: #2b2118;
  --board-slat: #3a2d21;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --wrap: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--body); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--paper); }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.prose { max-width: 68ch; }
.prose p { white-space: pre-line; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 56ch; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.logo { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.logo img { width: 40px; height: 40px; object-fit: contain; }
.logo .mark { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--brand); }
.nav a.on { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem; font-size: 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.3rem; border-radius: 6px; border: 2px solid var(--brand); background: var(--brand); color: #fff; font: 600 1rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.light { background: #fff; color: var(--brand); border-color: #fff; }
.nav .btn { color: #fff; padding: .55rem 1.1rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Hero */
.hero { background: var(--brand); color: #fff; position: relative; overflow: hidden; }
.hero.has-photo { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 92%, #000) 0%, color-mix(in srgb, var(--brand) 70%, transparent) 60%, transparent 100%), var(--hero) center/cover; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr .9fr; gap: 3rem; align-items: center; padding-top: 4.5rem; padding-bottom: 4.5rem; }
.hero h1 { color: #fff; max-width: 14ch; }
.hero .tagline { font-size: 1.3rem; opacity: .92; max-width: 40ch; }
.hero .cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero .denomination { opacity: .8; margin-bottom: .75rem; font-weight: 600; }

/* The hymn board */
.hymn-board { background: var(--board); border-radius: 6px; padding: 18px 16px 20px; box-shadow: inset 0 0 0 6px #22190f, 0 18px 40px rgba(0,0,0,.35); color: #f3ead8; }
.hymn-board .board-title { font-family: var(--display); font-weight: 600; text-align: center; font-size: 1rem; color: var(--accent); margin: 2px 0 14px; letter-spacing: .02em; }
.slat { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: baseline; background: var(--board-slat); border-top: 1px solid #4a3a2b; border-bottom: 2px solid #1d150e; padding: .65rem .9rem; margin-bottom: 8px; border-radius: 2px; }
.slat:last-child { margin-bottom: 0; }
.slat .what { font-size: 1rem; }
.slat .when { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Sections */
section { padding: 4.5rem 0; }
section.tint { background: var(--mist); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; }
.page-hero { background: var(--mist); padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }

/* Announcements strip */
.notices { background: color-mix(in srgb, var(--accent) 18%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, #fff); padding: 1.1rem 0; }
.notices .wrap { display: grid; gap: .6rem; }
.notice strong { font-family: var(--display); }

/* Sermon feature */
.feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: center; }
.video { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 6px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sermon-meta { color: var(--ink-soft); font-size: .95rem; }
.scripture { font-family: var(--display); font-weight: 600; color: var(--brand); }

/* Lists */
.sermon-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.sermon-item a { text-decoration: none; color: inherit; }
.sermon-item .thumb { aspect-ratio: 16/9; background: var(--brand); border-radius: 4px; overflow: hidden; margin-bottom: .8rem; display: grid; place-items: center; color: #fff; font-family: var(--display); font-size: 1.1rem; padding: 1rem; text-align: center; }
.sermon-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sermon-item h3 { margin: 0 0 .25rem; }
.sermon-item a:hover h3 { color: var(--brand); }

.event-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.event-row { display: grid; grid-template-columns: 76px 1fr auto; gap: 1.25rem; align-items: center; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.date-block { text-align: center; border: 2px solid var(--brand); border-radius: 6px; padding: .3rem 0 .4rem; line-height: 1.1; }
.date-block .d { display: block; font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--brand); }
.date-block .m { display: block; font-size: .85rem; font-weight: 600; }
.event-row h3 { margin: 0 0 .15rem; }
.event-row h3 a { color: var(--ink); text-decoration: none; }
.event-row h3 a:hover { color: var(--brand); }
.event-row .where { color: var(--ink-soft); font-size: .95rem; }

.ministry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ministry { padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.ministry img { aspect-ratio: 3/2; object-fit: cover; width: 100%; border-radius: 4px; margin-bottom: .9rem; }
.ministry h3 { margin-bottom: .3rem; }
.ministry .meets { color: var(--ink-soft); font-size: .95rem; margin-bottom: .5rem; }

/* Give band */
.give-band { background: var(--ink); color: #fff; }
.give-band .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; }
.give-band h2 { color: #fff; }
.give-band p { color: #c9ced8; }
.paybill { border: 2px solid var(--accent); border-radius: 8px; padding: 1.25rem 1.5rem; }
.paybill .label { color: #c9ced8; font-size: .95rem; }
.paybill .num { font-family: var(--display); font-weight: 700; font-size: 2.2rem; color: #fff; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* Forms (Give, Contact) */
.form-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 1.75rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field input, .field select, .field textarea { width: 100%; padding: .75rem .85rem; border: 1px solid #c4cad3; border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
.field textarea { min-height: 140px; }
.field .err { color: #b3261e; font-size: .9rem; margin-top: .3rem; }
.funds { display: grid; gap: .55rem; }
.fund-option { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid #c4cad3; border-radius: 6px; padding: .8rem .9rem; cursor: pointer; }
.fund-option input { margin-top: .35rem; accent-color: var(--brand); }
.fund-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.fund-option .desc { color: var(--ink-soft); font-size: .92rem; }
.amounts { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.amounts button { border: 1px solid #c4cad3; background: #fff; border-radius: 6px; padding: .5rem .9rem; font: 600 .95rem var(--body); cursor: pointer; }
.amounts button:hover { border-color: var(--brand); color: var(--brand); }
.flash { padding: 1rem 1.2rem; border-radius: 6px; margin-bottom: 1.25rem; }
.flash.ok { background: #e5f4ec; color: #145236; border: 1px solid #b9e0cb; }
.flash.bad { background: #fbe8e6; color: #7a1a14; border: 1px solid #f1c2bd; }
.flash.wait { background: #eaf0f8; color: #1d3f72; border: 1px solid #c8d6ea; }
.hp { position: absolute; left: -9999px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.map { width: 100%; aspect-ratio: 4/3; border: 0; border-radius: 6px; }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 2.5rem 0 0; }
.pagination .page-link { display: block; padding: .45rem .85rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); }
.pagination .active .page-link { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled .page-link { color: #aaa; }
nav .small.text-muted, nav p.small { color: var(--ink-soft); font-size: .9rem; }
nav .d-sm-none { display: none; }
.empty { color: var(--ink-soft); padding: 1.5rem 0; }

/* Footer */
.site-footer { background: #13151a; color: #b9bfca; padding: 3.5rem 0 1.5rem; font-size: .97rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.site-footer h3 { color: #fff; font-size: 1.05rem; }
.site-footer a { color: #e6e9ef; }
.site-footer p { white-space: pre-line; }
.site-footer .base { border-top: 1px solid #2a2e36; padding-top: 1.25rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .88rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap, .feature, .give-band .wrap, .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .sermon-list, .ministry-grid { grid-template-columns: 1fr 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--paper); flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line); padding: .5rem 20px 1rem; }
  .nav.open { display: flex; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: .75rem; border-bottom: 0; }
  section { padding: 3rem 0; }
  .hero .wrap { padding-top: 3rem; padding-bottom: 3rem; }
}
@media (max-width: 560px) {
  .sermon-list, .ministry-grid, .site-footer .cols { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 64px 1fr; }
  .event-row .btn { grid-column: 2; justify-self: start; }
}
.field .fund-option input { width: auto; flex: none; }
