/* ===================================================================
   AME Edith Ming Chapel — public site styles
   Hand-written, mobile-first, no build step (no Sass/Tailwind — the
   shared host this runs on has no CLI). Brand colors sampled directly
   from the official AME Church shield logo.
   =================================================================== */

:root {
  --amec-red: #ED1C24;
  --amec-red-dark: #B1151B;
  --amec-green: #00A651;
  --amec-green-dark: #007C3D;
  --amec-black: #141414;
  --amec-white: #FFFFFF;
  --amec-cream: #FAF7F2;
  --amec-ink: #2A2A2A;
  --amec-muted: #6B6660;
  --amec-border: #E8E2D9;

  --shadow-soft: 0 4px 20px rgba(20, 20, 20, 0.08);
  --shadow-lift: 0 12px 32px rgba(20, 20, 20, 0.14);
  --radius-lg: 1.1rem;
  --radius-md: 0.7rem;
  --radius-sm: 0.4rem;

  --font-heading: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --container-width: 1140px;
  --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--amec-ink);
  background: var(--amec-cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--amec-black);
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 4vw + 1rem, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 1rem, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

a { color: var(--amec-red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 3rem 0; }
.section--tight { padding: 1.75rem 0; }
.section--alt { background: var(--amec-white); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 2rem; }
.section-head p { color: var(--amec-muted); }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amec-green-dark);
  margin-bottom: 0.5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn--primary { background: var(--amec-red); color: var(--amec-white); box-shadow: var(--shadow-soft); }
.btn--primary:hover { background: var(--amec-red-dark); box-shadow: var(--shadow-lift); }

.btn--outline { background: transparent; border-color: var(--amec-green); color: var(--amec-green-dark); }
.btn--outline:hover { background: var(--amec-green); color: var(--amec-white); }

.btn--ghost { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.6); color: var(--amec-white); }
.btn--ghost:hover { background: var(--amec-white); color: var(--amec-black); }

.btn--sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--amec-red);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
}

.nav-brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { height: 42px; width: auto; }
.nav-brand-text { font-family: var(--font-heading); font-weight: 700; line-height: 1.1; font-size: 1rem; color: var(--amec-black); }
.nav-brand-text small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.68rem; color: var(--amec-muted); }

.nav-toggle {
  display: inline-flex;
  background: none;
  border: 2px solid var(--amec-black);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--amec-black);
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

.nav-links {
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  width: 100%;
}
.nav-links.is-open { display: flex; width: 100%; order: 3; }
.nav-links a {
  display: block;
  padding: 0.6rem 0.25rem;
  color: var(--amec-ink);
  font-weight: 600;
  border-bottom: 1px solid var(--amec-border);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--amec-red-dark); text-decoration: none; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    width: auto;
    margin: 0;
  }
  .nav-links a { border-bottom: none; padding: 0.3rem 0; }
  .nav-links a.is-active { border-bottom: 2px solid var(--amec-red); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--amec-white);
  background: linear-gradient(135deg, var(--amec-black) 0%, #241414 55%, var(--amec-red-dark) 130%);
  padding: 4rem 0 3.5rem;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(0,166,81,0.35), transparent 55%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 640px; }
