/* =========================================================================
   MercyGate Church — Design Tokens
   Palette drawn from the church's own logo (navy ring, green+gold flame)
   ========================================================================= */

:root {
  --navy: #0F2547;
  --navy-deep: #081227;
  --green: #1E6B4F;
  --green-light: #2F8A67;
  --gold: #D9A441;
  --gold-light: #F0C878;
  --cream: #FAF8F3;
  --paper: #F3EFE4;
  --ink: #1C1C1E;
  --ink-soft: #4A4E57;
  --line: #E4DFD2;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

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

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.4rem; }

p { max-width: 62ch; }
p.wide { max-width: none; }

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

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

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-light); }

.btn-navy { background: var(--navy); color: var(--cream); }
.btn-navy:hover { background: var(--navy-deep); }

.btn-green { background: var(--green); color: var(--cream); }
.btn-green:hover { background: var(--green-light); }

.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--cream); }

.btn-block { width: 100%; justify-content: center; }

/* ---------------------------------------------------------------------
   Top bar + Header
   --------------------------------------------------------------------- */

.topbar {
  background: var(--navy-deep);
  color: #C9D2DF;
  font-size: 0.82rem;
}
.topbar-inner {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 24px;
}
.topbar a { color: #E8D9A9; }
.topbar-divider { opacity: 0.4; }

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--navy); }
.brand-text small { font-size: 0.68rem; letter-spacing: 0.04em; color: var(--ink-soft); }

.main-nav {
  display: flex;
  gap: 24px;
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--green); }

.header-ctas { display: flex; gap: 10px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px 24px 20px;
  background: var(--cream);
  border-top: 1px solid var(--line);
}
.mobile-nav a { padding: 10px 0; border-bottom: 1px solid var(--line); }
.mobile-nav.open { display: flex; }

@media (max-width: 880px) {
  .main-nav, .header-ctas { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------------------------------------------------------------------
   Flash messages
   --------------------------------------------------------------------- */
.flash-wrap { padding-top: 16px; }
.flash {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.flash-success { background: #E3F0E8; border: 1px solid var(--green); color: var(--green); }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */

.hero {
  position: relative;
  background: var(--navy-deep);
  color: var(--cream);
  overflow: hidden;
  padding: 90px 0 110px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 78% 20%, rgba(217,164,65,0.28), transparent 60%),
    linear-gradient(200deg, rgba(30,107,79,0.35), transparent 55%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.hero h1 { color: var(--cream); }
.hero h1 em { font-style: italic; color: var(--gold-light); }
.hero-sub {
  color: #C9D2DF;
  font-size: 1.15rem;
  max-width: 46ch;
  margin: 18px 0 30px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-service-card {
  background: rgba(250,248,243,0.06);
  border: 1px solid rgba(250,248,243,0.18);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(6px);
}
.hero-service-card h3 { color: var(--cream); margin-bottom: 14px; font-size: 1.1rem; }
.hero-service-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(250,248,243,0.14);
  font-size: 0.92rem;
}
.hero-service-item:first-of-type { border-top: none; }
.hero-service-item span:first-child { color: var(--gold-light); font-weight: 600; }

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

/* ---------------------------------------------------------------------
   Sections (generic)
   --------------------------------------------------------------------- */

section { padding: 84px 0; }
.section-alt { background: var(--paper); }
.section-navy { background: var(--navy); color: var(--cream); }
.section-navy h2, .section-navy h3 { color: var(--cream); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 40px;
}
.section-head .kicker {
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 8px;
}

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

/* Cards */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-body { padding: 22px; }
.card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card iframe { aspect-ratio: 16/9; width: 100%; border: none; display: block; }
.card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 8px;
}
.card h3 { margin-bottom: 8px; }
.card .meta { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 6px; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */

.form-grid { display: grid; gap: 18px; max-width: 640px; }
.form-row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

label { font-weight: 600; font-size: 0.88rem; display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }

.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }

/* ---------------------------------------------------------------------
   Give page
   --------------------------------------------------------------------- */

.give-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
@media (max-width: 880px) { .give-methods { grid-template-columns: 1fr; } }
.give-method {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--cream);
}
.give-method h4 { font-family: var(--font-display); color: var(--navy); margin-bottom: 10px; }
.bank-detail { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 0.9rem; }
.bank-detail:first-of-type { border-top: none; }

.fund-pills { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 20px; }
.fund-pill {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
}
.fund-pill input { display: none; }
.fund-pill:has(input:checked) { background: var(--green); color: var(--cream); border-color: var(--green); }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */

.site-footer { background: var(--navy-deep); color: #C9D2DF; padding: 64px 0 0; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 880px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.footer-logo { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 14px; }
.footer-tagline { color: var(--gold-light); font-weight: 600; margin-bottom: 4px; }
.footer-voice { font-style: italic; color: #9AA6B8; }
.site-footer h4 { color: var(--cream); font-family: var(--font-body); font-size: 0.9rem; letter-spacing: 0.02em; margin-bottom: 16px; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 14px; font-size: 0.9rem; }
.footer-list span { color: #9AA6B8; }
.footer-col p { font-size: 0.9rem; margin: 0 0 10px; }
.footer-col a:hover { color: var(--gold-light); }
.social-links { display: flex; flex-direction: column; gap: 10px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding: 22px 24px;
  font-size: 0.82rem;
  color: #7C879C;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------------------------------------------------------------
   Page header (non-home pages)
   --------------------------------------------------------------------- */

.page-header {
  background: var(--navy);
  color: var(--cream);
  padding: 64px 0;
}
.page-header h1 { color: var(--cream); font-size: clamp(2rem, 4vw, 3rem); }
.page-header p { color: #C9D2DF; margin-top: 10px; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------------------------------------------------------------------
   Admin panel
   --------------------------------------------------------------------- */

.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: 60vh;
}
@media (max-width: 780px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-main { overflow-x: auto; padding: 24px 16px; }
  table.admin-table { min-width: 620px; }
}

.admin-sidebar {
  background: var(--navy-deep);
  color: #C9D2DF;
  padding: 32px 20px;
}
.admin-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(217,164,65,0.16);
  color: var(--gold-light);
}

.admin-main { padding: 40px 32px; background: var(--cream); }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 32px; }
.admin-stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.admin-stat .num { font-family: var(--font-display); font-size: 2rem; color: var(--navy); font-weight: 700; }
.admin-stat .label { font-size: 0.82rem; color: var(--ink-soft); }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

table.admin-table { width: 100%; border-collapse: collapse; background: var(--cream); }
table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  vertical-align: top;
}
table.admin-table th { color: var(--ink-soft); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
table.admin-table .row-actions { display: flex; gap: 10px; white-space: nowrap; }
table.admin-table .row-actions a, table.admin-table .row-actions button {
  font-size: 0.82rem;
  background: none;
  border: none;
  color: var(--green);
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}
table.admin-table .row-actions .danger { color: #B3432B; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-confirmed { background: #E3F0E8; color: var(--green); }
.badge-pending { background: #F6EEDB; color: var(--gold); }
.badge-failed { background: #F5E1DC; color: #B3432B; }

/* ---------------------------------------------------------------------
   Gallery
   --------------------------------------------------------------------- */

.gallery-grid {
  columns: 4 260px;
  column-gap: 16px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: var(--paper);
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.03); }
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(8,18,39,0.85), transparent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}
@media (max-width: 640px) {
  .gallery-grid { columns: 2 160px; }
}

