.team-gallery,
.team-gallery *,
.team-gallery *::before,
.team-gallery *::after {
  box-sizing: border-box;
}

.team-gallery {
  position: relative;
  padding-top: 72px;
}

/* Tab row — white pill bar sitting above the blue band */
/* White pill — holds arrows pinned at the ends, scroller in the middle */
.team-gallery__tabs {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto -24px;
  padding: 10px 20px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.team-gallery__tabs-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  /* Firefox */
}

.team-gallery__tabs-scroll::-webkit-scrollbar {
  display: none;
}

.team-gallery__tab {
  border: 2px solid transparent;
  background: none;
  border-radius: 999px;
  padding: 8px 20px;
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #2E2E2E;
  cursor: pointer;
  white-space: nowrap;
}

.team-gallery__tab.is-active {
  border-color: #00AEEF;
  color: #005E81;
  font-weight: 600;
}

/* Scroll arrows — hidden on desktop (all tabs fit), shown on mobile */
.team-gallery__tab-arrow {
  display: none;
  flex: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: #2E2E2E;   /* same as the tab text */
  cursor: pointer;
}

.team-gallery__tab.is-active {
  border-color: #00AEEF;
  color: #005E81;
  font-weight: 600;
}

/* Blue band */
.team-gallery__band {
  background: linear-gradient(#00AEEF 0 58%, #fff 58% 100%);
  padding: 64px 20px 48px;
}

.team-gallery__heading {
  margin: 0 0 4px;
  text-align: center;
  font-family: 'Crimson Text', serif;
  font-size: 44px;
  font-weight: 400;
  color: #fff;
}

.team-gallery__group-label {
  margin: 0 0 36px;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-size: 17px;
  color: #fff;
}

.team-gallery__panels {
  max-width: 1600px;
  margin: 0 auto;
}

/* Cards */
.team-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
}

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

.team-card__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 18px 18px;
  background: linear-gradient(180deg, rgba(0, 40, 60, 0) 0%, rgba(0, 40, 60, 0.75) 45%);
  font-family: 'Roboto', sans-serif;
  color: #fff;
}

.team-card__name {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 400;
}
.team-card__role {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.45;
}
.team-card__email {
  font-size: 16px;
  color: #fff;
  text-decoration: underline;
  word-break: break-all;
}

/* Nav — arrows either side of the counter, below the track */
.team-panel__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}

.team-panel__nav .team-panel__arrow {
  position: static;
  transform: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  opacity: 1;
}

.team-panel__nav .splide__arrow--prev {
  background: #0B3B4C;
  color: #fff;
}

.team-panel__nav .splide__arrow--next {
  background: #00AEEF;
  color: #fff;
}

.team-panel__nav .splide__arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  transform: none;
}

.team-panel__counter {
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #2E2E2E;
}

/* Groups that fit on one page: centre them, no peek */
.team-panel.is-few .splide__list { justify-content: center; }
.team-panel.is-few .splide__track { padding-right: 0 !important; }


.team-gallery__tab-arrow {
  display: none;
  /* desktop: no arrows */
  flex: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #005E81;
  color: #fff;
  cursor: pointer;
}


@media (max-width: 767px) {
.team-gallery__tab-row {
    margin: 0 12px -20px;
    padding: 0;
  }

    .team-gallery__tabs {
      margin: 0 12px -20px;
      border-radius: 16px;
      padding: 8px 10px;
    }

    .team-gallery__tab-arrow {
      display: inline-flex;
      /* show the pinned arrows on mobile */
    }

  .team-gallery__tabs::-webkit-scrollbar {
    display: none;
  }

  .team-gallery__tab-arrow {
    display: inline-flex;   /* show the pinned arrows on mobile */
    /* mobile-only arrow styling here — e.g. bring back the circle */
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #005E81;
    color: #fff;
  }

  /* show arrows on mobile */

  .team-card__name {
    font-size: 28px;
    font-weight: 400;
  }
  .team-card__role {
    font-size: 16px;
    line-height: 1.45;
  }
  .team-card__email {
    font-size: 16px;
  }

    /* Splide is destroyed below 767px — stack the slides */
    .team-panel__splide .splide__list {
      display: flex;
      flex-direction: column;
      gap: 40px;
      padding: 0;
      margin: 0;
      list-style: none;
    }

    .team-panel__splide .splide__slide {
      width: 100%;
    }

     .team-panel__splide .splide__slide + .splide__slide {
    margin-top: 40px;
  }

    .team-panel__nav {
      display: none;
    }

    .team-card__photo img {
      height: 420px;
    }


  .team-gallery__heading {
    font-size: 30px;
  }

  .team-gallery__band {
    padding: 48px 12px 36px;
  }
}
