/* =========================================================
   Uhai Forest Trust — Design System & Shared Styles
   ========================================================= */

:root {
  /* Brand palette — matched to uhaiforesttrust.org's live dark-green sections */
  --forest-green: #1b2e1a;
  --forest-green-dark: #12200f;
  --forest-green-light: #233623;
  --gold: #b9a459;
  --gold-light: #d2c284;
  --sage: #9fbd82;
  --muted-cream: #95a195;
  --earth-brown: #4a3728;
  --cream: #faf6ee;
  --cream-dark: #f1e8d4;
  --white: #ffffff;

  /* Type */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1180px;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(27, 46, 26, 0.12);
  --header-height: 84px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--earth-brown);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--forest-green);
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  font-weight: 700;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.6rem); }

p { margin: 0 0 var(--space-sm); }

a {
  color: var(--forest-green);
  text-decoration: underline;
  text-decoration-color: rgba(27, 46, 26, 0.35);
  text-underline-offset: 3px;
}
a:hover { color: var(--gold); }

ul { padding-left: 1.2rem; }

/* Visible, high-contrast focus ring for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

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

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

.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -60px;
  background: var(--forest-green);
  color: var(--white);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  z-index: 1000;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: var(--space-sm); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--gold);
  color: var(--forest-green-dark);
}
.btn-primary:hover { background: var(--gold-light); color: var(--forest-green-dark); }

.btn-secondary {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}
.btn-secondary:hover { background: var(--white); color: var(--forest-green); }

.btn-outline {
  background: transparent;
  border-color: var(--forest-green);
  color: var(--forest-green);
}
.btn-outline:hover { background: var(--forest-green); color: var(--white); }

.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--forest-green);
  line-height: 1.1;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--earth-brown);
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--forest-green);
  border-bottom-color: var(--gold);
}

.main-nav a.nav-cta {
  background: var(--forest-green);
  color: var(--white);
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  border-bottom: none;
}
.main-nav a.nav-cta:hover { background: var(--gold); color: var(--forest-green-dark); }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--forest-green);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--forest-green);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .hamburger { display: flex; }

  .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--cream-dark);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.is-open { max-height: 480px; }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }
  .main-nav li { border-bottom: 1px solid var(--cream-dark); }
  .main-nav li:last-child { border-bottom: none; }
  .main-nav a { display: block; padding: 0.9rem 0.2rem; }
  .main-nav a.nav-cta { text-align: center; margin-top: var(--space-xs); }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--forest-green) 0%, var(--forest-green-dark) 100%);
  color: var(--white);
  padding: var(--space-2xl) 0 var(--space-xl);
}
.hero h1 { color: var(--white); }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: var(--space-sm);
}
.hero-lede {
  font-size: 1.2rem;
  max-width: 62ch;
  color: var(--muted-cream);
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}
.hero-image-wrap {
  margin-top: var(--space-lg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.page-hero {
  background: var(--forest-green);
  color: var(--white);
  padding: var(--space-xl) 0 var(--space-lg);
}
.page-hero h1 { color: var(--white); }
.page-hero p { color: var(--muted-cream); max-width: 65ch; font-size: 1.1rem; }

/* ---------- Sections ---------- */
section { padding: var(--space-2xl) 0; }
.section-tight { padding: var(--space-xl) 0; }
.section-alt { background: var(--white); }
.section-forest { background: var(--forest-green); color: var(--white); }
.section-forest h2, .section-forest h3 { color: var(--white); }

.section-intro { max-width: 72ch; margin-bottom: var(--space-lg); }
.section-intro h2 { margin-bottom: var(--space-xs); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: var(--space-xs);
  display: block;
}

/* ---------- Stats strip ---------- */
.stats-strip {
  background: var(--earth-brown);
  color: var(--white);
  padding: var(--space-lg) 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  text-align: center;
}
.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--gold-light);
  font-weight: 700;
  display: block;
}
.stat-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}
.stats-current {
  text-align: center;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.2);
  font-weight: 700;
  color: var(--gold-light);
}

/* ---------- Card grids ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow);
  border: 1px solid var(--cream-dark);
}
.card-icon { font-size: 2rem; margin-bottom: var(--space-xs); }
.card h3 { margin-bottom: var(--space-xs); }

/* Pillars */
.pillar {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--cream-dark);
}
.pillar:last-child { border-bottom: none; }
.pillar-number {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1;
}
.pillar-quote {
  font-style: italic;
  color: var(--forest-green);
  border-left: 3px solid var(--gold);
  padding-left: var(--space-sm);
  margin-top: var(--space-sm);
}

