/* Team Flip Grid (4-up) */

.acf-team-flip-grid { padding: clamp(2.5rem, 4vw, 4rem) 0; }
.team-grid-inner { max-width:1200px; margin-inline:auto; padding:1rem; }
.team-grid-title { text-align:center; margin:0 0 2rem; font-style:italic;}

/* Grid */
.team-grid{
  display:grid;
  gap:3rem 1rem;
  grid-template-columns:repeat(5,1fr);
  align-items:stretch;
}
@media (max-width:1024px){
  .team-grid{ grid-template-columns:repeat(3,1fr); }
}
@media (max-width:800px){
  .team-grid{ grid-template-columns:repeat(2,1fr); }
  .team-card__back{ padding:3rem 2rem; }
}
@media (max-width:540px){
  .team-grid{ grid-template-columns:1fr; }
}

/* Card */
.team-card{
  perspective:1200px;
  border-radius:1rem;
  position:relative;
  isolation:isolate;
}
.team-card__flipper{
  position:relative;
  transform-style:preserve-3d;
  transition:transform .7s cubic-bezier(.2,.6,.2,1);
  min-height:360px; /* desktop/tablet baseline */
}

/* Hover flip (desktop) */
@media (hover:hover) and (pointer:fine){
  .team-card:hover .team-card__flipper{ transform:rotateY(180deg); }
}

/* Faces (baseline) */
.team-card__face{
  position:absolute;
  inset:0;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  border-radius:10px;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto auto; /* image + band */
  box-shadow:
    0 6px 10px rgba(0,0,0,.08),
    0 2px 6px rgba(0,0,0,.06);
	 border:1px solid rgba(0,0,0,.05);
}

.team-card__front{ transform:rotateY(0deg); }

.team-card__back{
  transform:rotateY(180deg);
  padding:3rem 1rem;
  display:flex;
  flex-direction:column;
  gap:0rem;
  justify-content:center;
  align-items:center;
  text-align:center;
  border:1px solid rgba(0,0,0,.05);
}

/* Front image (desktop) */
.team-card__image{
  display:block;
  padding:0;
  width:100%;
  overflow:hidden;
}
.team-photo{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Band */
.team-card__band{
  padding:.6rem 1rem;
  color:#fff !important;
  min-height:60px;
  display:flex;
  flex-direction:column;
  justify-content:start;
  align-items:center;
  text-align:center;
}
.team-card__band[style*="#fff"],
.team-card__band[style*="#FFF"]{ color:#000; }

.person-name{
  font-weight:600;
  font-size:1.125rem;
  line-height:1.15;
  margin:0 0 2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.person-role,
.person-loc{
  font-size:.95rem;
  line-height:1.25;
  opacity:.95;
  margin:0;
}

/* Back details */
.team-card__logo img{ max-height:75px; width:auto; height:auto; }
.team-card__meta{
  width:100%;
  list-style:none;
  padding:0;
  margin:.5rem 0 0;
  display:grid;
  gap:.5rem;
  font-size:.975rem;
}
.team-card__meta strong{ font-weight:700; }

/* =========================
   MOBILE: TAP TO FLIP (single clean block)
   ========================= */
@media (max-width:540px){

  /* Give flipper real height so absolute faces have room.
     100vw - 2rem matches .team-grid-inner padding (1rem L/R)
     1.25 = 5/4 (600x750)
     + 60px = band height
  */
  .team-card__flipper{
    min-height:0;
    height:calc((100vw - 2rem) * 1.25 + 60px);
    transform:rotateY(0deg);
  }

  /* Flip via class (JS) */
  .team-card.is-flipped .team-card__flipper{
    transform:rotateY(180deg);
  }

  /* Image should be contained on mobile (no crop, no stretch) */
  .team-card__image{
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
  }
  .team-photo{
    width:100%;
    height:100%;
    object-fit:contain;
  }
}