/* Habillage Leaflet commun à la carte principale, à la mini-carte et à la fiche mémo. */

/* Hors de l'emprise swisstopo il n'y a pas de tuile : ce fond clair, proche du papier de la carte, fait le cadre. */
.leaflet-container {
  background: #f1f3ee;
  font: inherit;
  color: var(--encre);
}
.leaflet-container a {
  color: var(--bleu);
}
.leaflet-container :focus-visible {
  outline: 3px solid var(--bleu);
  outline-offset: 2px;
}

.leaflet-control-attribution {
  padding: 2px 8px !important;
  border-radius: 8px 0 0 0;
  background: rgb(255 255 255 / 0.88) !important;
  color: var(--encre);
  font: 400 11px / 1.5 var(--f-texte);
}
.leaflet-control-attribution a {
  color: var(--encre);
}

/* Marqueurs */
.vf-pin,
.vf-poi,
.vf-cluster {
  background: none;
  border: 0;
}
.vf-pin svg {
  display: block;
  overflow: visible;
  transform-origin: 47% 92%;
  transition: transform 160ms var(--ease);
}
.vf-pin:hover svg,
.vf-pin.is-hot svg,
.vf-pin:focus-visible svg {
  transform: scale(1.3);
  filter: drop-shadow(0 0 0.5px var(--jaune)) drop-shadow(0 0 3px var(--jaune)) drop-shadow(0 0 3px var(--jaune));
}
.vf-pin:focus-visible,
.vf-cluster:focus-visible {
  outline: none;
}
.vf-pin:focus-visible svg {
  outline: 3px solid var(--bleu);
  outline-offset: 3px;
  border-radius: 8px;
}

.vf-cluster svg {
  display: block;
  border-radius: 50%;
  box-shadow: 0 3px 0 var(--encre);
  transition: transform 160ms var(--ease);
}
.vf-cluster:hover svg,
.vf-cluster.is-hot svg,
.vf-cluster:focus-visible svg {
  transform: scale(1.1);
  box-shadow:
    0 0 0 4px var(--jaune),
    0 3px 0 4px var(--encre);
}

.vf-poi svg {
  display: block;
  filter: drop-shadow(0 2px 0 var(--encre));
}

.vf-you {
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--bleu);
  box-shadow:
    0 0 0 2px var(--encre),
    0 0 0 10px rgb(27 111 194 / 0.22);
}

/* Boutons posés sur la carte */
.vf-ctl {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--encre);
  border-radius: var(--r-12);
  background: var(--blanc);
  color: var(--encre);
  box-shadow: var(--socle);
}
.vf-ctl:hover {
  background: var(--jaune-clair);
}
.vf-ctl:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--encre);
}
.vf-ctl .ico {
  width: 22px;
  height: 22px;
}
.vf-ctl[aria-expanded="true"] {
  background: var(--jaune);
}

.vf-zoom {
  display: grid;
  gap: 0;
}
.vf-zoom .vf-ctl:first-child {
  border-radius: var(--r-12) var(--r-12) 0 0;
  box-shadow: none;
  border-bottom-width: 1px;
}
.vf-zoom .vf-ctl:last-child {
  border-radius: 0 0 var(--r-12) var(--r-12);
  border-top-width: 1px;
}
.vf-zoom .vf-ctl:active {
  transform: none;
}

.vf-base {
  position: relative;
}
.vf-base__menu {
  position: absolute;
  top: 0;
  right: 54px;
  display: grid;
  gap: 4px;
  width: 208px;
  padding: 6px;
  border: 2px solid var(--encre);
  border-radius: var(--r-18);
  background: var(--blanc);
  box-shadow: var(--flotte);
}
.vf-base__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 5px 10px 5px 5px;
  border: 2px solid transparent;
  border-radius: var(--r-12);
  background: none;
  font: 500 var(--t-15) / 1.2 var(--f-titre);
  text-align: left;
}
.vf-base__opt:hover {
  background: var(--brume);
}
.vf-base__opt[aria-checked="true"] {
  border-color: var(--encre);
  background: var(--jaune);
}
.vf-base__thumb {
  width: 42px;
  height: 42px;
  flex: none;
  border: 1.5px solid var(--encre);
  border-radius: 8px;
  background: var(--foret) center / cover;
}
.vf-base__thumb[data-thumb="swisstopo"] {
  background-image: url("https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/11/1066/723.jpeg");
}
.vf-base__thumb[data-thumb="topo"] {
  background-image: url("https://a.tile.opentopomap.org/11/1066/723.png");
}
.vf-base__thumb[data-thumb="sat"] {
  background-image: url("https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage/default/current/3857/11/1066/723.jpeg");
}

