/* ==========================================================================
   Ngwerere Bread of Life Church — design system
   Palette:
     --ink       #1E2A45  deep dusk-sky blue (nav, hero, footer)
     --ink-2     #16203A  darker ink for depth/gradients
     --gold      #C68A2E  harvest wheat gold (primary accent)
     --gold-dk   #9C6A1E  pressed/hover gold
     --clay      #9C3B2E  Zambian clay-soil red (secondary accent)
     --leaf      #2F4B3C  forest green (growth / life)
     --linen     #F1ECDD  warm linen paper (page background)
     --linen-2   #E8E0CB  deeper linen (panels, stripes)
     --charcoal  #24211B  warm near-black (body text)
   ========================================================================== */

:root {
  --ink: #1E2A45;
  --ink-2: #16203A;
  --gold: #C68A2E;
  --gold-dk: #9C6A1E;
  --clay: #9C3B2E;
  --leaf: #2F4B3C;
  --linen: #F1ECDD;
  --linen-2: #E8E0CB;
  --charcoal: #24211B;
  --paper: #FBF9F3;
  --line: rgba(36, 33, 27, 0.14);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", system-ui, sans-serif;

  --max: 1120px;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--linen);
  color: var(--charcoal);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 560; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--clay); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-dk); }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- woven stripe divider (chitenge-inspired) ---------- */
.woven-divider {
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0 26px,
    var(--clay) 26px 40px,
    var(--leaf) 40px 50px,
    var(--gold-dk) 50px 58px
  );
}

/* ---------- header / nav ---------- */
.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.brand:hover { color: var(--gold); }
.brand svg { flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #E7E2D2;
  text-decoration: none;
  font-size: 0.94rem;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: rgba(198, 138, 46, 0.18);
  color: var(--gold);
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 4px;
  }
  .nav-links.open { display: flex; }
  .nav { flex-wrap: wrap; }
  .nav-links a { padding: 10px 6px; }
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #F3EFE2;
  padding: 72px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: end;
}

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 { color: #fff; max-width: 14ch; }
.hero .lede { color: #D9D2BE; font-size: 1.1rem; max-width: 46ch; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--ink-2); }
.btn-gold:hover { background: #DDA43D; color: var(--ink-2); }
.btn-outline { border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-clay { background: var(--clay); color: #fff; }
.btn-clay:hover { background: #B24735; color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-2); color: var(--gold); }

/* today's reading card sits inside hero, offset panel */
.reading-card {
  background: var(--paper);
  color: var(--charcoal);
  padding: 26px 26px 22px;
  border-radius: var(--radius);
  border-left: 5px solid var(--gold);
  box-shadow: 8px 8px 0 rgba(0,0,0,0.18);
}
.reading-card .label { font-family: var(--font-display); font-style: italic; color: var(--clay); margin-bottom: 6px; font-size: 1.05rem; }
.reading-card .refs { font-weight: 600; margin-bottom: 10px; }
.reading-card blockquote { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.05rem; line-height: 1.5; }
.reading-card cite { font-style: normal; color: var(--ink); font-size: 0.85rem; }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--linen-2); }
.section-ink { background: var(--ink); color: #F3EFE2; }
.section-ink h2 { color: #fff; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p.kicker { margin: 0; color: var(--clay); font-family: var(--font-display); font-style: italic; font-size: 1.05rem; }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 22px;
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  inset: 6px auto auto 6px;
  width: 100%;
  height: 100%;
  background: var(--linen-2);
  z-index: -1;
}
.card-wrap { padding: 6px 6px 6px 0; }

.tag {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border: 1px solid var(--clay);
  color: var(--clay);
  border-radius: 999px;
  margin-bottom: 10px;
}

.media-16x9 {
  aspect-ratio: 16/9;
  background: var(--ink);
  overflow: hidden;
  margin-bottom: 12px;
}
.media-16x9 iframe, .media-16x9 video, .media-16x9 img { width: 100%; height: 100%; object-fit: cover; border: 0; }

/* ---------- list / ledger style (events, announcements) ---------- */
.ledger { border-top: 1px solid var(--line); }
.ledger-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) { .ledger-row { grid-template-columns: 1fr; gap: 4px; } }
.ledger-date {
  font-family: var(--font-display);
  color: var(--clay);
  font-size: 1.4rem;
  line-height: 1.1;
}
.ledger-date small { display: block; font-family: var(--font-body); font-size: 0.7rem; color: var(--ink); letter-spacing: 0.04em; }

/* ---------- forms ---------- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: var(--radius);
  color: var(--charcoal);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--gold);
  outline: none;
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.82rem; color: #5c5748; margin-top: 4px; }
.form-msg { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.92rem; }
.form-msg.ok { background: #E3EEE1; color: var(--leaf); border: 1px solid var(--leaf); }
.form-msg.err { background: #F4E1DC; color: var(--clay); border: 1px solid var(--clay); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink-2);
  color: #C9C2AC;
  padding: 48px 0 28px;
}
.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer a { color: #C9C2AC; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- misc ---------- */
.empty-state {
  border: 1.5px dashed var(--line);
  padding: 32px;
  text-align: center;
  color: #6b6656;
}

.badge-loading { color: #6b6656; font-style: italic; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin-table th { color: var(--ink); font-family: var(--font-display); font-weight: 600; }

.page-hero {
  background: var(--ink);
  color: #fff;
  padding: 48px 0;
}
.page-hero h1 { color: #fff; max-width: none; }
.page-hero p { color: #D9D2BE; }

/* ---------- gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gallery-item { margin: 0; background: var(--paper); border: 1px solid var(--line); }
.gallery-item img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-item figcaption { padding: 10px 12px; font-size: 0.85rem; color: #5c5748; }

/* ---------- full daily reading (devotions page) ---------- */
.reading-chapter { margin-bottom: 22px; }
.reading-chapter h3 { font-size: 1.05rem; color: var(--clay); margin-bottom: 6px; }
.reading-chapter p { max-width: 72ch; }
.verse-num { font-size: 0.72rem; vertical-align: super; color: var(--gold-dk); font-weight: 700; margin-right: 1px; }

/* ---------- simple month calendar grid ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cal-cell { background: var(--paper); min-height: 92px; padding: 6px; font-size: 0.8rem; }
.cal-cell.pad { background: var(--linen); }
.cal-cell .num { font-family: var(--font-display); color: var(--ink); font-size: 0.95rem; }
.cal-cell .evt { display: block; background: var(--gold); color: var(--ink-2); border-radius: 2px; padding: 1px 4px; margin-top: 3px; font-size: 0.72rem; line-height: 1.3; }
.cal-head { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--ink); padding: 6px 0; background: var(--linen-2); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav button { background: var(--ink); color: #fff; border: none; padding: 8px 14px; cursor: pointer; border-radius: var(--radius); }
.cal-nav button:hover { background: var(--ink-2); }
.cal-nav h3 { margin: 0; }
