/*
 * Impact page (templates/impact.php).
 *
 * Everything the page can build out of the theme's utility classes does so; this
 * file only carries the three components the design system does not already have.
 * Loaded from functions.php, on that template only.
 */

/* Stat tile ---------------------------------------------------------------- */

.impact-stat {
  align-items: center;
  border-radius: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.25rem;
}

@media (min-width: 48em) {

  .impact-stat {
    padding: 2.5rem 1.5rem;
  }

}

.impact-stat__icon {
  display: block;
  height: 1.5rem;
  margin-bottom: 1.25rem;
}

.impact-stat__icon svg {
  display: block;
  height: 100%;
  width: auto;
}

.impact-stat__value {
  line-height: 1;
}

/* Hero --------------------------------------------------------------------- */

/*
 * The shared hero scrim is a flat 75% wash, which on this page's photograph
 * leaves the jets as an indistinct dark smear. From lg up a gentle left-to-right
 * gradient lets them show through instead — but only gently, because the pillar
 * row spans the full width and its right-hand column sits over the lit fuselage.
 *
 * Below lg the flat wash stays, a little heavier than the shared one, since the
 * copy there runs the full width over the brightest part of the photograph.
 */

.hero--impact .hero__image::after {
  opacity: 0.82;
}

@media (min-width: 64em) {

  .hero--impact .hero__image::after {
    background-color: transparent;
    background-image: linear-gradient(to right, rgba(25, 35, 70, 0.95) 0%, rgba(25, 35, 70, 0.88) 50%, rgba(25, 35, 70, 0.62) 100%);
    opacity: 1;
  }

}

/* Gallery caption ---------------------------------------------------------- */

/*
 * The gallery shows the same photographs as the mission rows further down, so
 * each slide names the mission it belongs to — otherwise it reads as a second,
 * unexplained set of pictures.
 */

/*
 * Mission photographs come straight off phones, so the set mixes landscape and
 * portrait. The shared .gallery box is a 16:9 cover crop, which takes a portrait
 * shot and leaves nothing but sky — so fit the whole frame instead, on the brand
 * navy, and cap the height so a tall photo cannot run away with the page.
 */

.impact-gallery {
  background-color: #192346;
  border-radius: 0.5rem;
  height: 80vw;
  margin: 0;
  max-height: 34rem;
  padding-top: 0;
}

.impact-gallery {
  overflow: hidden;
}

.impact-gallery .gallery__image {
  -o-object-fit: contain;
  object-fit: contain;
  position: relative;
}

/*
 * A portrait shot fitted into a landscape box covers about a third of it, which
 * leaves it stranded in a field of navy. Filling the rest with a blurred, dimmed
 * copy of the same photograph reads as intentional and keeps the eye on the
 * subject. A small thumbnail is enough — it is blurred past recognition anyway.
 */

.impact-gallery__backdrop {
  background-position: center;
  background-size: cover;
  bottom: 0;
  display: block;
  filter: blur(1.5rem) brightness(0.55);
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transform: scale(1.15);
}

.impact-gallery__caption {
  background-image: linear-gradient(to top, rgba(25, 35, 70, 0.85) 0%, rgba(25, 35, 70, 0) 100%);
  border-radius: 0 0 0.5rem 0.5rem;
  bottom: 0;
  left: 0;
  padding: 4rem 1.25rem 1.25rem;
  position: absolute;
  right: 0;
}

@media (min-width: 48em) {

  .impact-gallery__caption {
    padding: 5rem 2rem 1.75rem;
  }

}

.impact-gallery__caption time {
  display: block;
  margin-top: 0.25rem;
}

/* Mission row -------------------------------------------------------------- */

/*
 * One mission per row. Stacked on small screens; from md up the photograph
 * takes the left two fifths and the story sits beside it, which keeps the row
 * from becoming a very tall image with a caption under it.
 */

.impact-mission {
  border-radius: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.impact-mission__thumbnail {
  display: block;
  padding-top: 62%;
  position: relative;
}

.impact-mission__thumbnail img {
  display: block;
  height: 100%;
  left: 0;
  -o-object-fit: cover;
  object-fit: cover;
  position: absolute;
  top: 0;
  width: 100%;
}

/*
 * Stand-in when a mission has no photograph of its own. The logo is small, so
 * it is centred at its natural size on a tint rather than stretched to fill the
 * slot — the slot itself keeps a photograph's dimensions, which is the point.
 */

.impact-mission__thumbnail--placeholder {
  background-color: #f0f7fe;
}

.impact-mission__thumbnail--placeholder img {
  height: auto;
  left: 50%;
  max-width: 9.875rem;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
}

.impact-mission__content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
  padding: 1.5rem 1.25rem;
}

@media (min-width: 48em) {

  .impact-mission {
    flex-direction: row;
    min-height: 20rem;
  }

  .impact-mission__thumbnail {
    flex: 0 0 40%;
    padding-top: 0;
  }

  .impact-mission__content {
    padding: 2.5rem;
  }

}

@media (min-width: 64em) {

  .impact-mission__content {
    padding: 3rem 3.5rem;
  }

}

/* The h3 inside carries dst--lg, whose margin is suppressed on a last child, so
   the gap between the name and the story belongs to the wrapper now. */

.impact-mission__meta:not(:last-child) {
  margin-bottom: 1.5rem;
}

/*
 * Some families ask us not to publish a photograph. Without one the row would
 * otherwise run a single paragraph the full width of the card, so it reflows
 * into two columns — date and name where the photo would have been, story
 * beside it — keeping both the reading measure and the rhythm of the rows above.
 */

