.t4n-map {
  /* Dark palette, anchored on the site's corporate navy #083B49 (matches the
     breadcrumb and country-grid bands). Scoped to the component rather than
     :root so it can never leak into or collide with unrelated page styles. */
  --t4n-base: #083b49;
  --t4n-surface: rgba(16, 66, 80, 0.85);
  --t4n-surface-strong: rgba(19, 74, 89, 0.95);
  --t4n-border: rgba(255, 255, 255, 0.14);
  --t4n-ink: #eef6f5;
  --t4n-ink-soft: #9bc0c2;
  --t4n-accent: #ef6a61;
  --t4n-accent-secondary: #7c5cff;
  --t4n-map-bg: #04222a;
  --t4n-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);

  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(290px, 360px) 1fr;
  min-height: var(--t4n-map-height, 720px);
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(24, 108, 128, 0.55), transparent 32%),
    linear-gradient(135deg, #0b4152 0%, #062a34 100%);
  box-shadow: var(--t4n-shadow);
}

.t4n-map__sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 22px 22px;
  background: linear-gradient(180deg, rgba(16, 66, 80, 0.9), rgba(6, 42, 52, 0.86));
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--t4n-border);
}

.t4n-map__sidebar-head {
  display: grid;
  gap: 12px;
}

.t4n-map__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7fd9c9;
}

.t4n-map__title {
  margin: 0;
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem);
  line-height: 1;
  color: var(--t4n-ink);
}

.t4n-map__search {
  box-sizing: border-box;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--t4n-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--t4n-ink);
  font-size: 15px;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.t4n-map__search::placeholder {
  color: var(--t4n-ink-soft) !important;
  opacity: 1;
}

.t4n-map .t4n-map__search:focus,
.t4n-map .t4n-map__search:not(:placeholder-shown) {
  color: var(--t4n-ink) !important;
}

.t4n-map__search:focus {
  outline: 2px solid rgba(155, 192, 194, 0.5);
  outline-offset: 2px;
}

.t4n-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.t4n-map__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--t4n-border);
  color: var(--t4n-ink);
  font: inherit;
  font-size: 13px;
  line-height: normal;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.t4n-map__legend-item:hover {
  background: rgba(255, 255, 255, 0.13);
}

.t4n-map__legend-item:focus-visible {
  outline: 2px solid var(--t4n-accent);
  outline-offset: 2px;
}

.t4n-map__legend-item--inactive {
  background: transparent;
  border-color: transparent;
  color: var(--t4n-ink-soft);
  opacity: 0.55;
}

.t4n-map__legend-item--inactive:hover {
  background: rgba(255, 255, 255, 0.07);
}

.t4n-map__legend-item--inactive .t4n-map__legend-swatch {
  box-shadow: none;
  opacity: 0.5;
}

.t4n-map__legend-swatch {
  width: 10px;
  height: 10px;
  /* !important survives the theme's `* { border-radius: 0 !important }` reset
     (style_gl_76.css) which would otherwise square this dot. */
  border-radius: 999px !important;
  background: var(--marker-color, var(--t4n-accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker-color, var(--t4n-accent)) 18%, white);
}

.t4n-map__results {
  display: grid;
  gap: 12px;
  min-height: 120px;
  max-height: calc(var(--t4n-map-height, 720px) - 280px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.t4n-map__results::-webkit-scrollbar {
  width: 4px;
}

.t4n-map__results::-webkit-scrollbar-track {
  background: transparent;
}

.t4n-map__results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.t4n-map__results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

.t4n-map__site-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--t4n-border);
  border-radius: 18px;
  background: var(--t4n-surface-strong);
  color: var(--t4n-ink);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.t4n-map__site-card:hover,
.t4n-map__site-card:focus-visible,
.t4n-map__site-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(155, 192, 194, 0.4);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.t4n-map__site-thumb {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(127, 217, 201, 0.18), rgba(124, 92, 255, 0.24));
}

.t4n-map__site-copy {
  display: grid;
  gap: 4px;
}

.t4n-map__site-kicker,
.t4n-map__site-status {
  font-size: 12px;
  color: var(--t4n-ink-soft);
}

.t4n-map__site-title {
  font-size: 14px;
  line-height: 1.35;
}

.t4n-map__empty {
  margin: 0;
  color: var(--t4n-ink-soft);
}

.t4n-map__canvas-wrap {
  position: relative;
  min-width: 0;
  background: var(--t4n-map-bg);
}

.t4n-map__canvas {
  height: 100%;
  min-height: var(--t4n-map-height, 720px);
}

.t4n-map__map-meta {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 500;
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--t4n-ink);
}

