/* ==========================================================================
   Carte « zone d'intervention » (contact.html#zone)
   - Carte SVG dessinée dans la page : aucune carte externe, aucun traceur.
   - Couleurs uniquement via les variables (--green, --sage, --rose…) :
     fonctionne en palette verte et en palette bleue (palette-bleue.css).
   - Noms de communes en HTML par-dessus le SVG : taille fixe en px,
     lisible même quand la carte rétrécit (≥ 14 px à 390 px).
   - Animations : seulement après .is-in (main.js) ; rien en mouvement réduit.
   ========================================================================== */

.cz-section { background:
  radial-gradient(55% 60% at 90% 20%, color-mix(in srgb, var(--sage-soft) 70%, transparent), transparent 70%),
  var(--ivory); overflow: hidden; }

.cz-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.45fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.cz-text h2 { margin-bottom: .45em; }
.cz-lead { font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.6; color: var(--ink); margin: 0 0 .9em; }
.cz-lead strong { color: var(--green); }
.cz-ask { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 1.6em; padding: 14px 18px; border-radius: var(--radius-s); background: rgba(255,255,255,.7); border: 1px solid rgba(31,74,60,.1); }
.cz-text .btn-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.cz-phone { font-weight: 700; font-size: 1.15rem; color: var(--green); text-decoration: none; border-bottom: 2px solid var(--rose); padding-bottom: 2px; }
.cz-phone:hover { color: var(--rose-ink); }

/* ---------- La carte ---------- */
.cz-fig { margin: 0; min-width: 0; }
.js .cz-fig.reveal { opacity: 1; transform: none; } /* le bloc reste en place : ce sont ses éléments qui s'animent */
.cz-card { background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow-soft); padding: clamp(10px, 1.6vw, 18px); border: 1px solid color-mix(in srgb, var(--green) 10%, transparent); }
.cz-map { position: relative; aspect-ratio: 1000 / 731; border-radius: calc(var(--radius-l) - 12px); overflow: hidden; background: color-mix(in srgb, var(--cream) 45%, var(--white)); }
.cz-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.cz-grid-dot { fill: var(--sage); opacity: .28; }
.cz-stop-a { stop-color: var(--rose-soft); stop-opacity: .95; }
.cz-stop-b { stop-color: var(--sage); stop-opacity: .32; }
.cz-zone-fill { transform-box: view-box; transform-origin: 48.1% 49%; }
.cz-zone-line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linejoin: round; opacity: .85; }
.cz-river { fill: none; stroke: var(--sage); stroke-width: 9; stroke-linecap: round; opacity: .75; }
.cz-road-halo { fill: none; stroke: var(--white); stroke-width: 9; stroke-linecap: round; opacity: .9; }
.cz-road { fill: none; stroke: var(--rose); stroke-width: 4; stroke-linecap: round; opacity: .9; }
.cz-dot { fill: var(--white); stroke: var(--green); stroke-width: 3.5; }
.cz-dot--city { fill: var(--green); stroke: var(--white); stroke-width: 3; }
.cz-home-dot { fill: var(--green); stroke: var(--white); stroke-width: 4; }
.cz-pulse { fill: none; stroke: var(--rose); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.cz-scale path { fill: none; stroke: var(--ink-soft); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }

/* ---------- Noms des communes ---------- */
.cz-labels { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.cz-l { position: absolute; left: var(--x); top: var(--y); margin: 0; }
.cz-l span { display: block; white-space: nowrap; font-family: var(--font-body); font-size: 14px; line-height: 1.15; font-weight: 600; color: var(--ink);
  text-shadow: 0 0 2px var(--white), 0 0 4px var(--white), 0 0 6px var(--white), 0 0 8px var(--white); }
.cz-l--left span  { transform: translate(calc(-100% - 11px), -50%); }
.cz-l--right span { transform: translate(11px, -50%); }
.cz-l--above span { transform: translate(-50%, calc(-100% - 9px)); }
.cz-l--below span { transform: translate(-50%, 9px); }
.cz-l--home span { font-size: 17px; font-weight: 700; color: var(--green); letter-spacing: .01em; }
.cz-l--left.cz-l--home span { transform: translate(calc(-100% - 15px), -50%); }
.cz-l--city span { font-size: 16px; font-weight: 700; color: var(--green); }
.cz-l--above.cz-l--city span { transform: translate(-50%, calc(-100% - 12px)); }

.cz-tag { position: absolute; font-family: var(--font-body); font-size: 13px; line-height: 1; pointer-events: none; }
.cz-tag--river { left: 81%; top: 74%; font-family: var(--font-display); font-style: italic; font-size: 17px; font-weight: 600; color: var(--sage-ink); transform: rotate(-52deg); transform-origin: left center;
  text-shadow: 0 0 3px var(--white), 0 0 6px var(--white); }
.cz-tag--road { left: 11%; top: 51.5%; padding: 3px 7px; border-radius: 6px; background: var(--white); color: var(--rose-ink); font-weight: 700; border: 1.5px solid var(--rose); }
.cz-tag--scale { left: 4%; bottom: 7.5%; color: var(--ink-soft); font-weight: 600; }
.cz-north { position: absolute; right: 3.5%; top: 4.5%; display: grid; justify-items: center; gap: 1px; font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--ink-soft); line-height: 1; }
.cz-north svg { width: 20px; height: 20px; }

/* ---------- Légende ---------- */
.cz-legend { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; padding-inline: 6px; font-size: 1.02rem; color: var(--ink-soft); }
.cz-key { display: inline-flex; align-items: center; gap: 10px; }
.cz-key i { flex: none; display: inline-block; }
.cz-key-zone { width: 30px; height: 20px; border-radius: 10px; border: 2.5px solid var(--green);
  background: radial-gradient(circle at 50% 50%, var(--rose-soft), color-mix(in srgb, var(--sage) 40%, var(--white))); }
.cz-key-home { width: 16px; height: 16px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--white), 0 0 0 5.5px var(--rose); margin-inline: 4px; }
.cz-see { font-weight: 700; white-space: nowrap; }

