/* The French Keys — V24 — SIXTE 30 session 3 : carte des marchés de /marche/ (SPEC-TFK-CARTE-IRIS93, règles IRIS 94,
   IRIS 94b F1/F2). Fichier construit par carte_v24/build_carte.py. Variables et police : charte.css. Tout est préfixé
   cm- ou limité à #carte et .ph--carte, pour ne rien changer ailleurs. */

/* En-tête de page resserré (IRIS 94 e : à 390 px, la carte commence à 330 px du haut au plus ; inchangé en s3). */
.ph--carte{padding-top:12px;padding-bottom:12px}
.ph--carte .ph-text{padding-top:0}
.ph--carte .crumb{margin-bottom:2px}
.ph--carte .h1{margin-bottom:8px}
.ph--carte .lede{margin-bottom:0}
/* IRIS 94b F2 : à partir de 900 px, haut de page compacté ; carte.js place le chapô en tête de la colonne droite, au-dessus
   de la fiche (exemple cité par IRIS). Sans script, le chapô reste sous le H1. Le haut de page mobile ne change pas. */
@media (min-width:900px){
  .ph--carte{padding-top:20px;padding-bottom:16px}
  .ph--carte .h1{margin-bottom:8px}
  .cm-pan .lede{max-width:none;margin:0 0 16px;font-size:17px;line-height:1.5}
}

