/* =========================
   xTEAM
   ========================= */
   
.team-card {
  border-radius: var(--radius-small);
  overflow: hidden;
  position: relative; cursor: pointer;
}

.team-card__media {
  position: relative;
  aspect-ratio: 1/1.3; 
  overflow: hidden;
  
}

.team-card__img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transform: scale(1); transition: transform .4s ease;
}

.team-card__blur {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.0) 50%, rgba(0, 0, 0, 0.5) 100%);
  opacity: 1; transition: opacity .3s ease;
}

.team-card__overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(246, 243, 183, 0.00) 0%, rgba(126, 136, 247, 0.20) 48.56%, var(--red-primary) 100%);
  opacity: 0; transition: opacity .3s ease;
}

.team-card:hover .team-card__img { transform: scale(1.05); } 

.team-card:hover .team-card__overlay { opacity: 1; }
.team-card:hover .team-card__blur { opacity: 0; }

.team-card__open {
  position: absolute;
  right: 20px; bottom: 20px; width: 32px; height: 32px;
  border-radius: 50%; border: none; background: var(--warm-grey-5);
  color: var(--black); font-size: 28px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.35); z-index: 2; cursor: pointer;
  transition: background .3s ease;
}

.team-card__open::before, .team-card__open::after{
  content:""; position:absolute; left:50%; top:50%;
  width: 12px; height: 1px; background:var(--black); transform-origin:center;
}
.team-card__open::before{ transform: translate(-50%,-50%); }
.team-card__open::after{ transform: translate(-50%,-50%) rotate(90deg); }

.team-card__open:hover { background:var(--warm-grey-4)}

.team-card__meta {
  position: absolute; left: 20px; bottom: 20px; right: 50px;
  color: var(--white); text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.team-card__name {
  font-family: var(--DM-Sans); margin: 0px;
  font-weight: 700; font-size: 24px; line-height: 1.15;
}
.team-card__role {
  font-family: var(--DM-Sans); font-weight: 400; font-size: 16px; line-height: 1.30;
}

/* Modal */
.team-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; grid-template-rows: 1fr;
  background: transparent; pointer-events: none; 
}

.team-modal[aria-hidden="false"] { pointer-events: auto; }

.team-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); opacity: 0;
  transition: opacity .25s ease;
}

.team-modal__panel {
  position: relative; padding: 0px 10%; margin: auto;
  height: 100%; width: min(1440px, 94vw); max-height: 90%;
  background: var(--warm-grey-2); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,.45);
  overflow: hidden; transform: translateY(110%); transition: transform .45s cubic-bezier(.22,.61,.36,1);
  display: grid; grid-template-columns: 0.6fr 0.4fr; align-items: center; gap: clamp(24px, 4vw, 64px);
}

.team-modal[aria-hidden="false"] .team-modal__backdrop { opacity: 1; }

.team-modal[aria-hidden="false"] .team-modal__panel { transform: translateY(0); }

.team-modal__close {
  position: absolute; top: 40px; left: 10.7%; 
  width: 32px; height: 32px;
  border-radius: 50%; border: none; background: var(--warm-grey-5); color: var(--black);
  display: grid; place-items: center; cursor: pointer; z-index: 2;
}

.team-modal__close::before, .team-modal__close::after{
  content:""; position:absolute; left:50%; top:50%;
  width: 12px; height: 1px; background:var(--black); transform-origin:center;
}

.team-modal__close::before{ transform: translate(-50%,-50%) rotate(135deg); }

.team-modal__close::after{ transform: translate(-50%,-50%) rotate(45deg); }

.team-modal__close:hover { background:var(--warm-grey-4)}


.team-modal__content {display: contents; }

.team-details {display: contents;}

.team-details__media {
  border-radius: var(--radius-small);  
  overflow: hidden; display: grid; place-items: center;
}

.team-details__media img { width:100%; height:100%; object-fit:cover; display:block; aspect-ratio: 1 / 1.25;}

.team-details__body {padding-top: clamp(20px, 4vw, 48px); padding-bottom: clamp(20px, 4vw, 48px); max-width: 560px; }

.team-details__name {
  color: var(--white); font-family: var(--Outfit); font-size: 32px; font-style: normal; font-weight: 900;
  line-height: 1.15; margin-bottom: 8px;
}

.team-details__role {
  color: var(--red-primary); font-family: var(--DM-Mono); font-weight: 400; line-height: 1.15; 
  margin-bottom: 24px; text-transform: uppercase; font-size: 14px; margin-bottom: 40px;
}

.team-details__bio p {
  color: var(--warm-grey-4); font-family: var(--DM-Sans); 
  font-size: 18px; font-weight: 400; line-height: 1.15; 
}


/* Responsive */
@media (max-width: 900px) { 
  .team-modal__panel{
    grid-template-columns: 1fr;
    align-items: start;
    max-height: 95vh;
    overflow-y: auto;                
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;    
    padding: 10px 5%;         
    gap: 24px;
  }

  .team-details__media{ order: 0; }
  .team-details__body{  order: 1; }

  .team-details__media{
    justify-self: center;
    width: 100%; max-width: 350px;
    overflow: visible;
  }

  .team-details__media img{ width: 100%; height: auto; display: block; border-radius: var(--radius-small);}

  .team-details__body{padding-top: 8px; padding-bottom: 32px; max-width: 100%; width: 100%;}
  .team-details__role, .team-details__name{width: 350px; justify-self: center;}

  .team-modal__close{position: sticky; top: 20px; left: 0; z-index: 3;}
}

@media (max-width: 640px) { 
  .team-modal__panel{max-height: 100vh; border-radius: 0px; padding-top: 0px; position: relative;}
  .team-modal__panel::before{content: "";position: sticky;top: 0;display: block;height: 70px; background: var(--warm-grey-2); z-index: 2;}
  .team-details__media, .team-details__body{position: relative;z-index: 1;}
  .team-details__media{margin-top: -45px; max-width: 100%}
  .team-details__role, .team-details__name{width: 100%; justify-self: center;}
  .team-details__role{margin-bottom: 32px;}
  .team-modal__close{margin-top: -75px;}
} 