/* ---------- Animations (uniquement avec JS, déclenchées par .is-in) ---------- */
.js .cz-zone-line, .js .cz-river, .js .cz-road { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .cz-zone-line { transition: stroke-dashoffset 2.2s var(--ease-out) .25s; }
.js .cz-river { transition: stroke-dashoffset 2.4s var(--ease-out) .1s; }
.js .cz-road { transition: stroke-dashoffset 1.8s var(--ease-out) .5s; }
.js .cz-zone-fill { opacity: 0; transform: scale(.55); transition: opacity 1.4s var(--ease) .5s, transform 1.8s var(--ease-out) .5s; }
.js .cz-dot { opacity: 0; transition: opacity .6s var(--ease); transition-delay: calc(.8s + var(--i, 0) * 110ms); }
.js .cz-home, .js .cz-tag, .js .cz-north { opacity: 0; transition: opacity .8s var(--ease) .2s; }
.js .cz-tag, .js .cz-north { transition-delay: 1.6s; }
.js .cz-labels > .reveal { transition-delay: calc(.8s + var(--i, 0) * 110ms); }

.js .cz-fig.is-in .cz-zone-line, .js .cz-fig.is-in .cz-river, .js .cz-fig.is-in .cz-road { stroke-dashoffset: 0; }
.js .cz-fig.is-in .cz-zone-fill { opacity: 1; transform: none; }
.js .cz-fig.is-in .cz-dot, .js .cz-fig.is-in .cz-home, .js .cz-fig.is-in .cz-tag, .js .cz-fig.is-in .cz-north { opacity: 1; }
.cz-fig.is-in .cz-pulse { animation: cz-pulse 3.2s var(--ease) 1.4s infinite; }
.cz-fig.is-in .cz-pulse--2 { animation-delay: 3s; }
@keyframes cz-pulse {
  0%   { opacity: .75; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(3.2); }
  100% { opacity: 0;   transform: scale(3.2); }
}

/* Mouvement réduit : tout est affiché tout de suite, rien ne pulse */
.reduced .cz-zone-line, .reduced .cz-river, .reduced .cz-road { stroke-dashoffset: 0 !important; transition: none !important; }
.reduced .cz-zone-fill, .reduced .cz-dot, .reduced .cz-home, .reduced .cz-tag, .reduced .cz-north { opacity: 1 !important; transform: none !important; transition: none !important; }
.reduced .cz-pulse { animation: none !important; opacity: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  .js .cz-zone-line, .js .cz-river, .js .cz-road { stroke-dashoffset: 0 !important; }
  .js .cz-zone-fill, .js .cz-dot, .js .cz-home, .js .cz-tag, .js .cz-north { opacity: 1 !important; transform: none !important; }
  .cz-pulse { animation: none !important; opacity: 0 !important; }
}

/* ---------- Écrans moyens et petits ---------- */
@media (min-width: 1200px) {
  .cz-l span { font-size: 15px; }
  .cz-l--home span { font-size: 19px; }
  .cz-l--city span { font-size: 18px; }
}
@media (max-width: 960px) {
  .cz-grid { grid-template-columns: 1fr; }
  .cz-text { max-width: 640px; }
}
@media (max-width: 600px) {
  .cz-card { margin-inline: calc(10px - var(--gutter)); padding: 6px; border-radius: var(--radius-m); }
  .cz-map { border-radius: calc(var(--radius-m) - 6px); }
  .cz-l span { font-size: 13.5px; }
  .cz-l--home span { font-size: 16px; }
  .cz-l--city span { font-size: 15px; }
  .cz-tag--river { font-size: 15px; }
  .cz-north svg { width: 16px; height: 16px; }
  .cz-legend { font-size: .98rem; }
}
