/* ======================================================
   TEAM SECTION
====================================================== */

.sage-team-section {
  padding: 100px 0;
}

.sage-team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}


/* ======================================================
   TEAM CARDS
====================================================== */

.sage-team-card {
  height: 100%;
}

.sage-team-card__button {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--sage-white);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 35px rgb(0 0 0 / 8%);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.sage-team-card__button:hover,
.sage-team-card__button:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgb(0 0 0 / 13%);
}

.sage-team-card__button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

.sage-team-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--sage-cream);
}

.sage-team-card__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.sage-team-card__button:hover .sage-team-card__photo,
.sage-team-card__button:focus-visible .sage-team-card__photo {
  transform: scale(1.035);
}

.sage-team-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--sage-cream);
}

.sage-team-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 28px 30px;
}

.sage-team-card__name {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.sage-team-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/*
 * The entire card is clickable, so the Read Bio text
 * remains available in the markup but is visually hidden.
 */
.sage-team-card__link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ======================================================
   TEAM MODAL
====================================================== */

.sage-team-modal[hidden] {
  display: none;
}

.sage-team-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.sage-team-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 68%);
  cursor: pointer;
}

.sage-team-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--sage-cream);
  box-shadow: 0 30px 80px rgb(0 0 0 / 30%);
}

.sage-team-modal__close {
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 20px;
  display: flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sage-white);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 18px rgb(0 0 0 / 12%);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.sage-team-modal__close:hover,
.sage-team-modal__close:focus-visible {
  transform: rotate(90deg);
}

.sage-team-modal__close:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.sage-team-modal__layout {
  display: grid;
  grid-template-columns: minmax(300px, 40%) minmax(0, 60%);
  min-height: 600px;
}

.sage-team-modal__image {
  min-height: 100%;
  background: var(--sage-tan);
}

.sage-team-modal__photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 600px;
  object-fit: cover;
  object-position: center top;
}

.sage-team-modal__content {
  padding: 75px 65px 65px;
}

.sage-team-modal__name {
  margin: 12px 0 8px;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.05;
}

.sage-team-modal__title {
  margin: 0 0 24px;
  font-size: 19px;
  line-height: 1.5;
}

.sage-team-modal .sage-divider {
  display: block;
  width: min(260px, 80%);
  height: auto;
  margin: 25px 0 30px;
}

.sage-team-modal__biography {
  font-size: 17px;
  line-height: 1.75;
}

.sage-team-modal__biography > :first-child {
  margin-top: 0;
}

.sage-team-modal__biography > :last-child {
  margin-bottom: 0;
}

body.sage-modal-open {
  overflow: hidden;
}


/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 1024px) {
  .sage-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }

  .sage-team-modal__layout {
    grid-template-columns: minmax(260px, 38%) minmax(0, 62%);
  }

  .sage-team-modal__content {
    padding: 70px 45px 50px;
  }
}

@media (max-width: 767px) {
  .sage-team-section {
    padding: 70px 0;
  }

  .sage-team-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sage-team-modal {
    align-items: flex-start;
    padding: 16px;
  }

  .sage-team-modal__dialog {
    max-height: calc(100vh - 32px);
  }

  .sage-team-modal__layout {
    display: block;
    min-height: 0;
  }

  .sage-team-modal__image {
    height: 390px;
    min-height: 0;
  }

  .sage-team-modal__photo {
    height: 100%;
    min-height: 0;
  }

  .sage-team-modal__content {
    padding: 45px 28px 40px;
  }

  .sage-team-modal__close {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 480px) {
  .sage-team-modal__image {
    height: 330px;
  }

  .sage-team-modal__content {
    padding: 38px 22px 35px;
  }

  .sage-team-card__name {
    font-size: 25px;
  }
}
