/* ==========================================================================
   Mercy Manor — Design System
   Granbury, TX · Christian women's residential recovery ministry

   Palette concept: "Limestone & Clay" — pulled from the actual materials
   of Hood County rather than an abstract color-theory mood ("hope = green,
   dawn = orange"). That approach produced two consecutive AI-tell palettes
   (warm-ivory/sage/gold, then a purple/indigo accent — literally the most
   recognizable AI-generated-site tell there is, traceable to Tailwind's
   indigo-500 default). Grounding in real material references instead:
     - Limestone — the pale stone the actual Hood County Courthouse and
       most of the Hill Country is built from. The neutral base, warm-gray,
       not yellow-cream.
     - Iron/ink — a true near-black charcoal for text and dark sections.
       Not a colored "mood" dark (no purple-black, no green-black) —
       genuinely neutral, like aged iron or a chiseled inscription.
     - Red clay — the actual soil color of the region. The one strong
       accent color, used for every CTA and point of emphasis. Warm,
       specific, and completely outside the purple/teal/gold-gradient
       family AI defaults to.
     - Live oak — the deep, near-black-green of the region's namesake
       tree, used narrowly and functionally for safety/crisis content
       only (not spread across the UI as a second decorative color).
   Only two true accent hues, on a true neutral scale — fewer named
   "brand colors" than the last two attempts, which is itself part of
   what makes a palette read as designed rather than generated.

   Body class .rv-ready is a safety hook: ALL elements start fully visible
   (opacity:1, transform:none). Scroll-reveal / counters are enhancement
   layered on top, never a requirement to read the page. This protects
   against Cloudflare's email-protection script breaking IntersectionObserver
   (lesson carried over from the Shalom Park build). Do not remove.
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ---- Color: "Limestone & Clay" ---- */
  --bg:        #EAE4D8;   /* limestone — warm stone-gray, not yellow cream */
  --bg-alt:    #DFD6C4;   /* deeper limestone — alternating section bands */
  --bg-deep:   #D3C6AE;   /* buff limestone — cards/callouts */
  --fg:        #221E19;   /* iron ink — genuinely neutral dark, no color cast */
  --fg-soft:   #3E3830;
  --muted:     #6C6152;   /* 4.78:1 on --bg */
  --rule:      #C9BC9F;
  --rule-soft: #D8CBB2;

  --accent:       #33422C;   /* Live oak — deep, near-black green; used narrowly (safety content, one pillar icon), not as a general secondary color */
  --accent-dark:  #1A1712;   /* Iron-black — dark sections + dark numeral/text emphasis (true neutral, not a colored "mood" dark) */
  --accent-tint:  #E1E6DA;

  --gold:       #9C3B26;   /* Red clay — the single strong accent: every CTA, link emphasis, border, eyebrow */
  --gold-dark:  #7A2D1C;   /* AA-safe for white text on a clay button background (9.0:1) */
  --gold-darker: #5E2214;  /* hover state (11.6:1) */
  --gold-tint:  #EAD3C7;

  --terracotta: #2A3524;   /* Deep live oak — crisis/safety-block accent only, deliberately distinct from the clay CTA color so hotline content never reads as a giving upsell */
  --terracotta-tint: #E5E9DE;

  --crisis-bg:  #E9EDE2;
  --crisis-edge: #2A3524;

  --white: #FBF9F4;

  /* ---- Type ---- */
  --font-heading: Iowan Old Style, Palatino Linotype, Palatino, "URW Palladio L", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;

  /* ---- Layout ---- */
  --max-width: 42rem;
  --max-wide: 72rem;
  --pad: 1.5rem;
  --radius: 10px;
  --radius-lg: 18px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .5s;
}

html {
  font-size: 18px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Safety: everything visible by default, always. */
body.rv-ready * {
  opacity: 1 !important;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  color: var(--fg);
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 0.55em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); margin-bottom: 0.6em; }
h3 { font-size: 1.3rem; margin-bottom: 0.5em; }
h4 { font-size: 1.05rem; margin-bottom: 0.4em; }

p {
  margin-bottom: 1.1em;
  max-width: var(--max-width);
}

p.lede {
  font-size: 1.2rem;
  color: var(--fg-soft);
}

.measure-wide p, .measure-wide { max-width: var(--max-wide); }

a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--gold-dark); }

ul, ol { padding-left: 1.3em; margin-bottom: 1.1em; }
li { margin-bottom: 0.45em; max-width: var(--max-width); }

strong { font-weight: 600; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent-dark);
  color: var(--white);
  padding: 0.75em 1.25em;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */

header.site-header {
  padding: 1.1rem var(--pad);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 40;
}

nav.main-nav {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  text-decoration: none;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  white-space: nowrap;
}
.logo .logo-mark { color: var(--gold-dark); }

