/* North Newington Baptist Church — styled after cosdowntown.org's actual
   design language: warm paper background, serif headings + grotesque body,
   a full-bleed photographic hero, generous whitespace, and a deep-navy
   footer. Fonts self-hosted (no CDN); both are variable (one file/family). */

@font-face {
  font-family: 'Inter';
  src: url("../fonts/inter.var.260c81a4759b.woff2") format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url("../fonts/source-serif-4.var.e9192c2fe0a3.woff2") format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}

:root {
  /* cosdowntown's ACTUAL applied palette (eyedropped from the live site):
     white page, near-black text, olive header, ochre primary button,
     olive secondary button, black footer. */
  --paper:   #ffffff;          /* page background */
  --paper-2: #f5f5f3;          /* subtle alt band */
  --surface: #ffffff;
  --navy:    #0e172d;          /* headings (near-black on white) */
  --ink:     #0e172d;          /* body text */
  --olive:   #525a43;          /* header, secondary button, calendar head */
  --ochre:   #9e6327;          /* primary button, accent */
  --ochre-dk:#824f1f;          /* primary button hover */
  --olive-dk:#3f4634;          /* secondary button hover */
  --footer:  #111111;          /* black footer */
  --blue:    #0e172d;          /* legacy var → links resolve to ink */
  --blue-dk: #0e172d;
  --sky:     #c9c5ba;          /* footer text/links (light on black) */
  --lime:    #d8a766;          /* footer link hover (warm) */
  --muted:   #5c6470;
  --line:    #e6e6e3;          /* hairlines on white */
  --serif:   'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --maxw:    66rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.65;
  font-size: 1.02rem;
  /* Sticky footer: footer sits at the bottom even on short pages. */
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
h1, h2, h3, .brand {
  font-family: var(--serif); color: var(--navy); line-height: 1.18;
  font-weight: 600; letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ochre); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }

/* ---- Header: solid olive bar, light text ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--olive); color: #fff;
  border-bottom: 1px solid rgba(0,0,0,.18);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .35rem 1.5rem; padding: .9rem 1.5rem;
}
.site-header .brand {
  font-size: 1.3rem; font-weight: 600; text-decoration: none;
  color: #fff; margin-right: auto;
}
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-nav a {
  color: #f0efe7; text-decoration: none; font-size: .93rem;
  padding: .15rem 0; border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: #fff; }

/* ---- Mobile hamburger nav (no-JS; CSS checkbox-label toggle) ---- */
.nav-toggle { position: absolute; left: -9999px; }   /* visually hidden, keyboard-reachable */
.nav-burger { display: none; cursor: pointer; padding: .35rem .4rem; border-radius: 4px; user-select: none; }
.nav-burger span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; transition: transform .18s ease, opacity .18s ease; }

/* Desktop (≥ 56rem): hamburger hidden, nav inline as before. */
@media (min-width: 56rem) {
  .nav-toggle, .nav-burger { display: none !important; }
}

/* Mobile (< 56rem): hamburger visible, nav collapsed until checked. */
@media (max-width: 55.999rem) {
  .site-header .wrap { align-items: center; }
  .nav-burger  { display: inline-block; order: 3; margin-left: .25rem; }
  .lang-switch { order: 2; margin-left: auto; }
  .site-nav    { order: 4; width: 100%; flex-direction: column; gap: 0;
                 max-height: 0; overflow: hidden;
                 transition: max-height .25s ease; }
  .site-nav a  { padding: .85rem 0; border-bottom: 1px solid rgba(255,255,255,.18); }
  .nav-toggle:checked ~ .site-nav { max-height: 32rem; }
  /* Hamburger morph → × when menu is open. */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  /* Focus ring on the visible label (the checkbox itself is off-screen). */
  .nav-toggle:focus-visible ~ .nav-burger { outline: 2px solid #fff; outline-offset: 2px; }
}

/* ---- Hero: full-bleed church photo, serif headline, one CTA ---- */
.hero {
  position: relative; color: #fff;
  /* 4:3 photo (2000x1506): bias toward the top so the steeple stays in
     frame, and give it enough height that little is cropped. */
  background: var(--ink) center 18% / cover no-repeat;
  min-height: clamp(24rem, 64vh, 40rem);
  display: flex; align-items: flex-end;
}
.hero::after {           /* legibility gradient over the photo */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(14,23,45,.20) 0%, rgba(14,23,45,.45) 45%, rgba(14,23,45,.86) 100%);
}
.hero .wrap { position: relative; z-index: 1; padding-top: 3rem; padding-bottom: 3rem; }
.hero h1 { color: #fff; margin: 0 0 .5rem; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.hero p {
  color: #fff; font-size: 1.15rem; margin: 0 0 1.4rem;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
}

