/* ---------------------------------------------------------------------------
 * assets/css/pmac-carte.css
 *
 * La page Carte & Itinéraires reprend entièrement la mise en page du fil
 * Découvrir : pmac-reel.css est donc chargé avant celui-ci, qui se contente
 * d'habiller ce qui change — la carte à la place de la photo.
 * ------------------------------------------------------------------------ */

/* La carte occupe tout le cadre, comme le ferait une photo. */
.pmac-carte-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0b1a2e;
}

/* Leaflet pose ses propres couleurs : on les ramène à celles du fil. */
.pmac-carte-map .leaflet-control-zoom a {
  background: rgba(4, 17, 36, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.pmac-carte-map .leaflet-control-zoom a:hover {
  background: rgba(4, 17, 36, 0.95);
}

.pmac-carte-map .leaflet-control-zoom {
  margin-right: 12px;
  margin-bottom: 128px;
  border: 0;
}

.pmac-carte-map .leaflet-tooltip {
  background: rgba(4, 17, 36, 0.92);
  border: 0;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.pmac-carte-map .leaflet-tooltip-top::before {
  border-top-color: rgba(4, 17, 36, 0.92);
}

/* Le bouton qui rend la carte manœuvrable. */
.pmac-carte-explorer {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.pmac-carte-explorer[aria-pressed="true"] {
  background: var(--reel-yellow);
  border-color: var(--reel-yellow);
  color: #041124;
}

body.pmac-reel-page .pmac-carte-explorer > i {
  width: auto;
  min-width: 0;
}

/* Le niveau de sécurité du lieu, dans le coin opposé. */
.pmac-carte-securite {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}

body.pmac-reel-page .pmac-carte-securite > i {
  width: auto;
  min-width: 0;
  color: var(--carte-couleur, #ffb000);
}

/* Pendant l'exploration d'une carte, le fil ne doit pas coulisser sous le
   doigt : c'est la carte que l'on manœuvre, pas la page. */
.pmac-reel-viewport.is-fige {
  overflow-y: hidden;
  scroll-snap-type: none;
}

/* Le voile du bas assombrit la carte pour que le texte reste lisible, mais
   sans avaler les repères du haut. */
.pmac-carte-media .pmac-reel-shade {
  z-index: 2;
}

.pmac-carte-media .pmac-reel-info {
  z-index: 3;
}

/* Le raccourci des itinéraires vit dans la colonne des vues : il doit s'y
   fondre, alors que c'est un bouton et non un lien. */
body.pmac-carte-page button.pmac-reel-side__link {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

/* --- Les itinéraires entre villes, dans leur propre panneau --- */

.pmac-carte-routes {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pmac-carte-routes[hidden] {
  display: none;
}

.pmac-carte-routes__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 10, 22, 0.66);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.pmac-carte-routes.is-open .pmac-carte-routes__backdrop {
  opacity: 1;
}

.pmac-carte-routes__panel {
  position: relative;
  width: min(620px, 100%);
  max-height: 82dvh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 22px 22px 0 0;
  background: #0b1a2e;
  color: #fff;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.26s ease;
}

.pmac-carte-routes.is-open .pmac-carte-routes__panel {
  transform: translateY(0);
  opacity: 1;
}

.pmac-carte-routes__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.pmac-carte-routes__head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.pmac-carte-routes__head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
}

.pmac-carte-routes__head button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.pmac-carte-route {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pmac-carte-route__villes {
  flex: 1 1 200px;
  font-size: 14px;
  font-weight: 700;
}

body.pmac-reel-page .pmac-carte-route__villes > i {
  width: auto;
  min-width: 0;
  color: var(--reel-yellow);
}

.pmac-carte-route__duree {
  font-size: 13px;
  font-weight: 700;
  color: var(--reel-yellow);
}

.pmac-carte-route__note {
  flex: 1 1 100%;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
}

@media (min-width: 901px) {
  .pmac-carte-routes {
    align-items: center;
  }

  .pmac-carte-routes__panel {
    border-radius: 22px;
  }
}

/* Sur téléphone, le bandeau des onglets flotte au-dessus de la carte : les
   repères du haut se rangent juste en dessous pour ne pas le heurter. */
@media (max-width: 900px) {
  .pmac-carte-explorer,
  .pmac-carte-securite {
    top: 54px;
  }
}

@media (max-width: 480px) {
  .pmac-carte-explorer,
  .pmac-carte-securite {
    top: 50px;
  }

  /* Les deux repères ne tiennent pas côte à côte : le libellé de sécurité
     se réduit à sa pastille de couleur. */
  .pmac-carte-securite {
    font-size: 0;
    gap: 0;
    padding: 8px;
  }

  body.pmac-reel-page .pmac-carte-securite > i {
    font-size: 13px;
  }
}
