/* Communities of Hope
   Design constraints, deliberately stated:
   - Brand colours sampled from their own logo (#90C838) and header (#0073A8).
   - Photography always full colour. Never desaturated.
   - Banned: purple gradients, Inter, glassmorphism, glowing card grids,
     cream + Instrument Serif, centred-everything hero stacks.
   - Type: Fraunces (display) against Archivo (text). */

:root {
  --forest:      #12240F;
  --forest-2:    #1B3517;
  --ink:         #17210F;
  --ink-2:       #45513C;
  --ink-3:       #5F6B57;   /* was #6E7A66, which measured 4.45:1 on paper */
  --paper:       #FFFDF8;
  --sand:        #F2EFE4;
  --sand-2:      #E5E0CE;
  --green:       #90C838;
  --green-deep:  #4B7A1B;
  --green-dark:  #35590F;
  --blue:        #0073A8;
  --blue-deep:   #04506F;
  --clay:        #9E5230;   /* was #B4643C, which measured 4.28:1 on paper */

  /* One colour, used for giving and nothing else. Every strong non-profit site
     studied does this: One Acre Fund rust on green, PIH orange, charity: water
     yellow. Green is this brand's chrome, so giving needs its own signal. */
  --give:        #C0562E;
  --give-hi:     #A6441F;

  --wrap: 1220px;
  --gap: clamp(1.5rem, 4vw, 4rem);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  /* clip, not hidden: hidden would break position:sticky on the masthead */
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.02rem, 0.97rem + 0.25vw, 1.14rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "SOFT" 20, "WONK" 0;
  line-height: 1.06;
  letter-spacing: -0.018em;
  margin: 0 0 0.6em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* Minimums sized so the longest real headline still fits a 360px phone. */
h1 { font-size: clamp(1.95rem, 1.12rem + 3.55vw, 5.1rem); }
h2 { font-size: clamp(1.6rem, 1.16rem + 1.95vw, 3.25rem); }
h3 { font-size: clamp(1.18rem, 1.05rem + 0.6vw, 1.65rem); }

p { margin: 0 0 1.15em; max-width: 66ch; }

.wrap { width: min(100% - 2.4rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.4rem, 780px); margin-inline: auto; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-deep);
  margin: 0 0 1.1rem;
}
.eyebrow.on-dark { color: var(--green); }

.lede { font-size: clamp(1.14rem, 1.02rem + 0.55vw, 1.4rem); color: var(--ink-2); line-height: 1.5; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--forest); color: #fff; padding: 0.8rem 1.2rem;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,253,248,0.96);
  border-bottom: 1px solid var(--sand-2);
}
.masthead-in {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 74px;
}
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 42px; width: auto; }

.nav { margin-left: auto; display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 2rem); }
.nav a {
  font-size: 0.94rem; font-weight: 550; color: var(--ink);
  text-decoration: none; padding: 0.4rem 0; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--green); color: var(--ink); }

/* `.nav a` (0,1,1) out-specifies `.btn` (0,1,0) and was eating the button's
   padding and border. Same trap the language toggle fell into. */
