.team-grid {
  display: grid;
  gap: 2rem;
  row-gap: .5rem;
  margin: 0 auto;
}

/* Desktop Grid */
@media (min-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(var(--sp-story-grid-columns), 1fr);
  }
}

/* Tablet Grid */
@media (min-width: 768px) and (max-width: 1023px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Grid */
@media (max-width: 767px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

.team-card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  overflow: hidden;
}

.team-card__inner {
  display: contents;
  text-align: center;
}

.team-card__image {
  grid-row: 1;
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

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

.play-button-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.play-icon {
  width: 200px;
  height: 200px;
  transition: transform 0.3s ease;
}

.team-card__image:hover .play-icon {
  transform: scale(1.1);
}

h3.team-card__name {
  grid-row: 2;
  margin: 2rem 1rem 0 1rem;
  font-size: 2rem;
  font-weight: 400;
  line-height: normal;
  color: #000;
}

@media (max-width: 767px) {
  h3.team-card__name {
    margin: 1rem 1rem 0 1rem;
    font-size: 1.5rem;
  }
}

p.team-card__title {
  grid-row: 3;
  margin: 0 1rem 1.5rem 1rem;
  font-size: 1.5rem;
  color: #000;
  font-weight: 300;
  line-height: normal;
}

@media (max-width: 767px) {
  p.team-card__title {
    margin: 0 1rem;
    font-size: 1.3rem;
  }
}

.team-card__button {
  grid-row: 4;
  padding: 1rem 1rem 1.5rem 1rem;
}

.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 1000px;
  margin: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 10000;
  line-height: 1;
}

.close:hover {
  color: #ccc;
}

.video-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-container video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 80vh;
}

@media (max-width: 767px) {
  .modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .close {
    top: -35px;
    font-size: 30px;
  }
}

@supports not (grid-template-rows: subgrid) {
  .team-card {
    display: flex;
    flex-direction: column;
  }
  
  .team-card__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .team-card__image {
    flex-shrink: 0;
  }
  
  .team-card__name {
    flex-grow: 0;
  }
  
  .team-card__title {
    flex-grow: 0;
  }
  
  .team-card__button {
    margin-top: auto;
  }
}
