.home-map {
  --map-pin: #4c6b4e;
  --map-card: #fffef9;
  --map-ink: #28352b;
  --map-label: #344e40;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1120 / 750;
}

.home-map-land {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("places/suisse-relief.webp") center / 100% 100% no-repeat;
}

.home-map-alps {
  position: absolute;
  left: 43%;
  top: 60%;
  transform: translateX(-50%) rotate(-14deg);
  color: var(--map-label);
  font: italic 450 clamp(.78rem, 2.5cqw, 1.1rem)/1.1 var(--display, Georgia, serif);
  text-shadow: 0 1px 4px var(--paper);
  white-space: nowrap;
  pointer-events: none;
}

/* Points de localité swissNAMES3D, projetés dans le même cadre MN95 que le relief. */
.home-map-place {
  position: absolute;
  display: block;
  width: max-content;
  --pin-align: 50%;
  --pin-size: clamp(7px, 1.65cqw, 11px);
  --stem: calc(var(--pin-size) * .48 + 6px);
  transform: translate(calc(0% - var(--pin-align)), calc(-100% - var(--stem)));
}
.home-map-place-geneve { left: 9.07%; top: 73.63%; --pin-align: 24%; }
.home-map-place-neuchatel { left: 25.01%; top: 39.87%; --pin-align: 55%; }
.home-map-place-zurich { left: 56.47%; top: 22.93%; --pin-align: 34%; }
.home-map-place-lugano { left: 65.52%; top: 82.04%; --pin-align: 23%; }
.home-map-place::before {
  content: "";
  position: absolute;
  left: var(--pin-align);
  top: calc(100% + var(--stem));
  width: var(--pin-size);
  height: var(--pin-size);
  transform: translate(-50%, -50%);
  background: var(--map-pin);
  border: 2px solid var(--map-card);
  border-radius: 50%;
  box-shadow: 0 1px 4px #283b2b55;
}
.home-map-place::after {
  content: "";
  position: absolute;
  left: calc(var(--pin-align) - 1px);
  top: 100%;
  height: 6px;
  width: 2px;
  background: var(--map-pin);
}
.home-map-card {
  display: block;
  width: max-content;
  min-width: clamp(96px, 19cqw, 138px);
  padding: clamp(4px, .85cqw, 6px);
  border: 1px solid #5d6e4c28;
  border-radius: clamp(9px, 1.9cqw, 14px);
  background: var(--map-card);
  color: var(--map-ink);
  font: 650 clamp(.76rem, 2.26cqw, .95rem)/1.2 var(--fd-body, system-ui, sans-serif);
  text-align: left;
  box-shadow: 0 6px 15px #263b2721, 0 1px 3px #263b2718;
}
.home-map-card img {
  display: block;
  width: 100%;
  min-width: 0;
  /* Exclude the intrinsic 360px photo width from the label's max-content width. */
  contain: inline-size;
  height: clamp(40px, 8.8cqw, 66px);
  object-fit: cover;
  border-radius: clamp(5px, 1.2cqw, 9px);
}
.home-map-card span { display: block; padding: .35em .24em .12em; white-space: nowrap; }
.home-map-place:hover, .home-map-place:focus-visible { z-index: 1; }
.home-map-place:hover .home-map-card, .home-map-place:focus-visible .home-map-card {
  outline: 2px solid var(--map-pin);
  outline-offset: 2px;
}
.home-map-place:focus-visible { outline: 0; }
.home-map-credit {
  position: absolute;
  right: 1%;
  bottom: 0;
  color: var(--soft);
  font: 450 .75rem/1.4 var(--fd-body, sans-serif);
}
.home-map-credit a:hover { text-decoration: underline; }

[data-theme="dark"] .home-map {
  --map-pin: #aecc9d;
  --map-card: #28362d;
  --map-ink: #f4f3e9;
  --map-label: #c0d1b9;
}
[data-theme="dark"] .home-map-land { background-image: url("places/suisse-relief-dark.webp"); }
[data-theme="dark"] .home-map-card { border-color: #e3efd934; }

@container (max-width: 475px) {
  .home-map-card {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: auto;
    min-height: 44px;
    padding: 4px 7px 4px 4px;
    font-size: .75rem;
  }
  .home-map-card img { width: 29px; height: 29px; border-radius: 5px; }
  .home-map-card span { padding: 0; }
  .home-map-place-neuchatel { --pin-align: 61%; }
  .home-map-place-zurich { --pin-align: 18%; }
  .home-map-alps { left: 49%; top: 57%; }
}
