/* ── CSS Variables (defaults — overridden dynamically by app.js from DB settings) ── */
:root {
  --color-primary:    #6b4c2a;
  --color-accent:     #c4882a;
  --color-bg:         #fdf8f3;
  --color-text:       #2c1a0e;
  --color-surface:    #fff8f0;
  --color-border:     #e8d9c5;
  --color-muted:      #8a6a4a;
  --color-hero-overlay: rgba(44, 26, 14, 0.52);
  --font-heading:     'Playfair Display', Georgia, serif;
  --font-body:        'Source Sans 3', system-ui, sans-serif;
  --radius:           10px;
  --shadow:           0 2px 12px rgba(107, 76, 42, 0.10);
  --shadow-card:      0 4px 20px rgba(107, 76, 42, 0.12);
  --transition:       0.18s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ── Navbar ── */
#navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-size: 17px; font-weight: 600;
  color: var(--color-primary);
}
#nav-logo-img { height: 38px; width: auto; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--color-muted);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--color-primary); text-decoration: none; }
.btn-outline {
  padding: 6px 16px; border: 1.5px solid var(--color-accent);
  border-radius: 6px; color: var(--color-accent) !important;
  font-weight: 600; transition: background var(--transition), color var(--transition);
}
.btn-outline:hover {
  background: var(--color-accent); color: #fff !important; text-decoration: none;
}

/* ── Hero ── */
#hero {
  position: relative; min-height: 480px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary);
  background-image: url('/uploads/hero.webp');
  background-size: cover; background-position: center;
  overflow: hidden;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: var(--color-hero-overlay);
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center; padding: 60px 24px;
  color: #fff;
}
.hero-cross {
  font-size: 36px; opacity: 0.85; margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-content h1 {
  font-family: var(--font-heading); font-size: clamp(28px, 5vw, 48px);
  font-weight: 600; line-height: 1.2; margin-bottom: 14px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero-content p {
  font-size: clamp(15px, 2vw, 18px); opacity: 0.92;
  max-width: 520px; margin: 0 auto 28px;
}
.btn-hero {
  display: inline-block;
  background: var(--color-accent); color: #fff;
  padding: 13px 32px; border-radius: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-hero:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  text-decoration: none;
}

/* ── Directory section ── */
#directory { padding: 64px 0 80px; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-header h2 {
  font-family: var(--font-heading); font-size: 32px;
  color: var(--color-primary); margin-bottom: 8px;
}
.section-header p { font-size: 16px; color: var(--color-muted); }

/* ── Denomination tabs ── */
.denom-tabs {
  display: flex; justify-content: center; gap: 10px; margin-bottom: 32px;
}
.denom-tab {
  padding: 8px 22px; border-radius: 24px; border: 1.5px solid var(--color-border);
  background: var(--color-surface); color: var(--color-muted);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.denom-tab.active, .denom-tab:hover {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}

/* ── Location grid ── */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.loc-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 20px 14px;
  text-align: center; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.loc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--color-accent);
}
.loc-card.active {
  border-color: var(--color-primary); border-width: 2px;
  background: #fff5e8;
}
.loc-icon { font-size: 28px; margin-bottom: 8px; }
.loc-name {
  font-family: var(--font-heading); font-size: 15px; font-weight: 600;
  color: var(--color-primary);
}
.loc-count { font-size: 12px; color: var(--color-muted); margin-top: 3px; }

/* ── Church panel ── */
.church-panel { margin-top: 40px; }
.panel-header {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 12px; margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.back-btn {
  background: none; border: 1px solid var(--color-border);
  border-radius: 6px; padding: 6px 14px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--color-muted); cursor: pointer;
  transition: all var(--transition);
}
.back-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.panel-header h3 {
  font-family: var(--font-heading); font-size: 22px;
  color: var(--color-primary); flex: 1;
}
#panel-count { font-size: 13px; color: var(--color-muted); }

