.archive-team {
  position: relative;
}

.archive-team > *:not(.team-decorations) {
  position: relative;
  z-index: 2;
}

/* Keep the shared Team/Fellows decorations inside the content area.
   Clip only this layer so card hover effects and focus outlines remain visible. */
.archive-team > .team-decorations {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.team-bg-svg {
  position: absolute !important;
  pointer-events: none;
  z-index: 1;
  width: 45vw;
}

.team-shape-1 {
  top: 0;
  width: auto;
}

.team-shape-2 {
  top: 20%;
  right: 0;
  width: auto;
}

.team-shape-3 {
  bottom: 0;
  left: 0;
  width: auto;
}

.team-section-header {
  display: flex;
  gap: 16px;
}

@media (max-width: 1000px) {
  .team-section-header {
    flex-direction: column;
    gap: 32px;
  }
}

/* CUSTOM SEARCH */
.custom-search input {
  height: 48px;
  min-width: 373px;
  padding: 12px 12px 12px 50px;
  font-weight: 500;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 100px;
  background-image: url("./../../icons/search_icon.svg");
  background-repeat: no-repeat;
  background-position: 16px center;
  background-size: 16px 16px;
}

@media (max-width: 1000px) {
  .custom-search input {
    min-width: 100%;
  }
}

.team-grid-wrapper {
  background-color: var(--color-brand-secondary-background);
  border-top-left-radius: var(--border-radius-xxl);
  border-top-right-radius: var(--border-radius-xxl);
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 50px;
}

@media (min-width: 600px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.team-card {
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  border-radius: var(--border-radius-xl);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background-color 0.3s ease;
  position: relative;
}

.team-card-image-wrapper {
  margin-top: 1rem;
}

.team-card-image {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.team-card-image img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.team-card-content {
  padding: 1rem 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
  align-items: center;
}

.team-card-social {
  display: flex;
  gap: 16px;
}

.team-card-name {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-primary);
}

.team-card-job {
  font-size: 16px;
  font-weight: 500;
}

/* ==========================================================================
   RESEARCH FELLOWS
   ========================================================================== */

.team-fellows-wrapper {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.team-fellows-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-brand-secondary-02);
}

.team-fellows-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .team-fellows-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .team-fellows-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .team-fellows-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* HOVER Effects */
.team-card:hover,
.team-card:focus-within {
  background-color: #b387d81a;
  border: 2px solid #b387d8;
  z-index: 2;
  transform: scale(1.04);
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.1);
}

.team-card:hover .team-card-name a,
.team-card:focus-within .team-card-name a {
  color: var(--color-brand-primary);
}

/* The impact banner no longer shares its space with a carousel. */
.archive-team .team-impact-banner {
  grid-template-columns: 1fr;
  padding: 64px;
}

@media (max-width: 992px) {
  .archive-team .team-impact-banner {
    padding: 40px 24px;
  }
}
