/* Leaflet owns position and keyboard interaction. Only the image scales. */
html[data-design-preview] .buoy-icon.swelle-buoy-marker {
  display: grid;
  place-items: center;
  width: 36px !important;
  height: 36px !important;
  filter: none;
  isolation: isolate;
}

.swelle-buoy-marker img {
  position: relative;
  z-index: 1;
  display: block;
  width: 16px;
  height: 16px;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgb(3 24 37 / 18%));
  transition: transform 160ms ease;
}

@media (hover: hover) {
  .swelle-buoy-marker:hover img { transform: scale(1.16); }
}
.swelle-buoy-marker:focus-visible img { transform: scale(1.16); }
.swelle-buoy-marker:focus-visible { outline: 2px solid #1cb9cc; outline-offset: 1px; border-radius: 50%; }

.swelle-buoy-marker:not(.is-selected) img {
  animation: swelle-buoy-blink 4.8s ease-in-out var(--buoy-phase, 0s) infinite;
}

@keyframes swelle-buoy-blink {
  0%, 32%, 56%, 100% { opacity: 1; }
  42% { opacity: .76; }
}

.swelle-buoy-marker:not(.is-selected)::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  box-sizing: border-box;
  border: 1px solid #d8edf0;
  border-radius: 50%;
  pointer-events: none;
  animation: swelle-buoy-breathe 4.8s ease-in-out var(--buoy-phase, 0s) infinite;
}

/* Avoid a synchronized flash across the whole coastline. */
.swelle-buoy-marker:nth-child(3n+2) { --buoy-phase: -1.6s; }
.swelle-buoy-marker:nth-child(3n) { --buoy-phase: -3.2s; }

@keyframes swelle-buoy-breathe {
  0%, 100% { transform: scale(.96); opacity: .08; }
  44% { transform: scale(1.22); opacity: .34; }
}

.swelle-buoy-marker.is-selected::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border: 1.35px solid #2996a7;
  border-radius: 50%;
  pointer-events: none;
  animation: swelle-buoy-pulse 2.7s ease-out infinite;
}

@keyframes swelle-buoy-pulse {
  0% { transform: scale(.78); opacity: .62; }
  80%, 100% { transform: scale(1.65); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .swelle-buoy-marker img { transition: none; }
  .swelle-buoy-marker:not(.is-selected) img { animation: none; }
  .swelle-buoy-marker.is-selected::before,
  .swelle-buoy-marker:not(.is-selected)::after { animation: none; opacity: 0; }
}