/* ── Church cards ── */
.church-list { display: flex; flex-direction: column; gap: 16px; }
.church-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex; gap: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.church-card:hover { box-shadow: var(--shadow-card); }

.church-photo-wrap {
  width: 130px; flex-shrink: 0; position: relative;
  background: #eedfc8; overflow: hidden;
}
.church-photo {
  width: 100%; height: 100%; object-fit: cover;
}
.church-photo-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--color-border); opacity: 0.6;
}

.church-body { padding: 18px 20px; flex: 1; min-width: 0; }
.church-card-top {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.church-name {
  font-family: var(--font-heading); font-size: 18px; font-weight: 600;
  color: var(--color-primary); flex: 1;
}
.church-denom-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 4px;
  background: #f0e6d3; color: var(--color-primary);
  white-space: nowrap; flex-shrink: 0;
}

.church-details { margin-bottom: 14px; }
.detail-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 5px; font-size: 14px; color: var(--color-muted);
}
.detail-icon { flex-shrink: 0; font-size: 13px; margin-top: 2px; }
.detail-text { line-height: 1.45; }
.desc-text { font-size: 14px; color: var(--color-muted); font-style: italic; }

.church-links { display: flex; flex-wrap: wrap; gap: 8px; }
.church-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; padding: 5px 12px;
  border-radius: 6px; border: 1px solid var(--color-border);
  color: var(--color-muted); background: #fff;
  transition: all var(--transition); cursor: pointer;
}
.church-link:hover { border-color: var(--color-accent); color: var(--color-accent); text-decoration: none; }
.church-link.map { color: #1a6fb5; border-color: #b8d4f0; background: #f0f6ff; }
.church-link.map:hover { background: #1a6fb5; color: #fff; border-color: #1a6fb5; }
.church-link.website { color: #2a6b2a; border-color: #b8dcb8; background: #f0f8f0; }
.church-link.website:hover { background: #2a6b2a; color: #fff; }
.church-link.facebook { color: #1877f2; border-color: #c0d8fc; background: #f0f4ff; }
.church-link.facebook:hover { background: #1877f2; color: #fff; }

.empty-message {
  text-align: center; padding: 48px 24px;
  color: var(--color-muted); font-size: 15px;
}
.empty-message .empty-icon { font-size: 36px; margin-bottom: 12px; }

/* ── Submit section ── */
.submit-section {
  background: var(--color-primary);
  padding: 56px 24px;
}
.submit-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 24px;
}
.submit-text h2 {
  font-family: var(--font-heading); font-size: 26px;
  color: #fff; margin-bottom: 6px;
}
.submit-text p { color: rgba(255,255,255,0.82); font-size: 15px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-accent); color: #fff;
  padding: 13px 28px; border-radius: 8px;
  font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn-primary:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  text-decoration: none; color: #fff;
}

/* ── About ── */
.about-section { padding: 64px 0; }
.about-inner { max-width: 680px; margin: 0 auto; text-align: center; }
.about-inner h2 {
  font-family: var(--font-heading); font-size: 28px;
  color: var(--color-primary); margin-bottom: 16px;
}
.about-inner p { font-size: 16px; color: var(--color-muted); line-height: 1.75; }

/* ── Footer ── */
#site-footer {
  background: var(--color-text); color: rgba(255,255,255,0.65);
  padding: 24px;
}
#site-footer .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
#footer-text { font-size: 13px; }
.footer-admin-link {
  font-size: 12px; color: rgba(255,255,255,0.35);
  transition: color var(--transition);
}
.footer-admin-link:hover { color: rgba(255,255,255,0.7); text-decoration: none; }

/* ── Loading spinner ── */
.spinner {
  display: flex; justify-content: center; padding: 40px;
}
.spinner::after {
  content: ''; width: 32px; height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .church-photo-wrap { width: 90px; }
  .church-name { font-size: 16px; }
  .submit-inner { flex-direction: column; text-align: center; }
  .nav-links a:not(.btn-outline) { display: none; }
}
