/**
 * @file
 * Page /equipa — wireframe Equipa.png.
 *
 * Layout :
 *   - Section header centré (kicker + h1 + lead)
 *   - Grille 2 cols, cards rectangulaires bordées pointillées
 *     - Photo ronde à gauche (88px)
 *     - Body à droite : nom italique Caveat, rôle + "desde XXXX", bio courte, icons sociaux
 *   - Footer CTA "Quer juntar-se?" (bloc bordé pointillé framboise)
 */

.team-listing {
  padding-block: 3rem 4rem;
}

/* ─────────── Header centré ─────────── */
.team-listing__head {
  text-align: center;
  margin: 0 auto 3rem;
  max-width: 640px;
}
.team-listing__head .ocdm-section-head__kicker {
  margin: 0 0 0.5rem;
}
.team-listing__title {
  font-family: var(--ocdm-font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 1.7rem + 2vw, 3.5rem);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ocdm-text-strong);
  margin: 0 0 0.75rem;
}
.team-listing__lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ocdm-text-muted);
  margin: 0;
}

/* ─────────── Grille 2 cols ─────────── */
/* ─────── Tabs filter (Members / Staff / Volunteers) ─────── */
.team-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0 2.5rem;
}
.team-tab {
  padding: 0.55rem 1.4rem;
  background: #fff;
  border: 1.5px solid var(--ocdm-border, #e5dfd3);
  border-radius: 999px;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ocdm-text-strong, #1f1820);
  cursor: pointer;
  transition: all 0.15s ease;
}
.team-tab:hover {
  background: var(--ocdm-blue-soft, #dce9ee);
  border-color: var(--ocdm-blue, #b8d0db);
}
.team-tab.is-active {
  background: var(--ocdm-framboise, #c9357a);
  border-color: var(--ocdm-framboise, #c9357a);
  color: #fff;
}
.team-tab:focus-visible {
  outline: 2px solid var(--ocdm-framboise);
  outline-offset: 2px;
}

/* ─────── Sections (1 par type, switch via JS) ─────── */
.team-section {
  margin-bottom: 2rem;
}
.team-section[hidden] { display: none; }

/* ─────── Grille 4 colonnes ─────── */
.team-listing__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 1024px) {
  .team-listing__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .team-listing__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .team-listing__grid { grid-template-columns: 1fr; }
}

/* ─────── Carte président — pleine largeur, style "gold" ─────── */
.team-president {
  margin-bottom: 2rem;
}
.team-president .team-card {
  grid-template-columns: 200px 1fr;
  padding: 2rem 2.5rem;
  background: linear-gradient(135deg, #FFF8E1 0%, #F4ECDC 100%);
  border: 2.5px solid #C9A24E;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(201, 162, 78, 0.15);
}
.team-president .team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(201, 162, 78, 0.25);
}
.team-president .team-card__photo {
  width: 180px;
  height: 180px;
  border: 3px solid #C9A24E;
}
.team-president .team-card__name {
  font-size: 1.8rem;
  color: #8A6500;
}
.team-president .team-card__role {
  font-size: 1.1rem;
}
.team-president .team-card__bio {
  font-size: 1rem;
  line-height: 1.6;
}
/* Petite couronne en haut-droite pour signaler le rôle */
.team-president .team-card::before {
  content: '★';
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: #C9A24E;
}
.team-president .team-card {
  position: relative;
}
@media (max-width: 600px) {
  .team-president .team-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.5rem;
  }
  .team-president .team-card__photo {
    margin: 0 auto;
  }
}

/* Cards normales en grille 4 cols : layout column (photo en haut, body en bas) */
.team-listing__grid .team-card {
  grid-template-columns: 1fr;
  text-align: center;
  padding: 1.5rem 1.25rem;
}
.team-listing__grid .team-card__photo {
  margin: 0 auto;
  cursor: pointer;
}

/* ─────── Lightbox photo ─────── */
.team-lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
}
.team-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}
.team-lightbox__img {
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  border: 4px solid #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.team-lightbox__close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
}
.team-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.team-lightbox__caption {
  color: #fff;
  text-align: center;
  margin-top: 1rem;
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
}

/* ─────────── Card rectangulaire bordée pointillée ─────────── */
.team-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--ocdm-bg-elevated, #fff);
  border: 1.5px dashed var(--ocdm-text-strong, #1f1820);
  border-radius: var(--ocdm-radius-lg, 16px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-style 0.2s ease;
}
.team-card:hover {
  transform: translateY(-2px);
  border-style: solid;
  box-shadow: 0 6px 18px rgba(31, 24, 32, 0.08);
}

@media (max-width: 480px) {
  .team-card {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding: 1rem;
  }
}

/* Photo ronde 88px (largeur card photo bornée à 112, padding inside) */
.team-card__photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ocdm-bg-sunken, #f6ebe0);
  border: 1.5px solid var(--ocdm-text-strong, #1f1820);
  flex-shrink: 0;
}
.team-card__photo img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  /* L'image arrive pré-cropée par l'image style `team_photo` (3:4 + crop manual
     défini en admin via image_widget_crop). On laisse `object-fit: cover` et
     position par défaut (center center) — le crop admin a déjà centré le sujet. */
  object-fit: cover;
  object-position: center center;
  display: block;
}
.team-card__photo .field,
.team-card__photo .field__item { display: contents; }
.team-card__photo .ocdm-photo-placeholder {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  width: 100%;
  font-family: var(--ocdm-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ocdm-framboise);
}
.team-card__photo .ocdm-photo-placeholder::before { display: none; }

@media (max-width: 480px) {
  .team-card__photo { width: 64px; height: 64px; }
}

/* Body droite */
.team-card__body {
  min-width: 0;
}

.team-card__name {
  font-family: var(--ocdm-font-hand);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ocdm-framboise);
  margin: 0 0 0.25rem;
  letter-spacing: 0;
}
.team-card__name::after { display: none !important; }

