.team-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}
.team-photo {
  margin: 0;
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.team-photo a { display: block; border-radius: 16px 16px 0 0; }
.team-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 15px 15px 0 0;
}
.team-photo figcaption { padding: 12px 15px; color: var(--navy); font-weight: 700; }
.team-viewer {
  width: fit-content;
  max-width: calc(100% - 28px);
  max-height: calc(100% - 28px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.team-viewer::backdrop { background: rgb(9 36 57 / 80%); }
.team-viewer form { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.team-viewer figure { margin: 0; }
.team-viewer img { width: auto; max-width: min(85vw, 1100px); max-height: 70vh; object-fit: contain; margin: auto; }
.team-viewer figcaption { padding-top: 10px; text-align: center; }
@media (max-width: 900px) { .team-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  .team-gallery { grid-template-columns: 1fr; }
  .team-viewer img { max-width: 100%; }
}