/* No hamburger/disclosure widget: with only six nav items, the simplest
   deploy-safe pattern is letting nav-links wrap onto additional lines at
   narrow widths. A JS-toggled off-canvas menu would mean the nav depends
   on JS to become reachable on mobile — exactly the pattern this project's
   safety rule forbids. Nothing here needs a toggle button. */

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.9rem 1.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--fg-soft);
  font-size: 0.97rem;
  font-weight: 500;
  padding: 0.3em 0.1em;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--accent-dark);
  border-bottom-color: var(--gold);
}

.btn {
  display: inline-block;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 999px;
  padding: 0.65em 1.4em;
  border: 2px solid transparent;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-1px); }
.btn-gold {
  background: var(--gold-dark);
  color: var(--white) !important;
}
.btn-gold:hover { background: var(--gold-darker); color: var(--white) !important; }
.btn-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent-dark) !important;
}
.btn-outline:hover { background: var(--accent-tint); }
.btn-ghost {
  background: transparent;
  color: var(--fg) !important;
  border-color: var(--rule);
}
/* Ghost button on a dark (.section-deep) background — uses the palette's
   own clay tint rather than a hardcoded hex. */
.section-deep .btn-ghost {
  border-color: var(--gold-tint);
  color: var(--white) !important;
}
.btn-lg { padding: 0.85em 1.9em; font-size: 1.08rem; }
.btn-block { display: block; width: 100%; text-align: center; }

.nav-links .cta { margin-left: 0.25rem; }
.nav-links .cta a {
  background: var(--gold-dark);
  color: var(--white) !important;
  border-radius: 999px;
  padding: 0.55em 1.3em;
  border-bottom: none;
}
.nav-links .cta a:hover { background: var(--gold-darker); }
.nav-links .cta-secondary a {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent-dark) !important;
  border-radius: 999px;
  padding: 0.5em 1.2em;
}
.nav-links .cta-secondary a:hover { background: var(--accent-tint); }

@media (max-width: 860px) {
  nav.main-nav { flex-wrap: wrap; row-gap: 0.75rem; }
  .nav-links { width: 100%; gap: 0.75rem 1.1rem; }
  .nav-links .cta { margin-left: 0; }
}

/* ==========================================================================
   Layout / sections
   ========================================================================== */

main { display: block; }

.section {
  padding: 4.5rem var(--pad);
}
.section-tight { padding: 3rem var(--pad); }
.section-alt { background: var(--bg-alt); }
.section-deep { background: var(--accent-dark); color: var(--white); }
.section-deep h1, .section-deep h2, .section-deep h3 { color: var(--white); }
.section-deep p { color: #E9E4D6; }
.section-deep a { color: var(--gold-tint); }

.wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
}
.wrap-narrow {
  max-width: 46rem;
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 0.9em;
  display: inline-block;
}
.section-deep .eyebrow { color: var(--gold-tint); }

.grid {
  display: grid;
  gap: 2rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 5rem var(--pad) 4rem;
  background:
    radial-gradient(ellipse at 15% 0%, var(--gold-tint) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
}
.hero .wrap { text-align: left; }
.hero h1 { max-width: 18ch; }
.hero .tagline {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--fg-soft);
  max-width: 42ch;
  margin-bottom: 1.6em;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.hero-location {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 1.3rem;
}

/* ==========================================================================
   Stat blocks
   ========================================================================== */

.stat-band {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(3, 1fr);
  text-align: left;
}
@media (max-width: 760px) { .stat-band { grid-template-columns: 1fr; } }

.stat {
  border-left: 3px solid var(--gold);
  padding-left: 1.1rem;
}
.stat .stat-num {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 3rem);
  color: var(--accent-dark);
  line-height: 1;
  display: block;
  margin-bottom: 0.25em;
}
.section-deep .stat .stat-num { color: var(--gold-tint); }
.stat .stat-label { color: var(--muted); font-size: 0.95rem; }
.section-deep .stat .stat-label { color: #D8D2C1; }
.stat .stat-source { font-size: 0.78rem; color: var(--muted); display: block; margin-top: 0.4em; }

/* ==========================================================================
   Pillars / cards
   ========================================================================== */

.pillar-card, .card {
  background: var(--white);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.pillar-card .pillar-icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--accent-tint);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
  color: var(--accent-dark);
}

/* ==========================================================================
   Pull quote
   ========================================================================== */

.pull-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.4;
  color: var(--accent-dark);
  max-width: 38ch;
  position: relative;
  padding-left: 1.4rem;
  border-left: 4px solid var(--gold);
}
.pull-quote cite {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 1rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* ==========================================================================
   Crisis / resource callout
   ========================================================================== */

.crisis-block {
  background: var(--crisis-bg);
  border: 1px solid var(--crisis-edge);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin: 2rem 0;
}
.crisis-block h3 { color: var(--terracotta); margin-bottom: 0.6em; }
.crisis-list { list-style: none; padding: 0; margin: 0; }
.crisis-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6em 0;
  border-bottom: 1px dashed #E3B8A2;
  margin: 0;
}
.crisis-list li:last-child { border-bottom: none; }
.crisis-list a { font-weight: 700; color: var(--terracotta); white-space: nowrap; }

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 2.2rem;
  border-left: 2px solid var(--rule);
  max-width: var(--max-wide);
}
.timeline-item {
  position: relative;
  padding-bottom: 2.4rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 0.25rem;
  width: 0.85rem; height: 0.85rem;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline-item.is-done::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.timeline-item.is-next::before { background: var(--white); box-shadow: 0 0 0 2px var(--gold); }
.timeline-item .timeline-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
}
.timeline-item.is-done .timeline-tag { color: var(--accent-dark); }
.timeline-item.is-next .timeline-tag { color: var(--gold-dark); }

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */

