/* =========================================================
   Carte Île-de-France — carte-idf (14/09/2026)
   Préfixe de classes : cdc-carte-*. Reprend les variables du thème
   (--navy-*, --coral-*, --peri-500, --radius, --shadow, --line, --surface).
   ========================================================= */

.cdc-carte-layout{
  display:grid;
  grid-template-columns:560px 1fr;
  gap:28px;
  align-items:start;
}

.cdc-carte-map-wrap{
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px 20px 14px;
}

@media (min-width:901px){
  .cdc-carte-map-wrap{position:sticky;top:20px}
}

.cdc-carte-svg{
  display:block;
  width:100%;
  height:auto;
  overflow:visible;
}

/* Deux cartes empilées : l'encart zoom (Paris + petite couronne, agrandi,
   la vedette) au-dessus, la carte d'ensemble en vignette compacte dessous
   (contexte géographique complet, plus petite). Même ordre mobile/desktop
   ("l'encart d'abord, c'est là que sont les villes"), donc pas de reflow
   JS nécessaire entre les deux formats. */
.cdc-carte-maps{
  display:flex;
  flex-direction:column;
  gap:18px;
  align-items:center;
}
.cdc-carte-zoom-block{width:100%;min-width:0}
.cdc-carte-main-block{width:100%;min-width:0}
@media (min-width:901px){
  .cdc-carte-main-block{max-width:260px}
}
.cdc-carte-mini-titre{
  margin:0 0 8px;
  font-size:.78rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--navy-800);
  text-align:center;
}
.cdc-carte-svg-zoom{
  background:var(--blue-100);
  border-radius:12px;
}

/* Départements */
.cdc-carte-dept path{
  fill:var(--blue-100);
  stroke:var(--navy-700);
  stroke-width:1.4;
  transition:fill .2s ease,stroke .2s ease;
  cursor:pointer;
}
.cdc-carte-dept:hover path,
.cdc-carte-dept:focus path{
  fill:var(--coral-100);
  stroke:var(--coral-600);
  stroke-width:2;
}
.cdc-carte-dept:focus{
  outline:3px solid var(--coral-500);
  outline-offset:2px;
}
.cdc-carte-dept-label{
  font:700 12px var(--font);
  fill:var(--navy-900);
  text-anchor:middle;
  pointer-events:none;
  paint-order:stroke;
  stroke:#fff;
  stroke-width:4px;
  stroke-linejoin:round;
}

/* Départements de CONTEXTE (grande couronne) dans l'encart zoom : juste le
   décor géographique, non cliquables, en retrait visuel derrière les 4
   départements principaux (dessinés après, donc par-dessus). */
.cdc-carte-dept-contexte{
  fill:#e9f0f7;
  stroke:#a9bccf;
  stroke-width:1.2;
  pointer-events:none;
}
.cdc-carte-dept-label--contexte{
  font:700 10.5px var(--font);
  fill:var(--ink-soft);
  stroke-width:3.5px;
}

/* Communes */
.cdc-carte-hit{
  fill:transparent;
  pointer-events:all;
}
.cdc-carte-point{
  fill:var(--coral-500);
  stroke:#fff;
  stroke-width:1.5;
  transform-box:fill-box;
  transform-origin:center;
  transition:transform .15s ease,fill .15s ease;
  pointer-events:none;
}
.cdc-carte-commune{cursor:pointer}
.cdc-carte-commune:hover .cdc-carte-point,
.cdc-carte-commune:focus .cdc-carte-point,
.cdc-carte-commune:focus-within .cdc-carte-point,
.cdc-carte-commune.cdc-carte-open .cdc-carte-point{
  fill:var(--coral-600);
  transform:scale(1.7);
}
.cdc-carte-commune:focus .cdc-carte-hit,
.cdc-carte-commune:focus-within .cdc-carte-hit,
.cdc-carte-commune.cdc-carte-open .cdc-carte-hit{
  fill:rgba(250,127,111,.16);
  stroke:var(--coral-500);
  stroke-width:2;
}
.cdc-carte-commune:focus{outline:none}

