/* =========================================================
   YEFA Leadership Pages
   Shared styles for board members, college advisors,
   and current leadership pages
========================================================= */

/* =========================
   Base reset and page safety
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #f4f9fd;
  color: #08264a;
  font-family:
    Inter,
    Arial,
    Helvetica,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* =========================
   Page structure
========================= */

.yefa-team-page {
  width: 100%;
  min-height: 100vh;
}

.yefa-team-container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

/* =========================
   Hero section
========================= */

.yefa-team-hero {
  padding: 68px 0 40px;
  background:
    linear-gradient(
      180deg,
      #eaf5ff 0%,
      #f4f9fd 100%
    );
}

.yefa-team-hero__inner {
  max-width: 760px;
}

.yefa-team-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: #e47716;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.yefa-team-hero h1 {
  margin: 0;
  color: #08264a;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.yefa-team-hero p {
  max-width: 700px;
  margin: 18px 0 0;
  color: #536b84;
  font-size: 1.04rem;
  line-height: 1.7;
}

/* =========================
   Team section
========================= */

.yefa-team-section {
  padding: 44px 0 80px;
}

.yefa-team-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* =========================
   Leadership card
========================= */

.yefa-card {
  min-width: 0;
  height: 100%;
}

.yefa-card__button {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid rgba(20, 74, 118, 0.09);
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(17, 61, 101, 0.08);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.yefa-card__button:hover {
  transform: translateY(-6px);
  border-color: rgba(242, 140, 40, 0.34);
  box-shadow:
    0 18px 38px rgba(17, 61, 101, 0.14);
}

.yefa-card__button:focus-visible {
  outline: 3px solid #f28c28;
  outline-offset: 4px;
}

/* =========================
   Card image
========================= */

.yefa-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.5;
  overflow: hidden;
  background: #dceaf7;
}

.yefa-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.yefa-card__button:hover .yefa-card__img {
  transform: scale(1.035);
}

/* =========================
   Card hover overlay
========================= */

.yefa-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background:
    linear-gradient(
      to top,
      rgba(5, 37, 69, 0.72),
      rgba(5, 37, 69, 0.08) 48%,
      transparent 72%
    );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.yefa-card__overlay span {
  padding: 8px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #d96c0c;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.14);
}

.yefa-card__button:hover .yefa-card__overlay,
.yefa-card__button:focus-visible .yefa-card__overlay {
  opacity: 1;
}

/* =========================
   Image fallback
========================= */

.yefa-card__fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(
      145deg,
      #dcecf8,
      #f4f9fd
    );
}

.yefa-card__initials {
  color: #174d78;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

/* =========================
   Card text
========================= */

.yefa-card__content {
  flex: 1;
  min-height: 120px;
  padding: 19px 16px 21px;
  text-align: center;
}

.yefa-card__name {
  margin: 0;
  color: #08264a;
  font-size: 1.14rem;
  line-height: 1.3;
}

.yefa-card__title {
  margin: 7px 0 0;
  color: #687b91;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.yefa-card__link {
  display: inline-block;
  margin-top: 14px;
  color: #df7314;
  font-size: 0.79rem;
  font-weight: 750;
}

.yefa-card__link::after {
  content: " →";
}

/* =========================
   Status message
========================= */

.yefa-team-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border-radius: 14px;
  background: #ffffff;
  color: #536b84;
  text-align: center;
  box-shadow:
    0 8px 24px rgba(17, 61, 101, 0.08);
}

/* =========================
   Biography modal
========================= */

.yefa-modal[hidden] {
  display: none;
}

.yefa-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.yefa-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.yefa-modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(3, 21, 40, 0.72);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.yefa-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 20px;
  background: #ffffff;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.28);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.2s ease;
}

.yefa-modal.is-open .yefa-modal__dialog {
  transform: translateY(0) scale(1);
}

/* =========================
   Modal close button
========================= */

.yefa-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #08264a;
  font-family: Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 5px 18px rgba(0, 0, 0, 0.18);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.yefa-modal__close:hover {
  background: #fff3e7;
  color: #d66b0c;
  transform: rotate(5deg);
}

.yefa-modal__close:focus-visible {
  outline: 3px solid #f28c28;
  outline-offset: 3px;
}

