/* UNM-inspired palette
   Cherry: #ba0c2f
   Turquoise: #007a86
   Silver: #a7a8aa
   Lobo Gray: #63666a
*/

.peer-mentors {
  background: #ffffff;
  color: #63666a;
  padding: 2rem 1rem 3rem;
}

.peer-mentors__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.peer-mentors h1,
.peer-mentors h2,
.peer-mentors h3,
.peer-mentors p,
.peer-mentors a {
  font-family: inherit;
}

.peer-mentors h1,
.peer-mentors h2,
.peer-mentors h3 {
  color: #63666a;
  line-height: 1.2;
  margin-top: 0;
}

.peer-mentors h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 3vw, 2.75rem);
}

.peer-mentors__intro {
  max-width: 48rem;
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.peer-mentors__count {
  margin: 0 0 1.5rem;
  font-weight: 600;
}

.peer-mentors__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.mentor-card {
  min-width: 0;
}

.mentor-card__trigger {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid #a7a8aa;
  background: #ffffff;
  color: #63666a;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mentor-card__trigger:hover {
  border-color: #63666a;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.mentor-card__trigger:focus,
.mentor-card__trigger:focus-visible {
  outline: 3px solid #ba0c2f;
  outline-offset: 2px;
}

.mentor-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 1rem;
  background: #e9e9e9;
}

.mentor-card__name {
  display: block;
  margin-bottom: 0.5rem;
  color: #63666a;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.mentor-card__subjects {
  display: block;
  margin-bottom: 0.85rem;
  color: #007a86;
  font-size: 0.98rem;
  line-height: 1.5;
  font-weight: 600;
}

.mentor-card__link {
  display: inline-block;
  margin-top: auto;
  color: #ba0c2f;
  font-weight: 700;
  text-decoration: underline;
}

.mentor-card__trigger:hover .mentor-card__link,
.mentor-card__trigger:focus .mentor-card__link,
.mentor-card__trigger:focus-visible .mentor-card__link {
  color: #ba0c2f;
}

.mentor-modal[hidden] {
  display: none;
}

.mentor-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.mentor-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(55, 55, 55, 0.55);
}

.mentor-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(960px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  overflow: auto;
  border: 1px solid #a7a8aa;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.mentor-modal__close {
  border: 1px solid #ba0c2f;
  background: #ffffff;
  color: #ba0c2f;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.mentor-modal__close:hover,
.mentor-modal__close:focus,
.mentor-modal__close:focus-visible {
  background: #ba0c2f;
  color: #ffffff;
  outline: 3px solid #ba0c2f;
  outline-offset: 2px;
}

.mentor-modal__close--top {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.75rem;
  line-height: 1;
}

.mentor-modal__content {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem;
}

.mentor-modal__media {
  min-width: 0;
}

.mentor-modal__image {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  background: #e9e9e9;
}

.mentor-modal__body {
  min-width: 0;
}

.mentor-modal__title {
  margin-bottom: 0.5rem;
  font-size: clamp(1.85rem, 3vw, 2.4rem);
}

.mentor-modal__subjects {
  margin: 0 0 0.75rem;
  color: #007a86;
  font-weight: 700;
  line-height: 1.5;
}

.mentor-modal__meta {
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.mentor-modal__meta a {
  color: #ba0c2f;
  font-weight: 700;
  text-decoration: underline;
  word-break: break-word;
}

.mentor-modal__about-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #a7a8aa;
}

.mentor-modal__bio {
  margin: 0 0 1.5rem;
  line-height: 1.7;
}

.mentor-modal__close--bottom {
  min-width: 8rem;
  padding: 0.85rem 1.25rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .peer-mentors__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mentor-modal__content {
    grid-template-columns: 1fr;
  }

  .mentor-modal__media {
    max-width: 320px;
  }
}

@media (max-width: 640px) {
  .peer-mentors {
    padding: 1.5rem 1rem 2.5rem;
  }

  .peer-mentors__grid {
    grid-template-columns: 1fr;
  }

  .mentor-card__name {
    font-size: 1.15rem;
  }

  .mentor-modal__dialog {
    width: calc(100% - 1rem);
    max-height: calc(100vh - 1rem);
    margin: 0.5rem auto;
  }

  .mentor-modal__content {
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .mentor-modal__close--top {
    top: 0.75rem;
    right: 0.75rem;
  }
}