/* L’Aventura : carte du carnet local. À charger APRÈS vendor/leaflet-1.9.4/leaflet.css.
   Le panneau suit les jetons de chaque univers (--sc-ink, --sc-canvas, --sc-accent). L’intérieur de la carte
   (fiches, mentions, repères) reste en encre sombre sur fond clair, quel que soit l’univers. */
.av-map { margin-top: var(--sc-6); min-width: 0; }
.av-map__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; min-height: 2.75rem; margin-bottom: var(--sc-3); }
.av-map__count { min-width: 0; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.av-map__tools { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; gap: 0.4rem; }
.av-map__tool--home { display: inline-flex; align-items: center; gap: 0.45rem; border-color: var(--sc-accent); }
.av-map__tool--home > span { font-size: inherit; }
.av-map__tool--home .av-home__g { width: 1.3rem; height: 1.3rem; color: var(--sc-accent); }
.av-map__tool--home[hidden], .av-map__homekey[hidden] { display: none; }
.av-map__tool { min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.6rem; border: 1.5px solid var(--av-chip-bd, var(--sc-hairline-strong)); border-radius: var(--av-r, var(--sc-r-pill)); background: transparent; color: inherit; font-weight: 600; font-size: var(--sc-t-sm); line-height: 1; cursor: pointer; }
.av-map__tool > span { font-size: 1.35rem; }
.av-map__tool--txt { padding-inline: 1rem; }
.av-map__tool[aria-disabled="true"] { opacity: 0.45; cursor: default; }

/* cadre : la carte et l’invitation occupent la même case, la hauteur ne bouge pas à l’ouverture */
.av-map__frame { position: relative; display: grid; border-radius: var(--av-r-field, var(--sc-r-sm)); }
.av-map__frame > * { grid-area: 1 / 1; min-width: 0; border-radius: inherit; }
.av-map__canvas { position: relative; z-index: 0; isolation: isolate; width: 100%; height: 400px; }
.av-map__canvas:focus-visible { outline: 3px solid var(--sc-accent); outline-offset: 3px; }
.av-map__gate { position: relative; z-index: 1; display: grid; align-content: center; justify-items: center; gap: var(--sc-4); min-height: 400px; padding: var(--sc-5) var(--sc-4); text-align: center; border: 1px solid var(--av-map-line, var(--sc-hairline-strong));
  background:
    linear-gradient(color-mix(in oklab, var(--sc-ink) 7%, transparent) 1px, transparent 1px) 0 0 / 100% 3.5rem,
    linear-gradient(90deg, color-mix(in oklab, var(--sc-ink) 7%, transparent) 1px, transparent 1px) 0 0 / 3.5rem 100%,
    color-mix(in oklab, var(--sc-ink) 5%, var(--sc-canvas)); }
.av-map__lede { max-width: 34ch; font-family: var(--sc-font-display); font-size: var(--sc-t-lg); line-height: 1.3; text-wrap: balance; }
.av-map__alert { max-width: 44ch; font-weight: 600; }
.av-map__gate [aria-disabled="true"] { opacity: 0.7; cursor: progress; }
.av-map__warn { margin-top: var(--sc-3); padding: 0.6rem 0.8rem; border: 1.5px solid currentColor; border-radius: var(--av-r-field, var(--sc-r-sm)); font-size: var(--sc-t-sm); font-weight: 600; }
.av-map__legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin-top: var(--sc-3); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.av-map__legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.av-map__legend .av-pin__g { width: 1.15rem; height: 1.15rem; }
.av-map__note { max-width: 70ch; margin-top: var(--sc-3); }
@media (max-width: 640px) {
  .av-map__canvas { height: 320px; }
  .av-map__gate { min-height: 320px; }
}

/* bouton « Voir sur la carte » des fiches : même registre que les liens d’action du carnet */
.av-mapbtn { display: inline-flex; align-items: center; min-height: 2.75rem; }
.av-mapbtn::before { content: ""; flex: none; width: 0.55em; height: 0.55em; margin-right: 0.5em; border: 2px solid currentColor; border-radius: 50% 50% 50% 0; rotate: -45deg; }

/* repères : une forme et une couleur par catégorie ; contour seul pour une zone indicative */
.av-pin { --pin: #5b6470; }
.av-pin--eat { --pin: #b4401c; }
.av-pin--shop { --pin: #2e7031; }
.av-pin--walk { --pin: #1565a8; }
.av-pin--visit { --pin: #6b3fa0; }
.av-pin--wine { --pin: #8f1d4d; }
.av-pin--key { --pin: currentColor; }
.av-pin__g { flex: none; overflow: visible; }
.av-pin__s { fill: var(--pin); stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; }
.av-pin__c { display: none; fill: var(--pin); }
.av-pin--area .av-pin__s { fill: #fff; stroke: var(--pin); stroke-width: 3; }
.av-pin--area .av-pin__c { display: block; }
.av-map .leaflet-marker-icon.av-pin { border: 0; background: none; }
.av-map .av-pin__b { position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.av-map .av-pin__b .av-pin__g { width: 30px; height: 30px; pointer-events: none; filter: drop-shadow(0 1px 1.5px rgba(8, 14, 12, 0.55)); transition: transform 140ms ease-out; }
.av-map .av-pin.is-open .av-pin__g { transform: scale(1.3); }
.av-map .av-pin__b:focus-visible { outline: 3px solid #10231f; outline-offset: -1px; border-radius: 50%; background: rgba(255, 255, 255, 0.8); }
.av-map .av-pin__n { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #10231f; color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 1.5px #fff; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .av-map .av-pin__b .av-pin__g { transition: none; } }

/* intérieur Leaflet : toujours clair et lisible, y compris dans les univers sombres */
.av-map .leaflet-container { background: #e7e3d8; color: #16211e; color-scheme: light; font-family: inherit; font-size: 0.875rem; line-height: 1.45; letter-spacing: 0; }
.av-map .leaflet-container a:focus-visible, .av-map .leaflet-container button:focus-visible { outline: 3px solid #10231f; outline-offset: 2px; border-radius: 3px; }
.av-map .leaflet-container .leaflet-control-attribution { padding: 1px 6px; background: rgba(255, 255, 255, 0.88); color: #16211e; font-size: 0.72rem; line-height: 1.5; }
.av-map .leaflet-control-attribution a { color: #0b4a63; text-decoration: underline; text-decoration-color: currentColor; }
.av-map .leaflet-popup-content-wrapper, .av-map .leaflet-popup-tip { background: #fbf8f1; color: #16211e; box-shadow: 0 3px 14px rgba(8, 14, 12, 0.4); }
.av-map .leaflet-popup-content-wrapper { padding: 0; border-radius: 8px; }
.av-map .leaflet-popup-content { margin: 0; padding: 14px 16px; font-size: 0.875rem; line-height: 1.45; }
.av-map .leaflet-container a.leaflet-popup-close-button { top: 0; right: 0; width: 44px; height: 44px; border-radius: 0 8px 0 8px; color: #16211e; font: 400 24px/44px system-ui, sans-serif; text-decoration: none; }
.av-map .av-pop { display: grid; gap: 0.35rem; }
.av-map .av-pop:focus-visible { outline: none; }
.av-map .av-pop p { margin: 0; }
.av-map .av-pop__cat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-right: 30px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #46524e; }
.av-map .av-pop__cat .av-pin__g { width: 0.95rem; height: 0.95rem; }
.av-map .av-pop__name { margin-right: 30px; font-family: var(--sc-font-display); font-size: 1.2rem; font-weight: 500; line-height: 1.2; }
.av-map .av-pop__town { font-size: 0.82rem; color: #46524e; }
.av-map .av-pop__scope { padding-top: 0.45rem; border-top: 1px solid rgba(22, 33, 30, 0.2); font-size: 0.82rem; }
.av-map .av-pop__act { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.av-map .av-pop__same { padding-top: 0.45rem; border-top: 1px solid rgba(22, 33, 30, 0.2); font-size: 0.82rem; }
.av-map .av-pop__same button { display: flex; }

/* la roulotte : repère or et ivoire, étiquette permanente, halo fixe (aucune animation) ; sa couche passe au-dessus des lieux */
.av-home__disc { flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 2px solid #fbf8f1; border-radius: 50%; background: #d9b45c; color: #10231f; box-shadow: 0 0 0 1.5px #10231f; }
.av-home__g { display: block; flex: none; width: 70%; height: 70%; fill: currentColor; }
.av-map__homekey { display: inline-flex; align-items: center; gap: 0.7rem; max-width: 100%; padding: 0.5rem 0.95rem 0.5rem 0.6rem; border: 1px solid var(--av-map-line, var(--sc-hairline-strong)); border-radius: var(--av-r-field, var(--sc-r-sm)); background: var(--sc-canvas); font-size: var(--sc-t-sm); line-height: 1.35; text-align: left; }
.av-map__homekey strong { display: block; font-family: var(--sc-font-display); font-size: 1.2em; font-weight: 600; line-height: 1.2; }
.av-map .leaflet-avhome-pane { z-index: 650; }
.av-map .leaflet-marker-icon.av-home { border: 0; background: none; }
.av-map .av-home__b { position: relative; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: #10231f; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.av-map .av-home__b .av-home__disc { width: 40px; height: 40px; border-width: 2.5px; box-shadow: 0 0 0 1.5px #10231f, 0 0 0 8px rgba(217, 180, 92, 0.45), 0 3px 10px 6px rgba(8, 14, 12, 0.3); }
.av-map .av-home.is-open .av-home__disc { box-shadow: 0 0 0 1.5px #10231f, 0 0 0 8px rgba(217, 180, 92, 0.8), 0 3px 10px 6px rgba(8, 14, 12, 0.3); }
.av-map .av-home__label { position: absolute; top: 100%; left: 50%; display: grid; justify-items: center; margin-top: 4px; padding: 3px 9px 4px; border: 1.5px solid #a57c1f; border-radius: 6px; background: #fbf8f1; color: #10231f; box-shadow: 0 1px 5px rgba(8, 14, 12, 0.45); font-size: 11px; font-weight: 600; line-height: 1.2; letter-spacing: 0; white-space: nowrap; transform: translateX(-50%); }
.av-map .av-home__label strong { font-size: 14px; font-weight: 700; line-height: 1.15; }
.av-map .leaflet-container .av-home__b:focus-visible { outline: 3px solid #10231f; outline-offset: 2px; border-radius: 50%; box-shadow: 0 0 0 8px #fbf8f1; }
.av-map .av-pop__cat .av-home__disc { width: 1.6rem; height: 1.6rem; border-width: 0; }

/* fond de carte accordé aux cinq univers : le filtre ne porte que sur le volet des tuiles, jamais sur les repères, les fiches
   ni la mention OpenStreetMap. Ivoire chaud (vitrail, mix-lumière), vert profond (kaléidoscope), bleu nuit (étoiles, mix-étoiles) ;
   en sombre, la clarté est inversée : routes plus sombres que le sol, noms de lieux clairs. Le fond du conteneur suit la teinte du sol. */
.l-guide .av-map { --av-map-line: var(--l-frame, var(--sc-hairline-strong)); }
.k-guide .av-map { --av-map-line: var(--k-frame, var(--sc-hairline-strong)); }
.av-map[data-map-state="ready"] .av-map__frame { box-shadow: 0 0 0 1px var(--av-map-line, var(--sc-hairline-strong)); }
.v-guide .av-map .leaflet-tile-pane, .l-guide .av-map .leaflet-tile-pane { filter: saturate(0.72) brightness(0.94) sepia(0.24); }
.v-guide .av-map .leaflet-container, .l-guide .av-map .leaflet-container { background: #f5ecda; }
.k-guide .av-map .leaflet-tile-pane { filter: invert(0.92) brightness(1.2) hue-rotate(70deg) sepia(0.8) hue-rotate(110deg) saturate(1.5); }
.k-guide .av-map .leaflet-container { background: #22352d; }
.e-guide .av-map .leaflet-tile-pane, .m-guide .av-map .leaflet-tile-pane { filter: invert(0.92) brightness(1.15) sepia(0.8) hue-rotate(180deg) saturate(2.6); }
.e-guide .av-map .leaflet-container, .m-guide .av-map .leaflet-container { background: #253044; }
.av-map .av-pop a, .av-map .av-pop button { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: #16211e; font: inherit; font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 0.22em; cursor: pointer; }