#carte{padding:0 16px 56px;overflow-anchor:none}
#carte [hidden]{display:none!important}
@media (min-width:900px){#carte{padding:0 var(--pad) 88px}}
.cm-fr{display:grid;gap:20px;max-width:1216px}
@media (min-width:900px){.cm-fr{grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:20px;align-items:start}.cm-js .cm-pan{position:sticky;top:calc(var(--hdr) + 16px)}}

/* Figure : fil d'Ariane (hors SVG), carte, légende des pastilles, couverture et crédit */
.cm-fig{margin:0}
.cm-fil{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;min-height:28px;margin:0 0 8px}
.cm-fil.in{min-height:44px}
@media (min-width:900px){.cm-fil{min-height:44px}}
.cm-fil button{min-height:44px;padding:0 14px;border:1px solid var(--green);border-radius:999px;background:var(--card);color:var(--green);font:500 15px/1 var(--sans);cursor:pointer}
.cm-fil button:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.cm-fil span{font:500 15px/1.35 var(--sans);color:var(--ink-2)}
.cm-fil.in span{font-weight:600;color:var(--ink)}
.cm-svgw{container-type:inline-size;border:1px solid var(--rule);border-radius:6px;overflow:hidden;background:var(--paper)}
/* IRIS 94b F2 (remplace IRIS 94 e à partir de 900 px) : bas du cadre ≤ bas de fenêtre − 16 px. carte.js mesure le haut
   du cadre et fixe la largeur ; sans script (chapô sous le H1), repli : haut du cadre estimé à 320 px (ESTIMATE,
   carte_v24/tools/s3_layout.py), + 16 px + filet. */
@media (min-width:900px){.cm-svgw{max-width:calc((100vh - 338px) * 1.0707)}}
@supports (height:1svh){@media (min-width:900px){.cm-svgw{max-width:calc((100svh - 338px) * 1.0707)}}}
.cm-lg{margin:10px 0 0;padding-left:22px;font-size:14px;line-height:1.45;color:var(--ink-2)}
.cm-fig figcaption{margin-top:10px}
.cm-cov{display:block;font-size:14px;line-height:1.45;color:var(--ink-2)}
.cm-cred{display:block;margin-top:4px;font-size:12px;line-height:1.4;color:var(--ink-3)}
.cm-cred a{color:inherit;text-underline-offset:2px}

/* Carte */
#cm-map{display:block;width:100%;height:auto;max-width:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#cm-map .sea{fill:var(--sea);fill-opacity:.12}
#cm-map .ctx path{fill:var(--stone);stroke:var(--paper);stroke-width:.6px;vector-effect:non-scaling-stroke}
#cm-map .com path,#cm-map .mtp path{fill:var(--green);stroke:var(--paper);vector-effect:non-scaling-stroke;cursor:pointer;transition:fill-opacity .2s ease}
#cm-map .com path{stroke-width:.6px}
#cm-map .mtp path{stroke-width:.4px}
/* IRIS 94 a : 4 tons par coloration d'adjacence ; Montpellier le plus sombre (≥ 0,08 au-dessus du 4e). */
#cm-map .com .s0{fill-opacity:.10}#cm-map .com .s1{fill-opacity:.17}#cm-map .com .s2{fill-opacity:.24}#cm-map .com .s3{fill-opacity:.31}
#cm-map .mtp .q0{fill-opacity:.48}#cm-map .mtp .q1{fill-opacity:.40}
#cm-map .bord path{fill:none;stroke:var(--paper);stroke-width:1.6px;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;pointer-events:none}
#cm-map .out path{display:none;fill:none;stroke:var(--green);stroke-width:1.6px;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;pointer-events:none}
#cm-map .out path.on{display:inline}
/* Vue de quartier : tons de l'aperçu IRIS 90 (acceptés par IRIS 94). */
#cm-map.cm-vq .com path{fill-opacity:.06}
#cm-map.cm-vq .mtp path{fill-opacity:.14}
/* IRIS 94 a : vue de secteur, hors secteur = papier 55 % uni, filet vert 1,6 px autour du secteur. */
#cm-map.cm-vs .ctx path,#cm-map.cm-vs .mtp path,#cm-map.cm-vs .com path:not(.in){fill:var(--paper);fill-opacity:.55;stroke:var(--paper)}
#cm-map g path.in{fill-opacity:.16;stroke:var(--card);stroke-width:1.5px}
#cm-map g path.in.alt{fill-opacity:.26}
/* IRIS 94 : sélection = fond glow + contour vert 2,5 px (tracé au-dessus des frontières). */
#cm-map g path.sel{fill:var(--glow);fill-opacity:1}
#cm-map .cm-hl{fill:none;stroke:var(--green);stroke-width:2.5px;stroke-linejoin:round;vector-effect:non-scaling-stroke;pointer-events:none}
@media (hover:hover){#cm-map g path.in:hover{fill:var(--glow);fill-opacity:.7}}
#cm-map .deco{display:none}
#cm-map[data-v="T"] .deco,#cm-map[data-v="s-pic"] .deco,#cm-map[data-v="s-nord"] .deco{display:inline}
#cm-map .deco path{fill:none;stroke:var(--ink-3);stroke-width:1.4px;stroke-linejoin:round;vector-effect:non-scaling-stroke}
/* Taille optique figée à 14 : les étiquettes ont été mesurées ainsi au build (rapport_build.md § 5). Session 4 (IRIS 95) :
   classes de vue cm-v0 / cm-vq / cm-vs, car « .lv-s text » de v16b.css imposait 15 px et l'italique ; romain explicite. */
#cm-map .lab text{text-anchor:middle;dominant-baseline:central;font-family:var(--sans);font-style:normal;font-weight:600;font-variation-settings:"opsz" 14;fill:var(--ink);stroke:var(--paper);paint-order:stroke;stroke-linejoin:round;pointer-events:none}
#cm-map .lab .l0{fill:var(--green);font-weight:700}
#cm-map .lab .gh{fill:var(--ink-3)}
#cm-map .lab .pic,#cm-map .lab .mer{font-style:italic;font-weight:500;fill:var(--ink-2)}
#cm-map .lab .ld{fill:none;stroke:var(--ink-3);stroke-width:1px;vector-effect:non-scaling-stroke}
#cm-map .lab .ldp{fill:var(--ink-3);stroke:none}
#cm-map .nb circle{fill:var(--green);stroke:var(--paper);stroke-width:1.5px;vector-effect:non-scaling-stroke}
#cm-map .nb text{fill:var(--paper);stroke:none;font-weight:700}
/* Sans JavaScript : étiquettes statiques du territoire, jeu choisi par la largeur de la carte. */
#cm-map .lab0{display:none}
#cm-map .lab0.j-S{display:inline}
@container (min-width:500px){#cm-map .lab0.j-S{display:none}#cm-map .lab0.j-M{display:inline}}
@container (min-width:660px){#cm-map .lab0.j-M{display:none}#cm-map .lab0.j-L{display:inline}}

/* Panneau : listes des zones (HTML réel), puis carte de sélection */
.cm-g h3{margin:0 0 6px;font:500 22px/1.2 var(--sans);letter-spacing:-.01em}
.cm-g h3:focus{outline:none}
.cm-g+.cm-g{margin-top:28px}
.cm-pp{margin:0 0 12px;color:var(--ink-2)}
.cm-pk{margin:16px 0 8px;font:600 13px/1.3 var(--sans);letter-spacing:.08em;text-transform:uppercase;color:var(--green)}
.cm-chips{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0 0 14px;padding:0}
.cm-chip{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border:1px solid var(--rule);border-radius:999px;background:var(--card);color:var(--ink);font:500 15px/1.2 var(--sans);text-decoration:none;cursor:pointer}
.cm-chip[aria-pressed="true"]{background:var(--green);border-color:var(--green);color:var(--paper)}
.cm-chip:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.cm-alt{margin:6px 0 0;font-size:15px}
.cm-alt a{color:var(--green);font-weight:600;text-underline-offset:3px}

/* Fiche de sélection (spec § 4, IRIS 94, IRIS 94b F1). À partir de 900 px : en tête du panneau (carte.js l'y place),
   dans la colonne collante, à côté de la carte quel que soit le nombre de puces. */
.cm-sel{margin:0 0 20px;padding:16px;background:var(--card);border:1px solid var(--rule);border-left:4px solid var(--glow);border-radius:6px}
.cm-sel-k{margin:0;font:600 13px/1.3 var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--green)}
.cm-sel-t{margin:2px 0 6px;font:500 20px/1.25 var(--sans)}
.cm-sel-s{margin:0 0 12px;font-size:15px;line-height:1.45;color:var(--ink-2)}
.cm-go{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 22px;border-radius:999px;background:var(--green);color:var(--paper);font:600 16px/1.2 var(--sans);text-decoration:none}
@media (hover:hover){.cm-go:hover{background:var(--green-2)}}
.cm-go:focus-visible{outline:2px solid var(--green);outline-offset:3px}
/* Sous 900 px (F1) : fiche fixée en bas de fenêtre dès la sélection, sans défilement ; la page remonte au besoin pour
   qu'elle ne couvre ni la zone choisie ni le bas de la carte (carte.js) ; réserve en bas de section de sa hauteur. */
@media (max-width:899px){
  .cm-sel{margin:0;border-radius:0;border-width:3px 0 0;border-color:var(--glow) transparent transparent;
          padding:12px 16px calc(12px + env(safe-area-inset-bottom));box-shadow:0 -6px 16px rgba(28,27,24,.08)}
  .cm-js .cm-sel{position:fixed;left:0;right:0;bottom:0;z-index:8}
  .cm-js .cm-sel.cm-off,.menu-open .cm-sel{display:none}
  #carte.cm-on{padding-bottom:calc(var(--cm-selh, 200px) + 16px)}
  .cm-sel-t{font-size:18px}.cm-sel-s{font-size:14px;margin-bottom:10px}
  .cm-go{display:flex;width:100%}
}
/* IRIS 94b F1 : fenêtre de moins de 700 px de haut, la fiche ne garde que le nom et le bouton (≈ 96 px). */
@media (max-height:699px){.cm-sel-k,.cm-sel-s{display:none}.cm-sel-t{margin:0 0 4px}}
@media (max-width:899px) and (max-height:699px){.cm-sel{padding-top:10px;padding-bottom:calc(10px + env(safe-area-inset-bottom))}}
/* Apparition : 160 ms (≤ 200 ms, F1) ; aucune animation en mouvement réduit. */
@media (prefers-reduced-motion:no-preference){.cm-sel:not([hidden]){animation:cmSelIn .16s ease-out}@keyframes cmSelIn{from{opacity:0;transform:translateY(6px)}}}
@media (prefers-reduced-motion:reduce){#cm-map .com path,#cm-map .mtp path{transition:none}.cm-sel{animation:none}}

/* ?debug=1 */
.cm-dbg{margin:16px 0 0;padding:10px 12px;border-radius:4px;background:var(--ink);color:var(--paper);font:400 13px/1.5 ui-monospace,Menlo,monospace}
