@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap");

:root {
  --map-bg: radial-gradient(
    circle at 20% 10%,
    #f7fafb 0%,
    #eef3f6 40%,
    #e7edf1 100%
  );
  --map-ink: #24323a;
  --region-fill: #cfd8dc;
  --region-stroke: #9fb0b9;
  --region-hover: #f08a2f;
  --region-active: #f08a2f;
  --popup-bg: #ffffff;
  --popup-shadow: 0 18px 50px rgba(13, 24, 32, 0.18);
  --button-bg: #5a7280;
  --button-bg-hover: #465d69;
}

* {
  box-sizing: border-box;
}

body.regio-in-beeld {
  margin: 0;
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--map-ink);
  background: #fff;
}

.regions-map {
  position: relative;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 24px;
  background: transparent;
  border-radius: 22px;
  overflow: hidden;
}

#regions-svg {
  display: block;
  width: 100%;
  height: auto;
}

#map-base {
  pointer-events: none;
}

.region {
  cursor: pointer;
}

.region path,
.region circle.region-hit {
  fill: rgba(0, 0, 0, 0.01);
  stroke: rgba(0, 0, 0, 0.01);
  stroke-width: 1.2;
  transition:
    fill 160ms ease,
    filter 160ms ease,
    stroke 160ms ease;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
}

/* Almere */
.region[data-id="9094"] .region-hit {
  fill: #cdd6db;
  stroke: #cdd6db;
}

.region-outline {
  fill: none !important;
  stroke: var(--region-stroke) !important;
  stroke-width: 1;
  vector-effect: none;
  pointer-events: none;
}

.region:hover path,
.region.is-active path,
.region:hover circle.region-hit,
.region.is-active circle.region-hit {
  fill: var(--region-hover);
  stroke: var(--region-hover);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

/* Almere */
.region[data-id="9094"]:hover .region-hit,
.region[data-id="9094"].is-active .region-hit {
  fill: var(--region-hover);
  stroke: var(--region-hover);
}

.region:focus-visible path,
.region:focus-visible circle.region-hit {
  outline: none;
  stroke: #334e5c;
  stroke-width: 2.4;
}

.region--city path,
.region--city circle.region-hit {
  stroke-width: 1.6;
}

.region--city .region-outline {
  stroke-width: 1;
}

.region-marker {
  fill: var(--region-hover);
  stroke: #ffffff;
  stroke-width: 1.2;
  pointer-events: none;
}

.popups {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.popup {
  position: absolute;
  min-width: 240px;
  max-width: 320px;
  background: var(--popup-bg);
  border-radius: 14px;
  padding: 16px 16px 12px;
  box-shadow: var(--popup-shadow);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.popup.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.popup h3 {
  margin: 2px 28px 12px 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.popup-actions {
  display: grid;
  gap: 8px;
}

.popup-actions a {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  background: var(--button-bg);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 140ms ease;
}

.popup-actions a:hover,
.popup-actions a:focus-visible {
  background: var(--button-bg-hover);
}

.popup-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #eef3f6;
  color: #2b3b44;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.popup-close:focus-visible {
  outline: 2px solid #2b3b44;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .regions-map {
    padding: 16px;
    border-radius: 16px;
  }

  .popup {
    min-width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .region,
  .popup,
  .popup-actions a {
    transition: none;
  }
}