.t4n-map__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 59, 73, 0.82);
  border: 1px solid var(--t4n-border);
  color: var(--t4n-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.t4n-map__footer {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  z-index: 450;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(8, 59, 73, 0.82);
  backdrop-filter: blur(8px);
  color: var(--t4n-ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

/* Darkens the CARTO "light_nolabels" raster tiles' pale mint/cream basemap
   into a navy tone that matches this component's dark palette. This is the
   permanent way the map stays dark on a light-styled tile set -- there is
   no plan to replace the tile provider. */
.t4n-map .leaflet-tile-pane {
  filter: brightness(0.4) saturate(1.5) hue-rotate(-6deg) contrast(1.05);
}

.t4n-map__marker-icon {
  background: transparent;
  border: 0;
}

.t4n-map__marker-shadow {
  position: absolute;
  bottom: 0;
  left: 3px;
  right: 3px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  filter: blur(4px);
}

.t4n-map__marker-pin {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 26px;
  height: 26px;
  /* !important survives the theme's `* { border-radius: 0 !important }` reset
     (style_gl_76.css) which would otherwise square this pin. */
  border-radius: 50% !important;
  background: var(--marker-color, var(--t4n-accent));
  transform: none;
  box-shadow: 0 4px 14px rgba(18, 54, 51, 0.35);
  border: 2.5px solid rgba(255, 255, 255, 0.65);
}

.t4n-map__marker-core {
  position: absolute;
  inset: 7px;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92);
}

.t4n-map__leaflet-popup .leaflet-popup-content-wrapper,
.t4n-map__leaflet-popup .leaflet-popup-tip {
  background: var(--t4n-surface-strong);
  color: var(--t4n-ink);
}

.t4n-map__leaflet-popup .leaflet-popup-content-wrapper {
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* Card opened below its marker (no room above it): the tip points up. */
.t4n-map__leaflet-popup--below .leaflet-popup-tip-container {
  top: -19px;
  margin-top: 0;
  transform: rotate(180deg);
}

/* Card opened beside its marker: no tip. */
.t4n-map__leaflet-popup--side .leaflet-popup-tip-container {
  display: none;
}

.t4n-map__popup {
  overflow: hidden;
  width: min(280px, 76vw);
}

.t4n-map__popup-image img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.t4n-map__popup-body {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.t4n-map__popup-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7fd9c9;
}

.t4n-map__popup-title {
  margin: 0;
  font-size: 18px;
  color: var(--t4n-ink);
}

.t4n-map__popup-meta,
.t4n-map__popup-copy {
  margin: 0;
  color: var(--t4n-ink-soft);
}

.t4n-map .t4n-map__popup-link,
.t4n-map .t4n-map__popup-link:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: linear-gradient(160deg, #9be6d8 0%, #7fd9c9 100%);
  color: #08312d !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.t4n-map .t4n-map__popup-link:hover,
.t4n-map .t4n-map__popup-link:focus-visible {
  background: linear-gradient(160deg, #b7f0e5 0%, #9be6d8 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
  color: #08312d !important;
  text-decoration: none !important;
}

/* The vendored leaflet.css ships a white/light zoom control by default;
   restyle it to match the component's dark theme. */
.t4n-map .leaflet-bar a {
  background-color: var(--t4n-surface-strong);
  border-bottom: 1px solid var(--t4n-border);
  color: var(--t4n-ink);
}

.t4n-map .leaflet-bar a:hover,
.t4n-map .leaflet-bar a:focus {
  background-color: rgba(255, 255, 255, 0.14);
}

.t4n-map .leaflet-bar a.leaflet-disabled {
  background-color: var(--t4n-surface-strong);
  color: var(--t4n-ink-soft);
}

.t4n-map__zoom-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 1000;
  transform: translate(-50%, -8px);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--t4n-surface-strong);
  color: var(--t4n-ink);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--t4n-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.t4n-map__zoom-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.screen-reader-text {
  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: 980px) {
  .t4n-map {
    grid-template-columns: 1fr;
  }

  .t4n-map__sidebar {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--t4n-border);
  }

  .t4n-map__canvas {
    min-height: 55vh;
  }

  .t4n-map__results {
    max-height: 320px;
  }
}

@media (max-width: 640px) {
  .t4n-map {
    min-height: auto;
    border-radius: 16px;
  }

  /* Taller on phones (Sara, 13-oct-2026; was WPCode snippet 1368). */
  .t4n-map__canvas {
    min-height: max(75vh, 540px);
  }

  .t4n-map__sidebar {
    padding: 16px;
    gap: 14px;
  }

  .t4n-map__title {
    font-size: 1.5rem;
  }

  .t4n-map__eyebrow {
    font-size: 10px;
  }

  .t4n-map__legend {
    gap: 6px;
  }

  .t4n-map__legend-item {
    font-size: 12px;
    padding: 6px 10px;
  }

  .t4n-map__site-card {
    grid-template-columns: 52px 1fr;
    gap: 10px;
    padding: 8px;
    border-radius: 14px;
  }

  .t4n-map__site-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
  }

  .t4n-map__map-meta {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .t4n-map__badge {
    font-size: 10px;
    padding: 6px 10px;
  }

  .t4n-map__footer {
    right: 10px;
    bottom: 10px;
    left: 10px;
    font-size: 10px;
    padding: 8px 12px;
  }

  .t4n-map__popup {
    width: min(260px, 84vw);
  }

  .t4n-map__popup-image img {
    height: 110px;
  }

  .t4n-map__popup-body {
    padding: 12px;
    gap: 6px;
  }

  .t4n-map__popup-title {
    font-size: 16px;
  }

  .t4n-map__results {
    max-height: 240px;
  }
}