/* ===========================================================
   Dehestani Foundation — stylesheet
   Bold & warm, mobile-first
   =========================================================== */

:root {
  --teal-900: #0f2e29;
  --teal-800: #163f38;
  --teal-700: #1f5f52;
  --teal-600: #2c7c6b;
  --teal-500: #3f9382;
  --teal-100: #e7f3f0;
  --sand-50: #fff8f0;
  --sand-100: #fdeee0;
  --amber-500: #f0812f;
  --amber-600: #d96a1c;
  --coral-500: #ef5b4e;
  --ink-900: #1a2220;
  --ink-600: #4b5754;
  --ink-400: #7c8a86;
  --white: #ffffff;
  --border: #e6e0d6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 16px 34px -16px rgba(15, 46, 41, 0.35);
  --shadow-lg: 0 26px 54px -20px rgba(15, 46, 41, 0.4);
  --max-width: 1140px;
  --mobile-cta-height: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink-900);
  background: var(--sand-50);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* room for the fixed mobile donate bar */
@media (max-width: 640px) {
  body { padding-bottom: var(--mobile-cta-height); }
}

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

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

h1, h2, h3, h4 {
  font-family: inherit;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.14;
  margin: 0 0 0.5em;
  color: var(--teal-900);
}

h1 { font-size: clamp(2.3rem, 7vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
h3 { font-size: 1.25rem; font-weight: 700; }

p { margin: 0 0 1em; color: var(--ink-600); font-size: 1.02rem; }

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

@media (min-width: 640px) {
  .container { padding: 0 32px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 13px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--amber-500), var(--coral-500));
  color: var(--white);
  box-shadow: 0 10px 24px -10px rgba(240, 129, 47, 0.65);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(240, 129, 47, 0.75); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  border-color: var(--teal-600);
  color: var(--teal-700);
}
.btn-outline:hover { background: var(--teal-100); }
.btn-light {
  background: var(--white);
  color: var(--teal-700);
}
.btn-light:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.1rem;
  color: var(--teal-900);
  white-space: nowrap;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber-500), var(--teal-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}
.brand-mark svg { width: 21px; height: 21px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-600);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--teal-700);
  border-bottom-color: var(--amber-500);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.nav-toggle:active { background: var(--teal-100); }
.nav-toggle svg { width: 26px; height: 26px; color: var(--teal-900); }
.nav-close { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed;
    inset: 0;
    top: 0;
    background: var(--teal-900);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 32px;
    display: none;
    z-index: 70;
  }
  /* backdrop-filter on .site-header creates a new containing block for
     position:fixed descendants, which traps this full-screen nav inside
     the header's own box instead of covering the viewport. Drop the
     filter while the nav is open so .main-nav sizes against the real
     viewport instead. */
  .site-header:has(.main-nav.open),
  body.nav-open .site-header { backdrop-filter: none; }
  .main-nav.open { display: flex; }
  .main-nav ul { flex-direction: column; gap: 6px; text-align: center; }
  .main-nav ul li a {
    color: rgba(255,255,255,0.85);
    font-size: 1.4rem;
    font-weight: 700;
    padding: 14px 0;
    display: block;
    border-bottom: none;
  }
  .main-nav ul li a:hover,
  .main-nav ul li a[aria-current="page"] { color: var(--amber-500); }
  .main-nav .btn { margin: 24px auto 0; }
  .nav-close {
    display: block;
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    color: var(--white);
    padding: 10px;
  }
  .nav-close svg { width: 26px; height: 26px; }
}

