/* This component uses an adapted map-pin SVG based on Lucide icons (MIT). */
:root {
  --pp-map-color: #38977d;
  --pp-map-pin: #ffffff;
  --pp-map-shadow: 0 16px 36px rgba(56, 151, 125, 0.14);
  --pp-map-tooltip-shadow: 0 18px 34px rgba(25, 41, 52, 0.16);
  --pp-map-body-font: "Exo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pp-map-heading-font: "K2D", "Exo", system-ui, sans-serif;
  --pp-map-ease: cubic-bezier(.2,.85,.25,1);
}

.pp-map,
.pp-map * ,
.pp-map *::before,
.pp-map *::after {
  box-sizing: border-box;
}

.pp-map {
  width: 100%;
  padding: clamp(8px, 2vw, 18px);
}

.pp-map__inner {
  position: relative;
  width: min(100%, var(--pp-map-max-width, 760px));
  margin-inline: auto;
  isolation: isolate;
}

.pp-map__stage {
  position: relative;
  width: 100%;
}

.pp-map__map {
  position: relative;
  z-index: 1;
  width: 100%;
  color: var(--pp-map-color);
  line-height: 0;
}

.pp-map__map img,
.pp-map__map svg,
.pp-map__svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(var(--pp-map-shadow));
}

.pp-map__svg path,
.pp-map__svg polygon,
.pp-map__svg rect,
.pp-map__svg circle,
.pp-map__svg ellipse {
  fill: currentColor;
}

.pp-map__item {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 1;
  animation: ppMapPinIntro 0.7s var(--pp-map-ease) both;
  animation-delay: var(--pp-map-delay, 0s);
}

.pp-map__item:hover,
.pp-map__item:focus-within,
.pp-map__item.is-active {
  z-index: 30;
}

.pp-map__pin {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  position: relative;
  width: 34px;
  height: 42px;
  transform-origin: 50% 88%;
}

.pp-map__pin-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  color: var(--pp-map-pin);
  filter: drop-shadow(0 8px 18px rgba(21, 40, 53, 0.18));
  transition: transform .24s ease;
}

.pp-map__item:hover .pp-map__pin-icon,
.pp-map__item:focus-within .pp-map__pin-icon,
.pp-map__item.is-active .pp-map__pin-icon {
  transform: scale(1.12);
}

.pp-map__pin-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pp-map__sonar {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
  border: 1px solid rgba(255,255,255,.75);
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: ppMapSonar var(--pp-map-sonar-duration, 2.4s) ease-out infinite;
  animation-delay: var(--pp-map-sonar-delay, 0s);
  pointer-events: none;
}

.pp-map__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(8px);
  width: max-content;
  min-width: 150px;
  max-width: min(250px, 72vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .24s ease, visibility .2s ease;
  z-index: 100;
}

.pp-map__item:hover .pp-map__tooltip,
.pp-map__item:focus-within .pp-map__tooltip,
.pp-map__item.is-active .pp-map__tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.pp-map__tooltip-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  color: #243344;
  text-decoration: none;
  box-shadow: var(--pp-map-tooltip-shadow);
  white-space: nowrap;
}

.pp-map__avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: visible;
  transform: scale(.82);
  opacity: 0;
  transition: transform .28s var(--pp-map-ease), opacity .22s ease;
}

.pp-map__item:hover .pp-map__avatar-wrap,
.pp-map__item:focus-within .pp-map__avatar-wrap,
.pp-map__item.is-active .pp-map__avatar-wrap {
  transform: scale(1);
  opacity: 1;
}

.pp-map__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.pp-map__count-badge {
  position: absolute;
  right: -8px;
  bottom: -3px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #243344;
  color: #ffffff;
  font: 600 12px/1 var(--pp-map-body-font);
  box-shadow: 0 8px 18px rgba(21, 40, 53, .24);
}

.pp-map__tooltip-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pp-map__city {
  font: 700 1rem/1.05 var(--pp-map-heading-font);
}

.pp-map__meta {
  font: 600 .875rem/1.2 var(--pp-map-body-font);
  color: #5d6a84;
}

@keyframes ppMapSonar {
  0% {
    opacity: .92;
    transform: translate(-50%, -50%) scale(.55);
    box-shadow: 0 0 0 0 rgba(255,255,255,.55);
  }
  68% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.95);
    box-shadow: 0 0 0 18px rgba(255,255,255,0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.95);
    box-shadow: 0 0 0 18px rgba(255,255,255,0);
  }
}

@keyframes ppMapPinIntro {
  0% {
    opacity: 0;
    transform: translate(-50%, -86%) scale(.82);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, -104%) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

@media (max-width: 767px) {
  .pp-map {
    padding: 8px;
  }

  .pp-map__pin,
  .pp-map__pin-icon {
    width: 30px;
    height: 38px;
  }

  .pp-map__sonar {
    width: 18px;
    height: 18px;
  }

  .pp-map__tooltip {
    min-width: 138px;
    max-width: min(220px, 76vw);
  }

  .pp-map__tooltip-link {
    min-height: 64px;
    padding: 10px 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .pp-map__avatar-wrap {
    width: 42px;
    height: 42px;
  }

  .pp-map__count-badge {
    min-width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .pp-map__city {
    font-size: .95rem;
  }

  .pp-map__meta {
    font-size: .82rem;
  }
}
