/* =========================================================
   TEAM DIRECTORY
   ========================================================= */

.team-directory{
  margin-top: 0;
  padding-bottom: 48px;
}

/* Use theme container but control spacing */
.team-directory .wp-block-group{
  margin-top: 0;
}

/* Title */
.team-directory__title{
  margin-bottom: 24px;
}

/* =========================================================
   GRID (DESKTOP)
   ========================================================= */

.team-list{
  display: grid;
  grid-template-columns: repeat(3, 220px);
  gap: 18px 28px;
  justify-content: start;
}

/* Card */
.team-card{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 220px;
  text-align: left;
  min-width: 0;
}

/* Image */
.team-card__avatar{
  width: 220px;
  height: 147px;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f2f2;
}

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

/* Text */
.team-card__meta{
  width: 100%;
  min-width: 0;
  padding-top: 8px;
}

.team-card__name{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.team-card__title{
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.7;
  word-break: break-word;
}

.team-card__contacts{
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.team-card__link{
  font-size: 11px;
  font-weight: 600;
  text-decoration: none !important;
  word-break: break-word;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px){
  .team-list{
    grid-template-columns: repeat(2, 220px);
  }
}

/* =========================================================
   MOBILE (EDGE-TO-EDGE ~2px)
   ========================================================= */

@media (max-width: 640px){

  /* Remove theme padding */
  .team-directory .wp-block-group,
  .is-layout-constrained{
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .team-directory{
    padding-bottom: 36px;
  }

  /* Grid full width */
  .team-list{
    grid-template-columns: 1fr;
    gap: 20px 0;
    padding: 0 2px;
  }

  /* Card full width */
  .team-card{
    width: 100%;
    max-width: 100%;
  }

  /* Responsive image */
  .team-card__avatar{
    width: 100%;
    height: auto;
    aspect-ratio: 220 / 147;
  }

  /* Slightly tighter title spacing */
  .team-directory__title{
    margin-bottom: 18px;
  }
}