@media (min-width: 48em) {

  .impact-mission--text {
    min-height: 0;
  }

  .impact-mission--text .impact-mission__content {
    -ms-grid-columns: 2fr 3.5rem 3fr;
    column-gap: 3.5rem;
    display: grid;
    grid-template-columns: 2fr 3fr;
  }

  .impact-mission--text .impact-mission__meta {
    margin-bottom: 0;
  }

}

.impact-mission__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  margin-top: 1.75rem;
}

.impact-mission__stat-value {
  display: block;
  line-height: 1.2;
}

.impact-mission__stat-label {
  display: block;
  margin-top: 0.125rem;
}

/* Mission photo lightbox ---------------------------------------------------- */

.impact-mission__thumbnail--open {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  /* Not the padding shorthand: padding-top is the thumbnail's aspect ratio on
     small screens, and resetting it collapses the button to nothing. */
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
}

.impact-mission__count {
  background-color: rgba(25, 35, 70, 0.75);
  border-radius: 1rem;
  bottom: 1rem;
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  left: 1rem;
  line-height: 1.75rem;
  padding: 0 0.875rem;
  position: absolute;
  transition: background-color 200ms ease;
}

.impact-mission__thumbnail--open:hover .impact-mission__count,
.impact-mission__thumbnail--open:focus-visible .impact-mission__count {
  background-color: #2480fd;
}

/* Follows the theme's modal convention: hidden by default, .is-active shows it. */

.impact-lightbox {
  background-color: rgba(12, 16, 32, 0.97);
  bottom: 0;
  display: none;
  flex-direction: column;
  left: 0;
  padding: 4rem 1rem 1.5rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 300;
}

.impact-lightbox.is-active {
  display: flex;
}

body.is-locked {
  overflow: hidden;
}

.impact-lightbox__close {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 2.5rem;
  line-height: 1;
  padding: 0.5rem 1rem;
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.impact-lightbox__stage {
  align-items: center;
  display: flex;
  flex-grow: 1;
  justify-content: center;
  min-height: 0;
  position: relative;
}

.impact-lightbox__image {
  display: block;
  max-height: 100%;
  max-width: 100%;
  -o-object-fit: contain;
  object-fit: contain;
}

.impact-lightbox__nav {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 3rem;
  justify-content: center;
  position: absolute;
  top: 50%;
  transition: background-color 200ms ease;
  width: 3rem;
  z-index: 1;
}

.impact-lightbox__nav:hover {
  background-color: #2480fd;
}

/* Overlaid rather than sitting beside the photo, which on a phone pushed them
   off the edge of the stage entirely. */

.impact-lightbox__nav--prev {
  left: 0;
  transform: translateY(-50%) scaleX(-1);
}

.impact-lightbox__nav--next {
  right: 0;
  transform: translateY(-50%);
}

.impact-lightbox__bar {
  padding: 1.25rem 0 0;
  text-align: center;
}

.impact-lightbox__count {
  display: block;
  margin-top: 0.25rem;
}

.impact-lightbox__thumbs {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.impact-lightbox__thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.1);
  background-position: center;
  background-size: cover;
  border: 0.125rem solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
  height: 3.25rem;
  opacity: 0.6;
  padding: 0;
  transition: opacity 200ms ease;
  width: 4.75rem;
}

.impact-lightbox__thumb:hover {
  opacity: 1;
}

.impact-lightbox__thumb.is-active {
  border-color: #fff;
  opacity: 1;
}

@media (min-width: 48em) {

  .impact-lightbox {
    padding: 4rem 3rem 2rem;
  }

  .impact-lightbox__thumb {
    height: 4.25rem;
    width: 6.25rem;
  }

}

/* Hero statement and pillars ------------------------------------------------ */

/*
 * The funding statement is the page's main claim, so this hero is set heavier
 * than the shared one — 300 weight reads as a caption, not a position.
 */

.hero--impact .txt--hero-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (min-width: 76.25em) {

  .hero--impact .txt--hero-title {
    font-size: 3.5rem;
  }

}

.pillars {
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 1.5rem;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 2rem 0 0;
}

@media (min-width: 48em) {

  .pillars {
    gap: 2.5rem;
    grid-template-columns: repeat(3, 1fr);
  }

}

.pillars__item {
  display: flex;
}

.pillars__icon {
  display: block;
  flex-shrink: 0;
  height: 1.25rem;
  margin-right: 0.75rem;
  margin-top: 0.125rem;
  width: 1.25rem;
}

.pillars__icon svg {
  display: block;
  height: 100%;
  width: 100%;
}

.pillars__title {
  display: block;
}

.pillars__paragraph {
  margin-top: 0.375rem;
}

.pillars__paragraph p {
  margin: 0;
}

/* Quote band --------------------------------------------------------------- */

.impact-quote {
  background-color: #192346;
  position: relative;
}

.impact-quote__image {
  bottom: 0;
  display: block;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.impact-quote__image::after {
  background-color: #1d1f38;
  bottom: 0;
  content: '';
  left: 0;
  opacity: 0.3;
  position: absolute;
  right: 0;
  top: 0;
}

.impact-quote__image img {
  display: block;
  height: 100%;
  left: 0;
  -o-object-fit: cover;
  object-fit: cover;
  position: absolute;
  top: 0;
  width: 100%;
}

.impact-quote__image + * {
  position: relative;
}

.impact-quote__text {
  margin: 0 auto;
  max-width: 44rem;
}

.impact-quote__text p {
  margin: 0;
}

/* Partner band ------------------------------------------------------------- */

.impact-partner__logo {
  display: block;
}

.impact-partner__logo img {
  margin-left: auto;
  margin-right: auto;
  max-width: 13rem;
}

.impact-partner__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
