/* ============================================================
   Raising Funds for Poor Orphanages — stylesheet
   Palette: soft teal (trust/care) + warm amber (hope/warmth)
   Cream background, system font stack, WCAG-AA contrast.
   Mobile-first; breakpoints at 640px and 960px.
   ============================================================ */

:root {
  /* Brand */
  --teal-900: #0b4f4a;
  --teal-700: #0f766e;
  --teal-600: #11867d;
  --teal-50:  #e6f3f1;

  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;

  --cream:    #fffdf7;
  --cream-2:  #fdf8ec;
  --white:    #ffffff;

  --ink:      #1f2a2e;   /* main text on light — 12.6:1 on cream */
  --ink-soft: #4b5b60;   /* secondary text — 6.9:1 on cream */
  --line:     #e3e0d6;

  --danger:   #b91c1c;
  --danger-bg:#fdecec;

  --radius:   14px;
  --radius-sm:10px;
  --shadow:   0 10px 30px rgba(15, 60, 55, 0.10);
  --shadow-sm:0 4px 14px rgba(15, 60, 55, 0.08);

  --container: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

/* ─── Reset / base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: var(--teal-700); }
a:hover { color: var(--teal-900); }

h1, h2, h3 { line-height: 1.2; color: var(--teal-900); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--amber-600);
  margin: 0 0 .4rem;
}
.eyebrow-light { color: var(--amber-100); }
.section-subtitle { color: var(--ink-soft); margin: 0 0 1.5rem; font-size: 1.05rem; }
.subtitle-light { color: rgba(255,255,255,.9); }

/* Visible only to screen readers */
.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-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--teal-700); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--amber-500); outline-offset: 2px; }

.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-900); color: #fff; }

.btn-amber { background: var(--amber-500); color: var(--teal-900); }
.btn-amber:hover { background: var(--amber-600); color: #fff; }

.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.btn-lg { padding: .95rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; display: block; }

/* ─── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .6rem;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--teal-900); }
.brand-heart { color: var(--amber-500); font-size: 1.4rem; line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1rem; }
.brand-text span { font-size: .78rem; color: var(--ink-soft); }
.header-cta { padding: .55rem 1.1rem; font-size: .95rem; }

/* ─── Hero ─────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(245,158,11,.18), transparent 60%),
    linear-gradient(160deg, var(--teal-700) 0%, var(--teal-900) 100%);
  color: #fff;
  padding: clamp(2.8rem, 7vw, 5.5rem) 0;
  text-align: center;
}
.hero-inner { max-width: 760px; margin-inline: auto; }
.hero .eyebrow { color: var(--amber-100); }
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero-quote {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: rgba(255,255,255,.95);
  font-style: italic;
  max-width: 40ch; margin-inline: auto;
}
.hero-actions {
  display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1.8rem;
}

/* ─── Progress ─────────────────────────────────────────────── */
.progress-section { padding: clamp(2.5rem, 5vw, 4rem) 0; background: var(--cream-2); }
.progress-section h2 { text-align: center; }
.progress-section .section-subtitle { text-align: center; }

.progress-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.3rem, 3vw, 2rem);
  max-width: 760px; margin-inline: auto;
}
.progress-figures {
  display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.3rem;
}
.figure { display: flex; flex-direction: column; gap: .15rem; }
.figure-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.figure-value { font-size: 1.6rem; font-weight: 800; color: var(--teal-900); }
.figure-percent .figure-value { color: var(--amber-600); }

.progress-bar {
  height: 18px; background: var(--teal-50); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
}
.progress-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--teal-600), var(--teal-700));
  border-radius: 999px;
  transition: width .8s cubic-bezier(.2,.7,.3,1);
}
.admin-note { font-size: .82rem; color: var(--ink-soft); margin: .9rem 0 0; font-style: italic; }

/* ─── Story ────────────────────────────────────────────────── */
.story-section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.story-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
.story-copy p { color: var(--ink); }
.story-subhead { font-weight: 700; color: var(--teal-900); margin-top: 1.2rem; }
.story-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.story-list li { position: relative; padding-left: 1.7rem; color: var(--ink); }
.story-list li::before {
  content: "❤"; color: var(--amber-500); position: absolute; left: 0; top: 0; font-size: .85rem;
}
.aside-card {
  background: var(--teal-50); border: 1px solid #cfe7e2; border-radius: var(--radius);
  padding: 1.4rem; color: var(--teal-900);
}
.aside-icon { display: inline-flex; color: var(--amber-600); margin-bottom: .4rem; }
.aside-card h3 { margin-bottom: .35rem; }
.aside-card p { margin: 0; color: var(--ink); }

/* ─── Why cards ────────────────────────────────────────────── */
.why-section { padding: clamp(2.5rem, 5vw, 4rem) 0; background: var(--cream-2); }
.why-section, .why-section h2, .why-section .section-subtitle { text-align: center; }
.cards-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr; gap: 1rem;
  text-align: left;
}
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm);
}
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 14px; margin-bottom: .7rem;
  background: var(--teal-50); color: var(--teal-700);
}
.card h3 { margin-bottom: .35rem; }
.card p { margin: 0; color: var(--ink-soft); }

