/* ============================================================
   TEAM — International Typographic Style (Swiss)
   ------------------------------------------------------------
   Same grid, gutter and type scale as the homepage, Ministries
   and Give.

   The team is still a slide, as it was: one person at a time,
   portrait beside their words, the whole roster along the
   bottom. What changed is that it is now built on the page's
   grid, and that the slide waits for the reader.
   ============================================================ */

/* Preflight is off in this project, so border-box is not the default. */
.team-hero,
.team-hero *,
.team-body,
.team-body * {
  box-sizing: border-box;
}

.team-hero,
.team-body {
  --tm-ink: #000;
  --tm-paper: #fff;
  --tm-accent: #ff820d;
  --tm-muted: #5c5c5c;
  --tm-rule: #d8d8d8;
  --tm-rule-strong: #000;

  --tm-gutter: clamp(1.25rem, 5vw, 6rem);
  --tm-max: 1440px;

  font-family: 'Sofia Pro', sans-serif;
}

/* ============================================================
   Hero
   ============================================================ */
.team-hero {
  position: relative;
  width: 100%;
  min-height: min(78svh, 720px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #1b1b1b;
}

.team-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  /* Anchored to the top of the frame: `center` splits the crop between top
     and bottom, which takes the tops of heads off a photograph of people.
     Trimming from the bottom instead keeps faces in. */
  background-position: center top;
  background-repeat: no-repeat;
}

.team-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.5) 45%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

.team-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--tm-max);
  margin: 0 auto;
  padding: 0 var(--tm-gutter) clamp(3rem, 8vh, 6rem);
}

.team-hero__overline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 clamp(1rem, 2vw, 1.75rem);
  color: var(--tm-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.team-hero__overline::before {
  content: "";
  width: clamp(2.5rem, 6vw, 5rem);
  height: 2px;
  background: var(--tm-accent);
  flex: none;
}

.team-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  max-width: 16ch;
}

.team-hero__cta {
  display: inline-flex;
  align-items: center;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  padding: 1rem 2.25rem;

  background: #fff;
  border: 0;
  border-radius: 0;
  color: #000;

  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .15s ease;
}

.team-hero__cta:hover {
  background: var(--tm-accent);
}

.team-hero__cta:focus-visible {
  outline: 2px solid var(--tm-accent);
  outline-offset: 3px;
}

/* ============================================================
   Slider
   ============================================================ */
.team-body {
  width: 100%;
  background: var(--tm-paper);
  color: var(--tm-ink);
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3.5rem, 7vw, 6rem);
  scroll-margin-top: clamp(5rem, 12vh, 7rem);
}

.team-slider {
  max-width: var(--tm-max);
  margin: 0 auto;
  padding-inline: var(--tm-gutter);
}

/* ------------------------------------------------------------
   Stage — portrait on the grid, words beside it
   ------------------------------------------------------------ */
.team-slider__stage {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1rem, 2vw, 2rem);
  row-gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

.team-slider__media {
  grid-column: 1 / span 5;
  min-width: 0;

  /* Every portrait sits in the same cell; only one is visible. The box keeps
     its size whichever is showing, so nothing below it moves on a change. */
  position: relative;
  aspect-ratio: 2 / 3;          /* the portraits are all 900x1350 -- no crop */
  overflow: hidden;
  background: #f4f4f4;
}

.team-slider__portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Top-anchored for the same reason the heroes are: these are photographs
     of people, and a centred crop takes the tops of their heads off. */
  object-position: center top;
  opacity: 0;
  transition: opacity .35s ease;
}

.team-slider__portrait.is-active {
  opacity: 1;
}

.team-slider__text {
  grid-column: 7 / span 6;
  min-width: 0;
  border-top: 2px solid var(--tm-rule-strong);
  padding-top: clamp(0.9rem, 1.6vw, 1.25rem);
}

.team-slider__count {
  margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  color: var(--tm-muted);
}

.team-slider__count-now {
  color: var(--tm-accent);
}

.team-slider__count-sep {
  margin: 0 0.4rem;
}

.team-slider__name {
  margin: 0;
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.team-slider__role {
  margin: clamp(0.6rem, 1.2vw, 0.9rem) 0 0;
  padding-top: clamp(0.6rem, 1.2vw, 0.9rem);
  border-top: 1px solid var(--tm-rule);
  color: var(--tm-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.team-slider__bio {
  margin: clamp(1.25rem, 2.5vw, 1.75rem) 0 0;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  font-weight: 300;
  line-height: 1.6;
  max-width: 56ch;
}

/* ------------------------------------------------------------
   Controls
   ------------------------------------------------------------ */
.team-slider__controls {
  display: flex;
  gap: 0;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

.team-slider__ctrl {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: 1px solid var(--tm-ink);
  border-radius: 0;
  color: var(--tm-ink);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.team-slider__ctrl + .team-slider__ctrl {
  border-left: 0;
}

.team-slider__ctrl:hover {
  background: var(--tm-ink);
  color: #fff;
}

.team-slider__ctrl:focus-visible {
  outline: 2px solid var(--tm-accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Roster strip — every face, always visible

   Horizontal scroll is the point here: it says there are more
   people than fit, which a wrapped grid does not.
   ------------------------------------------------------------ */
.team-slider__roster {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(0.9rem, 1.6vw, 1.25rem);
  border-top: 2px solid var(--tm-rule-strong);
}

.team-slider__roster-label {
  margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--tm-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.team-slider__strip {
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
}

.team-thumb {
  flex: 0 0 clamp(8.5rem, 14vw, 11rem);
  scroll-snap-align: center;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 0.6rem;

  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  /* The active thumbnail is marked by its own rule, not a coloured box. */
  border-top: 2px solid transparent;
  padding-top: 0.6rem;
  transition: border-color .15s ease;
}

.team-thumb__img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(1);
  opacity: 0.55;
  transition: filter .2s ease, opacity .2s ease;
}

.team-thumb__name {
  font-family: 'Sofia Pro', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--tm-ink);
}

.team-thumb__role {
  font-family: 'Sofia Pro', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tm-muted);
}

.team-thumb:hover .team-thumb__img,
.team-thumb:focus-visible .team-thumb__img {
  filter: grayscale(0);
  opacity: 1;
}

.team-thumb.is-active {
  border-top-color: var(--tm-accent);
}

.team-thumb.is-active .team-thumb__img {
  filter: grayscale(0);
  opacity: 1;
}

.team-thumb:focus-visible {
  outline: 2px solid var(--tm-accent);
  outline-offset: 3px;
}

/* ============================================================
   Responsive — the grid collapses, the left edge never moves
   ============================================================ */
@media screen and (max-width: 1024px) {

  .team-slider__media,
  .team-slider__text {
    grid-column: 1 / -1;
  }

  /* The portrait would otherwise be a full-width, screen-and-a-half
     tall wall of face. */
  .team-slider__media {
    aspect-ratio: 4 / 3;
    max-height: 60vh;
  }
}

@media screen and (max-width: 620px) {

  /* Sized to its label, not stretched across the screen: the hero's
     overline, title and lead all begin on the gutter, and a button
     spanning the full measure is the only thing that would not. */
  .team-hero__cta {
    width: auto;
    align-self: flex-start;
  }

  .team-slider__media {
    aspect-ratio: 1 / 1;
  }

  .team-slider__bio {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .team-slider__portrait,
  .team-thumb__img,
  .team-thumb,
  .team-slider__ctrl,
  .team-hero__cta {
    transition: none;
  }
}
