.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;
}

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

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) {
    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) {
    margin: 0 1rem;
    font-size: 1.3rem;
  }
}

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

@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;
  }
}
