/* Compassionate Heart Ministries — shared styles
   Palette: royal purple + gold, cream and white as neutrals.
   Fonts match the logo: Lora (headings) + Lato (body). */

:root {
  --purple-900: #2a0f4a;
  --purple-700: #3f1c70;
  --purple-500: #6a3fa6;
  --purple-100: #efe8f7;
  --gold: #c9a24b;
  --gold-light: #e6cd82;
  --cream: #fbf7ee;
  --white: #ffffff;
  --ink: #25162f;
  --ink-soft: #55476a;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Lato", "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--purple-700); text-underline-offset: 3px; }
a:hover { color: var(--purple-500); }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--purple-900);
  color: var(--white);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 0.5em;
  color: var(--purple-900);
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 68ch; }

section { padding: clamp(56px, 8vw, 96px) 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--purple-900);
}
.brand img { width: 64px; height: auto; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.1;
  color: #5b1228; /* the maroon from the logo lettering */
}
.brand-name small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  margin-top: 3px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--purple-700);
  color: var(--purple-700);
  font: inherit;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  font-weight: 700;
  color: var(--purple-900);
  border-radius: 999px;
}
.site-nav a:hover { background: var(--purple-100); }
.site-nav a[aria-current="page"] {
  background: var(--purple-700);
  color: var(--white);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-gold { background: var(--gold); color: var(--purple-900); }
.btn-gold:hover { background: var(--gold-light); color: var(--purple-900); }
.btn-outline { border-color: var(--gold-light); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.btn-purple { background: var(--purple-700); color: var(--white); }
.btn-purple:hover { background: var(--purple-500); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 500px at 85% 20%, rgba(106,63,166,0.55), transparent 70%),
    var(--purple-900);
  color: var(--white);
  padding: clamp(48px, 7vw, 88px) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
  margin-bottom: 0.5em;
}
.hero h1 span { display: block; }
.hero h1 span:nth-child(2) { color: var(--gold-light); }
.hero-lead {
  font-size: 1.2rem;
  color: #e9def7;
  max-width: 52ch;
}

.arch {
  background: var(--white);
  border-radius: 999px 999px 18px 18px;
  overflow: hidden;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 3vw, 36px) 20px;
  max-width: 400px;
  margin-inline: auto;
  outline: 2px solid var(--gold);
  outline-offset: 12px;
}

/* Gentle wing-flutter on the logo, once, on page load */
@media (prefers-reduced-motion: no-preference) {
  .arch img { animation: settle 1.4s ease-out 0.2s both; }
  @keyframes settle {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: none; }
  }
}

/* ---------- Prayer strip ---------- */
.strip {
  background: var(--gold);
  color: var(--purple-900);
  padding: 16px 0;
  font-weight: 700;
}
.strip p { margin: 0; max-width: none; text-align: center; }

/* ---------- Two-column blocks ---------- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}

.mandate {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--purple-900);
}
.mandate li {
  padding: 14px 0;
  border-bottom: 1px solid rgba(201,162,75,0.6);
}
.mandate li:first-child { border-top: 1px solid rgba(201,162,75,0.6); }

/* ---------- Scripture band ---------- */
.verse {
  background: var(--purple-700);
  color: var(--white);
  text-align: center;
}
.verse blockquote { margin: 0 auto; max-width: 34ch; }
.verse blockquote p {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.3;
  margin: 0 auto 0.6em;
}
.verse cite { font-style: normal; color: var(--gold-light); font-weight: 700; }

/* ---------- Ministry index (home) ---------- */
.index-list { list-style: none; margin: 32px 0 0; padding: 0; }
.index-list li { border-top: 1px solid rgba(63,28,112,0.2); }
.index-list li:last-child { border-bottom: 1px solid rgba(63,28,112,0.2); }
.index-list a {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 8px 32px;
  padding: 20px 8px;
  text-decoration: none;
  color: var(--ink);
}
.index-list a:hover { background: var(--purple-100); }
.index-list .name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--purple-900);
}

/* ---------- Ministries page detail ---------- */
.ministry {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(20px, 5vw, 64px);
  padding: 44px 0;
  border-top: 1px solid rgba(63,28,112,0.2);
  scroll-margin-top: 96px;
}
.ministry:first-of-type { border-top: 0; }
.ministry h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.ministry ul { padding-left: 1.2em; margin: 0 0 1em; }
.ministry li { margin-bottom: 0.3em; }
.ministry .scripture {
  font-family: var(--serif);
  font-style: italic;
  color: var(--purple-700);
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  margin: 1.2em 0 0;
}
.ministry .when {
  display: inline-block;
  background: var(--purple-100);
  color: var(--purple-900);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 1em;
}

