/* ============================================================
   TRUESTORY AFRICA — TEAM CSS
   Homepage team preview section + full team page
   ============================================================ */


/* ── Team Card ─────────────────────────────────────────────── */

.team-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.team-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-border-light);
}

.team-card:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 3px;
}

/* Collapsed (default): only photo, role and name are shown */
.team-card__bio,
.team-card__social {
  display: none;
}

.team-card__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-bg-alt);
  flex-shrink: 0;
}

.team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform var(--transition-slow);
  filter: grayscale(20%);
}

.team-card:hover .team-card__photo img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

.team-card__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.team-card__name {
  font-family: var(--font-heading);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.team-card__role {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: var(--space-1);
}

.team-card__bio {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  flex: 1;
}

.team-card__social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.team-card__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.team-card__social a:hover {
  color: var(--color-red);
}

.team-card__social svg {
  width: 16px;
  height: 16px;
}


/* ── Expanded card (clicked) ───────────────────────────────── */

.team-card.is-expanded {
  grid-column: span 2;
  flex-direction: row;
  align-items: stretch;
  cursor: default;
  border-color: var(--color-border-light);
  box-shadow: var(--shadow-hover);
}

.team-card.is-expanded:hover {
  transform: none;
}

.team-card.is-expanded .team-card__photo {
  width: 45%;
  max-width: 320px;
  aspect-ratio: auto;
  align-self: stretch;
}

.team-card.is-expanded .team-card__photo img {
  filter: grayscale(0%);
}

.team-card.is-expanded .team-card__body {
  justify-content: center;
}

.team-card.is-expanded .team-card__bio {
  display: block;
}

.team-card.is-expanded .team-card__social {
  display: flex;
}


/* ── Homepage Team Preview Section ────────────────────────── */

.team-preview {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.team-preview__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.team-preview__header-text h2 {
  margin-top: var(--space-3);
}

.team-preview__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.team-preview__footer {
  display: flex;
  justify-content: center;
  margin-top: var(--space-12);
}


/* ── Full Team Page ────────────────────────────────────────── */

.team-page__hero {
  padding-block: var(--space-20);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.team-page__hero .label {
  margin-bottom: var(--space-4);
}

.team-page__hero h1 {
  margin-bottom: var(--space-5);
}

.team-page__hero p {
  max-width: 560px;
  font-size: 17px;
}

.team-page__grid-section {
  padding-block: var(--space-20);
  background: var(--color-bg);
}

.team-page__grid-section + .team-page__grid-section {
  border-top: 1px solid var(--color-border);
}

.team-group__label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.team-group__label h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.team-group__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.team-page__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.team-page__cta {
  padding-block: var(--space-20);
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.team-page__cta h2 {
  margin-bottom: var(--space-4);
}

.team-page__cta p {
  max-width: 480px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}


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

@media (max-width: 1024px) {
  .team-preview__grid,
  .team-page__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-preview__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .team-preview__grid,
  .team-page__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  /* On a 2-col grid the photo column would be too narrow — give the
     expanded card a bit less photo width while keeping the row layout. */
  .team-card.is-expanded .team-card__photo {
    width: 40%;
  }
}

@media (max-width: 480px) {
  .team-preview__grid,
  .team-page__grid {
    grid-template-columns: 1fr;
  }

  .team-card__body {
    padding: var(--space-5);
  }

  /* Single column: stack the expanded card vertically instead of side-by-side */
  .team-card.is-expanded {
    flex-direction: column;
  }

  .team-card.is-expanded .team-card__photo {
    width: 100%;
    max-width: none;
    aspect-ratio: 4 / 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-card,
  .team-card:hover,
  .team-card__photo img {
    transition: none;
    transform: none;
  }
}