.faq {
  border-top: 1px solid var(--rule);
  max-width: var(--max-wide);
}
.faq-item {
  border-bottom: 1px solid var(--rule);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.2rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--fg);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--gold-dark);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a {
  padding: 0 0 1.4rem;
  color: var(--fg-soft);
}

/* ==========================================================================
   Giving ladder
   ========================================================================== */

.give-ladder {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 760px) { .give-ladder { grid-template-columns: 1fr; } }

.give-tier {
  background: var(--white);
  border: 2px solid var(--rule-soft);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s var(--ease);
  font-family: var(--font-body);
}
.give-tier:hover { transform: translateY(-2px); border-color: var(--gold); }
.give-tier.is-selected { border-color: var(--gold); background: var(--gold-tint); }
.give-tier .amt {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  color: var(--accent-dark);
  display: block;
  margin-bottom: 0.3em;
}
.give-tier .desc { color: var(--fg-soft); font-size: 0.98rem; margin: 0; }

.give-summary {
  margin-top: 1.75rem;
  padding: 1.5rem 1.75rem;
  background: var(--accent-tint);
  border-radius: var(--radius-lg);
  font-size: 1.08rem;
}
.give-summary strong { color: var(--accent-dark); }

.frequency-toggle {
  display: inline-flex;
  background: var(--bg-deep);
  border-radius: 999px;
  padding: 0.3rem;
  margin-bottom: 2rem;
}
.frequency-toggle button {
  border: none;
  background: none;
  padding: 0.55em 1.3em;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.frequency-toggle button.is-active {
  background: var(--accent);
  color: var(--white);
}

.transparency-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.5rem 0;
}
.transparency-badges .badge {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.6em 1em;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--white);
}

/* ==========================================================================
   Forms
   ========================================================================== */

form.stack { display: flex; flex-direction: column; gap: 1.1rem; max-width: 32rem; }
label { display: block; font-weight: 600; margin-bottom: 0.35em; font-size: 0.95rem; }
input, textarea, select {
  width: 100%;
  padding: 0.75em 0.9em;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--white);
  color: var(--fg);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.form-note { font-size: 0.85rem; color: var(--muted); }

/* ==========================================================================
   Jump nav / table of contents
   ========================================================================== */

.jump-nav {
  background: var(--bg-deep);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.5rem;
}
.jump-nav h2 { font-size: 1rem; font-family: var(--font-body); font-weight: 700; margin-bottom: 0.6em; }
.jump-nav ol { list-style: decimal; padding-left: 1.2em; margin: 0; }
.jump-nav a { text-decoration: none; }

/* ==========================================================================
   Draft / placeholder flags — visible in dev, easy to grep, remove on publish
   ========================================================================== */

.draft-flag {
  display: inline-block;
  background: var(--terracotta-tint);
  color: var(--terracotta);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25em 0.6em;
  border-radius: 5px;
  margin-bottom: 0.6em;
}

.privacy-note {
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  padding: 1.1rem 1.4rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.98rem;
  color: var(--fg-soft);
  margin-bottom: 2rem;
}

/* ==========================================================================
   Scroll reveal (enhancement only — see safety note at top of file)
   ========================================================================== */

.reveal {
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
body.js-ready .reveal {
  opacity: 0.001;
  transform: translateY(18px);
}
body.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.site-footer {
  background: var(--accent-dark);
  color: #E9E4D6;
  padding: 3.5rem var(--pad) 2rem;
}
footer.site-footer .wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 760px) {
  footer.site-footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  footer.site-footer .wrap { grid-template-columns: 1fr; }
}
footer.site-footer h4 {
  color: var(--gold-tint);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9em;
}
footer.site-footer ul { list-style: none; padding: 0; }
footer.site-footer a {
  color: #E9E4D6;
  text-decoration: none;
  font-size: 0.95rem;
}
footer.site-footer a:hover { color: var(--gold-tint); text-decoration: underline; }
footer.site-footer p { color: #C9C3B2; max-width: 32ch; font-size: 0.95rem; }
.footer-bottom {
  max-width: var(--max-wide);
  margin: 0 auto;
  border-top: 1px solid #4C5D44;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #B7B09E;
}
.footer-bottom a { color: #B7B09E; }

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

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