/* about.css: About page only (about.html). The hero (the H1 above the P6 collage), the story split, the
   founder quote's offset, the promises and team layouts, the safety steps beside their photo, the timeline
   component and small tweaks to shared components. Mobile first, built from the tokens in css/styles.css. */

/* == Hero: the H1 and its line above the four-photo collage == */

.about-hero { padding-block: clamp(var(--space-5), 4vw, var(--space-7)) clamp(var(--space-8), 8vw, var(--space-9)); }
.about-hero__head { display: grid; gap: var(--space-5); margin-bottom: clamp(var(--space-6), 4vw, var(--space-8)); }
.about-hero__lead { max-width: 24em; }
/* Each phrase stays on one line while it fits; wider than the column (large text on a phone), it wraps */
.about-hero__title .nowrap { display: inline-block; max-width: 100%; white-space: normal; }
@media (min-width: 56.25em) {
  .about-hero__head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--space-8); align-items: end; }
  .about-hero__lead { padding-bottom: var(--space-2); }
}

/* == Story (P2): the heading runs above both columns, so the five paragraphs and the standing photo
   start together; the first paragraph leads == */

.story__head { margin-bottom: clamp(var(--space-6), 4vw, var(--space-8)); }
.story__title { max-width: 22ch; }
/* Beside five paragraphs a 4:5 arch left half the column empty; a taller 2:3 arch (a verandah doorway)
   stands on the section's edge instead. The 4:5 photo loses a sixth of its width, as in the collage, so it
   is drawn 1.2 times the box width; the img's sizes in about.html says so. */
@media (min-width: 56.25em) { .story__media .photo { aspect-ratio: 2 / 3; } }

/* == Founder quote (P4): stepped in from the story's left edge == */

@media (min-width: 62.5em) {
  .founder-quote__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6); }
  .founder-quote__figure { grid-column: 3 / -1; }
}

/* == Promises: heading on the left, the numbered list on the right == */

.promises__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }
.promises__title { max-width: 11ch; }
.promises__lead { margin-top: var(--space-4); color: var(--color-text-muted); }
.promises__close { margin-top: var(--space-6); color: var(--color-text-muted); }
/* The email may break anywhere at large text sizes. An invisible ::after makes a 44px tap target without
   changing the line height (the same technique as contact's inline phone link). */
.promises__close a { position: relative; overflow-wrap: anywhere; }
.promises__close a::after { content: ""; position: absolute; inset: calc(50% - var(--tap-target) / 2) 0; }
.promises__list .ed-list__item { column-gap: var(--space-4); }
@media (min-width: 56.25em) {
  .promises__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-8); align-items: start; }
  .promises__head { position: sticky; top: calc(var(--header-h) + var(--space-7)); }
  .promises__list .ed-list__item { padding-block: var(--space-6); column-gap: var(--space-6); }
}

/* == Team: the intro takes the first cell of the people grid ==
   So five people and the intro fill two columns of three rows, or three columns of two rows, with no orphan.
   Both sit in one grid cell; the people's list skips its first cell and the intro lies over that cell. */

.team { --team-gap: var(--space-6); }
.team__head { display: grid; gap: var(--space-4); margin-bottom: var(--space-8); }
.team__lead { color: var(--color-text-muted); }
.team .person__portrait { margin-bottom: var(--space-5); }
.team .person__years { margin-bottom: var(--space-3); }
@media (min-width: 43.75em) {
  .team__layout { display: grid; }
  .team__layout > * { grid-area: 1 / 1; }
  .team__head { position: relative; z-index: 1; align-self: start; width: calc((100% - var(--team-gap)) / 2); margin-bottom: 0; }
  .team__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--team-gap); }
  .team__grid > :first-child { grid-column-start: 2; }
}
@media (min-width: 62.5em) {
  .team__head { width: calc((100% - 2 * var(--team-gap)) / 3); }
  .team__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* == Safety (P3 on green): five steps as a vertical list beside the photo, never tiles ==
   Small arch numerals run down the list's left edge; on green they are limewash with green numerals. */

.safety__grid, .safety__between { display: grid; gap: var(--space-7); }
.safety__between { margin-top: var(--space-9); }
.safety__media .photo { aspect-ratio: 3 / 2; }
/* A smaller arch than the shared 3.5rem, in rem so it grows with its numeral */
.safety__steps .arch-num { width: 2.75rem; font-size: var(--step-eyebrow); }
@media (min-width: 56.25em) {
  .safety__grid, .safety__between { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-8); align-items: start; }
  .safety__media { position: sticky; top: calc(var(--header-h) + var(--space-7)); }
}

/* == Timeline: dated points on a green line, years in Fraunces italic ==
   The line runs down the left edge (from 56.25em beside the heading); from 68.75em it runs across,
   one column per moment. Each item's point and its line to the next item are drawn by an empty
   decorative span, not by the item, so no text sits inside a filled pseudo-element. */

.timeline { --tl-dot: var(--space-4); --tl-gap: var(--space-6); --tl-dot-y: calc(var(--step-h3) * var(--leading-h3) / 2); }
.timeline__title { margin-bottom: clamp(var(--space-6), 5vw, var(--space-8)); }
.timeline__list { display: grid; gap: var(--tl-gap); }
.timeline__item { position: relative; padding-inline-start: calc(var(--tl-dot) + var(--space-5)); }
.timeline__point { position: absolute; top: 0; bottom: calc(-1 * var(--tl-gap)); left: 0; width: var(--tl-dot); }
.timeline__point::before, .timeline__point::after { content: ""; position: absolute; background: var(--color-brand); }
.timeline__point::before {
  top: var(--tl-dot-y); bottom: calc(-1 * var(--tl-dot-y)); left: calc((var(--tl-dot) - var(--rule-motif)) / 2); width: var(--rule-motif);
}
.timeline__item:last-child .timeline__point::before { content: none; }
.timeline__point::after {
  top: calc(var(--tl-dot-y) - var(--tl-dot) / 2); left: 0; width: var(--tl-dot); height: var(--tl-dot);
  border-radius: var(--radius-pill);
}
.timeline__date {
  font-family: var(--font-display); font-style: italic; font-size: var(--step-h3); line-height: var(--leading-h3);
  letter-spacing: var(--tracking-h3); color: var(--color-heading);
}
.timeline__text { margin-top: var(--space-2); max-width: 24em; }

@media (min-width: 56.25em) {
  .timeline__layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-8); align-items: start; }
  .timeline__title { margin-bottom: 0; }
}
@media (min-width: 68.75em) {
  .timeline { --tl-gap: var(--space-5); }
  .timeline__layout { display: block; }
  .timeline__title { margin-bottom: var(--space-8); }
  .timeline__list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .timeline__item { padding-inline-start: 0; padding-top: calc(var(--tl-dot) + var(--space-5)); }
  .timeline__point { bottom: auto; right: calc(-1 * var(--tl-gap)); width: auto; height: var(--tl-dot); }
  .timeline__item:last-child .timeline__point { right: 0; }
  .timeline__point::before, .timeline__item:last-child .timeline__point::before {
    content: ""; top: calc((var(--tl-dot) - var(--rule-motif)) / 2); bottom: auto; left: 0; right: 0; width: auto; height: var(--rule-motif);
  }
  .timeline__point::after { top: 0; }
  .timeline__text { margin-top: var(--space-3); padding-inline-end: var(--space-3); }
}

/* Forced colours repaint backgrounds, which would erase the line and points: draw them in the text colour */
@media (forced-colors: active) {
  .timeline__point::before, .timeline__point::after { forced-color-adjust: none; background: CanvasText; }
}
