/* Covenant Fellowship Alliance: shared styles for every public page.
   Colours and fonts are the brand's own; change them here and every page follows. */

:root {
  /* brand colours */
  --purple: #4B2E83;
  --purple-dark: #3A2366;
  --maroon: #8B1E2D;
  --maroon-dark: #721826;
  --gold: #C9A24D;
  --gold-pale: #F3E3B8;
  --green: #1F6B4E;
  --green-dark: #185A41;
  --parchment: #F0E5CE;
  --charcoal: #3F3E42;

  /* neutrals */
  --page: #F4F4F4;
  --header: #D9D9D9;
  --card: #FFFFFF;
  --ink: #141414;
  --ink-2: #4B4B52;
  --ink-3: #6B6B72;
  --line: #E4E4E7;

  /* type */
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-body: "Chivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-accent: "Lora", Georgia, "Times New Roman", serif;

  --h1: clamp(28px, 4vw, 36px);
  --h2: clamp(24px, 3.2vw, 28px);
  --h3: 20px;
  --body: 18px;
  --small: 15px;

  /* shape and space */
  --radius: 8px;
  --radius-lg: 12px;
  --gutter: clamp(16px, 4vw, 32px);
  --measure: 70ch;
  --content: 1100px;
  --shadow: 0 1px 2px rgba(20, 10, 40, .05), 0 6px 18px rgba(20, 10, 40, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--purple); color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 100; font-weight: 700; }
.skip:focus { top: 12px; }

