.neighborhood-map-embed {
  --color-gold: #C8943A;
  --color-neighbor: #8A95A2;
}

/* Standardize the gap around neighborhood map sections across all pages.
   The map section itself carries a small fixed block padding, and any
   adjacent section (preceding or following, including the first child of a
   following <main>) has its adjacent padding/margin clamped to the same
   value. This keeps the visible cushion consistent regardless of the
   surrounding content's own block padding (which varies from 12px to 96px).
   Note: :has() cannot be nested, so the preceding-sibling selectors target
   the map section via a descendant class rather than a nested :has().
*/
.gh-section:has(.neighborhood-map-embed) {
  padding-block: var(--space-4);
}
section:has(+ .gh-section .neighborhood-map-embed),
nav:has(+ .gh-section .neighborhood-map-embed) {
  padding-bottom: var(--space-6) !important;
}
.gh-section:has(.neighborhood-map-embed) + *,
.gh-section:has(.neighborhood-map-embed) + main > :first-child {
  padding-top: var(--space-6) !important;
  margin-top: 0 !important;
}

.neighborhood-map-embed .leaflet-container img,
.neighborhood-map-embed .leaflet-container canvas,
.neighborhood-map-embed .leaflet-container svg {
  max-width: none;
  max-height: none;
  height: auto;
}
.neighborhood-map-embed .leaflet-container .leaflet-tile,
.neighborhood-map-embed .leaflet-container .leaflet-zoom-animated {
  max-width: none;
  max-height: none;
}

.neighborhood-map-embed__caption {
  text-align: center;
  margin: 0 auto var(--space-6);
  max-width: 760px;
}
.neighborhood-map-embed__caption .section-eyebrow {
  max-width: none;
  margin-inline: auto;
}
.neighborhood-map-embed__caption .section-title {
  margin-bottom: 0;
}
.neighborhood-map-embed__disclaimer {
  max-width: 900px;
}

.neighborhood-map-embed #nbhd-map,
.neighborhood-map-embed #nbhd-map-overview {
  width: 100%;
  max-width: 900px;
  height: 560px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  z-index: 1;
  background: #E8F1F5;
  margin: 0 auto;
}

.neighborhood-map-embed__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 1.25rem auto 0;
  width: 100%;
  max-width: 900px;
  font-size: 0.78rem;
  color: #555;
  text-align: center;
}
.neighborhood-map-embed__footer .label {
  color: #888;
  margin-right: 0.4rem;
}
.neighborhood-map-embed__footer a {
  display: inline-block;
  color: var(--color-accent);
  text-decoration: none;
  padding: 0.5rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(27, 45, 69, 0.12);
  cursor: pointer;
  transition: background 0.18s ease;
}
@media (hover: hover){.neighborhood-map-embed__footer a:hover {
  background: rgba(27, 45, 69, 0.06);
}}
.neighborhood-map-embed__footer a:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.neighborhood-map-embed__disclaimer {
  margin: 0.6rem auto 0;
  font-size: 0.68rem;
  color: #9A9A9A;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 900px;
}

.neighborhood-map-embed .leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-family: var(--font-body);
}
.neighborhood-map-embed .leaflet-popup-content {
  margin: 12px 16px;
}
.neighborhood-map-embed .popup-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.neighborhood-map-embed .popup-link {
  color: var(--color-gold);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}
@media (hover: hover){.neighborhood-map-embed .popup-link:hover {
  text-decoration: underline;
}}

