.map-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 3rem) 0;
}

.album-map {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
}

.album-map__stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: clamp(260px, calc(100svh - 21rem), 900px);
  min-height: 260px;
  overflow: hidden;
  background: transparent;
}

#map {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  outline: none;
}

#map:active {
  cursor: grabbing;
}

#map:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

#map .land path {
  fill: var(--bg-white);
  stroke: var(--surface-border);
  stroke-width: 0.55px;
  vector-effect: non-scaling-stroke;
  transition: fill 160ms ease;
}

#map .land path.has-album {
  fill: #dedfe0;
}

#pins .pin {
  cursor: pointer;
  outline: none;
}

#pins .pin .pin-visible {
  fill: #74777a;
  stroke: var(--bg-white);
  stroke-width: 1.25px;
  vector-effect: non-scaling-stroke;
  transition: fill 120ms ease;
}

#pins .pin .pin-hit-target {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

#pins .pin:hover .pin-visible,
#pins .pin:focus-visible .pin-visible {
  fill: #4b4e51;
}

#pins .pin:focus-visible .pin-visible {
  stroke: var(--text-dark);
  stroke-width: 2px;
}

.album-map__controls {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.album-map__controls button {
  width: 2.65rem;
  height: 2.65rem;
  border: 0;
  border-bottom: 1px solid var(--surface-border);
  background: var(--bg-white);
  color: var(--text-dark);
  font: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.album-map__controls button:last-child {
  border-bottom: 0;
}

.album-map__controls button:hover {
  background: var(--bg-color);
}

.album-map__card {
  position: absolute;
  z-index: 2;
  width: min(15rem, calc(100vw - 2rem));
  padding: 0.65rem;
  background: var(--bg-white);
  color: var(--text-dark);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, calc(-100% - 0.65rem));
  pointer-events: auto;
}

.album-map__card.below-pin {
  transform: translate(-50%, 0.65rem);
}

.album-map__card a {
  display: block;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.album-map__card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-top: 0.5rem;
  object-fit: cover;
}

.album-map__card-title {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
}

.map-status {
  min-height: 1.5rem;
  padding-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.map-attribution {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.map-attribution a {
  color: inherit;
}

.map-page .map-footer {
  flex: 0 0 auto;
  padding: 0.75rem 1.5rem 1rem;
}

.map-albums {
  padding: 1rem 0 0;
}

.map-albums h2 {
  margin-bottom: 0.6rem;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 600;
}

.album-map__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  padding: 0 0 1.25rem;
  list-style: none;
}

.album-map__list a {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.album-map__list a:hover,
.album-map__list a:focus-visible {
  color: var(--text-dark);
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .map-wrapper {
    padding-top: 0.75rem;
  }

  .album-map__stage {
    height: clamp(300px, calc(100svh - 18rem), 760px);
  }

  .album-map__controls {
    right: 0.45rem;
    bottom: 0.45rem;
  }

  .album-map__controls button {
    width: 2.3rem;
    height: 2.3rem;
  }

  .album-map__list {
    gap: 0.4rem 0.9rem;
  }
}

@supports not (height: 100svh) {
  .album-map__stage {
    height: clamp(260px, calc(100vh - 21rem), 900px);
  }

  @media (max-width: 700px) {
    .album-map__stage {
      height: clamp(300px, calc(100vh - 18rem), 760px);
    }
  }
}