.container { width: 100%; max-width: var(--content); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 860px; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section.tight { padding-block: clamp(32px, 5vw, 56px); }
.bg-parchment { background: var(--parchment); }
.bg-purple { background: var(--purple); color: #fff; }
.bg-gold { background: var(--gold); }
.accent { font-family: var(--font-accent); font-style: italic; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--maroon); margin-bottom: 8px; display: block; }
.prose { max-width: var(--measure); }
.prose p { line-height: 1.7; }
.muted { color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: var(--radius); border: 2px solid transparent;
  font: 700 15px/1.2 var(--font-body); letter-spacing: .02em;
  text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-join { background: var(--maroon); color: #fff; }
.btn-join:hover { background: var(--maroon-dark); }
.btn-give { background: var(--green); color: #fff; }
.btn-give:hover { background: var(--green-dark); }
.btn-outline { background: transparent; color: var(--maroon); border-color: var(--maroon); }
.btn-outline:hover { background: var(--maroon); color: #fff; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-arrow { font-weight: 700; color: var(--maroon); text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- header ---------- */
.site-header { background: var(--header); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 104px; padding-block: 10px; transition: min-height .2s; }
.is-scrolled .header-inner { min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--purple); flex-shrink: 0; }
.brand img { width: 64px; height: auto; transition: width .2s; }
.is-scrolled .brand img { width: 44px; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.02; letter-spacing: .02em; }
.is-scrolled .brand span { font-size: 16px; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.utility { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.is-scrolled .utility { display: none; }
.welcome { font-family: var(--font-accent); font-weight: 500; font-size: 17px; margin-right: 8px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav > ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-link, .nav-toggle {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: none; border: 0; cursor: pointer;
  font: 700 17px/1.2 var(--font-body); color: var(--maroon); text-decoration: none; border-radius: var(--radius);
}
.nav-link:hover, .nav-toggle:hover { background: rgba(139, 30, 45, .07); }
.nav-link[aria-current="page"]::after, .nav-toggle[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px; background: var(--gold); border-radius: 2px;
}
.nav-toggle svg { width: 12px; height: 12px; transition: transform .15s; }
.nav-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.has-menu { position: relative; }
.submenu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; list-style: none; margin: 0; padding: 8px;
  background: #fff; border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(20, 10, 40, .16); border-top: 3px solid var(--gold);
}
.submenu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* bridges the gap so the mouse can reach the menu */
.submenu[hidden] { display: none; }
.submenu a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px; }
.submenu a:hover, .submenu a:focus-visible { background: #F6F2FC; color: var(--purple); }
.menu-button { display: none; }

@media (max-width: 1060px) {
  .header-inner { min-height: 76px; }
  .brand img { width: 48px; }
  .brand span { font-size: 17px; }
  .header-right { flex-direction: row; align-items: center; }
  .utility .welcome { display: none; }
  .menu-button {
    display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
    background: var(--purple); color: #fff; border: 0; border-radius: var(--radius); cursor: pointer;
  }
  .menu-button svg { width: 22px; height: 22px; }
  .nav { position: fixed; inset: 76px 0 0 0; background: #fff; display: none; flex-direction: column; align-items: stretch; padding: 16px var(--gutter) 40px; overflow-y: auto; }
  .is-scrolled .nav { inset: 68px 0 0 0; }
  .nav.open { display: flex; }
  .nav > ul { flex-direction: column; gap: 0; }
  .nav-link, .nav-toggle { width: 100%; justify-content: space-between; padding: 14px 6px; font-size: 18px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-link[aria-current="page"]::after, .nav-toggle[aria-current="page"]::after { left: 6px; right: auto; width: 32px; bottom: 6px; }
  .submenu { position: static; box-shadow: none; border-top: 0; padding: 4px 0 8px 12px; min-width: 0; }
  .utility { display: none; }
  .nav-actions { display: flex !important; }
}
@media (max-width: 480px) {
  .brand span { font-size: 14px; }
  .brand img { width: 40px; }
}
.nav-actions { display: none; flex-wrap: wrap; gap: 10px; padding-top: 18px; }
.nav-actions .welcome { width: 100%; margin: 0 0 4px; }

/* ---------- page banners ---------- */
.page-banner { background: var(--purple); }
.page-banner img { width: 100%; height: auto; }
.page-banner .mobile { display: none; }
@media (max-width: 640px) { .page-banner .desktop { display: none; } .page-banner .mobile { display: block; } }
.hero-video { background: var(--purple); }
.hero-video video { width: 100%; }
.hero-video .mobile { display: none; }
@media (max-width: 640px) { .hero-video .desktop { display: none; } .hero-video .mobile { display: block; } }
.tagline-band { background: var(--gold); text-align: center; padding: 20px var(--gutter); }
.tagline-band p { font-family: var(--font-accent); font-style: italic; font-size: clamp(16px, 2vw, 20px); margin: 0; color: var(--ink); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 7px; }
.field label { font-weight: 700; font-size: 16px; }
.field .hint { font-size: 14px; color: var(--ink-3); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #D5D5DB; border-radius: var(--radius);
  background: #fff; color: var(--ink); font: 400 16px/1.4 var(--font-body);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(201, 162, 77, .55); border-color: var(--gold); }
.field .error { color: var(--maroon); font-size: 14px; font-weight: 500; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--maroon); }
.form-message { padding: 14px 16px; border-radius: var(--radius); font-weight: 500; }
.form-message.error { background: #FBEDEF; color: var(--maroon); }
.form-message.success { background: #E6F2EC; color: var(--green); }

/* ---------- toast ---------- */
.toast-area { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 14px 18px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 15px; border-left: 4px solid var(--gold); }
.toast.error { border-left-color: #E4808E; }
.toast.success { border-left-color: #5FB892; }

/* ---------- footer ---------- */
.site-footer { background: var(--charcoal); color: #fff; }
.footer-gold { height: 60px; background: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 170px 1.15fr 1.25fr 1fr 1fr; gap: 36px; padding-block: 64px 48px; }
.footer-seal img { width: 170px; }
.footer-col h2 { font-family: var(--font-body); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: #fff; text-decoration: none; font-size: 16px; }
.footer-col a:hover { text-decoration: underline; color: var(--gold-pale); }
.footer-col p { font-size: 16px; margin: 0 0 16px; }
.footer-col .person b { display: block; }
.footer-col .person i { font-family: var(--font-accent); color: #E6E1D4; }
.footer-email { overflow-wrap: anywhere; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.35); padding-block: 22px; font-size: 14px; color: #E6E6EA; text-align: center; }
.footer-bottom a { color: #fff; }
@media (max-width: 1000px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-seal { grid-column: 1 / -1; } .footer-seal img { width: 140px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- utilities ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.center { text-align: center; }
.stack { display: grid; gap: 16px; }
.loading { color: var(--ink-3); font-style: italic; padding: 24px 0; }
.empty { color: var(--ink-3); padding: 24px 0; }

/* ---------- dialog ---------- */
.dialog { margin: auto; max-width: min(720px, calc(100vw - 32px)); max-height: 86vh; padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog::backdrop { background: rgba(20, 10, 40, .55); }
.dialog-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; background: #fff; border-bottom: 3px solid var(--gold); }
.dialog-head h2 { margin: 0; font-size: 22px; color: var(--purple); }
.dialog-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #F1EEF6; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink); }
.dialog-body { padding: 20px 24px 28px; font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
