/* Founder portraits must fit their own track instead of inheriting its row height.
 * A stretched, auto-sized aspect-ratio item can become wider than its grid track.
 * Load after the current marketing styles; native photographs and copy stay intact.
 */

.team-design .team-design__founder-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.team-design .team-design__person.team-design__person--founder {
  display: grid;
  grid-template-columns: minmax(0, .45fr) minmax(0, .55fr);
  align-items: start;
  gap: 27px;
  min-width: 0;
}

.team-design .team-design__person--founder > .team-design__portrait {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1.12;
  align-self: start;
  justify-self: stretch;
  flex: none;
  margin: 0;
  overflow: hidden;
}

.team-design .team-design__person--founder > .team-design__portrait > img,
.team-design .team-design__hero-person > a > img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.team-design .team-design__person--founder > .team-design__person-body {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  align-self: start;
  overflow-wrap: anywhere;
}

/* The separate hero pair keeps its normal image-then-caption flow. */
.team-design .team-design__hero-person {
  min-width: 0;
  max-width: 100%;
}

.team-design .team-design__hero-person > a {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-width: 0;
}

.team-design .team-design__hero-person > figcaption {
  position: static;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Home and About use different compositions, but their children need the same
 * bounded track sizing. Keep their existing photo heights, badges and typography.
 */
.homepage .founder-card,
.about-design .about-core-person {
  min-width: 0;
  align-items: start;
}

.homepage .founder-card {
  grid-template-columns: minmax(0, 1fr);
}

.homepage .founder-card > .founder-photo,
.about-design .about-core-person > .about-core-photo {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: start;
}

.homepage .founder-card > .founder-info,
.about-design .about-core-person > .about-core-person-copy {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.homepage .founder-photo > img,
.about-design .about-core-photo img {
  display: block;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 1150px) {
  /* Retain the two outer cards on tablet, with a portrait above each biography. */
  .team-design .team-design__person.team-design__person--founder {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  .team-design .team-design__person--founder > .team-design__portrait {
    width: min(210px, 100%);
    max-width: 100%;
    align-self: flex-start;
  }
}

@media (max-width: 767px) {
  .team-design .team-design__founder-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-design .team-design__person--founder > .team-design__portrait {
    width: min(220px, 100%);
  }
}