/* ---------- Roadmap / timeline ---------- */
.roadmap {
  display: grid;
  gap: var(--space-md);
  counter-reset: phase;
}
.roadmap-phase {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  align-items: start;
  position: relative;
  padding-bottom: var(--space-lg);
}
.roadmap-phase:last-child { padding-bottom: 0; }
.roadmap-marker {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--forest-green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  position: relative;
  z-index: 2;
}
.roadmap-phase.is-active .roadmap-marker { background: var(--gold); color: var(--forest-green-dark); }
.roadmap-phase:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 46px;
  bottom: -8px;
  width: 2px;
  background: var(--cream-dark);
}
.roadmap-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: rgba(185,164,89,0.14);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.3rem;
}

/* ---------- Quote block ---------- */
.pull-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--forest-green);
  text-align: center;
  max-width: 46ch;
  margin: 0 auto;
  line-height: 1.4;
}
.pull-quote::before,
.pull-quote::after { color: var(--gold); }

.philosophy-band {
  background: var(--cream-dark);
  text-align: center;
  padding: var(--space-xl) 0;
}

/* ---------- Photo gallery ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-md);
}
figure.photo { margin: 0; }
figure.photo img {
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
figure.photo figcaption {
  font-size: 0.9rem;
  color: var(--earth-brown);
  margin-top: 0.5rem;
}

/* ---------- Founder split (image + text) ---------- */
.founder-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-xl);
  align-items: center;
}
.founder-split img {
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 62%;
  box-shadow: var(--shadow);
  width: 100%;
}
@media (max-width: 780px) {
  .founder-split { grid-template-columns: 1fr; }
  .founder-split img { max-width: 320px; margin: 0 auto; }
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--forest-green);
  color: var(--white);
  text-align: center;
  padding: var(--space-xl) 0;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--muted-cream); max-width: 60ch; margin-left: auto; margin-right: auto; }

/* ---------- Tabs / paths (Get Involved) ---------- */
.path-tabs {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  border-bottom: 2px solid var(--cream-dark);
}
.path-tab {
  background: transparent;
  border: none;
  padding: 0.8rem 1.4rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--earth-brown);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.path-tab[aria-selected="true"] {
  color: var(--forest-green);
  border-bottom-color: var(--gold);
}
.path-panel { display: none; }
.path-panel.is-active { display: block; }

.check-list { list-style: none; padding: 0; }
.check-list li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.7rem;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

.appeal-box {
  background: var(--cream-dark);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: var(--space-md) 0;
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  gap: var(--space-md);
}
label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--forest-green);
}
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  background: var(--white);
  color: var(--earth-brown);
}
textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 0.85rem; color: var(--earth-brown); opacity: 0.75; }

.contact-details {
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}
.contact-details a { font-weight: 700; }

.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- Blog ---------- */
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--cream-dark);
  display: flex;
  flex-direction: column;
}
.post-card img { aspect-ratio: 16/10; object-fit: cover; }
.post-card-body { padding: var(--space-md); }
.post-date {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.post-card h3 a { text-decoration: none; color: var(--forest-green); }
.post-excerpt { color: var(--earth-brown); }

.post-body { max-width: 72ch; margin: 0 auto; }
.post-body h2 { margin-top: var(--space-lg); }
.post-body img { border-radius: var(--radius); margin: var(--space-md) 0; }
.post-meta {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  color: var(--earth-brown);
  opacity: 0.8;
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--forest-green-dark);
  color: var(--muted-cream);
  padding-top: var(--space-xl);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.footer-title {
  font-family: var(--font-heading);
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
}
.footer-tagline { font-style: italic; color: var(--gold-light); }
.footer-contact a { color: var(--muted-cream); text-decoration: none; }
.footer-contact a:hover { color: var(--gold-light); }
.footer-social { display: flex; gap: var(--space-sm); align-items: flex-start; }
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-decoration: none;
}
.footer-social a:hover { background: var(--gold); border-color: var(--gold); color: var(--forest-green-dark); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  padding: var(--space-md) 0;
  color: var(--muted-cream);
}
.footer-bottom a { color: var(--muted-cream); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-0 { margin-bottom: 0; }

@media (max-width: 600px) {
  .pillar { grid-template-columns: 60px 1fr; }
  .pillar-number { font-size: 2rem; }
}

/* ---------- Lightbox ---------- */
figure.photo a { display: block; }
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 32, 15, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.lightbox.is-open { display: flex; }
.lightbox figure {
  margin: 0;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}
.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius);
  margin: 0 auto;
}
.lightbox-caption {
  color: var(--white);
  margin-top: var(--space-sm);
}
.lightbox-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: var(--gold); border-color: var(--gold); color: var(--forest-green-dark); }

/* ---------- Missing-photo placeholder ---------- */
.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 160px;
  background: var(--cream-dark);
  border: 1px dashed var(--forest-green-light);
  border-radius: var(--radius);
  color: var(--earth-brown);
  text-align: center;
  padding: var(--space-md);
}
.img-placeholder-icon { font-size: 1.8rem; }
.img-placeholder-caption {
  font-size: 0.85rem;
  max-width: 30ch;
  opacity: 0.8;
}
a.lightbox-disabled { cursor: default; text-decoration: none; }