.hero p.lead { color: rgba(255,255,255,0.85); font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.stats--overlap {
  margin-top: -2.75rem;
  position: relative;
  z-index: 2;
}
@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: var(--amec-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 1.25rem 1rem;
  text-align: center;
}
.stat-card .num { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--amec-red-dark); }
.stat-card .label { font-size: 0.8rem; color: var(--amec-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--amec-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card-body { padding: 1.3rem; flex: 1; display: flex; flex-direction: column; }
.card-media { aspect-ratio: 16/10; background: var(--amec-border); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-meta { font-size: 0.8rem; color: var(--amec-muted); margin-bottom: 0.4rem; }
.card h3 { margin-bottom: 0.4rem; font-size: 1.15rem; }
.card p { color: var(--amec-muted); font-size: 0.95rem; }
.card-footer { padding: 0 1.3rem 1.3rem; margin-top: auto; }

/* accent top-border strips, alternating red/green — never touching each other */
.card--accent-red { border-top: 4px solid var(--amec-red); }
.card--accent-green { border-top: 4px solid var(--amec-green); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.badge--green { background: rgba(0,166,81,0.12); color: var(--amec-green-dark); }
.badge--red { background: rgba(237,28,36,0.1); color: var(--amec-red-dark); }
.badge--black { background: rgba(20,20,20,0.08); color: var(--amec-black); }

/* ---------- Testimonials ---------- */
.testimonial {
  background: var(--amec-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  position: relative;
}
.testimonial::before {
  content: '\201C';
  font-family: Georgia, serif;
  font-size: 3.5rem;
  color: var(--amec-green);
  opacity: 0.35;
  line-height: 1;
  position: absolute;
  top: 0.5rem;
  left: 1rem;
}
.testimonial p { position: relative; z-index: 1; font-style: italic; }
.testimonial .author { font-weight: 700; color: var(--amec-black); font-style: normal; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.92rem; }
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--amec-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: var(--amec-white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--amec-green);
  box-shadow: 0 0 0 3px rgba(0,166,81,0.15);
}
textarea.form-control { min-height: 130px; resize: vertical; }
.form-error { color: var(--amec-red-dark); font-size: 0.85rem; margin-top: 0.3rem; }
.form-hint { color: var(--amec-muted); font-size: 0.82rem; margin-top: 0.3rem; }

/* ---------- Alerts / flash ---------- */
.alert { padding: 0.9rem 1.1rem; border-radius: var(--radius-md); margin-bottom: 1.2rem; font-size: 0.95rem; }
.alert--success { background: rgba(0,166,81,0.12); color: var(--amec-green-dark); border: 1px solid rgba(0,166,81,0.3); }
.alert--error { background: rgba(237,28,36,0.1); color: var(--amec-red-dark); border: 1px solid rgba(237,28,36,0.3); }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--amec-black);
  color: var(--amec-white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(237,28,36,0.25), transparent 50%, rgba(0,166,81,0.25));
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 { color: var(--amec-white); }

/* ---------- Footer ---------- */
.site-footer { background: var(--amec-black); color: rgba(255,255,255,0.8); padding: 3rem 0 1.5rem; margin-top: 3rem; border-top: 4px solid var(--amec-green); }
.site-footer h4 { color: var(--amec-white); font-size: 1rem; }
.site-footer a { color: rgba(255,255,255,0.75); }
.site-footer a:hover { color: var(--amec-white); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 2rem; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.25rem; font-size: 0.85rem; text-align: center; color: rgba(255,255,255,0.55); }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 0.5rem; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--amec-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--amec-muted); }
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { text-decoration: none; }

/* ---------- Filters bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--amec-white);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 2rem;
}
.filter-bar select, .filter-bar input { min-width: 160px; }

/* ---------- Auto-scrolling gallery banner (home page) ---------- */
.gallery-banner {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.gallery-banner-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: gallery-scroll 140s linear infinite;
}
.gallery-banner:hover .gallery-banner-track { animation-play-state: paused; }
.gallery-banner-track a {
  flex-shrink: 0;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.gallery-banner-track img {
  height: 200px;
  width: 280px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.gallery-banner-track a:hover img { transform: scale(1.05); }
@media (min-width: 700px) {
  .gallery-banner-track img { height: 240px; width: 340px; }
}
@keyframes gallery-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-banner-track { animation: none; overflow-x: auto; }
}

/* ---------- Plain data table (e.g. leadership history) ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  background: var(--amec-white);
}
.table-wrap--scroll { max-height: 420px; overflow-y: auto; }
.table-wrap--scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.plain-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.plain-table th, .plain-table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--amec-border); vertical-align: top; }
.plain-table th { background: var(--amec-cream); font-family: var(--font-heading); white-space: nowrap; }
.plain-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Tabs (e.g. About page History section) ---------- */
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--amec-border);
}
.tabs-nav button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 0.2rem;
  margin-right: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--amec-muted);
  cursor: pointer;
}
.tabs-nav button:hover { color: var(--amec-red-dark); }
.tabs-nav button[aria-selected="true"] { color: var(--amec-black); border-bottom-color: var(--amec-red); }
.tab-panel[hidden] { display: none; }
.video-embed {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin: 1.25rem 0;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Lightbox (gallery) ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(10,10,10,0.9);
  display: none; z-index: 100; padding: 3.5rem 1rem 1.5rem;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.lightbox-overlay.is-open { display: block; }
.lightbox-overlay img { display: block; max-height: 85vh; max-width: 100%; margin: 0 auto; border-radius: var(--radius-sm); }
.lightbox-close { position: fixed; top: 1.2rem; right: 1.5rem; color: #fff; font-size: 2rem; background: none; border: none; cursor: pointer; z-index: 101; }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 1.5rem 0; text-align: center; }
.ad-slot img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.ad-slot--footer { margin: 0 0 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
.ad-slot--header { margin-top: 0; }
