/* ─── Team Grid ─────────────────────────────────────────────────────────── */

.team-grid {
  width: min(96%, 1120px);
  margin: 0 auto;
  padding: 3rem 1rem;
}

/* Grid layout */
.team-grid__grid {
  display: grid;
  column-gap: 10px;
  row-gap: 2.5rem;
  align-items: start;
}

.team-grid__grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.team-grid__grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.team-grid__grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ─── Person card ──────────────────────────────────────────────────────── */

.team-grid__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: opacity 180ms ease;
  padding: .85rem;
  /* Prevent sticky header + sticky nav from covering the card when scrolled to */
  scroll-margin-top: var(--sticky-total-offset, 84px);
}

.team-grid__card:hover .team-grid__photo,
.team-grid__card:focus-visible .team-grid__photo {
  box-shadow: 0 0 0 3px #10ab9e;
}

.team-grid__card:focus-visible {
  outline: none;
}

/* Circular photo */
.team-grid__photo-wrap {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  overflow: hidden;
  background: #dce6f0;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.team-grid__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 50%;
  transition: box-shadow 180ms ease;
}

.team-grid__photo--placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #c9d9e8 0%, #a8c0d6 100%);
}

/* Name */
.team-grid__name {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 21px;
  font-weight: 300;
  color: #333;
  margin: 0 0 0.2rem;
  line-height: 1.1;
}

/* Active card: name gets accent colour */
.team-grid__card[aria-expanded="true"] .team-grid__name {
  color: #10ab9e;
}

/* Denomination */
.team-grid__denomination {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: #000;
  margin: 0;
  line-height: 1.6;
}

/* ─── Biography panel ─────────────────────────────────────────────────── */

.team-grid__bio {
  /* Spans all columns regardless of column count */
  grid-column: 1 / -1;
  position: relative;
  background: #fff;
  border: 1px solid #e0e7ef;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  padding: 2rem 3rem 2rem 2rem;
  margin-top: 0;
  /* Arrow indicator */
}

/* Arrow pointing upward — JS sets --arrow-left.
   Arrow height (20px) must exceed the row-gap so it bridges the gap. */
.team-grid__bio::before {
  content: "";
  position: absolute;
  top: -20px;
  left: var(--arrow-left, 80px);
  transform: translateX(-50%);
  border: 20px solid transparent;
  border-top: 0;
  border-bottom-color: #e0e7ef;
  pointer-events: none;
}

.team-grid__bio::after {
  content: "";
  position: absolute;
  top: -18px;
  left: var(--arrow-left, 80px);
  transform: translateX(-50%);
  border: 18px solid transparent;
  border-top: 0;
  border-bottom-color: #fff;
  pointer-events: none;
}

/* Close button */
.team-grid__bio-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #333;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.team-grid__bio-close:hover {
  color: #10ab9e;
}

/* Bio content */
.team-grid__bio-name {
  font-family: "Roboto Condensed", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  color: #000000;
  margin: 0 0 1.2rem;
}

.team-grid__bio-text {
  font-size: 1rem;
  line-height: 1.5;
  color: #2c2c2c;
}

.team-grid__bio-text p {
  margin: 0 0 0.9rem;
}

.team-grid__bio-text p:last-child {
  margin-bottom: 0;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {

  .team-grid__grid--cols-4,
  .team-grid__grid--cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {

  .team-grid__grid--cols-4,
  .team-grid__grid--cols-3,
  .team-grid__grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid__photo-wrap {
    width: 110px;
    height: 110px;
  }

  .team-grid__bio {
    padding: 1.5rem 2rem 1.5rem 1rem;
  }
}