/* ==========================================================================
   Las Animas First Church of the Nazarene
   Design: prairie horizon / brick & wheat
   ========================================================================== */

:root {
  /* Color tokens — brick (adobe/clay), wheat gold, dusk teal, warm ivory */
  --bg:          #FBF6EC;
  --bg-alt:      #F2E7D3;
  --ink:         #2B2420;
  --ink-soft:    #55493C;
  --brick:       #7A3428;
  --brick-dark:  #5B2620;
  --gold:        #B4842E;
  --gold-light:  #E7C77C;
  --dusk:        #30403D;
  --dusk-dark:   #22302D;
  --cream-text:  #F7EFDD;
  --line:        rgba(43, 36, 32, 0.12);

  /* Type */
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: Optima, Candara, "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 4px;
  --wrap: 1140px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--brick-dark);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: 0.2px;
}

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

p { margin: 0 0 1em; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-block;
  margin-bottom: 0.9em;
}

/* Signature element — the horizon rule: a thin gradient line evoking a
   prairie sunrise/sunset, used as the recurring visual signature. */
.horizon-rule {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--brick) 0%, var(--gold) 50%, var(--dusk) 100%);
  border: none;
  margin: 0;
}
.horizon-rule--section {
  width: 72px;
  height: 3px;
  border-radius: 2px;
  margin: 0 0 1.4em;
}

/* ---------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 13px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--brick);
  color: var(--cream-text);
}
.btn-primary:hover { background: var(--brick-dark); }
.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: var(--brick);
}
.btn-outline:hover { background: var(--brick); color: var(--cream-text); border-color: var(--brick); }
.btn-on-dark {
  background: var(--gold);
  color: var(--dusk-dark);
}
.btn-on-dark:hover { background: var(--gold-light); }

/* ---------------------------- Header ---------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
}
.logo-img {
  height: 56px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
.brand-text {
  font-family: var(--font-display);
  line-height: 1.1;
}
.brand-text .name-line1 {
  display: block;
  font-size: 1.05rem;
  color: var(--brick-dark);
}
.brand-text .name-line2 {
  display: block;
  font-size: 0.78rem;
  font-family: var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease;
}
.main-nav a:hover { background: var(--bg-alt); color: var(--brick-dark); }
.main-nav a.active { color: var(--brick); }
.main-nav a.btn { margin-left: 10px; }
.main-nav a.btn-primary { color: var(--cream-text); }
.main-nav a.btn-primary:hover { color: var(--cream-text); background: var(--brick-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.2s;
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 20px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 6px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .main-nav .btn { margin: 12px 0 0; justify-content: center; }
}

/* ---------------------------- Hero ---------------------------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, #EFE2C9 0%, #EBD7AE 55%, var(--bg) 100%);
  overflow: hidden;
}
.hero .wrap {
  position: relative;
  z-index: 2;
  padding-top: 92px;
  padding-bottom: 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: end;
}
.hero-copy { padding-bottom: 84px; }
.hero-copy h1 { max-width: 11ch; }
.hero-copy .lede {
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--ink-soft);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.6em; }

.hero-scene { position: relative; height: 100%; min-height: 320px; }
.hero-scene svg { position: absolute; bottom: 0; left: 0; width: 100%; height: auto; }

.hero-photo-frame {
  position: relative;
  height: calc(100% - 40px);
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(43, 36, 32, 0.18);
}
.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(122,52,40,0.28) 0%, rgba(180,132,46,0.08) 45%, rgba(48,64,61,0.32) 100%);
  mix-blend-mode: multiply;
}
.hero-photo-frame::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brick) 0%, var(--gold) 50%, var(--dusk) 100%);
  z-index: 2;
}

.small-page .hero .wrap { grid-template-columns: 1fr; padding-bottom: 64px; }
.small-page .hero-copy { padding-bottom: 40px; }
.small-page .hero-copy .lede { max-width: 60ch; }

.hero.photo-bg {
  background-image:
    linear-gradient(180deg, rgba(239,226,201,0.88) 0%, rgba(235,215,174,0.85) 55%, rgba(251,246,236,0.94) 100%),
    url('images/las-animas-first-church-of-the-nazarene.jpg');
  background-size: cover;
  background-position: center 65%;
}

/* ---------------------------- Sections ---------------------------- */
section { padding: 84px 0; }
section.alt { background: var(--bg-alt); }
section.dusk {
  background: var(--dusk-dark);
  color: var(--cream-text);
}
section.dusk h2, section.dusk h3 { color: var(--cream-text); }
section.dusk p { color: #CBD2CC; }

.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------------------------- Cards / grids ---------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (max-width: 880px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.info-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
}
.info-card .icon { width: 30px; height: 30px; margin-bottom: 14px; color: var(--brick); }
.info-card h3 { margin-bottom: 0.4em; }
.info-card p:last-child { margin-bottom: 0; }

.reason {
  display: flex;
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.reason:last-child { border-bottom: 1px solid var(--line); }
.reason .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  flex: none;
  width: 2.2ch;
}
.reason h3 { margin-bottom: 0.3em; }
.reason p { margin-bottom: 0; }

.creed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: creed;
}
.creed-list li {
  counter-increment: creed;
  position: relative;
  padding: 22px 0 22px 52px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.creed-list li:last-child { border-bottom: 1px solid var(--line); }
.creed-list li::before {
  content: counter(creed, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 22px;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1rem;
}
.creed-list strong { color: var(--ink); }

/* ---------------------------- Pastor / people ---------------------------- */
.pastor-block {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 780px) { .pastor-block { grid-template-columns: 1fr; } }
.pastor-portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--brick) 0%, var(--brick-dark) 100%);
  position: relative;
  overflow: hidden;
}
.pastor-portrait svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pastor-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.pastor-portrait::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brick) 0%, var(--gold) 50%, var(--dusk) 100%);
  z-index: 2;
}