/* ─── Donate section ───────────────────────────────────────── */
.donate-section {
  padding: clamp(2.8rem, 6vw, 4.5rem) 0;
  background:
    radial-gradient(900px 300px at 15% 0%, rgba(245,158,11,.22), transparent 60%),
    linear-gradient(160deg, var(--teal-700), var(--teal-900));
  color: #fff; text-align: center;
}
.donate-card { max-width: 680px; margin-inline: auto; }
.donate-section h2 { color: #fff; }
.secure-note { margin: 1rem 0 0; font-size: .92rem; color: rgba(255,255,255,.92); }
.donate-unavailable {
  margin: 1rem auto 0; max-width: 36ch;
  background: var(--amber-100); color: var(--amber-600);
  font-weight: 700; font-size: .95rem;
  padding: .7rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid #fcd98a;
}

/* ─── Contact ──────────────────────────────────────────────── */
.contact-section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.address-block { font-style: normal; color: var(--ink); line-height: 1.7; }
.phone { margin-top: 1rem; }
.contact-label { color: var(--ink-soft); margin-right: .25rem; }

.contact-form {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.contact-form h3 { margin-bottom: 1rem; }

/* ─── Form fields ──────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .92rem; margin-bottom: .3rem; color: var(--ink); }
.field input, .field textarea, .field select {
  font: inherit; color: var(--ink);
  padding: .7rem .8rem; border: 1px solid #c9c6bb; border-radius: var(--radius-sm);
  background: var(--cream);
  width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgba(17,134,125,.18);
  background: #fff;
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--danger); background: var(--danger-bg);
}
.error-text { color: var(--danger); font-size: .82rem; min-height: 1em; margin-top: .25rem; }
.form-error { color: var(--danger); font-weight: 600; margin: 0 0 .8rem; min-height: 1em; }
.form-status { font-size: .9rem; color: var(--teal-700); margin: .6rem 0 0; min-height: 1em; }

/* ─── Trust ────────────────────────────────────────────────── */
.trust-section { padding: clamp(2.5rem, 5vw, 4rem) 0; background: var(--cream-2); text-align: center; }
.trust-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr; gap: .8rem; text-align: left;
}
.trust-item {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .9rem 1.1rem; color: var(--ink);
}
.trust-item a { text-decoration: none; font-weight: 600; display: block; }
.trust-tag {
  display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  background: var(--amber-100); color: var(--amber-600); border-radius: 999px;
  padding: .12rem .55rem; margin-right: .5rem; font-weight: 700;
}

/* ─── Legal ────────────────────────────────────────────────── */
.legal-section { padding: clamp(2rem, 4vw, 3rem) 0; background: var(--cream); }
.legal-section-alt { background: var(--cream-2); }
.legal-copy { max-width: 760px; }
.legal-copy h3 { margin-top: 1.2rem; color: var(--teal-700); }

/* ─── Footer ───────────────────────────────────────────────── */
.site-footer { background: var(--teal-900); color: rgba(255,255,255,.92); padding: 2.2rem 0 1.5rem; }
.footer-inner { text-align: center; }
.footer-brand { font-size: 1.1rem; margin-bottom: .4rem; color: #fff; }
.footer-quote { font-style: italic; max-width: 56ch; margin: 0 auto 1rem; }
.footer-nav { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-nav a { color: var(--amber-100); text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-contact { font-size: .88rem; color: rgba(255,255,255,.8); margin-bottom: .8rem; }
.footer-contact a { color: var(--amber-100); }
.footer-copy { font-size: .82rem; color: rgba(255,255,255,.7); margin: 0; }

/* ─── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 40, 38, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem) 1rem;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--cream); border-radius: var(--radius);
  width: min(100%, 560px); box-shadow: var(--shadow);
  position: relative; padding: clamp(1.4rem, 3vw, 2rem);
  margin-top: auto; margin-bottom: auto;
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: .5rem; right: .6rem;
  background: transparent; border: 0; font-size: 1.8rem; line-height: 1;
  color: var(--ink-soft); cursor: pointer; padding: .2rem .5rem; border-radius: 8px;
}
.modal-close:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.modal-close:focus-visible { outline: 3px solid var(--amber-500); outline-offset: 2px; }
.modal-desc { color: var(--ink-soft); margin-bottom: 1.2rem; font-size: .95rem; }
.modal-footnote { font-size: .82rem; color: var(--ink-soft); margin: .9rem 0 0; }

/* ─── Breakpoints ──────────────────────────────────────────── */
@media (min-width: 640px) {
  .progress-figures { grid-template-columns: repeat(3, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr 1.1fr; }
  .story-grid { grid-template-columns: 1.4fr 1fr; }
}

@media (min-width: 960px) {
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .progress-fill { transition: none; }
}
