/* ==========================================================================
   ORIGINE v2 — CARTE DES SECTEURS (assets/carte-secteurs.js)
   S'appuie sur assets/commun.css (jetons) sans le modifier.
   Rendu : secteurs en bleu charte, bords ivoire marqués ; la zone MEL en bronze (porte d'entrée
   du niveau 2). Survol : le secteur s'agrandit nettement (×1,3), passe au-dessus et prend une ombre.
   Secteur choisi : bronze.
   Sommaire : 1 bloc et en-tête · 2 carte SVG · 3 étiquettes · 4 détail · 5 liste (petits écrans)
   ========================================================================== */

/* 1. BLOC ET EN-TÊTE ------------------------------------------------------------ */
.cs-bloc { display: flex; flex-direction: column; gap: var(--e-2); }
.cs-tete { min-height: 5.2rem; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e-4) var(--e-6); flex-wrap: wrap; margin-bottom: 0; }
.cs-tete-texte { min-width: 0; }
.cs-tete h2 { margin-bottom: var(--e-2); }
.cs-sous-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.cs-ariane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-size: var(--t-s); font-weight: 500; color: var(--bleu); }
.cs-ariane li { display: inline-flex; align-items: center; }
.cs-ariane li + li::before { content: "›"; margin: 0 .55rem; color: var(--bronze-texte); font-weight: 400; }
.cs-ariane li[aria-current] { font-weight: 700; }
.cs-ariane-lien {
  border: 0; background: none; padding: .7rem 0; margin: -.7rem 0; color: var(--bleu); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--bronze); text-underline-offset: .22em; cursor: pointer;
}
.cs-ariane-lien:hover { color: var(--bronze-texte); }
.cs-intro { margin: 0; color: var(--gris-texte); font-size: var(--t-s); max-width: 60ch; }
.cs-carte { min-width: 0; display: flex; justify-content: center; padding: 0; }
.cs-svg { width: 100%; max-width: 980px; height: auto; max-height: 74vh; overflow: visible; font-family: var(--police); }
.cs-fondu { animation: cs-fondu .25s ease both; }
@keyframes cs-fondu { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* 2. CARTE SVG ---------------------------------------------------------------- */
.cs-svg {
  --cs-fond: var(--bleu);              /* même bleu que les aplats de la charte */
  --cs-bord: var(--ivoire);
  --cs-texte: var(--ivoire);
  --cs-fond-survol: #1E5563;           /* bleu éclairci au survol */
  --cs-fond-actif: var(--bronze);      /* secteur choisi : bronze */
  --cs-fond-mel: var(--bronze-texte);  /* la métropole, porte d'entrée du niveau 2 */
}
.cs-socle { fill: var(--ivoire-3); }
.cs-hors { fill: var(--gris); fill-opacity: .55; stroke: var(--ivoire); stroke-width: 1.2; pointer-events: none; }
.cs-repere {
  fill: var(--gris-texte); font-size: 11px; font-weight: 500; font-style: italic;
  letter-spacing: .22em; text-transform: uppercase; text-anchor: middle; opacity: .75; pointer-events: none;
}
.cs-zone {
  cursor: pointer; outline: none;
  transform-box: fill-box; transform-origin: center;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1.1), filter .28s ease, opacity var(--transition);
}
.cs-forme {
  fill: var(--cs-fond); stroke: var(--cs-bord); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
  transition: fill var(--transition), stroke-width var(--transition);
}
.cs-zone-mel .cs-forme { fill: var(--cs-fond-mel); }
/* Survol : agrandi, au-dessus, ombre portée, bleu éclairci ; les autres s'effacent légèrement */
.cs-svg.a-survol .cs-zone:not(.est-survole) { opacity: .78; }
.cs-zone.est-survole { transform: scale(1.3); filter: var(--cs-relief); opacity: 1; }
.cs-zone.est-survole .cs-forme { fill: var(--cs-fond-survol); stroke-width: 2.6; }
.cs-zone-mel.est-survole .cs-forme { fill: var(--bronze); }
.cs-zone:focus-visible .cs-forme { stroke: var(--bronze-clair); stroke-width: 3.5; }
/* Secteur choisi : bronze ; les autres en retrait (le survol reprend le dessus) */
.cs-svg.a-actif .cs-zone:not(.est-actif):not(.est-survole) { opacity: .55; }
.cs-zone.est-actif .cs-forme { fill: var(--cs-fond-actif); stroke-width: 2.6; }
.cs-zone.est-actif.est-survole .cs-forme { fill: var(--bronze-fonce); }
@media (prefers-reduced-motion: reduce) { .cs-zone.est-survole { transform: none; } }

