/* Church Directory - redesigned site styles. Warm palette: off-white paper,
   deep navy ink, gold accent; Fraunces headings, Inter text. */
:root {
    --bg: #FBF8F3;
    --surface: #FFFFFF;
    --tint: #F5EFE4;
    --ink: #1F2A44;
    --ink-2: #33415F;
    --text: #2B2F3A;
    --muted: #6B7080;
    --line: #EAE2D3;
    --gold: #C8963E;
    --gold-dark: #A77A28;
    --gold-soft: #FBF1DE;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(31, 42, 68, .05), 0 6px 20px rgba(31, 42, 68, .06);
    --shadow-lg: 0 12px 34px rgba(31, 42, 68, .12);
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--ink-2); text-decoration-color: rgba(51, 65, 95, .35); text-underline-offset: 3px; }
a:hover { color: var(--gold-dark); }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.2; font-weight: 600; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 248, 243, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.brand strong { font-weight: 700; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; color: var(--gold); }
.site-nav { display: flex; gap: 6px; }
.site-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.site-nav a:hover { background: var(--tint); color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s; content: ''; }
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; padding: 44px 0 40px; background: linear-gradient(160deg, rgba(31, 42, 68, .96) 0%, rgba(31, 42, 68, .88) 55%, rgba(66, 52, 34, .82) 100%), url('/assets/img/hero_bg.webp') center / cover no-repeat; }
.hero h1 { color: #fff; font-size: clamp(28px, 4.2vw, 46px); margin-bottom: 12px; max-width: 900px; }
.hero-lead { font-size: clamp(16px, 1.6vw, 19px); color: rgba(255, 255, 255, .86); max-width: 760px; }
.hero-search { padding: 56px 0 48px; }
.hero-sub { font-family: var(--sans); font-size: 16px; font-weight: 500; color: rgba(255, 255, 255, .8); margin: 0 0 12px; letter-spacing: 0; }
.hero-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 4px 0 22px; color: rgba(255, 255, 255, .8); font-size: 15px; }
.hero-stats strong { color: #fff; font-size: 18px; font-weight: 700; margin-right: 4px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 14px; font-size: 14px; }
.breadcrumbs li { color: rgba(255, 255, 255, .7); }
.breadcrumbs li + li::before { content: '›'; margin: 0 6px 0 2px; color: rgba(255, 255, 255, .45); }
.breadcrumbs a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.breadcrumbs a:hover { color: #fff; text-decoration: underline; }

/* ---------- search form ---------- */
.near-form { display: flex; flex-wrap: wrap; gap: 10px; max-width: 820px; background: #fff; padding: 8px; border-radius: 16px; box-shadow: var(--shadow-lg); }
.near-input { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg); border-radius: 10px; border: 1px solid transparent; }
.near-input:focus-within { border-color: var(--gold); background: #fff; }
.near-input svg { width: 20px; height: 20px; color: var(--gold-dark); flex: none; }
.near-input input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; padding: 12px 0; color: var(--text); outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 10px; border: 0; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .15s, color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--tint); color: var(--ink); }
.btn-ghost-dark { background: var(--tint); color: var(--ink); }
.btn-ghost-dark:hover { background: #ECE3D2; color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- sections ---------- */
.section { padding: 48px 0; }
.section-tint { background: var(--tint); }
.section-head { margin-bottom: 22px; max-width: 760px; }
.section-head h2, .h-section { font-size: clamp(22px, 2.4vw, 30px); }
.section-head p { color: var(--muted); margin: 0; }
.section-head-row { max-width: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.section-head-row h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- tiles (states / denominations) ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .15s, border-color .15s; }
.tile:hover { box-shadow: var(--shadow); border-color: #E0D3BC; }
.tile-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.tile-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.tile-count { flex: none; background: var(--gold-soft); color: var(--gold-dark); font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.tile-more { border-top: 1px solid var(--line); }
.tile-more summary { list-style: none; cursor: pointer; padding: 8px 16px; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.tile-more summary::-webkit-details-marker { display: none; }
.tile-more summary::after { content: '+'; font-size: 16px; color: var(--gold-dark); }
.tile-more[open] summary::after { content: '−'; }
.tile-more ul { list-style: none; margin: 0; padding: 0 16px 12px; }
.tile-more li a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 14px; text-decoration: none; color: var(--ink-2); }
.tile-more li a:hover { color: var(--gold-dark); }
.tile-more li span { color: var(--muted); font-size: 12px; }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.church-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, transform .15s; }
.church-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.church-card.has-article { border-top: 3px solid var(--gold); }
.church-card h3 { font-size: 18px; margin: 0; }
.church-card h3 a { color: var(--ink); text-decoration: none; }
.church-card h3 a::after { content: ''; }
.church-card h3 a:hover { color: var(--gold-dark); }
.card-place { color: var(--muted); font-size: 14px; margin: 0; }
.card-miles { color: var(--gold-dark); font-weight: 700; font-size: 14px; margin: 0; }
.card-summary { font-size: 14px; color: var(--text); margin: 4px 0 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; border: 1px solid transparent; line-height: 1.4; }
a.chip:hover { background: #ECE3D2; color: var(--ink); }
.chip span { color: var(--muted); font-size: 12px; }
.chip-muted { background: transparent; border-color: var(--line); }
.chip-gold { background: var(--gold-soft); color: var(--gold-dark); }
.chip-lg { padding: 7px 14px; font-size: 14px; }
.chip-hero { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .2); }
a.chip-hero:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.chip-toggle { cursor: pointer; font: inherit; font-size: 13px; }
.chip-toggle.is-active { background: var(--ink); color: #fff; }
.chip-toggle.is-active span { color: rgba(255, 255, 255, .7); }
.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.denom-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }

/* ---------- lists ---------- */
.list-filter { flex: 0 1 320px; padding: 11px 14px; font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.list-filter:focus { border-color: var(--gold); outline: none; }
.letter-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 8px 0; }
.letter-nav a { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.letter-nav a:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.az-list { columns: 4 240px; column-gap: 28px; }
.az-group { break-inside: avoid; margin-bottom: 18px; }
.az-group h3 { font-size: 22px; color: var(--gold-dark); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 6px; }
.az-group ul, .link-columns, .rank-list { list-style: none; margin: 0; padding: 0; }
.az-group li, .link-columns li, .rank-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 15px; }
.az-group a, .link-columns a, .rank-list a { text-decoration: none; color: var(--ink-2); }
.az-group a:hover, .link-columns a:hover, .rank-list a:hover { color: var(--gold-dark); text-decoration: underline; }
.link-columns { columns: 2 200px; column-gap: 24px; }
.link-columns li { break-inside: avoid; }
.rank-list li { border-bottom: 1px solid var(--line); padding: 9px 0; }
.city-groups { columns: 3 300px; column-gap: 28px; }
.city-group { break-inside: avoid; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px; }
.city-group h3 { font-size: 18px; display: flex; justify-content: space-between; align-items: baseline; }
.city-group h3 a { text-decoration: none; color: var(--ink); }
.city-group ul { list-style: none; margin: 0; padding: 0; }
.city-group li { padding: 5px 0; border-top: 1px solid #F3EDE2; font-size: 15px; }
.city-group li a { text-decoration: none; }
.city-group .sub { display: none; }
.dot-gold { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); vertical-align: middle; margin-left: 4px; }
.filter-empty { color: var(--muted); }
[hidden] { display: none !important; }
.more-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- maps ---------- */
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #EDE6D8; box-shadow: var(--shadow); }
.map { height: var(--map-h, 420px); width: 100%; position: relative; z-index: 1; }
.map-placeholder { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
.leaflet-popup-content a { font-weight: 600; color: var(--ink); }
.usa-map-wrap { max-width: 980px; margin: 0 auto; }
.usa-map-wrap .cmm-usa { margin-top: 0 !important; }
.usa-map-wrap .cmm-usa-hover-state-info { box-shadow: var(--shadow-lg) !important; border-radius: 12px !important; font-family: var(--sans); }
.usa-map-wrap .cmm-usa-hover-state-info span:first-child { color: var(--ink) !important; font-family: var(--serif); font-size: 16px; }

/* ---------- church page ---------- */
.church-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.church-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.church-aside { display: flex; flex-direction: column; gap: 14px; }
.card-pad { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px; }
.card-pad > h2 { font-size: 24px; }
.prose { font-size: 17.5px; line-height: 1.75; color: #2A2E38; }
.prose h2 { font-size: 26px; margin: 1.6em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 21px; margin: 1.4em 0 .4em; }
.prose h4 { font-family: var(--sans); font-size: 17px; margin: 1.2em 0 .3em; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--gold); }
.prose blockquote { margin: 1em 0; padding: .4em 1em; border-left: 3px solid var(--gold); color: var(--ink-2); font-style: italic; }
.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold-dark); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 10px 0 0; color: var(--text); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-contact { border-top: 3px solid var(--gold); }
.panel-title { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-dark); margin: 0 0 10px; }
.panel p { margin: 0 0 6px; font-size: 15px; }
.panel-address { font-weight: 600; color: var(--ink); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.panel-actions .btn { flex: 1; }
.link-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 14px; }
.schedule, .facts { margin: 0; }
.schedule dt, .facts dt { font-weight: 700; color: var(--ink); font-size: 14px; margin-top: 10px; }
.schedule dt:first-child, .facts dt:first-child { margin-top: 0; }
.schedule dd, .facts dd { margin: 2px 0 0; font-size: 14.5px; color: var(--text); }
.leaders { list-style: none; margin: 0; padding: 0; }
.leaders li { padding: 7px 0; border-top: 1px solid #F3EDE2; font-size: 15px; }
.leaders li:first-child { border-top: 0; padding-top: 0; }
.leaders strong { display: block; color: var(--ink); }
.leaders span { color: var(--muted); font-size: 14px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tags li { background: var(--tint); border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--ink-2); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; margin: 0; }
.detail-grid dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail-grid dd { margin: 2px 0 0; color: var(--ink); }
.section-nearby { margin-top: 40px; }

/* ---------- near me ---------- */
.search-panel { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); margin-bottom: 20px; }
.search-panel select { padding: 12px; font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.result-summary { font-size: 17px; color: var(--ink); font-weight: 600; margin: 8px 0 16px; }
.results-grid { margin-top: 20px; }
.notice { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); padding: 14px 18px; }
.notice-error { border-left-color: #B4533A; color: #7A3322; }
.intro-grid { max-width: 800px; }

/* ---------- empty / 404 ---------- */
.empty-state { text-align: center; padding: 60px 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .75); margin-top: 0; padding: 44px 0 20px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.brand-footer { color: #fff; margin-bottom: 8px; }
.brand-footer:hover { color: #fff; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 28px; padding-top: 16px; font-size: 13px; }
.footer-bottom p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .church-layout { grid-template-columns: 1fr; }
    .church-aside { position: static; order: -1; }
    .two-col { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 720px) {
    .container { padding: 0 16px; }
    .nav-toggle { display: block; }
    .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px 16px; box-shadow: var(--shadow); }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: 12px 10px; border-radius: 8px; }
    .hero { padding: 30px 0 28px; }
    .hero-search { padding: 36px 0 30px; }
    .near-form { padding: 6px; }
    .near-form .btn { flex: 1 1 auto; }
    .section { padding: 34px 0; }
    .card-pad { padding: 20px 18px; }
    .prose { font-size: 16.5px; }
    .az-list { columns: 2 150px; }
    .tile-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .tile-main { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
    .tile-title { font-size: 14px; }
    .tile-more summary { padding: 7px 12px; font-size: 12px; }
    .tile-more ul { padding: 0 12px 10px; }
    .letter-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .letter-nav a { flex: none; }
    .search-panel > * { flex: 1 1 100%; }
    .footer-grid { grid-template-columns: 1fr; }
    .list-filter { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
