/* =========================================================================
   The Roots Foundation — shared site styles
   -------------------------------------------------------------------------
   ⚠️  This stylesheet is loaded by EVERY page. Any rule added here applies
   site-wide. Do NOT add page-specific tweaks here — they will bleed across
   pages and reintroduce the edit-isolation bug.

   For page-specific rules, edit the matching file under `assets/pages/`:
       home.css, about.css, our-work.css, approach.css,
       donate.css, privacy.css, terms.css
   Every rule in those files is scoped with `.page-<slug>` and applies only
   to that page (each <body> carries the matching `page-<slug>` class).
   ========================================================================= */

/* Self-hosted fonts — latin subsets pulled from Google Fonts so the page
   doesn't have to wait on a third-party stylesheet round trip. */
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/merriweather-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('fonts/merriweather-900.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/source-sans-3-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/source-sans-3-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/source-sans-3-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/source-sans-3-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand palette */
  --forest: #2C7444;
  --forest-deep: #1e5230;
  --forest-ink: #173c22;
  --lime: #88b23c;
  --wheat: #E7D37F;
  --apricot: #FD9B63;
  --cream: #F2EBE2;
  --cream-deep: #e8dfd1;
  --paper: #FBF8F3;
  --ink: #1f2a24;
  --ink-soft: #4a554e;
  --rule: rgba(44, 116, 68, 0.18);

  /* Type */
  --serif: 'Merriweather', 'Source Serif 4', Georgia, serif;
  --sans: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 14px;
  --radius-lg: 28px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--forest); text-decoration: none; transition: color .18s; }
a:hover { color: var(--forest-deep); }

/* ---------- Type scale ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 900;
  color: var(--forest-ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.18; }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.25; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; text-wrap: pretty; }
p.lead {
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 62ch;
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1.5px;
  background: var(--forest);
  display: inline-block;
}
.eyebrow.eyebrow-heading {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 44.8px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
  color: #173c22;
  display: block;
  margin: 0 0 1.1rem;
}
.eyebrow.eyebrow-heading::before {
  content: none;
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding: 0 var(--gutter); }

section { padding: clamp(64px, 9vw, 128px) 0; }

.grid { display: grid; gap: clamp(24px, 3.5vw, 48px); }
.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: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
  text-decoration: none;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}
.btn-primary:hover {
  background: var(--forest-deep);
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(44, 116, 68, 0.6);
}

.btn-accent {
  background: var(--apricot);
  color: var(--forest-ink);
  border-color: var(--apricot);
}
.btn-accent:hover {
  background: #fc8a49;
  color: var(--forest-ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(253, 155, 99, 0.65);
}

.btn-ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.btn-ghost:hover {
  background: var(--forest);
  color: var(--cream);
}

.btn-ghost-cream {
  background: transparent;
  color: var(--cream);
  border-color: rgba(242, 235, 226, 0.5);
}
.btn-ghost-cream:hover {
  background: var(--cream);
  color: var(--forest-ink);
  border-color: var(--cream);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 243, 0.92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 84px;
}
.site-header .logo {
  display: flex;
  align-items: center;
  height: 56px;
}
.site-header .logo img { height: 100%; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav a {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--forest-ink);
  padding: 10px 16px;
  border-radius: 999px;
  position: relative;
  transition: color .18s, background .18s;
}
.nav a:hover { color: var(--forest); background: rgba(44, 116, 68, 0.06); }
.nav a.active { color: var(--forest); }
.nav a.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  background: var(--apricot);
  border-radius: 50%;
}
.nav .nav-cta {
  margin-left: 10px;
  padding: 10px 22px;
  background: var(--forest);
  color: var(--cream);
  font-size: 0.93rem;
}
.nav .nav-cta:hover { background: var(--forest-deep); color: var(--cream); }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--forest);
  color: var(--forest);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .site-header .wrap { height: 72px; }
  .site-header .logo { height: 44px; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 20px var(--gutter);
    gap: 4px;
    align-items: stretch;
  }
  .nav.open a { text-align: left; }
  .nav-toggle { display: inline-block; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--forest-ink);
  color: var(--cream);
  padding: 80px 0 32px;
  margin-top: 0;
}
.site-footer a { color: var(--cream); }
.site-footer a:hover { color: var(--wheat); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-logo img { height: 72px; width: auto; margin-bottom: 20px; }
.footer-brand p {
  color: rgba(242, 235, 226, 0.75);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 34ch;
}

.footer-col h5 {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 18px;
  font-weight: 600;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; font-size: 0.95rem; }

.footer-col address {
  font-style: normal;
  font-size: 0.95rem;
  color: rgba(242, 235, 226, 0.82);
  line-height: 1.7;
}

.newsletter input[type="email"] {
  width: 100%;
  background: rgba(242, 235, 226, 0.08);
  border: 1px solid rgba(242, 235, 226, 0.22);
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.newsletter input::placeholder { color: rgba(242, 235, 226, 0.45); }
.newsletter input:focus {
  outline: none;
  border-color: var(--lime);
  background: rgba(242, 235, 226, 0.12);
}
.newsletter button {
  width: 100%;
  padding: 12px;
  background: var(--lime);
  color: var(--forest-ink);
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .18s;
}
.newsletter button:hover { background: #a3dd5b; }

.footer-bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(242, 235, 226, 0.15);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(242, 235, 226, 0.6);
  gap: 16px 24px;
}
.footer-bottom > :first-child { justify-self: start; }
.footer-bottom > :last-child  { justify-self: end; }
.footer-legal {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-legal a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 500;
  transition: color .18s;
}
.footer-legal a:hover { color: var(--wheat); text-decoration: underline; }
.footer-legal .sep {
  color: rgba(242, 235, 226, 0.35);
  font-size: 0.75rem;
}
@media (max-width: 720px) {
  .footer-bottom {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-bottom > :first-child,
  .footer-bottom > :last-child,
  .footer-legal { justify-self: center; }
}

/* ---------- Legal pages (Terms, Privacy) ---------- */
.legal-page { background: var(--paper); padding: 80px 0 100px; }
.legal-page .wrap { max-width: 820px; }
.legal-page h1 {
  color: var(--forest-deep);
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 8px;
}
.legal-page .effective {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 36px;
}
.legal-page h2 {
  color: var(--forest-deep);
  font-weight: 900;
  font-size: 1.35rem;
  margin: 40px 0 12px;
}
.legal-page p {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 0 0 16px;
}
.legal-page ul {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.75;
}
.legal-page ul li { margin-bottom: 8px; }
.legal-page a { color: var(--forest); }
.legal-page a:hover { color: var(--forest-deep); text-decoration: underline; }