/* Bulle (foreignObject) */
.cdc-carte-bulle{
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease;
  overflow:visible;
}
.cdc-carte-bulle-in,
.cdc-carte-bulle-in *{
  /* pointer-events ne traverse pas toujours proprement la frontière SVG/HTML
     d'un foreignObject selon les moteurs : on le fixe explicitement ici
     plutôt que de compter sur l'héritage depuis le <foreignObject>. */
  pointer-events:none;
}
.cdc-carte-commune:hover .cdc-carte-bulle,
.cdc-carte-commune:focus .cdc-carte-bulle,
.cdc-carte-commune:focus-within .cdc-carte-bulle,
.cdc-carte-commune.cdc-carte-open .cdc-carte-bulle{
  opacity:1;
  pointer-events:auto;
}
.cdc-carte-commune:hover .cdc-carte-bulle-in,
.cdc-carte-commune:hover .cdc-carte-bulle-in *,
.cdc-carte-commune:focus .cdc-carte-bulle-in,
.cdc-carte-commune:focus .cdc-carte-bulle-in *,
.cdc-carte-commune:focus-within .cdc-carte-bulle-in,
.cdc-carte-commune:focus-within .cdc-carte-bulle-in *,
.cdc-carte-commune.cdc-carte-open .cdc-carte-bulle-in,
.cdc-carte-commune.cdc-carte-open .cdc-carte-bulle-in *{
  pointer-events:auto;
}
.cdc-carte-bulle-in{
  font-family:var(--font);
  background:var(--navy-950);
  color:#fff;
  border-radius:10px;
  padding:9px 11px;
  box-shadow:0 14px 30px -12px rgba(5,22,39,.55);
  font-size:13px;
  line-height:1.35;
  box-sizing:border-box;
  width:100%;
  height:100%;
}
.cdc-carte-bulle-in strong{
  display:block;
  color:#fff;
  font-size:13px;
  margin-bottom:5px;
}
.cdc-carte-bulle-liens{display:flex;gap:6px;flex-wrap:wrap}
.cdc-carte-bulle-liens a{
  display:inline-block;
  background:var(--coral-500);
  color:#fff;
  text-decoration:none;
  font-weight:700;
  font-size:11.5px;
  padding:4px 9px;
  border-radius:999px;
  white-space:nowrap;
}
.cdc-carte-bulle-liens a:hover,
.cdc-carte-bulle-liens a:focus{background:var(--coral-600)}

.cdc-carte-legende{
  margin:12px 2px 0;
  font-size:.8rem;
  color:var(--ink-soft);
  min-height:1.2em;
}

/* Liste HTML crawlable (secours mobile + accordéon) */
.cdc-carte-liste{display:flex;flex-direction:column;gap:12px}
.cdc-carte-liste--renvoi{
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:26px 24px;
  text-align:center;
}
.cdc-carte-liste--renvoi p{color:var(--ink-soft);margin-bottom:16px}

.cdc-carte-dept-acc{
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:0 18px 36px -26px rgba(10,37,64,.4),0 2px 6px rgba(10,37,64,.06);
  overflow:hidden;
}
.cdc-carte-dept-acc summary{
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  list-style:none;
  padding:14px 18px;
  font-weight:800;
  font-size:.94rem;
  color:var(--ink);
}
.cdc-carte-dept-acc summary::-webkit-details-marker{display:none}
.cdc-carte-dept-acc summary::after{
  content:"–";
  margin-left:auto;
  color:var(--coral-500);
  font-weight:800;
  font-size:1.1rem;
}
.cdc-carte-dept-acc:not([open]) summary::after{content:"+"}
.cdc-carte-dept-num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--navy-950);
  color:#fff;
  font-size:.7rem;
  font-weight:800;
  padding:4px 9px;
  border-radius:999px;
  flex:none;
}
.cdc-carte-villes-liste{list-style:none;margin:0;padding:0 18px 14px}
.cdc-carte-villes-liste li{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:9px 0;
  border-top:1px solid var(--line);
}
.cdc-carte-villes-liste li:first-child{border-top:0}
.cdc-carte-ville-nom{font-weight:700;font-size:.9rem;color:var(--ink)}
.cdc-carte-ville-liens{display:flex;gap:8px;flex-wrap:wrap}
.cdc-carte-ville-liens a{
  font-size:.82rem;
  font-weight:700;
  color:var(--navy-800);
  text-decoration:none;
  border-bottom:2px solid var(--blue-100);
}
.cdc-carte-ville-liens a:hover,
.cdc-carte-ville-liens a:focus{
  color:var(--coral-600);
  border-color:var(--coral-500);
}

.cdc-carte-cta{text-align:center;margin-top:34px}

@media (max-width:900px){
  .cdc-carte-layout{grid-template-columns:1fr}
  .cdc-carte-map-wrap{padding:16px 14px 10px}
}

@media (max-width:480px){
  .cdc-carte-bulle-in{padding:7px 9px;font-size:12px}
  .cdc-carte-bulle-in strong{font-size:12px}
  .cdc-carte-bulle-liens a{font-size:11px;padding:3px 8px}
  .cdc-carte-dept-acc summary{padding:12px 14px;font-size:.88rem}
  .cdc-carte-villes-liste{padding:0 14px 12px}
}
