/* Management team page. Scoped to .team-page to preserve the shared site system. */

.team-page {
  background: var(--paper);
}

.team-main {
  padding-top: 0;
}

.team-hero .detail-hero-video {
  object-position: center 52%;
}

.team-section {
  padding: clamp(32px, 2.2vw, 36px) var(--site-inline-gutter) clamp(14px, 1.1vw, 18px);
}

.team-section--leadership {
  padding-top: clamp(48px, 4vw, 64px);
}

.team-section--professional {
  padding-top: clamp(40px, 3.2vw, 52px);
}

.team-section-heading {
  margin: 0 auto clamp(28px, 2.2vw, 36px);
  text-align: center;
}

.team-section-heading p {
  margin: 0 0 12px;
  color: var(--heading-accent);
  font-size: clamp(21px, 1.8vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.team-section-heading h2 {
  margin: 0;
  color: var(--heading-ink);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.team-grid {
  --team-grid-gap: clamp(18px, 1.7vw, 28px);
  display: grid;
  align-items: stretch;
  justify-content: center;
  margin-inline: auto;
  gap: var(--team-grid-gap);
}

.team-grid--leadership {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1540px;
}

.team-section-title-row {
  position: relative;
  width: fit-content;
  margin-inline: auto;
}

.team-section-title-row > h2 {
  font-size: var(--bilingual-title-size);
  font-weight: var(--bilingual-heading-weight);
  line-height: var(--bilingual-title-line-height);
  letter-spacing: normal;
}

.team-section-heading .team-ordering-note {
  position: absolute;
  bottom: clamp(2px, 0.25vw, 4px);
  left: calc(100% + clamp(14px, 1.2vw, 20px));
  margin: 0;
  color: #667789;
  font-size: clamp(12px, 0.8vw, 14px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}

.team-card {
  display: flex;
  min-width: 0;
}

.team-card--static {
  pointer-events: none;
}

.team-card-content {
  display: flex;
  width: 100%;
  color: inherit;
}

.team-portrait {
  --team-object-position: center top;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(8, 74, 145, 0.2);
  border-radius: 0;
  box-shadow: 0 16px 38px rgba(8, 42, 78, 0.08);
  transform: translateY(0);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.team-portrait-media {
  height: clamp(280px, 18vw, 320px);
  overflow: hidden;
  background: var(--team-card-background);
}

.team-portrait-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--team-object-fit);
  object-position: var(--team-object-position);
  transform: translateY(var(--team-image-shift-y)) scale(var(--team-image-scale));
  transition: transform 0.35s ease;
}

.team-card-caption {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: clamp(96px, 7vw, 112px);
  padding: clamp(17px, 1.35vw, 22px);
  color: var(--heading-ink);
  background: #F6F7F9;
  text-align: center;
}

.team-card-caption h3 {
  margin: 0;
  color: inherit;
  font-size: clamp(15px, 1.15vw, 19px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.team-card-caption p {
  margin: 10px 0 0;
  color: inherit;
  font-size: clamp(12px, 0.85vw, 14px);
  font-weight: 400;
  line-height: 1.35;
}

.team-card:hover .team-portrait,
.team-card:focus-within .team-portrait {
  border-color: rgba(8, 74, 145, 0.42);
  box-shadow: 0 22px 48px rgba(8, 42, 78, 0.14);
  transform: translateY(-4px);
}

.team-card:hover .team-portrait-media img,
.team-card:focus-within .team-portrait-media img {
  transform: translateY(var(--team-image-shift-y)) scale(var(--team-image-hover-scale));
}

@media (min-width: 820px) {
  .team-grid--executive .team-card:nth-child(1),
  .team-grid--professional .team-card:nth-child(1),
  .team-grid--professional .team-card:nth-child(5) {
    grid-column: 1;
  }

  .team-grid--executive .team-card:nth-child(2),
  .team-grid--professional .team-card:nth-child(2),
  .team-grid--professional .team-card:nth-child(6) {
    grid-column: 2;
  }

  .team-grid--executive .team-card:nth-child(3),
  .team-grid--professional .team-card:nth-child(3),
  .team-grid--professional .team-card:nth-child(7) {
    grid-column: 3;
  }

  .team-grid--professional .team-card:nth-child(4) {
    grid-column: 4;
  }

  .team-grid--executive .team-card,
  .team-grid--professional .team-card:nth-child(-n + 4) {
    grid-row: 1;
  }

  .team-grid--professional .team-card:nth-child(n + 5) {
    grid-row: 2;
  }

  .team-grid--executive .team-card,
  .team-grid--professional .team-card:nth-child(n + 5) {
    transform: translateX(calc((100% + var(--team-grid-gap)) / 2));
  }
}

@media (min-width: 1024px) {
  .team-grid--leadership {
    /* Preserve the original five-column card width while arranging four slots. */
    grid-template-columns: repeat(4, minmax(0, calc(20% - clamp(14.4px, 1.36vw, 22.4px))));
  }
}

@media (max-width: 819px) {
  .team-portrait {
    height: auto;
    aspect-ratio: auto;
  }

  .team-portrait-media {
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .team-portrait-media img {
    transform: translateY(var(--team-mobile-image-shift-y)) scale(var(--team-mobile-image-scale));
  }

  .team-card:hover .team-portrait-media img,
  .team-card:focus-within .team-portrait-media img {
    transform: translateY(var(--team-mobile-image-shift-y)) scale(var(--team-mobile-image-hover-scale));
  }

  .team-grid--leadership {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 720px;
  }
}

@media (max-width: 819px) {
  .team-section-heading .team-ordering-note {
    position: static;
    margin-top: 8px;
    text-align: center;
  }
}

@media (max-width: 599px) {
  .team-hero {
    min-height: 400px;
  }

  .team-section {
    padding: 56px 20px 72px;
  }

  .team-section--leadership {
    padding-bottom: 28px;
  }

  .team-section--professional {
    padding-top: 36px;
  }

  .team-section-heading {
    margin-bottom: 30px;
  }

  .team-section-heading p {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .team-section-heading h2 {
    font-size: clamp(28px, 9vw, 34px);
  }

  .team-grid--leadership {
    grid-template-columns: minmax(0, 1fr);
    max-width: 380px;
    gap: 22px;
  }

  .team-card-caption h3 {
    font-size: 18px;
  }

  .team-card-caption p {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-portrait,
  .team-portrait-media img {
    transition: none;
  }

  .team-card:hover .team-portrait,
  .team-card:focus-within .team-portrait {
    transform: none;
  }

  .team-card:hover .team-portrait-media img,
  .team-card:focus-within .team-portrait-media img {
    transform: translateY(var(--team-image-shift-y)) scale(var(--team-image-scale));
  }
}

@media (max-width: 819px) and (prefers-reduced-motion: reduce) {
  .team-card:hover .team-portrait-media img,
  .team-card:focus-within .team-portrait-media img {
    transform: translateY(var(--team-mobile-image-shift-y)) scale(var(--team-mobile-image-scale));
  }
}
