/* ============================================
   VITRINE PARCOURS — Mind map embed
   À inclure APRÈS css/style.css du site Académie.
   ============================================ */

/* Alias vers les variables du site Académie pour réutiliser les styles
   originaux de la vitrine sans tout réécrire */
.vitrine-section {
  --paper: var(--bg, #fafaf7);
  --paper-warm: var(--bg-warm, #f5f2eb);
  --blue-primary: var(--primary, #0f1d36);
  --blue-dark: var(--primary, #0f1d36);
  --gold: var(--accent, #c5a44e);
  --gold-light: var(--accent-hover, #d4b86a);
  --gold-dark: #a78b3a;
  --ink: var(--text, #1e1e1e);
  --ink-soft: var(--text-secondary, #5a5a5a);
  --gray-line: var(--border, rgba(0,0,0,0.06));
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(15, 29, 54, 0.06);
  --shadow-md: 0 6px 24px rgba(15, 29, 54, 0.10);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Mode toggle (Voie ↔ Domaine) ----- */
.vitrine-section .mode-toggle {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  padding: 6px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.vitrine-section .mode-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 14px 22px;
  border-radius: calc(var(--radius-lg) - 6px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  transition: var(--transition);
  color: var(--ink-soft);
  font-family: inherit;
}
.vitrine-section .mode-btn:hover { background: var(--paper-warm); color: var(--ink); }
.vitrine-section .mode-btn.active {
  background: var(--blue-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.vitrine-section .mode-btn.active .mode-hint { color: rgba(255, 255, 255, 0.75); }
.vitrine-section .mode-label { font-weight: 600; font-size: 0.95rem; }
.vitrine-section .mode-hint { font-size: 0.78rem; opacity: 0.75; margin-top: 2px; }

/* ----- Mind map container ----- */
.vitrine-section #mindmap {
  position: relative;
  /* Déborde du .container (1180px), mais sans aller plein cadre. */
  width: 88vw;
  max-width: 1480px;
  margin-left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 14 / 10;
  background: radial-gradient(ellipse at center, var(--paper) 0%, var(--paper-warm) 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
  border: 1px solid var(--gray-line);
}
.vitrine-section .mindmap-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.vitrine-section .mindmap-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
  letter-spacing: 0.02em;
}
.vitrine-section .mindmap-intro {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 24px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary, #5a5a5a);
}
.vitrine-section .mindmap-intro strong {
  color: var(--primary, #0f1d36);
  font-weight: 600;
}
/* Périmètre ancêtres / anciens */
.alumni-scope {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 18px;
}
.alumni-scope-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text, #1e1e1e);
  cursor: pointer;
}
.alumni-scope-check input { width: 16px; height: 16px; accent-color: var(--gold, #c5a44e); cursor: pointer; }
.alumni-scope-help {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--gold, #c5a44e); background: transparent;
  color: var(--gold-dark, #a78b3a); font-size: 0.8rem; font-weight: 700; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.alumni-scope-help:hover { background: var(--gold, #c5a44e); color: #fff; }
.alumni-scope-popup {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  z-index: 60; width: min(420px, 90vw);
  background: var(--bg-card, #fff); color: var(--text-secondary, #5a5a5a);
  border: 1px solid var(--border, rgba(0,0,0,0.1)); border-radius: var(--radius-md, 14px);
  box-shadow: var(--shadow-md, 0 8px 30px rgba(0,0,0,0.12));
  padding: 14px 16px; font-size: 0.9rem; line-height: 1.55; text-align: left;
}
.alumni-scope-popup strong { color: var(--primary, #0f1d36); }
.alumni-scope-popup[hidden] { display: none; }
.vitrine-section .loading,
.vitrine-section .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
  font-style: italic;
}

/* ----- Liens ----- */
.link-center {
  fill: none;
  stroke: var(--border, rgba(0,0,0,0.18));
  stroke-width: 2.6;
  stroke-dasharray: 4 5;
  stroke-linecap: round;
  transition: opacity 0.3s ease, stroke-width 0.25s ease, stroke 0.25s ease;
}
/* Fil « allumé » quand on survole la voie reliée (couleur posée en JS). */
.link-center.lit {
  stroke-width: 5.5;
  stroke-dasharray: none;
  opacity: 1 !important;
  filter: drop-shadow(0 0 6px currentColor);
}
.link-ancien {
  stroke-width: 1.5;
  stroke-dasharray: 2 3;
}
.link-filiere {
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

/* ----- Centre Académie ----- */
.center-bg {
  fill: var(--accent, #c5a44e);
  stroke: #fff;
  stroke-width: 3;
}
.center-glow {
  fill: var(--accent, #c5a44e);
  opacity: 0.35;
}
.center-label-1,
.center-label-2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  fill: var(--primary, #0f1d36);
}
.center-label-1 { font-size: 16px; }
.center-label-2 { font-size: 13px; opacity: 0.85; }

/* ----- Voies (niveau 1) ----- */
.voie-bg {
  stroke: #fff;
  stroke-width: 3;
  transition: r 0.25s ease, filter 0.2s ease, stroke-width 0.2s ease;
}
.voie:hover .voie-bg { filter: brightness(1.08) drop-shadow(0 3px 8px rgba(0,0,0,0.18)); stroke-width: 5; }
.voie:hover .voie-label { fill: var(--gold-dark, #a78b3a); }
.voie:hover .voie-halo { opacity: 0.32 !important; }
.voie-halo { transition: opacity 0.35s ease, r 0.35s ease; }
.voie-label { transition: fill 0.2s ease; }
.voie-label {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  font-weight: 700;
  fill: var(--primary, #0f1d36);
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg, #fafaf7);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.voie-count {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  fill: var(--text-secondary, #5a5a5a);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg, #fafaf7);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* ----- Filières (niveau 2) ----- */
.filiere-bg {
  stroke: #fff;
  stroke-width: 2.5;
  transition: filter 0.2s ease;
}
.filiere-node:hover .filiere-bg { filter: brightness(1.15); }
.filiere-node:hover .filiere-halo { opacity: 0.3 !important; }
.filiere-halo { transition: opacity 0.3s ease; }
.filiere-count {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}
.filiere-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  fill: var(--primary, #0f1d36);
  letter-spacing: 0.02em;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg, #fafaf7);
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* ----- Anciens (niveau 3) ----- */
.ancien-shadow { pointer-events: none; }
.ancien-base { stroke: rgba(255, 255, 255, 0.9); stroke-width: 0; }
.ancien-ring { transition: stroke-width 0.2s ease, r 0.2s ease; }
.ancien-initials-bg {
  fill: var(--bg-warm, #f5f2eb);
  stroke: var(--border, rgba(0,0,0,0.06));
  stroke-width: 1;
}
.ancien-initials {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  fill: var(--primary, #0f1d36);
  pointer-events: none;
  letter-spacing: -0.01em;
}
.ancien-node:hover .ancien-ring {
  stroke-width: 3.5;
  r: 38;
}
.ancien-node:hover .ancien-base { stroke-width: 1.5; }
.ancien-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  fill: var(--text, #1e1e1e);
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg, #fafaf7);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.ancien-node { transition: filter 0.2s ease; }
.ancien-node:hover {
  filter: brightness(1.08) drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}

/* ----- Carte d'info latérale ----- */
.mindmap-card {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 320px;
  max-width: calc(100% - 56px);
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(15, 29, 54, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 5;
}
.mindmap-card.visible { opacity: 1; transform: translateY(0); }
.mindmap-card .card-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary, #5a5a5a);
  padding: 4px 8px;
}
.mindmap-card .card-close:hover { color: var(--text, #1e1e1e); }
.mindmap-card .card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  margin-bottom: 16px;
}
.mindmap-card .card-icon svg { width: 22px; height: 22px; }
.mindmap-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--primary, #0f1d36);
  margin-bottom: 6px;
}
.mindmap-card .card-tagline {
  font-size: 0.85rem;
  color: #a78b3a;
  font-weight: 600;
  margin-bottom: 14px;
}
.mindmap-card .card-manifesto {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary, #5a5a5a);
  margin-bottom: 16px;
}
.mindmap-card .card-stats {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border, rgba(0,0,0,0.06));
  margin-bottom: 14px;
}
.mindmap-card .card-stat {
  font-size: 0.85rem;
  color: var(--text-secondary, #5a5a5a);
}
.mindmap-card .card-stat strong {
  color: var(--primary, #0f1d36);
  font-size: 1.1rem;
  font-weight: 700;
  margin-right: 4px;
}
.mindmap-card .card-hint {
  font-size: 0.78rem;
  color: var(--text-secondary, #5a5a5a);
  font-style: italic;
  margin-bottom: 12px;
}
.mindmap-card .card-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary, #0f1d36);
  border-bottom: 1px solid currentColor;
}
.mindmap-card .card-link:hover { color: #a78b3a; }

/* ---- Recherche d'un ancien par école / formation ---- */
.alumni-search { position: relative; max-width: 620px; margin: 0 auto 24px; }
.alumni-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-muted, #8a8a8a); pointer-events: none; }
.alumni-search-input {
  width: 100%; padding: 15px 18px 15px 50px;
  border: 2px solid var(--border, rgba(0,0,0,0.1)); border-radius: var(--radius-md, 14px);
  font-size: 1rem; font-family: inherit; background: var(--bg-card, #fff); color: var(--text, #1e1e1e);
  transition: border-color .2s, box-shadow .2s;
}
.alumni-search-input:focus { outline: none; border-color: var(--gold, #c5a44e); box-shadow: 0 0 0 3px var(--accent-soft, rgba(197,164,78,0.12)); }
.alumni-search-results { max-width: 980px; margin: 0 auto; }
.alumni-search-msg { text-align: center; color: var(--text-secondary, #5a5a5a); font-size: 1rem; margin: 6px 0 18px; }
.alumni-search-msg strong { color: var(--text, #1e1e1e); }
.alumni-search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.alumni-result {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-card, #fff); border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: var(--radius-md, 14px); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
  text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.alumni-result:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 8px 30px rgba(0,0,0,0.08)); border-color: var(--gold-light, #d4b86a); }
.alumni-result-photo, .alumni-result-initials { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; background: var(--bg-warm, #f5f2eb); }
.alumni-result-photo { object-fit: cover; object-position: center top; }
.alumni-result-initials { display: flex; align-items: center; justify-content: center; color: var(--gold-dark, #a78b3a); font-weight: 600; }
.alumni-result-body { min-width: 0; }
.alumni-result-name { display: block; font-weight: 600; color: var(--primary, #0f1d36); font-size: .95rem; }
.alumni-result-detail { display: block; font-size: .82rem; color: var(--text-secondary, #5a5a5a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- Carte mentale : adaptation mobile -----
   En paysage 14/10 sur un téléphone, le conteneur est trop bas (~245px) et la
   carte devient minuscule. On le passe en portrait pour lui donner de la
   hauteur ; côté JS, overviewBox() resserre alors la vue sur les voies. */
@media (max-width: 768px) {
  .vitrine-section #mindmap { width: 94vw; aspect-ratio: 10 / 13; }
}
@media (max-width: 480px) {
  .vitrine-section #mindmap { width: 96vw; aspect-ratio: 4 / 5; }
}