/* ---------- Cards / Program tiles ---------- */
.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px rgba(44, 116, 68, 0.28);
  border-color: rgba(44, 116, 68, 0.3);
}
.card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--forest-ink);
}
.card .card-icon svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); flex: 1; margin-bottom: 20px; }
.card a.card-link {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--forest);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card a.card-link:hover { gap: 10px; }

/* ---------- Sub-page hero ---------- */
.page-hero {
  background: var(--cream);
  padding: clamp(80px, 12vw, 160px) 0 clamp(64px, 9vw, 112px);
  position: relative;
  overflow: hidden;
}
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero h1 { max-width: 18ch; }
.page-hero p.lead { max-width: 56ch; margin-top: 16px; }
.page-hero p:not(.lead) { max-width: 56ch; font-size: 17.28px; color: #4a554e; }
.page-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(136, 178, 60, 0.28), transparent 70%);
  pointer-events: none;
}
.page-hero::before {
  content: "";
  position: absolute;
  left: -60px;
  top: 40%;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(136, 178, 60, 0.22), transparent 70%);
  pointer-events: none;
}

/* ---------- Colored sections ---------- */
.sec-cream { background: var(--cream); }
.sec-paper { background: var(--paper); }
.sec-forest { background: var(--forest-ink); color: var(--cream); }
.sec-forest h1, .sec-forest h2, .sec-forest h3 { color: var(--cream); }
.sec-forest p { color: rgba(242, 235, 226, 0.8); }

/* ---------- Utility ---------- */
.tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(44, 116, 68, 0.08);
  color: var(--forest);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 0;
}

/* Decorative organic shape */
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