/* ---------------------------- Event / news cards ---------------------------- */
.event-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
}
@media (max-width: 560px) { .event-card { grid-template-columns: 1fr; } }
.event-date {
  background: var(--bg-alt);
  border-radius: var(--radius);
  text-align: center;
  padding: 14px 8px;
  align-self: start;
}
.event-date .day { display: block; font-family: var(--font-display); font-size: 1.9rem; color: var(--brick); line-height: 1; }
.event-date .mon { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }
.event-card h3 { margin-bottom: 0.3em; }
.event-card .meta { font-size: 0.85rem; color: var(--gold); font-weight: 600; letter-spacing: 0.03em; margin-bottom: 0.6em; }
.event-card p { margin-bottom: 0.5em; }
.event-card a.read-more { font-weight: 600; color: var(--brick); text-decoration: none; }
.event-card a.read-more:hover { text-decoration: underline; }

/* ---------------------------- Scripture callout ---------------------------- */
.scripture-box {
  border-left: 3px solid var(--gold);
  padding: 8px 0 8px 26px;
}
.scripture-box .verse { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); font-style: italic; }
.scripture-box .ref { font-size: 0.85rem; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; margin-top: 0.6em; }
.scripture-box .rotates-note { font-size: 0.78rem; color: var(--ink-soft); opacity: 0.7; margin-top: 0.9em; font-family: var(--font-body); }

/* ---------------------------- Contact / forms ---------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4/3;
}

/* ---------------------------- CTA band ---------------------------- */
.cta-band {
  background: var(--brick);
  color: var(--cream-text);
  text-align: center;
  padding: 72px 0;
}
.cta-band h2 { color: var(--cream-text); }
.cta-band p { color: #EAD9C9; max-width: 52ch; margin-left: auto; margin-right: auto; }
.cta-band .hero-actions { justify-content: center; }

/* ---------------------------- Footer ---------------------------- */
.site-footer {
  background: var(--dusk-dark);
  color: #C8D0CB;
  padding: 60px 0 26px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-brand .brand-text .name-line1 { color: var(--cream-text); }
.footer-brand .brand-text .name-line2 { color: #9AA6A0; }
.footer-brand p { color: #9AA6A0; margin-top: 14px; max-width: 32ch; }
.site-footer h4 {
  color: var(--cream-text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1em;
}
.site-footer a { color: #C8D0CB; text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: #7C8985;
}

/* ---------------------------- Utility ---------------------------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------------------------- Admin ---------------------------- */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
  background: var(--dusk-dark);
  color: var(--cream-text);
  padding: 18px 0;
}
.admin-topbar .wrap { display: flex; align-items: center; justify-content: space-between; }
.admin-topbar .logo-img { height: 40px; }
.admin-topbar .admin-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9AA6A0;
  margin-left: 10px;
}
.admin-main { flex: 1; padding: 48px 0 80px; }

.admin-login-wrap {
  max-width: 400px;
  margin: 12vh auto 0;
  text-align: center;
}
.admin-login-wrap .info-card { text-align: left; margin-top: 1.4rem; }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-event-row {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.admin-event-row .info h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.admin-event-row .info .when { font-size: 0.85rem; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.admin-event-row .info p { margin: 0; font-size: 0.92rem; }
.admin-event-row .actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.admin-event-row .row-buttons { display: flex; gap: 8px; }
.admin-event-row .row-buttons button {
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px 4px;
}
.admin-event-row .row-buttons button:hover { color: var(--brick); }
.admin-event-row .row-buttons button.danger:hover { color: #A33; }

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.status-badge.published { background: rgba(180,132,46,0.18); color: var(--gold); }
.status-badge.draft { background: rgba(43,36,32,0.08); color: var(--ink-soft); }

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-switch .track {
  width: 42px;
  height: 24px;
  background: var(--line);
  border-radius: 20px;
  position: relative;
  display: inline-block;
  transition: background 0.2s ease;
  flex: none;
}
.toggle-switch .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.toggle-switch input:checked + .track { background: var(--gold); }
.toggle-switch input:checked + .track::after { transform: translateX(18px); }
.toggle-switch input:focus-visible + .track { outline: 2px solid var(--brick); outline-offset: 2px; }
.toggle-switch .toggle-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }

/* Override the generic .field label rule (uppercase/block) when a
   toggle switch is used inside a form field. */
.field label.toggle-switch {
  display: inline-flex;
  text-transform: none;
  letter-spacing: normal;
  font-size: inherit;
  font-weight: normal;
  color: inherit;
  margin-bottom: 0;
}

.admin-empty {
  color: var(--ink-soft);
  font-style: italic;
  padding: 30px 0;
}

.admin-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.admin-alert.error { background: rgba(163,51,51,0.1); color: #7A2626; }
.admin-alert.success { background: rgba(180,132,46,0.15); color: var(--brick-dark); }