.nav a.btn {
  padding: 0.62rem 1.3rem; border-width: 2px; border-style: solid;
  border-bottom-width: 2px; font-size: 0.92rem;
}
.nav a.btn-give { background: var(--give); border-color: var(--give); color: #fff; }
.nav a.btn-give:hover { background: var(--give-hi); border-color: var(--give-hi); color: #fff; }

/* Needs to out-specify `.nav a`, which sets its own border-bottom and padding. */
.nav a.lang, .lang {
  font-size: 0.8rem; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--ink-3); border-radius: 2px;
  padding: 0.42rem 0.62rem; line-height: 1;
}
.nav a.lang:hover, .lang:hover { border-color: var(--green-deep); color: var(--green-deep); background: var(--sand); }
.nav .btn-give + a.lang { margin-left: 0.6rem; }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--sand-2);
  border-radius: 2px; padding: 0.5rem 0.7rem; font: inherit; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; color: var(--ink);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 0.97rem; font-weight: 650;
  letter-spacing: 0.005em; text-decoration: none; padding: 0.92rem 1.7rem;
  border: 2px solid transparent; border-radius: 2px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-give { background: var(--give); color: #fff; border-color: var(--give); }
.btn-give:hover { background: var(--give-hi); border-color: var(--give-hi); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: currentColor; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-ghost.on-dark { color: #fff; }
.btn-ghost.on-dark:hover { background: #fff; color: var(--forest); }
.btn-sm { padding: 0.62rem 1.15rem; font-size: 0.9rem; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--forest); color: #fff; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
/* The faces are the point. Darken only far enough left to seat the type,
   then get out of the way. */
.hero-media img { filter: saturate(1.06) brightness(1.1); }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(9,22,7,0.9) 0%, rgba(9,22,7,0.72) 34%, rgba(9,22,7,0.2) 62%, rgba(9,22,7,0) 88%),
    linear-gradient(to top, rgba(9,22,7,0.55) 0%, rgba(9,22,7,0) 42%);
}
.hero-in { position: relative; padding: clamp(4.5rem, 11vw, 9.5rem) 0 clamp(3.5rem, 8vw, 7rem); }
.hero-copy { max-width: 44rem; }
.hero h1 { color: #fff; margin-bottom: 0.5em; }
.hero .lede { color: rgba(255,255,255,0.9); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }

/* ---------- give widget (in the hero) ---------- */
.gw {
  background: var(--paper); border-radius: 3px; max-width: 27rem;
  margin: 2rem 0 1.4rem; box-shadow: 0 24px 50px -28px rgba(0,0,0,0.75);
}
.gw-tabs { display: flex; border-bottom: 1px solid var(--sand-2); }
.gw-tab {
  flex: 1; font: inherit; font-size: 0.9rem; font-weight: 650; cursor: pointer;
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 0.95rem 0.6rem; color: var(--ink-3);
}
.gw-tab.is-on { color: var(--ink); border-bottom-color: var(--give); }
.gw-tab:hover { color: var(--ink); }
.gw-body { padding: 1.15rem 1.15rem 1.3rem; }
.gw-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 0.95rem; }
.gw-amt {
  font: inherit; font-size: 0.95rem; font-weight: 650; cursor: pointer;
  padding: 0.7rem 0.2rem; border: 1px solid var(--sand-2); border-radius: 2px;
  background: var(--paper); color: var(--ink-2); text-align: center;
}
.gw-amt:hover { border-color: var(--ink-3); color: var(--ink); }
.gw-amt.is-on { background: var(--give); border-color: var(--give); color: #fff; }
.gw-cta { display: block; width: 100%; text-align: center; padding: 0.95rem 1rem; }
.gw-note { font-size: 0.82rem; color: var(--ink-3); margin: 0.75rem 0 0; text-align: center; max-width: none; }
.hero-alt-link a { color: rgba(255,255,255,0.88); font-size: 0.95rem; font-weight: 550; }
.hero-alt-link a:hover { color: #fff; }

/* ---------- photo caption pill ---------- */
/* Says what a photograph actually is, so adjacency never implies a claim
   the picture does not support. */
.photo-cap {
  position: absolute; left: 0.8rem; bottom: 0.8rem; z-index: 3;
  background: rgba(9,22,7,0.82); color: rgba(255,255,255,0.94);
  font-size: 0.74rem; line-height: 1.35; letter-spacing: 0.01em;
  padding: 0.4rem 0.65rem; border-radius: 2px; max-width: calc(100% - 1.6rem);
}
.split-media { position: relative; }
/* In the hero the left side is occupied by the copy and the give widget. */
.hero-media .photo-cap { left: auto; right: 1rem; bottom: 1rem; }
@media (max-width: 720px) { .hero-media .photo-cap { display: none; } }

/* ---------- trust bar ---------- */
.trustbar { background: var(--sand); border-bottom: 1px solid var(--sand-2); }
.trustbar-in {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.7rem;
  padding: 0.95rem 0; font-size: 0.85rem; color: var(--ink-2);
}
.trustbar span { display: flex; align-items: center; gap: 0.55rem; }
.trustbar span::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--green-deep); flex: 0 0 auto;
}

/* ---------- where we work ---------- */
.places { list-style: none; padding: 0; margin: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; }
.places li { padding: 1.2rem 1.3rem 1.4rem; outline: 1px solid var(--sand-2); }
.places b { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.places span { display: block; font-size: 0.88rem; color: var(--ink-2); margin-top: 0.25rem; }

/* ---------- number band ---------- */
.figures { background: var(--forest-2); color: #fff; }
.figures-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,0.13);
}
.figure { padding: 2.4rem 1.4rem 2.1rem; border-right: 1px solid rgba(255,255,255,0.13); }
.figure:last-child { border-right: 0; }
.figure b {
  display: block; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.85rem, 1.05rem + 2.35vw, 3.4rem); line-height: 1; color: var(--green);
  letter-spacing: -0.035em; margin-bottom: 0.45rem;
  overflow-wrap: break-word;
}
.figure span { display: block; font-size: 0.92rem; color: rgba(255,255,255,0.82); line-height: 1.42; }
.figures-note {
  padding: 1.1rem 1.4rem 2rem; font-size: 0.82rem; color: rgba(255,255,255,0.58);
  border-top: 1px solid rgba(255,255,255,0.1); max-width: none;
}

/* ---------- sections ---------- */
.section { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.section-tight { padding: clamp(2.8rem, 6vw, 5rem) 0; }
.section-sand { background: var(--sand); }
.section-forest { background: var(--forest); color: #fff; }
.section-forest h2, .section-forest h3 { color: #fff; }
.section-forest p { color: rgba(255,255,255,0.85); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.2rem, 5vw, 3.6rem); }

/* asymmetric split */
.split {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.split-flip .split-media { order: -1; }
/* Images fill their column instead of floating in a pool of dead space. */
.split-media img {
  width: 100%; height: 100%; border-radius: 2px;
  object-fit: cover; min-height: clamp(320px, 32vw, 500px);
}
.split-media--poster img { object-fit: contain; height: auto; min-height: 0; }
.split-media--stack img { min-height: 0; height: auto; }

/* ---------- the model / steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.step { padding: 2rem 1.6rem 2.2rem 0; border-right: 1px solid var(--sand-2); padding-right: 1.6rem; }
.step:last-child { border-right: 0; }
.step-n {
  font-family: var(--serif); font-size: 0.95rem; font-weight: 600; color: var(--green-deep);
  letter-spacing: 0.1em; display: block; margin-bottom: 0.9rem;
}
.step h3 { margin-bottom: 0.5rem; }
.step p { font-size: 0.96rem; color: var(--ink-2); margin: 0; }

/* ---------- initiatives ---------- */
/* Outlines rather than a background-as-gridline, so an odd item count
   never leaves a coloured empty cell hanging off the end. */
.inits { display: grid; grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); gap: 1px; }
.init { background: var(--paper); padding: 1.9rem 1.7rem 2rem; outline: 1px solid var(--sand-2); }
.section-sand .init { background: var(--sand); }
.init h3 { font-size: 1.22rem; margin-bottom: 0.45rem; }
.init p { font-size: 0.95rem; color: var(--ink-2); margin: 0; }
.init-tag { font-size: 0.74rem; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 650; color: var(--clay); display: block; margin-bottom: 0.8rem; }

/* ---------- story ---------- */
.story-quote {
  font-family: var(--serif); font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2.1rem);
  line-height: 1.28; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 1.4rem; max-width: 24ch;
}
.section-forest .story-quote { color: #fff; }
.attrib { font-size: 0.9rem; color: var(--ink-3); letter-spacing: 0.02em; }
.section-forest .attrib { color: rgba(255,255,255,0.62); }

/* ---------- give ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin: 2.4rem 0 1.6rem; }
.tier {
  border: 1px solid var(--sand-2); background: var(--paper); padding: 1.6rem 1.4rem 1.7rem;
  display: flex; flex-direction: column; border-radius: 2px;
}
.tier-amount { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--ink); margin-bottom: 0.15rem; }
.tier-freq { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem; }
.tier h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.tier p { font-size: 0.92rem; color: var(--ink-2); margin: 0 0 1.4rem; }
.tier .btn { margin-top: auto; text-align: center; }
.tier-featured { border-color: var(--give); border-width: 2px; }
.tier-flag { font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 700; color: var(--give); margin-bottom: 0.7rem; }

.give-panel { background: var(--sand); border: 1px solid var(--sand-2); padding: clamp(1.6rem, 4vw, 2.6rem); border-radius: 2px; }

.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1.6rem 2.2rem; margin-top: 1rem; }
.trust h3 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.trust p { font-size: 0.92rem; color: var(--ink-2); margin: 0; }

/* ---------- notice ---------- */
.notice {
  border-left: 3px solid var(--clay); background: #FBF4EF;
  padding: 1.1rem 1.3rem; font-size: 0.93rem; color: var(--ink-2); border-radius: 0 2px 2px 0;
}
.notice p { margin: 0; max-width: none; }
.notice strong { color: var(--clay); }

/* ---------- team ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.6rem 2rem; }
.person { border-top: 2px solid var(--ink); padding-top: 0.9rem; }
.person b { display: block; font-family: var(--serif); font-size: 1.12rem; font-weight: 600; margin-bottom: 0.15rem; }
.person span { font-size: 0.89rem; color: var(--ink-3); }

/* ---------- prose lists ---------- */
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 1rem 0; border-bottom: 1px solid var(--sand-2); }
.plain-list li:first-child { border-top: 1px solid var(--sand-2); }
.plain-list b { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; display: block; margin-bottom: 0.15rem; }
.plain-list span { color: var(--ink-2); font-size: 0.95rem; }

/* ---------- give strip ---------- */
.strip { background: var(--green); color: var(--forest); }
.strip-in { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem 2.5rem; padding: clamp(2.4rem, 5vw, 3.6rem) 0; }
.strip h2 { color: var(--forest); margin: 0; flex: 1 1 22rem; font-size: clamp(1.7rem, 1.3rem + 1.7vw, 2.6rem); }
.strip .btn-give { background: var(--forest); color: #fff; border-color: var(--forest); }
.strip .btn-give:hover { background: #000; border-color: #000; }

/* ---------- footer ---------- */
.foot { background: var(--forest); color: rgba(255,255,255,0.78); padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; font-size: 0.94rem; }
.foot a { color: rgba(255,255,255,0.78); text-decoration: none; }
.foot a:hover { color: var(--green); text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.4rem; }
.foot h4 { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--green); font-weight: 650; margin-bottom: 1rem; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 0.55rem; }
.foot img { height: 40px; width: auto; margin-bottom: 1.1rem; filter: brightness(0) invert(1); opacity: 0.92; }
.foot p { max-width: 30ch; }
.foot-base { margin-top: 2.8rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.85rem; color: rgba(255,255,255,0.5); display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; }

/* ---------- page header ---------- */
.pagehead { background: var(--sand); border-bottom: 1px solid var(--sand-2); padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.4rem, 5vw, 4rem); }
.pagehead h1 { margin-bottom: 0.35em; }
.pagehead .lede { max-width: 44rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .figures-grid { grid-template-columns: repeat(2, 1fr); }
  .figure:nth-child(2n) { border-right: 0; }
  .figure:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.13); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(2n) { border-right: 0; }
  .split { grid-template-columns: 1fr; }
  .split-flip .split-media { order: 0; }
  .foot-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--sand-2);
    flex-direction: column; align-items: stretch; gap: 0; padding: 0.6rem 1.2rem 1.3rem;
    box-shadow: 0 14px 24px -18px rgba(0,0,0,0.4);
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.85rem 0; border-bottom: 1px solid var(--sand-2); }
  .nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--sand-2); color: var(--green-deep); }
  .nav .btn, .nav .lang { align-self: flex-start; margin-top: 0.9rem; }
  .masthead-in { position: relative; }
  .hero-media img { object-position: 62% 40%; }
  .hero-media::after {
    background: linear-gradient(to top, rgba(9,22,7,0.95) 12%, rgba(9,22,7,0.78) 52%, rgba(9,22,7,0.45) 100%);
  }
}

/* Big numbers like "10,260,000" do not survive a half-width phone column. */
@media (max-width: 620px) {
  .figures-grid { grid-template-columns: 1fr; }
  .figure { border-right: 0; }
  .figure + .figure { border-top: 1px solid rgba(255,255,255,0.13); }
  .figure:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.13); }
}

@media (max-width: 540px) {
  .steps { grid-template-columns: 1fr; border-top-width: 2px; }
  .step { border-right: 0; border-bottom: 1px solid var(--sand-2); padding-bottom: 1.6rem; }
  .step:last-child { border-bottom: 0; }
  .foot-grid { grid-template-columns: 1fr; }
}

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