/* Légende repliable, en bas à gauche de la carte */
.leaflet-bottom.leaflet-left .leaflet-control {
  margin: 0 0 14px 14px;
}
.vf-legend {
  font: 400 var(--t-13) / 1.3 var(--f-texte);
}
.vf-legend__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px 0 11px;
  border: 2px solid var(--encre);
  border-radius: 999px;
  background: var(--blanc);
  color: var(--encre);
  box-shadow: var(--socle);
  font: 500 var(--t-15) / 1 var(--f-titre);
}
.vf-legend__btn:hover {
  background: var(--jaune-clair);
}
.vf-legend__btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--encre);
}
.vf-legend__btn .ico {
  width: 20px;
  height: 20px;
}
.vf-legend__panel {
  display: grid;
  gap: 8px;
  width: 236px;
  padding: 0 12px 10px;
  border: 2px solid var(--encre);
  border-radius: var(--r-18);
  background: var(--blanc);
  box-shadow: var(--flotte);
}
.vf-legend__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -12px 2px;
  padding: 0 0 0 12px;
  border-bottom: 2px solid var(--encre);
  border-radius: 16px 16px 0 0;
  background: var(--jaune);
  font: 600 var(--t-15) / 1 var(--f-titre);
}
.vf-legend__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  border: 0;
  border-radius: 0 14px 0 0;
  background: none;
  color: var(--encre);
}
.vf-legend__close:hover {
  background: rgb(27 42 36 / 0.1);
}
.vf-legend__close .ico {
  width: 20px;
  height: 20px;
}
.vf-legend__lead {
  color: var(--encre-2);
}
.vf-legend ul {
  display: grid;
  gap: 5px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Les six cotations en une rangée, du plus facile au plus dur, comme une échelle. */
.vf-legend ul.vf-legend__k {
  display: flex;
  justify-content: space-between;
  gap: 0;
}
.vf-legend__k li {
  display: block;
}
.vf-legend__ends {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  font: 500 var(--t-13) / 1.2 var(--f-titre);
}
.vf-legend__ends i {
  flex: 1;
  height: 0;
  border-top: 2px dotted var(--bord);
}
.vf-legend__etc {
  padding-top: 8px !important;
  border-top: 1px solid var(--filet);
}
.vf-legend__etc li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.vf-legend li svg {
  display: block;
  justify-self: center;
}
.vf-legend__help {
  justify-self: start;
  min-height: 32px;
  font-size: var(--t-13);
}
.vf-legend__help .ico {
  width: 16px;
  height: 16px;
}

/* Popup : une petite fiche */
.leaflet-popup-content-wrapper {
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--encre);
  border-radius: var(--r-18);
  background: var(--blanc);
  color: var(--encre);
  box-shadow: var(--flotte);
}
.leaflet-popup-content {
  margin: 0;
  font: 400 var(--t-15) / 1.4 var(--f-texte);
}
.leaflet-popup-content p {
  margin: 0;
}
.leaflet-popup-tip-container {
  margin-top: -2px;
}
.leaflet-popup-tip {
  border: 2px solid var(--encre);
  background: var(--blanc);
  box-shadow: none;
}
.leaflet-container a.leaflet-popup-close-button {
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--encre);
  border-radius: 50%;
  background: var(--blanc)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2a24' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E")
    center / 20px no-repeat;
  color: transparent;
  font-size: 0;
}
.leaflet-container a.leaflet-popup-close-button:hover {
  background-color: var(--jaune);
  color: transparent;
}

.pop__img {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--foret);
  border-bottom: 2px solid var(--encre);
}
.pop__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pop__body {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
}
.pop__head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-right: 40px;
}
.pop__img + .pop__body .pop__head {
  padding-right: 0;
}
.pop__head h3 {
  font-size: var(--t-17);
  line-height: 1.2;
}
.pop__head h3 a {
  color: var(--encre);
  text-decoration: none;
}
.pop__place {
  color: var(--encre-2);
  font-size: var(--t-13);
}
.pop__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font: 500 var(--t-15) var(--f-titre);
}
.pop__facts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pop__facts .ico {
  width: 16px;
  height: 16px;
  color: var(--encre-2);
}
.pop .btn {
  margin-top: 2px;
  margin-bottom: 3px;
}
.pop--mini {
  padding: 10px 14px;
  font: 500 var(--t-15) / 1.3 var(--f-titre);
}
.pop--mini small {
  display: block;
  color: var(--encre-2);
  font: 400 var(--t-13) var(--f-texte);
}
