/* ═══════════════════════════════════════════════════
   SFP-Europa — Team grid (style-team.css)
   Layout: Flexbox a wrap con width fissa per card,
   garantisce righe regolari indipendentemente dalla
   lunghezza dei nomi. Su desktop standard ~6 per riga.
   ═══════════════════════════════════════════════════ */

.team-section {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 2rem;
}

/* ── Group header ── */
.team-group-title,
.team-group-header {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  color: var(--blue-deep);
  padding: .6rem 1rem;
  background: var(--blue-xlight);
  border-left: 3px solid var(--blue-deep);
  border-radius: 0 6px 6px 0;
  margin-bottom: .75rem;
  line-height: 1.4;
}

/* ── Grid ── */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 1.5rem;
  justify-content: flex-start;
}

/* ── Card (member) ──
   Width fissa = righe regolari. Cambia il valore qui sotto se vuoi
   card più grandi/piccole; il numero di colonne per riga si adatterà
   automaticamente alla larghezza del container. */
.team-member,
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  width: 110px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Avatar (img + fallback) ──
   Si applica sia alla img direttamente figlia di .team-member
   sia al div fallback con iniziali. */
.team-member > img,
.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 2px solid var(--border);
  background: var(--blue-xlight);
  flex-shrink: 0;
}

.team-avatar-fallback,
.team-initials {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue-deep);
  background: var(--blue-light);
  text-transform: uppercase;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* ── Name ── */
.team-member-name,
.team-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0rem;
  line-height: 1.25;
  width: 100%;
  font-size: .72rem;
  hyphens: auto;
}

.team-member-name strong,
.team-last {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: .03em;
  word-break: break-word;
}

.team-member-name br + *,
.team-first {
  font-size: .72rem;
  font-weight: 400;
  color: var(--text-mid);
  word-break: break-word;
}

/* Quando il nome è dentro <span class="team-member-name">
   senza span/div interni — gestione browser-agnostic via line-height */
.team-member-name {
  text-align: center;
}

.team-member-name {
  line-height: 1.15;    /* era implicito dal browser default */
  gap: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .team-grid { gap: 1.5rem 1.25rem; }
  .team-member, .team-card { width: 100px; }
  .team-member > img, .team-avatar,
  .team-avatar-fallback, .team-initials {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 640px) {
  .team-grid { gap: 1.25rem 1rem; }
  .team-member, .team-card { width: 88px; }
  .team-member > img, .team-avatar,
  .team-avatar-fallback, .team-initials {
    width: 64px;
    height: 64px;
  }
  .team-member-name,
  .team-last, .team-first { font-size: .68rem; }
}