.mm-team__header {
  margin-bottom: 2rem;
}

.mm-team__carousel {
  position: relative;
}

.mm-team__viewport {
  min-width: 0;
}

.mm-team__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.mm-team-member {
  text-align: center;
}

.mm-team-member__photo-wrap {
  aspect-ratio: 1;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--mm-border, #dce4ef);
  box-shadow: var(--mm-shadow-sm, 0 2px 8px rgba(11, 29, 57, 0.06));
  background: var(--mm-blue-50, #f3f7ff);
}

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

.mm-team-member__photo--fallback {
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--mm-blue-600, #1c65d8);
  background: linear-gradient(180deg, var(--mm-blue-50, #f3f7ff), var(--mm-white, #fff));
}

.mm-team-member__name {
  margin: .85rem 0 .2rem;
  font-size: 1.05rem;
  color: var(--mm-navy-900, #0b1d39);
}

.mm-team-member__role {
  margin: 0;
  font-size: .8125rem;
  color: var(--mm-text-muted, #64748b);
}

.mm-team-member__posts {
  margin: .55rem 0 0;
}

.mm-team-member__posts-link {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--mm-blue-600, #1c65d8);
  text-decoration: none;
}

.mm-team-member__posts-link:hover,
.mm-team-member__posts-link:focus-visible {
  color: var(--mm-blue-700, #1557c0);
  text-decoration: underline;
}

.mm-team-member__social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  margin: .65rem 0 0;
  padding: 0;
  list-style: none;
}

.mm-team-member__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: .45rem;
  border: 1px solid var(--mm-border, #dce4ef);
  background: var(--mm-white, #fff);
  transition: border-color 180ms ease, transform 180ms ease;
}

.mm-team-member__social-link:hover,
.mm-team-member__social-link:focus-visible {
  border-color: var(--mm-blue-300, #a8caff);
  transform: translateY(-1px);
}

.mm-team-member__social-icon {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.mm-team-member-posts__header {
  margin-bottom: 2rem;
}

.mm-team-member-posts__breadcrumb {
  margin-bottom: 1.25rem;
  font-size: .875rem;
}

.mm-team-member-posts__intro {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.mm-team-member-posts__avatar {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: 1rem;
  object-fit: cover;
  border: 1px solid var(--mm-border, #dce4ef);
}

.mm-team-member__social--archive {
  justify-content: flex-start;
  margin-top: 1rem;
}

.mm-team-member-posts__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  margin: 0 .15rem;
}

.mm-team__nav {
  display: none;
}

/* Desktop: 5 visible with manual prev/next paging */
@media (min-width: 992px) {
  .mm-team__carousel.is-carousel-active {
    display: flex;
    align-items: center;
    gap: .75rem;
  }

  .mm-team__carousel.is-carousel-active .mm-team__viewport {
    overflow: hidden;
    flex: 1;
    container-type: unset;
  }

  .mm-team__carousel.is-carousel-active .mm-team__grid {
    display: flex;
    gap: 1rem;
    width: max-content;
    will-change: transform;
  }

  .mm-team__carousel.is-carousel-active .mm-team-member {
    flex: 0 0 var(--mm-team-item-width, 12rem);
    width: var(--mm-team-item-width, 12rem);
    min-width: 0;
    scroll-snap-align: unset;
  }

  .mm-team__carousel.is-carousel-active .mm-team__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--mm-border, #dce4ef);
    background: var(--mm-white, #fff);
    color: var(--mm-navy-900, #0b1d39);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--mm-shadow-sm, 0 2px 8px rgba(11, 29, 57, 0.06));
    transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease;
  }

  .mm-team__carousel.is-carousel-active .mm-team__nav:hover:not(:disabled) {
    background: var(--mm-blue-50, #f3f7ff);
    border-color: var(--mm-blue-300, #a8caff);
  }

  .mm-team__carousel.is-carousel-active .mm-team__nav:disabled {
    opacity: .35;
    cursor: not-allowed;
  }

  .mm-team__carousel.is-carousel-active .mm-team__nav span {
    display: block;
    margin-top: -.1rem;
  }
}

/* Mobile: one staff member per view, swipe left/right */
@media (max-width: 991.98px) {
  .mm-team__carousel,
  .mm-team__carousel.is-carousel-active {
    display: block;
  }

  .mm-team__nav {
    display: none !important;
  }

  .mm-team__viewport {
    container-type: inline-size;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
  }

  .mm-team__viewport::-webkit-scrollbar {
    display: none;
  }

  .mm-team__grid {
    display: flex;
    gap: 0;
    width: max-content;
    transform: none !important;
  }

  .mm-team-member {
    flex: 0 0 100cqi;
    width: 100cqi;
    min-width: 100cqi;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 0 .25rem;
    box-sizing: border-box;
  }
}
