/* ==========================================================
   Team cards
   ========================================================== */

.team-group {
  --content-width: 1200px;                       /* fallback; JS sets the exact value from the parent container */
  --card-w: min(320px, 75vw);                    /* card width; the next card peeks in on phones */
  --start: max(20px, calc((100% - var(--content-width)) / 2));

  /* full-bleed: break out of the content container to both viewport edges */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 64px;
}

/* the full-bleed section is 100vw, which includes the scrollbar; clip so the page never scrolls sideways */
body {
  overflow-x: clip;
}

/* ---------- group heading ---------- */

.team-group__title {
  margin: 0 0 20px;
  padding-left: var(--start);
  font-size: 1.1rem;
  font-weight: 700;
  color: #0b2a4a;
}

.team-group__title:has(+ .team-group__sub) {
  margin-bottom: 4px;
}

.team-group__sub {
  margin: 0 0 20px;
  padding-left: var(--start);
  color: #0b2a4a;
}

/* ---------- arrows: hidden unless the cards overflow ---------- */

.team-carousel {
  position: relative;
}

.team-carousel .team-nav {
  display: none;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 24px;
  padding-right: var(--start);
}

.team-carousel.is-scrollable .team-nav {
  display: flex;
}

.team-nav button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #00B7A6;
  background: transparent;
  color: #0b2a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.team-nav svg {
  width: 20px;
  height: 20px;
}

/* one caret icon: the next button is the same icon turned around */
.team-next svg {
  transform: rotate(180deg);
}

/* ---------- track ---------- */

.team-carousel .team-track {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: none; /* in case a grid class is added by the theme */
  gap: 40px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px var(--start) 8px var(--start);
  scroll-padding-left: var(--start);
}

.team-carousel .team-track::-webkit-scrollbar {
  display: none;
}

.team-carousel .team-item {
  flex: 0 0 var(--card-w);
  width: auto;
}

/* added by JS only when the cards don't fit */
.team-carousel.is-scrollable .team-track {
  scroll-snap-type: x proximity;
  padding-right: max(20px, calc(100% - var(--card-w) - var(--start)));
}

.team-carousel.is-scrollable .team-item {
  scroll-snap-align: start;
}

/* ---------- card + flip ---------- */

.team-card {
  position: relative;
  aspect-ratio: 320 / 425;
  perspective: 1400px;
  cursor: pointer;
  outline-offset: 4px;
}

.team-card__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}

.team-card.is-flipped .team-card__inner {
  transform: rotateY(180deg);
}

.team-card__face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.team-card__front {
  background: #effcfb; /* shown while the photo loads */
}

.team-card__front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-card__back {
  transform: rotateY(180deg);
  background: #f3f6fa;
  color: #0b2a4a;
  padding: 18px;
  overflow-y: auto;
}

.team-back {
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  color: inherit;
  display: block;
}

.team-back svg {
  width: 18px;
  height: 18px;
  display: block;
}

.team-bio {
  margin-top: 18px;
  font-size: 1rem;
  line-height: 1.55;
}

.team-bio p {
  margin: 0 0 12px;
}

/* ---------- name under the card ---------- */

.team-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: .9rem;
  color: #0b2a4a;
}

.team-label img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.team-label strong {
  font-weight: 700;
}

/* centered labels when the group scrolls, like the live site */
.team-carousel.is-scrollable .team-label {
  justify-content: center;
  font-size: 1.05rem;
}

/* ---------- optional: teal duotone on plain photos ----------
.team-card__front img { filter: grayscale(1) contrast(1.05); }
.team-card__front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #0f6e86;
  mix-blend-mode: color;
  opacity: .85;
  pointer-events: none;
}
*/

@media (prefers-reduced-motion: reduce) {
  .team-card__inner {
    transition-duration: .01s;
  }
}