/* =========================================================
   ABOUT PAGE
   Tokens, type, the page header, facts row, impact band, values list
   and team cards come from css/wfc.css.
   ========================================================= */

/* ---------- Our story ---------- */

.wfc-origin {
  display: grid;
  gap: 40px;
}

.wfc-origin__body {
  display: grid;
  align-content: start;
  gap: 20px;
}

.wfc-origin__body p {
  margin: 0;
  max-width: 64ch;
  font-family: var(--wfc-text);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--wfc-slate);
}

/* The opening paragraph reads as the lead. */
.wfc-origin__body .wfc-h2 + p {
  margin-top: 8px;
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  line-height: 1.55;
  color: var(--wfc-ink);
}

.wfc-origin__body .wfc-facts {
  margin-top: 16px;
}

/* The photo has a leaf shape: two opposite corners are deeply rounded.
   A thin outline of the same shape sits behind it, set slightly off. */
.wfc-origin__photo {
  --leaf: clamp(64px, 16vw, 190px);
  position: relative;
  max-width: 640px;
  margin: 0 0 14px 14px;
  isolation: isolate;
}

.wfc-origin__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 2px solid var(--wfc-forest);
  border-radius: var(--leaf) 24px;
  transform: translate(-14px, 14px);
}

/* Stacked, the photo is shown whole. */
.wfc-origin__photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: var(--leaf) 24px;
}

/* Photo on the left, text on the right, in equal halves. The wide photo is
   cropped to a square here, placed so the woman's face, the child and the
   pot stay in. */
@media (min-width: 992px) {
  .wfc-origin {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
  }

  .wfc-origin__photo {
    order: -1;
    max-width: none;
  }

  .wfc-origin__photo img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 40% 50%;
  }
}

/* ---------- Mission and vision ---------- */

.wfc-purpose {
  display: grid;
}

.wfc-purpose__item {
  display: grid;
  align-content: start;
  gap: 16px;
}

.wfc-purpose__item + .wfc-purpose__item {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--wfc-line);
}

.wfc-purpose__label {
  margin: 0;
  font-family: var(--wfc-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--wfc-forest);
}

.wfc-purpose__text {
  margin: 0;
  max-width: 24ch;
  font-family: var(--wfc-display);
  font-weight: 700;
  font-stretch: 75%;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  line-height: 1.08;
  color: var(--wfc-ink);
  text-wrap: balance;
}

/* Side by side, divided by a hairline. */
@media (min-width: 768px) {
  .wfc-purpose {
    grid-template-columns: 1fr 1fr;
  }

  .wfc-purpose__item {
    padding-right: clamp(32px, 5vw, 72px);
  }

  .wfc-purpose__item + .wfc-purpose__item {
    margin-top: 0;
    padding-top: 0;
    padding-right: 0;
    padding-left: clamp(32px, 5vw, 72px);
    border-top: 0;
    border-left: 1px solid var(--wfc-line);
  }
}

/* ---------- World map: arrows from South Sudan to each continent ---------- */

.wfc-worldmap {
  padding-block: clamp(56px, 7vw, 96px) clamp(72px, 8vw, 120px);
  background: var(--wfc-paper);
}

.wfc-worldmap__frame {
  overflow: hidden;
  padding: clamp(16px, 3vw, 40px);
  border-radius: 28px;
  background: var(--wfc-mist);
}

/* The map image and the arrow layer share one box and one viewBox. */
.wfc-worldmap__canvas {
  position: relative;
}

.wfc-worldmap__land,
.wfc-worldmap__overlay {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}

.wfc-worldmap__overlay {
  position: absolute;
  inset: 0;
  height: 100%;
  overflow: visible;
}

.wfc-worldmap__arc {
  fill: none;
  stroke: var(--wfc-forest);
  stroke-width: 2.5;
  stroke-linecap: round;
  marker-end: url(#wfc-map-arrow);
}

#wfc-map-arrow path,
.wfc-worldmap__tip {
  fill: var(--wfc-forest);
}

/* The travelling arrowheads are only used by the animation. */
.wfc-worldmap__tip {
  display: none;
}

.wfc-worldmap__labels text {
  font-family: var(--wfc-text);
  font-weight: 600;
  font-size: 15px;
  fill: var(--wfc-slate);
}

.wfc-worldmap__labels .wfc-worldmap__home {
  font-family: var(--wfc-display);
  font-weight: 700;
  font-size: 17px;
  fill: var(--wfc-ink);
}

.wfc-worldmap__dot {
  fill: var(--wfc-forest);
  stroke: var(--wfc-paper);
  stroke-width: 2;
}

.wfc-worldmap__pulse {
  fill: none;
  stroke: var(--wfc-forest);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

/* Animated by js/about.js: the arcs draw outward and the arrowheads ride them. */
.wfc-worldmap.is-animated .wfc-worldmap__arc {
  marker-end: none;
}

.wfc-worldmap.is-animated .wfc-worldmap__tip {
  display: block;
  opacity: 0;
}

.wfc-worldmap.is-animated .wfc-worldmap__pulse {
  animation: wfc-map-pulse 2.6s ease-out infinite;
}

@keyframes wfc-map-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(4); opacity: 0; }
}

/* Tablets: the map is drawn smaller, so the labels are set larger to stay readable. */
@media (min-width: 768px) and (max-width: 1099.98px) {
  .wfc-worldmap__labels text {
    font-size: 21px;
  }

  .wfc-worldmap__labels .wfc-worldmap__home {
    font-size: 23px;
  }
}

/* Phones: zoom in on Africa so the map stays readable; arrows run off the
   edges toward the other continents, and the small labels are dropped. */
@media (max-width: 767.98px) {
  .wfc-worldmap__frame {
    border-radius: 20px;
  }

  .wfc-worldmap__canvas {
    width: 170%;
    margin-left: -45%;
  }

  .wfc-worldmap__labels text:not(.wfc-worldmap__home) {
    display: none;
  }

  .wfc-worldmap__labels .wfc-worldmap__home {
    font-size: 26px;
  }

  .wfc-worldmap__arc {
    stroke-width: 3.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wfc-worldmap.is-animated .wfc-worldmap__pulse {
    animation: none;
  }
}
