/* ============================================================
   GOUVERNANCE.CSS — Organigramme et cartes d'informations
   Chargé uniquement sur gouvernance.html
   ============================================================ */

/* Propriété locale : écartement entre les nœuds enfants.
   Elle est aussi utilisée dans les calculs des demi-barres
   horizontales — à ne pas changer sans ajuster les ::before. */
:root {
  --org-gap: 5rem;
  --org-line: #E5E7EB;
  --org-line-h: 40px;
}


/* ============================================================
   ORGANIGRAMME (.org-chart)
   ============================================================ */

.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-block: 3rem 1rem;
  /* Permet aux ::before absolus des enfants de déborder dans le gap */
  overflow: visible;
}

/* ---- Nœud parent ---- */
.org-chart__top {
  display: flex;
  justify-content: center;
}

.org-chart__top .org-node {
  background: #111827;
  color: #ffffff;
  border-radius: 12px;
  padding: 1.5rem 3rem;
  min-width: 220px;
  text-align: center;
  border: none;
  box-shadow: 0 4px 20px rgba(17, 24, 39, 0.18);
}

.org-chart__top .org-node .org-node__siren {
  color: rgba(255, 255, 255, 0.45);
}

/* ---- Trait vertical sous le parent ---- */
.org-chart__line-v {
  width: 2px;
  height: var(--org-line-h);
  background: var(--org-line);
  flex-shrink: 0;
}

/* ---- Rangée des enfants ---- */
.org-chart__row {
  display: flex;
  justify-content: center;
  gap: var(--org-gap);
  position: relative;
}

/* ---- Nœud enfant (wrapper colonne) ---- */
.org-chart__child {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative; /* référence pour les ::before absolus */
}

/*
  Connecteur horizontal — principe :
  Chaque enfant dessine SA MOITIÉ de la barre horizontale avec ::before.
  - Premier enfant  : de son centre vers la droite (dans le gap)
  - Dernier enfant  : depuis la gauche (dans le gap) jusqu'à son centre
  Les deux demi-barres se rejoignent exactement au milieu du gap.
  Le débordement négatif (ex: right: calc(-1 * var(--org-gap) / 2))
  est possible car position:absolute sort du flux flex.
*/
.org-chart__child:first-child::before,
.org-chart__child:last-child::before {
  content: '';
  position: absolute;
  top: 0;
  height: 2px;
  background: var(--org-line);
}

/* Premier enfant : de son centre → milieu du gap (vers la droite) */
.org-chart__child:first-child::before {
  left: 50%;
  right: calc(-1 * var(--org-gap) / 2);
}

/* Dernier enfant : milieu du gap → son centre (depuis la gauche) */
.org-chart__child:last-child::before {
  right: 50%;
  left: calc(-1 * var(--org-gap) / 2);
}

/* ---- Trait vertical de chaque enfant (de la barre → nœud) ---- */
.org-chart__line-child {
  width: 2px;
  height: var(--org-line-h);
  background: var(--org-line);
  flex-shrink: 0;
}

/* ---- Nœud enfant (visuel) ---- */
.org-node--child {
  background: #ffffff;
  color: #111827;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  padding: 1.25rem 2.25rem;
  min-width: 200px;
  text-align: center;
  transition: border-color 0.22s ease,
              box-shadow   0.22s ease,
              transform    0.22s ease;
}

.org-node--child:hover {
  border-color: #00ADEF;
  box-shadow: 0 4px 20px rgba(0, 173, 239, 0.14);
  transform: translateY(-4px);
}

/* ---- Typographie des nœuds ---- */
.org-node__name {
  font-size: 0.9375rem;   /* 15 px */
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}

.org-node--child .org-node__name { color: #111827; }

.org-node__siren {
  font-size: 0.75rem;
  font-weight: 400;
  margin-top: 0.25rem;
  color: #9CA3AF;         /* gris neutre */
}


/* ============================================================
   CARTES D'INFORMATIONS LÉGALES (.gov-info-grid)
   ============================================================ */

.gov-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.gov-info-card {
  background: #F8FAFC;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.gov-info-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  border-color: #CBD5E1;
}

/* Icône — fond bleu très clair, stroke bleu */
.gov-info-card__icon {
  width: 38px;
  height: 38px;
  background: #E0F2FE;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  color: #0093CB;
}

.gov-info-card__icon svg {
  stroke: #0093CB;
  fill: none;
}

/* Label — majuscules, gris, espacement de lettres */
.gov-info-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #6B7280;
  line-height: 1.4;
}

/* Valeur — noir, semi-gras */
.gov-info-card__value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.55;
}


/* ============================================================
   BUREAU — Grille de cartes membres
   ============================================================ */

.bureau-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.bureau-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.bureau-card:hover {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.09);
  transform: translateY(-4px);
}

/* Zone visuelle — format carré */
.bureau-card__photo {
  position: relative;
  overflow: hidden;
  background: #F1F5F9;
}

.bureau-card__photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.4s ease;
}

.bureau-card:hover .bureau-card__photo img {
  transform: scale(1.04);
}

/* Variante sans photo — logo */
.bureau-card__photo--logo {
  background: #F8FAFC;
}

.bureau-card__photo--logo img {
  object-fit: contain;
  padding: 1.75rem;
}

/* Variante sans photo — avatar initiales */
.bureau-card__photo--avatar {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #0093CB 0%, #00ADEF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bureau-card__initials {
  font-size: 2.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.03em;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* Corps — flex: 1 pour remplir l'espace restant et égaliser les hauteurs */
.bureau-card__body {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
}

/* Badge de rôle */
.bureau-card__badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00ADEF;
  background: rgba(0, 173, 239, 0.10);
  border: 1px solid rgba(0, 173, 239, 0.28);
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  margin-bottom: 0.625rem;
}

.bureau-card__badge--secondary {
  color: #6B7280;
  background: rgba(107, 114, 128, 0.08);
  border-color: rgba(107, 114, 128, 0.22);
}

/* Nom */
.bureau-card__name {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

/* Organisation */
.bureau-card__org {
  font-size: 0.75rem;
  color: #9CA3AF;
  font-weight: 500;
  margin-bottom: 0.875rem;
}

/* Bio */
.bureau-card__bio {
  font-size: 0.8125rem;
  color: #6B7280;
  line-height: 1.75;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --org-gap: 2.5rem;
    --org-line-h: 28px;
  }

  .org-chart__top .org-node {
    min-width: 180px;
    padding: 1.25rem 2rem;
  }

  .org-node--child {
    min-width: 150px;
    padding: 1rem 1.25rem;
  }

  .gov-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .bureau-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --org-gap: 1.25rem;
    --org-line-h: 24px;
  }

  .org-chart__top .org-node {
    min-width: 150px;
    padding: 1rem 1.5rem;
  }

  .org-node--child {
    min-width: 120px;
    padding: 0.875rem 1rem;
  }

  .org-node__name { font-size: 0.8125rem; }

  .gov-info-grid { grid-template-columns: 1fr; }

  .bureau-cards {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-inline: auto;
  }

  .bureau-card__body {
    padding: 0.875rem 1rem 1rem;
  }
}