/* ---- Sections / bands ---- */
main { padding-bottom: 3.5rem; }
.section { padding: 2.5rem 0; }
.band-alt { background: var(--paper-2); border-block: 1px solid var(--line); }
main > .wrap { padding-top: 2.5rem; }
.lead { font-size: 1.15rem; color: #33404f; }

/* Simple interior page title (NOT the photographic home hero). */
.page-head {
  padding: .5rem 0 1.25rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0 0 .25rem; }
.page-head p { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 44rem) { .two-col { grid-template-columns: 1fr; } }

/* ---- Home-page section bands (palette-driven, full-width) ---- */
.section--paper   { background: var(--paper); }
.section--paper-2 { background: var(--paper-2); }
.section--olive   { background: var(--olive); }
.section--ochre   { background: var(--ochre); }
/* White text on the colored bands. */
.section--olive, .section--olive h2, .section--olive p, .section--olive small, .section--olive a,
.section--ochre, .section--ochre h2, .section--ochre p, .section--ochre small, .section--ochre a {
  color: #fff;
}
.section--olive a, .section--ochre a { text-decoration: underline; text-underline-offset: .15em; }
.section--olive a:hover, .section--ochre a:hover { color: #fff; opacity: .85; }
/* Cards stay white-card on colored bands (nice pop). */
.section--olive .card, .section--ochre .card { color: var(--ink); }
.section--olive .card a, .section--ochre .card a { color: var(--ink); text-decoration: none; }
.section--olive .card a:hover, .section--ochre .card a:hover { color: var(--ochre); opacity: 1; }
/* Sermons + Devotionals: framed sub-regions on the ochre band. */
.section--ochre .two-col > div {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

/* ---- Cards ---- */
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.1rem 1.25rem;
}
.card a { text-decoration: none; }
.card a:hover { text-decoration: underline; }
.card small { color: var(--muted); font-size: .85rem; }
.card.priority-important { border-left: 4px solid #c98a00; }
.card.priority-urgent { border-left: 4px solid #c0392b; }
.banner { border-radius: 12px; margin: .5rem 0 1.25rem; }
.prose p { margin: 0 0 1rem; }
ul.meta { list-style: none; padding: 0; }
ul.meta li { margin: .2rem 0; }
p.meta { color: var(--muted); }
.err { color: #c0392b; font-size: .9rem; }

/* ---- Buttons / forms ---- */
.btn, button[type=submit] {        /* primary = ochre */
  display: inline-block; background: var(--ochre); color: #fff;
  border: 0; border-radius: 999px; padding: .7rem 1.5rem;
  font: 600 .98rem/1 var(--sans); cursor: pointer; text-decoration: none;
}
.btn:hover, button[type=submit]:hover { background: var(--ochre-dk); color: #fff; }
.btn--ghost {                       /* secondary = olive */
  background: var(--olive); color: #fff; box-shadow: none;
}
.btn--ghost:hover { background: var(--olive-dk); color: #fff; }
button[disabled] { background: var(--muted); cursor: not-allowed; }
/* Inline text-style action (e.g. "Re-translate" in the pastor dashboard) —
   overrides the big ochre pill that button[type=submit] gets by default. */
button.linklike, button.linklike:hover {
  display: inline; background: none; color: var(--ochre-dk);
  border: 0; padding: 0; border-radius: 0;
  font: inherit; cursor: pointer; text-decoration: underline;
}
.auth { max-width: 36rem; }
form p { margin: .7rem 0; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; max-width: 30rem; padding: .55rem .7rem;
  border: 1px solid #ccc6ba; border-radius: 8px; font: inherit;
  background: var(--surface);
}
input[type=checkbox] { margin-right: .45rem; }
.pagination { display: flex; gap: 1.25rem; align-items: center; margin: 1.75rem 0; }

/* ---- About / pastor ---- */
.pastor { display: grid; grid-template-columns: 240px 1fr; gap: 1.75rem; align-items: start; }
.pastor img { width: 240px; border-radius: 14px; border: 1px solid var(--line); }
@media (max-width: 40rem) {
  .pastor { grid-template-columns: 1fr; }
  .pastor img { width: 210px; }
}

/* ---- Calendar ---- */
.cal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; }
.cal-nav a { margin-left: 1.1rem; text-decoration: none; }
table.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--surface); border: 1px solid var(--line); }
table.calendar th { background: var(--olive); color: #fff; padding: .45rem; font-size: .78rem; font-weight: 600; }
table.calendar td { border: 1px solid var(--line); vertical-align: top; height: 6.5rem; padding: .3rem; overflow: hidden; }
table.calendar td.out { background: #faf8f4; color: #b9b3a7; }
table.calendar td.today { box-shadow: inset 0 0 0 2px var(--ochre); }
table.calendar .daynum { font-size: .78rem; color: var(--muted); text-align: right; }
table.calendar .evt { display: block; font-size: .72rem; line-height: 1.3; margin-top: .2rem; padding: .12rem .35rem; background: #e9eefc; border-radius: 5px; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.calendar .evt .t { color: var(--ochre); font-weight: 600; }

/* ---- Messages ---- */
ul.messages { list-style: none; max-width: var(--maxw); margin: 1rem auto 0; padding: 0 1.5rem; }
ul.messages li { padding: .6rem .9rem; border-radius: 8px; margin: .4rem 0; background: #eaf0ff; }
ul.messages li.error { background: #fdecea; }
ul.messages li.success { background: #e9f7ef; }

/* ---- Footer: black band + icon row ---- */
.site-footer { background: var(--footer); color: var(--sky); margin-top: 4rem; }
.site-footer .wrap { padding: 2.75rem 1.5rem 1.75rem; }
.footer-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1.75rem; }
@media (max-width: 44rem) { .footer-cols { grid-template-columns: 1fr; } }
/* Pastor dashboard: two equal management columns (announcements / events). */
.manage-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 1.5rem 0; }
@media (max-width: 44rem) { .manage-cols { grid-template-columns: 1fr; } }
/* Dashboard: one page, three tabs (Announcements / Calendar Events / SMS). */
.dash h2 { margin-top: 0; }
.dash-tabs { display: flex; flex-wrap: wrap; gap: .15rem; border-bottom: 2px solid var(--line); margin: 1rem 0 1.6rem; }
.dash-tabs a { padding: .6rem 1.1rem; text-decoration: none; color: var(--muted); font: 600 .98rem/1 var(--sans); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.dash-tabs a:hover { color: var(--ochre); }
.dash-tabs a.on { color: var(--ink); border-bottom-color: var(--ochre); }
.dash-rule { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0 1.25rem; }
.site-footer h3 { color: var(--paper); font-size: .95rem; font-family: var(--sans); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 .7rem; }
.site-footer a { color: var(--sky); text-decoration: none; }
.site-footer a:hover { color: var(--lime); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.footer-icons { display: flex; gap: 1rem; margin-top: .9rem; }
.footer-icons a { display: inline-flex; }
.footer-icons svg { width: 18px; height: 18px; fill: var(--sky); }
.footer-icons a:hover svg { fill: var(--lime); }
/* Footer address — whole block is the Google-Maps link, with a pin icon. */
.footer-address { display: inline-flex; align-items: flex-start; gap: .55rem; }
.footer-address svg { width: 18px; height: 18px; fill: var(--sky); flex-shrink: 0; margin-top: .2em; }
.footer-address:hover svg { fill: var(--lime); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.13); margin-top: 2rem; padding-top: 1.1rem; font-size: .85rem; color: #93a0b3; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

/* ---- Language switch: an obvious segmented EN | ES pill ---- */
.lang-switch {
  display: inline-flex; align-items: stretch; margin-left: .75rem;
  border: 1.5px solid rgba(255,255,255,.65); border-radius: 999px;
  overflow: hidden; font: 700 .8rem/1 var(--sans); letter-spacing: .03em;
}
.lang-switch a, .lang-switch .on {
  padding: .42rem .8rem; text-decoration: none; display: inline-flex;
  align-items: center;
}
.lang-switch a { color: #f0efe7; }
.lang-switch a:hover { background: rgba(255,255,255,.16); color: #fff; }
.lang-switch .on {                /* current language: filled */
  background: #fff; color: var(--olive); cursor: default;
}