/* =========================
   Modal content layout
========================= */

.yefa-modal__layout {
  display: grid;
  grid-template-columns:
    minmax(270px, 38%) 1fr;
  min-height: 470px;
}

.yefa-modal__image-wrap {
  min-height: 470px;
  overflow: hidden;
  background: #dceaf7;
}

.yefa-modal__image {
  width: 100%;
  height: 100%;
  min-height: 470px;
  object-fit: cover;
  object-position: center top;
}

.yefa-modal__content {
  padding: 50px 40px 40px;
}

.yefa-modal__eyebrow {
  margin: 0 0 10px;
  color: #e47716;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.yefa-modal__name {
  margin: 0;
  color: #08264a;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
}

.yefa-modal__title {
  margin: 10px 0 0;
  color: #5d7088;
  font-size: 1rem;
  font-weight: 600;
}

.yefa-modal__divider {
  width: 56px;
  height: 4px;
  margin: 24px 0;
  border-radius: 10px;
  background: #f28c28;
}

.yefa-modal__heading {
  margin: 0 0 10px;
  color: #12365b;
  font-size: 1rem;
}

.yefa-modal__bio {
  margin: 0;
  color: #4b6077;
  font-size: 0.94rem;
  line-height: 1.7;
  white-space: pre-line;
}

.yefa-modal-open {
  overflow: hidden;
}

/* =========================
   Responsive: large tablet
========================= */

@media (max-width: 1080px) {
  .yefa-team-container {
    width: min(920px, calc(100% - 40px));
  }

  .yefa-team-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

/* =========================
   Responsive: tablet
========================= */

@media (max-width: 780px) {
  .yefa-team-container {
    width: calc(100% - 32px);
  }

  .yefa-team-hero {
    padding: 52px 0 34px;
  }

  .yefa-team-hero p {
    font-size: 1rem;
  }

  .yefa-team-section {
    padding: 34px 0 60px;
  }

  .yefa-team-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .yefa-modal__layout {
    grid-template-columns: 1fr;
  }

  .yefa-modal__image-wrap,
  .yefa-modal__image {
    min-height: 320px;
    max-height: 380px;
  }

  .yefa-modal__content {
    padding: 34px 26px 30px;
  }
}

/* =========================
   Responsive: mobile
========================= */

@media (max-width: 520px) {
  .yefa-team-container {
    width: calc(100% - 24px);
  }

  .yefa-team-hero {
    padding: 42px 0 28px;
  }

  .yefa-team-hero h1 {
    font-size: 2.25rem;
  }

  .yefa-team-hero p {
    margin-top: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .yefa-team-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .yefa-card {
    width: min(100%, 350px);
    margin-inline: auto;
  }

  .yefa-card__img-wrap {
    aspect-ratio: 4 / 4.3;
  }

  .yefa-card__content {
    min-height: 112px;
    padding: 18px 14px 20px;
  }

  .yefa-modal {
    padding: 10px;
  }

  .yefa-modal__dialog {
    max-height: calc(100vh - 20px);
    border-radius: 15px;
  }

  .yefa-modal__image-wrap,
  .yefa-modal__image {
    min-height: 280px;
    max-height: 330px;
  }

  .yefa-modal__content {
    padding: 30px 20px 26px;
  }

  .yefa-modal__close {
    top: 10px;
    right: 10px;
  }
}

/* =========================
   Responsive: very small phones
========================= */

@media (max-width: 360px) {
  .yefa-team-container {
    width: calc(100% - 20px);
  }

  .yefa-card__content {
    padding-inline: 13px;
  }

  .yefa-modal__content {
    padding-inline: 18px;
  }
}

/* =========================
   Touch devices
========================= */

@media (hover: none) {
  .yefa-card__overlay {
    display: none;
  }

  .yefa-card__button:hover {
    transform: none;
  }

  .yefa-card__button:hover .yefa-card__img {
    transform: none;
  }
}

/* =========================
   Reduced motion
========================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .yefa-card__button,
  .yefa-card__img,
  .yefa-card__overlay,
  .yefa-modal,
  .yefa-modal__dialog,
  .yefa-modal__close {
    transition: none;
  }
}