/* ---------- Page banner (inner pages) ---------- */
.page-banner {
  background: var(--purple-900);
  color: var(--white);
  padding: clamp(44px, 6vw, 72px) 0;
  border-bottom: 4px solid var(--gold);
}
.page-banner h1 { color: var(--white); margin-bottom: 0.3em; font-size: clamp(2.1rem, 4.6vw, 3.2rem); }
.page-banner p { color: #e9def7; font-size: 1.15rem; margin: 0; }

/* ---------- Founder ---------- */
.founder {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.portrait {
  aspect-ratio: 4 / 5;
  background: var(--purple-100);
  border: 2px dashed var(--purple-500);
  border-radius: 999px 999px var(--radius) var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.founder-title { color: var(--purple-500); font-weight: 700; margin-bottom: 1.2em; }

/* ---------- Data-driven areas (filled from Supabase later) ---------- */
.empty {
  background: var(--white);
  border: 1px dashed var(--purple-500);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--ink-soft);
  margin-top: 24px;
}
.empty p { margin: 0; }

.event {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid rgba(63,28,112,0.2);
}
.event-date {
  background: var(--purple-700);
  color: var(--white);
  border-radius: var(--radius);
  text-align: center;
  padding: 10px 6px;
  font-family: var(--serif);
  line-height: 1.1;
}
.event-date strong { display: block; font-size: 1.9rem; color: var(--gold-light); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---------- Closing call ---------- */
.closing { background: var(--purple-900); color: var(--white); text-align: center; }
.closing h2 { color: var(--white); }
.closing p { margin-inline: auto; color: #e9def7; }
.closing .btn-row { justify-content: center; }
.journey {
  font-family: var(--serif);
  color: var(--gold-light);
  font-size: 1.15rem;
  margin-bottom: 1.4em;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1d0a35;
  color: #d8c9ee;
  padding: 48px 0 28px;
  font-size: 0.98rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 36px;
}
.site-footer h3 { color: var(--gold-light); font-size: 1.05rem; }
.site-footer a { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.footer-logo { background: var(--white); border-radius: 12px; padding: 10px; width: 210px; margin-bottom: 14px; }
.copyright {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 32px;
  padding-top: 18px;
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .split, .founder, .ministry, .footer-grid { grid-template-columns: 1fr; }
  .arch { max-width: 300px; }
  .index-list a { grid-template-columns: 1fr; }
  .portrait { max-width: 300px; }

  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--white);
    border-bottom: 3px solid var(--gold);
    padding: 8px 20px 16px;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .brand-name { font-size: 1.05rem; }
  .brand img { width: 52px; }
}

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

/* =====================================================
   Round 2: hero halo, Who we are, photo band, teachings,
   admin
   ===================================================== */

/* ---------- Hero: golden halo with the three butterflies ---------- */
.halo {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fffaf0 0%, #f3e3b0 46%, #d8b45c 100%);
  outline: 2px solid var(--gold);
  outline-offset: 14px;
  box-shadow: 0 0 90px rgba(226, 200, 121, 0.35);
}
.halo img { position: absolute; height: auto; filter: drop-shadow(0 8px 10px rgba(42, 15, 74, 0.35)); }
.halo .bf-large  { width: 47%; left: 8%;  bottom: 12%; transform: rotate(-8deg); }
.halo .bf-medium { width: 32%; right: 9%; top: 34%;    transform: rotate(10deg); }
.halo .bf-small  { width: 20%; left: 34%; top: 11%;    transform: rotate(-4deg); }

@media (prefers-reduced-motion: no-preference) {
  .halo img { animation: alight 1.6s ease-out both; }
  .halo .bf-medium { animation-delay: 0.25s; }
  .halo .bf-small  { animation-delay: 0.5s; }
  @keyframes alight {
    from { opacity: 0; translate: -14px 22px; }
    to   { opacity: 1; translate: 0 0; }
  }
}

/* ---------- Who we are (redesign) ---------- */
.intro-statement {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.8vw, 2.9rem);
  line-height: 1.22;
  color: var(--purple-900);
  max-width: 24ch;
  margin: 0 0 40px;
}
.two-ways {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  margin-bottom: 40px;
}
.way { padding: clamp(24px, 3.5vw, 40px); border-radius: var(--radius); }
.way h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 0.4em; }
.way p { margin: 0; }
.way-word { background: var(--purple-700); color: #efe6fb; }
.way-word h3 { color: var(--white); }
.way-love { background: #f1e3b8; color: var(--ink); }
.way-love h3 { color: var(--purple-900); }
.way-join {
  align-self: center;
  width: 46px;
  height: 46px;
  margin-inline: -23px;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--purple-900);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  border: 4px solid var(--cream);
}
.carry { max-width: 64ch; }
.mandate-title { margin: 36px 0 14px; font-size: 1.15rem; }
.chips { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  border: 1.5px solid var(--gold);
  background: var(--white);
  color: var(--purple-900);
  font-family: var(--serif);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
}

/* ---------- Photo band (replaces the scripture when photos exist) ---------- */
.photo-band { padding: 0; background: var(--purple-900); }
.photo-band .band-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.photo-band img { width: 100%; height: clamp(240px, 32vw, 400px); object-fit: cover; }
[hidden] { display: none !important; }

/* ---------- Teachings ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 28px; }
.toolbar input[type="search"], .field input, .field select, .field textarea {
  font: inherit;
  padding: 11px 16px;
  border: 1.5px solid rgba(63,28,112,0.35);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  width: 100%;
}
.toolbar input[type="search"] { flex: 1 1 260px; width: auto; border-radius: 999px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--purple-700); background: transparent; color: var(--purple-700);
}
.filters button[aria-pressed="true"] { background: var(--purple-700); color: var(--white); }

.teaching {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px 28px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid rgba(63,28,112,0.2);
}
.teaching:last-child { border-bottom: 1px solid rgba(63,28,112,0.2); }
.t-kind {
  background: var(--purple-100);
  color: var(--purple-900);
  font-weight: 700;
  text-align: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.92rem;
}
.t-body h3 { margin-bottom: 0.2em; }
.t-meta { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 0.6em; }
.t-body p { margin-bottom: 0.6em; }
.t-body audio { width: min(100%, 460px); margin-top: 6px; }

/* ---------- Admin ---------- */
.admin-shell { max-width: 900px; margin-inline: auto; }
.panel { background: var(--white); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); margin-bottom: 28px; border: 1px solid rgba(63,28,112,0.15); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field small { color: var(--ink-soft); display: block; margin-top: 4px; }
.field textarea { min-height: 96px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tabs button {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid var(--purple-700); background: transparent; color: var(--purple-700);
}
.tabs button[aria-selected="true"] { background: var(--purple-700); color: var(--white); }
.msg { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; max-width: none; }
.msg.ok  { background: #e6f4ea; color: #14502a; }
.msg.err { background: #fdeaea; color: #7a1212; }
.row-item { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid rgba(63,28,112,0.15); }
.row-item:first-child { border-top: 0; }
.row-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; overflow-wrap: anywhere; }
.btn-small { font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 1.5px solid #9b1c1c; color: #9b1c1c; background: transparent; cursor: pointer; }
.btn-small:hover { background: #fdeaea; }
button.btn { font: inherit; cursor: pointer; }

@media (max-width: 860px) {
  .two-ways { grid-template-columns: 1fr; gap: 0; }
  .way-join { margin: -23px auto; }
  .teaching { grid-template-columns: 1fr; }
  .t-kind { justify-self: start; }
  .grid-2 { grid-template-columns: 1fr; }
  .halo { width: min(100%, 320px); }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Round 3: photo hero and founder portrait ---------- */
.hero-grid { grid-template-columns: 0.95fr 1.15fr; }
.hero-photo { position: relative; margin: 0; }
.hero-photo > img:first-child {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  outline: 2px solid var(--gold);
  outline-offset: 12px;
}
.hero-photo .bf-corner {
  position: absolute;
  width: clamp(72px, 11vw, 120px);
  height: auto;
  top: -34px;
  right: -22px;
  transform: rotate(14deg);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
}
@media (prefers-reduced-motion: no-preference) {
  .hero-photo .bf-corner { animation: alight 1.6s ease-out 0.4s both; }
}
.portrait.has-photo {
  background: none;
  border: 0;
  padding: 0;
  border-radius: 50% 50% 14px 14px / 34% 34% 14px 14px;
  outline: 2px solid var(--gold);
  outline-offset: 10px;
}
.portrait.has-photo img { object-position: center top; }
@media (max-width: 860px) {
  .hero-photo .bf-corner { top: -26px; right: -8px; }
}
.hero-grid { grid-template-columns: 1.05fr 1fr; }
.hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-photo { max-width: 560px; margin-inline: auto; } }

/* ---------- Photo band above the scripture ---------- */
.verse.verse-photo {
  padding: 0;
  text-align: left;
  background: var(--purple-700);
  display: grid;
  grid-template-columns: 1fr;
}
.verse-media { order: -1; position: relative; }
.verse-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 591;
  max-height: 620px;
  object-fit: cover;
}
.verse-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(0deg, var(--purple-700), rgba(63, 28, 112, 0));
  pointer-events: none;
}
.verse-photo .verse-text {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px clamp(28px, 5vw, 64px);
  align-items: end;
  padding: 12px max(20px, calc((100vw - var(--wrap)) / 2)) clamp(40px, 5vw, 64px);
}
.verse-photo blockquote { margin: 0; max-width: 40rem; }
.verse-photo blockquote p { margin-left: 0; font-size: clamp(1.5rem, 2.8vw, 2.2rem); }
.photo-credit {
  margin: 0;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  color: #dccdf3;
  font-size: 0.98rem;
  max-width: 36ch;
}
@media (max-width: 860px) {
  .verse-photo .verse-text { grid-template-columns: 1fr; padding: 8px 20px 44px; }
}