/* 3. ÉTIQUETTES ---------------------------------------------------------------- */
.cs-etiquette { pointer-events: none; }
.cs-etiquette text { fill: var(--cs-texte); text-anchor: middle; }
.cs-nom { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cs-sous { font-size: 8.5px; font-weight: 500; letter-spacing: .04em; opacity: .85; }
.cs-etiquette.est-petit .cs-nom { font-size: 9.5px; letter-spacing: .05em; }
.cs-etiquette.est-moyen .cs-nom { font-size: 10.5px; letter-spacing: .06em; }
.cs-niveau-2 .cs-nom { font-size: 17px; }
.cs-niveau-2 .cs-etiquette.est-moyen .cs-nom { font-size: 14px; }
.cs-niveau-2 .cs-etiquette.est-petit .cs-nom { font-size: 12px; }
@media (max-width: 639px) { .cs-etiquette, .cs-repere { display: none; } }

/* 4. DÉTAIL DU SECTEUR CHOISI (en haut à droite) ------------------------------------ */
.cs-detail:empty { display: none; }
.cs-detail { padding: var(--e-2) 0 var(--e-2) var(--e-4); border-left: 2px solid var(--bronze); max-width: 34rem; }
.cs-detail-etiquette { display: block; font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--bronze-texte); margin-bottom: .15rem; }
.cs-detail-titre { margin: 0 0 .15rem; font-weight: 700; font-size: var(--t-l); color: var(--bleu); line-height: 1.25; }
.cs-detail-sous { font-weight: 500; font-size: var(--t-s); color: var(--gris-texte); }
.cs-detail-communes { margin: 0 0 .45rem; font-size: var(--t-s); color: var(--gris-texte); line-height: 1.5; }
.cs-retirer { background: none; border: 0; border-bottom: 1px solid var(--bronze); padding: .4rem 0 2px; cursor: pointer; font-size: var(--t-s); }
.cs-retour { margin-top: .2rem; }

/* 5. LISTE DES SECTEURS (petits écrans seulement) ------------------------------------ */
.cs-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e-2); }
@media (min-width: 1024px) { .cs-liste { display: none; } }
@media (max-width: 559px) { .cs-liste { grid-template-columns: minmax(0, 1fr); } }
.cs-liste-mel, .cs-liste-retour { grid-column: 1 / -1; }
.cs-ligne {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem;
  min-height: 52px; padding: .5rem .75rem; border: 1px solid var(--filet); border-radius: var(--rayon);
  background: var(--ivoire-3); color: var(--bleu); text-align: left; cursor: pointer; line-height: 1.2;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.cs-ligne:hover, .cs-ligne.est-survole { border-color: var(--bronze); background: var(--blanc); }
.cs-ligne.est-actif { background: var(--bleu); border-color: var(--bleu); color: var(--ivoire); }
.cs-ligne-mel { background: var(--bronze-texte); border-color: var(--bronze-texte); color: var(--blanc); }
.cs-ligne-mel:hover { background: var(--bronze-fonce); border-color: var(--bronze-fonce); }
.cs-ligne-mel .cs-ligne-sous { color: rgba(255, 255, 255, .85); }
.cs-ligne-icone { width: 18px; height: 18px; }
.cs-ligne-texte { display: flex; flex-direction: column; min-width: 0; }
.cs-ligne-nom { font-weight: 700; font-size: var(--t-s); letter-spacing: .02em; }
.cs-ligne-sous { font-size: .74rem; font-weight: 400; color: var(--gris-texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-ligne.est-actif .cs-ligne-sous { color: rgba(243, 241, 232, .78); }
