/* Preserve the native crop: square partners and 4:5 staff portraits. */
@media screen and (max-width: 1024px) {
  .team-directory-page #people .mobile-leader-pair img,
  .team-directory-page #people #team-field .field-team > article > img,
  .team-directory-page #people #team-field .field-team > article > .team-portrait-frame,
  .team-directory-page #people #team-field .field-team > article > .team-portrait-frame > img {
    display: block;
    flex: none;
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
  }
}


.mobile-roster-open { display: none; }
@media screen and (max-width: 1024px) {
  .team-directory-page #people #team-field > .field-team[data-mobile-profiles] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem clamp(.35rem, 1.6vw, 1rem);
    align-items: stretch;
    margin-top: 1rem;
  }

  .team-directory-page #people #team-field .field-team[data-mobile-profiles] > article {
    display: flex;
    position: relative;
    flex-direction: column;
    align-self: stretch;
    min-width: 0;
    padding: 0;
    gap: 0;
  }

  .team-directory-page #people #team-field .field-team[data-mobile-profiles] > article > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: .45rem clamp(.18rem, 1vw, .65rem) .55rem;
  }

  .team-directory-page #people #team-field .field-team[data-mobile-profiles] h3 {
    order: -1;
    margin: 0 0 .25rem;
    color: #171c20;
    font: 700 clamp(.875rem, 3.75vw, 1.125rem)/1.2 Inter, Arial, sans-serif;
    overflow-wrap: anywhere;
  }

  .team-directory-page #people #team-field .field-team[data-mobile-profiles] .team-role {
    margin: 0;
    color: #9c1423;
    font: 600 clamp(.8125rem, 2.5vw, .9375rem)/1.3 Inter, Arial, sans-serif;
    letter-spacing: 0;
    hyphens: auto;
    overflow-wrap: anywhere;
  }

  .team-directory-page #people #team-field .field-team[data-mobile-profiles] > article > div > :not(h3, .team-role) {
    display: none;
  }

  .field-team[data-mobile-profiles] .mobile-roster-open {
    display: block;
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
  }

  .team-directory-page #people #team-field article:has(.mobile-roster-open:focus-visible) h3 {
    text-decoration: underline;
  }
  .field-team .mobile-roster-open:focus-visible { outline-offset: -3px !important; }
  @media (hover: hover) {
    .team-directory-page #people #team-field .field-team[data-mobile-profiles] article:hover {
      border-color: var(--sla-red-ink);
      background: #f5f6f7;
    }
  }
}

.team-directory-page .roster-profile-dialog {
  width: min(calc(100% - 1.5rem), 32rem);
  max-width: none;
  height: auto;
  max-height: 88dvh;
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 1.1rem 1.25rem;
  border: none;
  border-top: 3px solid #ed1c24;
  background: #fff;
  color: #192127;
}
.roster-profile-dialog::backdrop { background: rgb(13 18 22 / 75%); }
.team-directory-page:has(.roster-profile-dialog[open]) { overflow: hidden; }
.roster-profile-dialog .roster-profile-tools {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: .25rem 0;
  background: #fff;
}
.roster-profile-tools button {
  min-height: 44px;
  padding: .4rem .65rem;
  border: 1px solid #b9c0c4;
  background: #fff;
  color: #192127;
  font: 650 1rem/1.2 Inter, Arial, sans-serif;
  cursor: pointer;
}
.roster-profile-dialog .roster-profile-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: .35rem 0 .9rem;
}
.roster-profile-dialog .roster-profile-identity img { width: min(28%, 6.5rem); height: auto; flex: none; }
.roster-profile-dialog h2 { margin: 0; font-size: clamp(1.3rem, 6vw, 1.8rem); line-height: 1.15; text-transform: none; }
.roster-profile-dialog .team-role { margin: .3rem 0 0; color: #9c1423; font-weight: 650; }
.roster-profile-dialog p { margin: .7rem 0; font-size: 1rem; line-height: 1.5; }
.roster-profile-dialog a { display: inline-flex; align-items: center; min-height: 44px; color: #9c1423; }