.neighborhood-map-embed .nbhd-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
}
.neighborhood-map-embed .nbhd-label .nlabel {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  line-height: 0.98;
  transform: translate(-50%, -50%);
  padding: 4px 6px;
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.15s ease;
  text-shadow:
    -1px -1px 0 var(--color-bg), 1px -1px 0 var(--color-bg),
    -1px  1px 0 var(--color-bg), 1px  1px 0 var(--color-bg),
     0   -2px 0 var(--color-bg), 0    2px 0 var(--color-bg),
    -2px  0   0 var(--color-bg), 2px  0   0 var(--color-bg),
     0    0   8px rgba(245, 243, 239, 0.85);
}
.neighborhood-map-embed .nbhd-label.focus .nlabel {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.14em;
  pointer-events: none;
  cursor: default;
}
@media (hover: hover){.neighborhood-map-embed .nbhd-label .nlabel:hover {
  color: var(--color-gold);
}}
.neighborhood-map-embed .nbhd-label .nlabel:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 2px;
}
.neighborhood-map-embed .nbhd-label.neighbor .nlabel {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-neighbor);
  letter-spacing: 0.1em;
}
@media (hover: hover){.neighborhood-map-embed .nbhd-label.neighbor .nlabel:hover {
  color: var(--color-accent);
}}

/* Split-line labels (internal sub-boundary labels rendered on the
   dashed polyline between sibling polygons, e.g. School House Rd
   between High Pines and Ponce-Davis). One step smaller than the
   main neighborhood label, regular weight, muted color. */
.neighborhood-map-embed .nbhd-map__split-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
}
.neighborhood-map-embed .nbhd-map__split-label span {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(28, 28, 28, 0.60);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  padding: 1px 6px;
  text-shadow:
     0   -2px 0 var(--color-bg),  0  2px 0 var(--color-bg),
    -2px  0   0 var(--color-bg),  2px 0  0 var(--color-bg),
     0    0   6px rgba(245, 243, 239, 0.9);
}

.neighborhood-map-embed .landmark-marker {
  background: none !important;
  border: none !important;
  pointer-events: auto;
}
.neighborhood-map-embed .landmark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 1.5px solid var(--color-bg);
  box-shadow:
    0 0 0 1px rgba(27, 45, 69, 0.20),
    0 1px 2px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: hover){.neighborhood-map-embed .landmark-dot:hover {
  transform: scale(1.5);
  background: #A67426;
  box-shadow:
    0 0 0 1px rgba(27, 45, 69, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.22);
}}
.neighborhood-map-embed .leaflet-tooltip.landmark-tip {
  background: rgba(245, 243, 239, 0.98);
  border: 1px solid rgba(27, 45, 69, 0.14);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-accent);
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}
.neighborhood-map-embed .leaflet-tooltip.landmark-tip::before {
  display: none;
}

.neighborhood-map-embed .leaflet-control-attribution {
  font-size: 9px;
  opacity: 0.6;
}
.neighborhood-map-embed .leaflet-control-zoom a {
  color: var(--color-accent) !important;
}

@media (max-width: 768px) {
  .neighborhood-map-embed #nbhd-map,
  .neighborhood-map-embed #nbhd-map-overview {
    height: 440px;
  }
  .neighborhood-map-embed .nbhd-label .nlabel {
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  .neighborhood-map-embed .nbhd-label.focus .nlabel {
    font-size: 15px;
  }
  .neighborhood-map-embed .nbhd-label.neighbor .nlabel {
    font-size: 9.5px;
  }
  .neighborhood-map-embed .nbhd-map__split-label span {
    font-size: 11px;
    letter-spacing: 0.06em;
  }
  .neighborhood-map-embed .landmark-dot {
    width: 7px;
    height: 7px;
    border-width: 1.25px;
  }
  .neighborhood-map-embed .leaflet-tooltip.landmark-tip {
    font-size: 10px;
    padding: 2px 6px;
  }
  .neighborhood-map-embed__footer {
    font-size: 0.72rem;
    gap: 0.3rem;
  }
  .neighborhood-map-embed__disclaimer {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .neighborhood-map-embed .leaflet-fade-anim .leaflet-tile,
  .neighborhood-map-embed .leaflet-zoom-anim .leaflet-zoom-animated {
    transition: none !important;
  }
}