/* ---------- Hero blocks (CSS-only art in place of photography) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--teal-900) 0%, var(--teal-600) 55%, var(--amber-500) 130%);
  color: var(--white);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero::before { width: 420px; height: 420px; top: -160px; right: -120px; }
.hero::after { width: 260px; height: 260px; bottom: -140px; left: -60px; background: rgba(239, 91, 78, 0.25); }

.hero .container {
  position: relative;
  padding: 64px 20px 56px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-page {
  padding: 52px 20px 48px;
}
.hero-page .container { grid-template-columns: 1fr; text-align: center; padding: 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sand-100);
  margin-bottom: 14px;
}
.hero h1 { color: var(--white); }
.hero p.lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  max-width: 46ch;
}
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }

.hero-art {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.24), transparent 45%),
    linear-gradient(160deg, var(--amber-500), var(--coral-500));
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-art svg { position: absolute; inset: 0; margin: auto; width: 46%; height: 46%; color: rgba(255,255,255,0.92); }

@media (min-width: 640px) {
  .hero .container { padding: 96px 32px 88px; }
  .hero-page { padding: 72px 32px; }
}
@media (max-width: 780px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-art { max-width: 320px; margin: 0 auto; }
}

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--sand-100); }
.section-header { max-width: 62ch; margin: 0 0 32px; }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }

@media (min-width: 640px) {
  .section { padding: 84px 0; }
  .section-header { margin-bottom: 44px; }
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; } }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--amber-500), var(--coral-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 24px; height: 24px; }

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; gap: 56px; }
  .split.reverse .split-art { order: 2; }
}
.split-art {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--teal-500), var(--teal-900));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 860px) { .split-art { max-width: none; } }
.split-art svg { position: absolute; inset: 0; margin: auto; width: 40%; height: 40%; color: var(--white); opacity: 0.9; }

.values-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 500px) { .values-list { grid-template-columns: repeat(2, 1fr); gap: 12px 28px; } }
.values-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--teal-800);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.values-list li svg {
  width: 20px; height: 20px; flex-shrink: 0;
  background: var(--amber-500);
  color: var(--white);
  border-radius: 50%;
  padding: 3px;
  box-sizing: content-box;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--coral-500), var(--amber-500) 55%, var(--teal-700));
  color: var(--white);
  text-align: center;
  padding: 48px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.92); }
@media (min-width: 640px) { .cta-band { padding: 64px 32px; } }

/* ---------- Forms ---------- */
.form-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  max-width: 640px;
}
@media (min-width: 640px) { .form-wrap { padding: 36px; } }
.form-row { margin-bottom: 18px; }
label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; color: var(--ink-900); }
input, textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink-900);
  background: var(--sand-50);
}
input:focus, textarea:focus { outline: 2px solid var(--amber-500); outline-offset: 1px; background: var(--white); }
.form-note { font-size: 0.85rem; color: var(--ink-400); margin-top: 8px; }
.form-status { margin-top: 14px; font-weight: 700; }

/* ---------- Contact / info blocks ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: start;
}
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 48px; } }
.info-item { display: flex; gap: 14px; margin-bottom: 20px; }
.info-item .icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--amber-500), var(--coral-500));
  color: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-item .icon svg { width: 20px; height: 20px; }

/* ---------- Lists / resource pages ---------- */
.resource-columns {
  columns: 1;
}
@media (min-width: 640px) { .resource-columns { columns: 2; column-gap: 40px; } }
.resource-columns li { break-inside: avoid; margin-bottom: 10px; }
.resource-section { margin-bottom: 40px; }
.resource-section h3 {
  border-bottom: 3px solid var(--amber-500);
  display: inline-block;
  padding-bottom: 6px;
  margin-bottom: 18px;
}
.resource-section ul { list-style: none; padding: 0; margin: 0; }
.resource-section a { color: var(--teal-700); font-weight: 600; }
.resource-section a:hover { color: var(--amber-600); text-decoration: underline; }

/* ---------- Blog ---------- */
.empty-state {
  text-align: center;
  padding: 52px 22px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--white);
}
.empty-state .card-icon { margin: 0 auto 18px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-900);
  color: rgba(255, 255, 255, 0.78);
  padding: 48px 0 24px;
  margin-top: 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; } }
.footer-grid h4 { color: var(--white); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a:hover { color: var(--amber-500); }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; margin-bottom: 14px; }
.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

/* ---------- Fixed mobile donate bar (injected by main.js) ---------- */
.mobile-cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  display: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 248, 240, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .mobile-cta-bar { display: block; }
}
.mobile-cta-bar .btn { width: 100%; }

/* ---------- Scroll-reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Misc ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--teal-900);
  color: var(--white);
  padding: 10px 16px;
  z-index: 100;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 16px; top: 16px; }

.breadcrumb { color: rgba(255,255,255,0.75); font-size: 0.85rem; margin-bottom: 10px; }
.breadcrumb a { color: rgba(255,255,255,0.9); }