.team-card__role {
  font-family: var(--ocdm-font-body);
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--ocdm-text-strong);
  margin: 0 0 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}
.team-card__role-name {
  font-weight: 700;
}
.team-card__since {
  color: var(--ocdm-text-muted);
  font-weight: 500;
  font-style: italic;
}

.team-card__bio {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ocdm-text);
  margin: 0 0 0.5rem;
}
.team-card__bio p { margin: 0; }

.team-card__social {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.team-card__social .field__item {
  display: inline-block;
  margin-right: 0.4rem;
}
.team-card__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--ocdm-border);
  color: var(--ocdm-text-muted);
  text-decoration: none;
  font-size: 12px;
  transition: all 0.15s ease;
}
.team-card__social a:hover {
  color: var(--ocdm-framboise);
  border-color: var(--ocdm-framboise);
}

/* ─────────── Footer CTA "Quer juntar-se?" ─────────── */
.team-listing__join {
  text-align: center;
  max-width: 720px;
  margin: 3rem auto 0;
  padding: 2.5rem 2rem;
  background: var(--ocdm-bg-elevated);
  border: 1.5px dashed var(--ocdm-framboise);
  border-radius: var(--ocdm-radius-lg, 16px);
}
.team-listing__join .ocdm-section-head__kicker {
  margin: 0 0 0.5rem;
}
.team-listing__join-lead {
  font-family: var(--ocdm-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  color: var(--ocdm-text-strong);
}
.team-listing__join-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
}
.team-listing__join-actions a { margin: 0; }

@media (max-width: 540px) {
  .team-listing__join {
    padding: 2rem 1.25rem;
  }
  .team-listing__join-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.team-listing__empty {
  text-align: center;
  color: var(--ocdm-text-muted);
  padding: 3rem 1rem;
}
