/* Security band head: heading and lead on the left, the dot map of Europe on the right (js/map.js).
   Without the script the head stays a single column and the map is not shown. */

.security-head.has-map {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.security-head-text {
  max-width: 28rem;
}

.eu-map {
  position: relative;
  width: 100%;
  max-width: 600px;
  justify-self: end;
  aspect-ratio: var(--eu-aspect, 42 / 38);
}

.eu-map[hidden] {
  display: none;
}

.eu-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* the crop cuts through land on the east and south: fade it out instead of a hard edge */
  -webkit-mask-image: radial-gradient(
    ellipse 72% 70% at 40% 50%,
    #000 62%,
    transparent 100%
  );
  mask-image: radial-gradient(ellipse 72% 70% at 40% 50%, #000 62%, transparent 100%);
}

.eu-map-land {
  fill: none;
  stroke: #3a3a46;
  stroke-width: 0.5;
  stroke-linecap: round;
}

/* markers: a button with a dot, a name next to it and a tooltip underneath */

.eu-pin {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 1;
}

.eu-pin:hover,
.eu-pin:focus-within,
.eu-pin.is-open {
  z-index: 3;
}

.eu-pin-btn {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--on-dark);
  font: inherit;
  cursor: pointer;
}

.eu-pin-btn:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 0;
  border-radius: 50%;
}

.eu-pin-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgb(255 109 31 / 0.22);
}

.eu-pin-irl .eu-pin-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 4px rgb(255 109 31 / 0.18);
}

.eu-pin-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}

.eu-pin-label {
  position: absolute;
  left: calc(50% + 14px);
  top: 50%;
  transform: translateY(-50%);
  padding-left: 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: var(--on-dark);
  text-shadow:
    0 0 6px var(--dark),
    0 0 10px var(--dark),
    0 1px 2px var(--dark);
}

.eu-pin-irl .eu-pin-label {
  left: auto;
  right: calc(50% + 12px);
  padding: 0 4px 0 0;
}

.eu-pin-tip {
  position: absolute;
  left: 0;
  top: 28px;
  transform: translate(-50%, 4px);
  width: max-content;
  max-width: 190px;
  padding: 10px 14px;
  border: 1px solid #34343e;
  border-radius: var(--radius-small);
  background: var(--dark-raised);
  color: var(--on-dark);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0s linear 0.16s;
}

.eu-pin:hover .eu-pin-tip,
.eu-pin:focus-within .eu-pin-tip,
.eu-pin.is-open .eu-pin-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.eu-pin.is-dismissed .eu-pin-tip {
  opacity: 0;
  visibility: hidden;
}

/* the ring around Frankfurt pulses three times (under 5 s), then rests */
.eu-map.is-live .eu-pin-fra .eu-pin-dot::after {
  animation: eu-pulse 1.5s ease-out 3;
}

@keyframes eu-pulse {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(3.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eu-pin-tip {
    transition: none;
  }

  .eu-map.is-live .eu-pin-fra .eu-pin-dot::after {
    animation: none;
  }
}

@media (max-width: 960px) {
  .security-head.has-map {
    grid-template-columns: minmax(0, 1fr);
  }

  .eu-map {
    justify-self: center;
  }
}
