/* ===== OUR TEAM SECTION ===== */
.team-section {
  background: #f7f5f0;       /* off white */
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.team-inner {
  max-width: 1120px;
  margin: 0 auto;
}

/* Header */
.team-header {
  text-align: center;
  margin-bottom: 2.4rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.team-title {
  font-size: clamp(2rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #155b3c;
  margin-bottom: 0.6rem;
}

.team-text {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.96rem;
  color: #495c53;
  line-height: 1.7;
}

/* Grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
}

/* CARD HEIGHT adjusted for portrait ratio */
.team-card {
  perspective: 1000px;
  height: 400px;   /* increased for vertical images */
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* FRONT FACE: image + label strip */
.team-card-front {
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

/* VERTICAL IMAGE — FULL WIDTH, FULL HEIGHT */
.team-photo {
  width: 100%;
  height: 88%;              /* taller space for portrait */
  object-fit: cover;        /* crop edges while staying centered */
  object-position: center;  /* keeps face centered */
  display: block;
  /* border-bottom: 1px solid rgba(0,0,0,0.08); */
}

/* INFO BAR */
.team-info {
  height: 12%;              /* remaining space under the image */
  padding: 0.3rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.team-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s ease;
  /* box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14); */
}

/* Flip on hover/focus */
.team-card:hover .team-card-inner,
.team-card:focus-within .team-card-inner {
  transform: rotateY(180deg);
}

/* Faces */
.team-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  /* border-radius: 0.6rem; */
  overflow: hidden;
}

/* FRONT: image + name + role */
.team-card-front {
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

/* Image: full width, ~90% of height */
.team-photo {
  width: 100%;
  height: 90%;       /* approx 90% of card height */
  object-fit: cover;
  display: block;
}

/* Name/role strip at bottom */
.team-info {
  flex: 1;
  padding: 0.35rem 0.75rem 0.55rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.team-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #123024;
}

.team-role {
  font-size: 0.84rem;
  color: #4a5e56;
}

/* BACK: biography */
.team-card-back {
  background: #0e75c2;
  color: #ffffff;
  transform: rotateY(180deg);
  padding: 0.9rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.team-name-back {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.team-role-back {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
  margin-bottom: 0.45rem;
}

.team-bio {
  font-size: 0.86rem;
  line-height: 1.6;
  opacity: 0.95;
}

/* In-view animation */
.team-section.in-view .team-header {
  opacity: 1;
  transform: translateY(0);
}

.team-section.in-view .team-card {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger cards */
.team-section.in-view .team-card:nth-child(1) { transition-delay: 0.05s; }
.team-section.in-view .team-card:nth-child(2) { transition-delay: 0.1s;  }
.team-section.in-view .team-card:nth-child(3) { transition-delay: 0.15s; }
.team-section.in-view .team-card:nth-child(4) { transition-delay: 0.2s;  }
.team-section.in-view .team-card:nth-child(5) { transition-delay: 0.25s; }
.team-section.in-view .team-card:nth-child(6) { transition-delay: 0.3s;  }
.team-section.in-view .team-card:nth-child(7) { transition-delay: 0.35s; }
.team-section.in-view .team-card:nth-child(8) { transition-delay: 0.4s;  }
.team-section.in-view .team-card:nth-child(9) { transition-delay: 0.45s; }
.team-section.in-view .team-card:nth-child(10){ transition-delay: 0.5s;  }
.team-section.in-view .team-card:nth-child(11){ transition-delay: 0.55s; }
.team-section.in-view .team-card:nth-child(12){ transition-delay: 0.6s;  }
.team-section.in-view .team-card:nth-child(13){ transition-delay: 0.65s; }
.team-section.in-view .team-card:nth-child(14){ transition-delay: 0.7s;  }
.team-section.in-view .team-card:nth-child(15){ transition-delay: 0.75s; }

/* Out-of-view reset */
.team-section.out-of-view .team-header,
.team-section.out-of-view .team-card {
  opacity: 0;
  transform: translateY(30px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .team-section {
    padding: 3rem 1.2rem;
  }

  .team-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-card {
    height: 260px;
  }
}
