/* ==========================================================================
   03-layout.css
   Page skeleton: the centered container, the vertical rhythm of sections,
   the section heading block, and the scroll-reveal mechanics.
   Anything that describes a *specific* piece of UI belongs in 04-components.
   ========================================================================== */

/* ---- Container -----------------------------------------------------------
   Every section wraps its content in this. 1200px max, 24px gutters.      */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}


/* ---- Sections ------------------------------------------------------------
   One class sets the rhythm; a modifier sets the background. To add a new
   section, use `.section` plus whichever background it needs.             */

.section {
  padding-block: 6rem;
}

.section--warm  { background-color: var(--warm-white); }
.section--sand  { background-color: var(--sand); }
.section--cream { background-color: var(--cream); }
.section--deep  { background-color: var(--deep-purple); }

/* The newsletter band is shorter than the rest. */
.section--tight { padding-block: 4rem; }

@media (min-width: 768px) {
  .section        { padding-block: 8rem; }
  .section--tight { padding-block: 5rem; }
}


/* ---- Section heading block ----------------------------------------------
   Eyebrow label -> heading -> optional lede paragraph, centered.          */

.section__head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--lavender);
}

.section-label--light { color: var(--light-purple); }

.section-heading {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: var(--lh-3xl);
  font-weight: 600;
  color: var(--charcoal);
  margin-top: 0.75rem;
}

.section-heading--light { color: var(--white); }

@media (min-width: 768px) {
  .section-heading { font-size: var(--text-4xl); line-height: var(--lh-4xl); }
}

.section__lede {
  margin-top: 1.25rem;
  margin-inline: auto;
  max-width: 700px;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--soft-gray);
}

/* On the dark Impact section the lede sits closer to the heading. */
.section__lede--light {
  margin-top: 1rem;
  max-width: 600px;
  color: rgb(255 255 255 / 0.8);
}

.section__lede--narrow {
  margin-top: 1rem;
  max-width: 600px;
}


/* ---- Grids ---------------------------------------------------------------
   Named after what they hold, so the section markup reads plainly.        */

.program-grid,
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.involve-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.impact-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 640px) {
  .program-grid,
  .involve-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .story-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
  .stat-grid    { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .involve-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .impact-split { grid-template-columns: 55% 45%; gap: 3rem; }
}


/* ==========================================================================
   SCROLL REVEAL

   These four classes are BEHAVIOURAL, not decorative — js/reveal.js queries
   them to decide which elements animate in. They intentionally carry no
   styling of their own beyond the starting state below. Do not delete them
   because they "look empty".

   A container opts in with `data-reveal="<selector>"`; see js/reveal.js.
   ========================================================================== */

.reveal-child,
.reveal-card,
.reveal-stat,
.reveal-content {
  opacity: 0;
  transform: translateY(var(--reveal-y, 30px));
  transition:
    opacity   var(--reveal-duration) var(--ease-out-quart),
    transform var(--reveal-duration) var(--ease-out-quart);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal-child.is-revealed,
.reveal-card.is-revealed,
.reveal-stat.is-revealed,
.reveal-content.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Readers who ask for reduced motion get the content immediately and in place
   rather than a page of invisible elements. */
@media (prefers-reduced-motion: reduce) {
  .reveal-child,
  .reveal-card,
  .reveal-stat,
  .reveal-content {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* If JavaScript never runs, nothing would remove the starting state, so the
   page would be blank. js/reveal.js sets `data-js` on <html> immediately;
   without it these rules keep everything visible. */
html:not([data-js]) .reveal-child,
html:not([data-js]) .reveal-card,
html:not([data-js]) .reveal-stat,
html:not([data-js]) .reveal-content {
  opacity: 1;
  transform: none;
}
