/* ==========================================================================
   CARTES DU SITE — un seul cadre, un seul repère (Leaflet + tuiles raster)
   Chargé par partials/map-assets.ejs sur les pages qui affichent une carte.
   ========================================================================== */

.af-map {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: var(--af-canvas);
}

.af-map--sm { height: 260px; }
/* Fiche hôtel : carte compacte, la carte suit la hauteur du contenu */
.af-map--md { height: 180px; }
.af-map--lg { height: 400px; }

/* Carte de contact : occupe toute la colonne de la carte */
.af-map--contact {
  height: 100%;
  min-height: 300px;
  border: 0;
  border-radius: var(--af-radius) 0 0 var(--af-radius);
}

/* Carte dans une modale (résultats, fiche) : hauteur utile, pas de cadre */
.af-map--modal {
  height: 70vh;
  border: 0;
  border-radius: 0;
}

/* Legacy style.css déclare #map en spécificité ID : ces règles la
   surclassent pour que les hauteurs du cadre s'appliquent partout */
#map.af-map { height: 340px; }
#map.af-map--sm { height: 260px; }
#map.af-map--md { height: 180px; }
#map.af-map--lg { height: 400px; }

/* Carte dans la modale des résultats : elle remplit le corps de la modale
   (position absolue + inset 0 via #map.hm-map). Spécificité supérieure aux
   deux règles ci-dessus pour que « height: auto » gagne à tous les écrans. */
#map.hm-map.af-map { height: auto; }

/* --- Contrôles Leaflet alignés sur le thème ------------------------------- */

.af-map .leaflet-control-attribution {
  padding: 2px 7px;
  border-radius: 6px 0 0 0;
  background: rgb(255 255 255 / 84%);
  color: var(--af-muted);
  font-family: var(--af-font);
  font-size: 10.5px;
}

.af-map .leaflet-control-attribution a {
  color: var(--af-muted);
  text-decoration: none;
}

.af-map .leaflet-control-attribution a:hover {
  color: var(--af-red);
}

.af-map .leaflet-control-zoom {
  border: 0 !important;
  box-shadow: var(--af-shadow-sm) !important;
}

.af-map .leaflet-control-zoom a {
  width: 32px;
  height: 32px;
  border-radius: 0 !important;
  border-color: var(--af-line) !important;
  background: #fff;
  color: var(--af-ink);
  font-family: var(--af-font);
  font-size: 17px;
  font-weight: 500;
  line-height: 30px;
}

.af-map .leaflet-control-zoom a:first-child { border-radius: 8px 8px 0 0 !important; }
.af-map .leaflet-control-zoom a:last-child { border-radius: 0 0 8px 8px !important; }

.af-map .leaflet-control-zoom a:hover {
  background: var(--af-canvas);
  color: var(--af-red);
}

/* --- Repère --------------------------------------------------------------- */

.af-pin {
  display: block;
  color: var(--af-red);
  filter: drop-shadow(0 6px 10px rgb(16 24 40 / 24%));
  transition: transform var(--af-ease), color var(--af-ease);
}

.af-pin svg {
  display: block;
  width: 30px;
  height: 40px;
}

.af-pin svg path { fill: currentColor; }
.af-pin svg circle { fill: #fff; }

.af-pin.is-active,
.af-pin:hover {
  color: var(--af-red-hover);
  transform: translateY(-2px);
}

/* --- Bulle ---------------------------------------------------------------- */

.leaflet-popup.af-popup-wrap .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 12px;
  box-shadow: var(--af-shadow);
}

.leaflet-popup.af-popup-wrap .leaflet-popup-content {
  width: auto !important;
  margin: 0;
}

.leaflet-popup.af-popup-wrap .leaflet-popup-tip { box-shadow: var(--af-shadow-sm); }

.af-popup {
  min-width: 190px;
  max-width: 280px;
  padding: 12px 14px;
  font-family: var(--af-font);
}

.af-popup-name {
  color: var(--af-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.af-popup-addr {
  margin-top: 2px;
  color: var(--af-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.af-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
}

.af-popup-actions a {
  color: var(--af-red);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.af-popup-actions a:hover {
  color: var(--af-red-hover);
  text-decoration: underline;
}

@media (max-width: 767px) {
  .af-map { height: 260px; }
  #map.af-map { height: 260px; }
  #map.af-map--md { height: 220px; }
  .af-map--lg { height: 300px; }
  #map.af-map--lg { height: 300px; }
  .af-map--modal { height: 70vh; }

  .af-map--contact {
    height: 240px;
    border-radius: var(--af-radius) var(--af-radius) 0 0;
  }
}
