/*
 * Community map container sizing.
 * Height is controlled via the Bricks element control.
 */
.cl-community-index-map {
  width: 100%;
  min-height: 340px;
  display: block;
  position: relative;
  isolation: isolate;
  z-index: 0;
  --clcim-surface: rgba(255, 255, 255, 0.96);
  --clcim-surface-strong: rgba(255, 255, 255, 0.99);
  --clcim-surface-soft: rgba(248, 250, 252, 0.92);
  --clcim-border: rgba(22, 50, 74, 0.14);
  --clcim-border-strong: rgba(22, 50, 74, 0.2);
  --clcim-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
  --clcim-shadow-soft: 0 5px 16px rgba(15, 23, 42, 0.1);
  --clcim-control-size: 44px;
  --clcim-control-radius: 14px;
  --clcim-control-accent: rgba(42, 92, 138, 0.12);
  --clcim-control-accent-strong: rgba(42, 92, 138, 0.2);
  --clcim-state-bg: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96));
  --clcim-state-text: #16324a;
}

.cl-community-index-map canvas {
  max-width: none !important;
}

.cl-community-index-map .leaflet-pane canvas {
  max-width: none !important;
}

.cl-community-index-map .leaflet-pane path.leaflet-interactive {
  cursor: default;
  transition: filter 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.cl-community-index-map .leaflet-pane path.leaflet-interactive[data-clickable="true"] {
  cursor: pointer;
}

.cl-community-index-map .leaflet-pane path.leaflet-interactive[data-clickable="false"] {
  cursor: default;
}

.cl-community-index-map .leaflet-pane path.leaflet-interactive[data-clickable="true"]:hover,
.cl-community-index-map .leaflet-pane path.leaflet-interactive[data-clickable="true"]:focus,
.cl-community-index-map .leaflet-pane path.leaflet-interactive[data-clickable="true"]:focus-visible {
  filter: drop-shadow(0 0 6px rgba(42, 92, 138, 0.24));
  opacity: 1;
}

.cl-community-index-map .leaflet-pane path.leaflet-interactive[data-clickable="true"]:focus,
.cl-community-index-map .leaflet-pane path.leaflet-interactive[data-clickable="true"]:focus-visible {
  outline: none;
}

/* Keep Leaflet panes visible even when parent layouts impose clipping/containment. */
.cl-community-index-map > .leaflet-pane,
.cl-community-index-map .leaflet-map-pane,
.cl-community-index-map .leaflet-tile-pane,
.cl-community-index-map .leaflet-pane,
.cl-community-index-map .leaflet-overlay-pane {
  overflow: visible;
  content-visibility: visible;
  contain: none;
}

/* Map label styling (HTML markers) scoped to the map element. */
.cl-community-index-map .leaflet-marker-icon.cl-map-label,
.cl-community-index-map .leaflet-marker-icon.cl-community-label,
.cl-community-index-map .leaflet-marker-icon.cl-neighborhood-label {
  position: relative;
  pointer-events: none;
}

.cl-community-index-map .leaflet-marker-icon.cl-map-label.is-interactive,
.cl-community-index-map .leaflet-marker-icon.cl-community-label.is-interactive,
.cl-community-index-map .leaflet-marker-icon.cl-neighborhood-label.is-interactive {
  pointer-events: auto;
}

.cl-community-index-map .cl-map-label__inner,
.cl-community-index-map .cl-community-label__inner {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-50% + var(--clcim-label-offset-y, 0px)))
    scale(calc(0.95 + 0.05 * var(--clcim-label-scale, 0)));
  transform-origin: center;
  display: inline-block;
  color: var(--clcim-label-color, #16324a);
  font-family: var(--clcim-label-font-family, inherit);
  font-size: calc(var(--clcim-label-base-size, 13px) + 6px * var(--clcim-label-scale, 0));
  font-weight: var(--clcim-label-font-weight, 600);
  line-height: var(--clcim-label-line-height, 1.2);
  letter-spacing: var(--clcim-label-letter-spacing, 0);
  opacity: calc(0.5 + 0.5 * var(--clcim-label-scale, 0));
  white-space: nowrap;
  background: var(--clcim-label-background, transparent);
  padding: var(--clcim-label-padding, 0);
  border: var(--clcim-label-border-width, 0) solid var(--clcim-label-border-color, transparent);
  border-radius: var(--clcim-label-border-radius, 0);
  box-shadow: none;
  text-shadow: var(--clcim-label-text-shadow, none);
  pointer-events: none;
  cursor: default;
  z-index: 1;
}

.cl-community-index-map .cl-community-label .cl-map-label__inner,
.cl-community-index-map .cl-community-label__inner {
  font-weight: 600;
  font-size: calc(var(--clcim-label-base-size, 13px) + 1px);
}

.cl-community-index-map .cl-neighborhood-label .cl-map-label__inner {
  opacity: 0.85;
}

.cl-community-index-map .cl-map-label.is-interactive .cl-map-label__inner {
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cl-community-index-map .cl-map-label.is-hover-label .cl-map-label__inner {
  color: var(--clcim-hover-label-color, var(--clcim-label-color, #0f2f45));
  transform: translate(-50%, calc(-50% + var(--clcim-label-offset-y, 0px)))
    scale(calc((0.95 + 0.05 * var(--clcim-label-scale, 0)) * 1.05));
}

.cl-community-index-map .cl-map-label.is-interactive:hover .cl-map-label__inner,
.cl-community-index-map .cl-map-label.is-interactive:focus-within .cl-map-label__inner,
.cl-community-index-map .cl-map-label.is-interactive:focus .cl-map-label__inner,
.cl-community-index-map .cl-map-label.is-interactive:focus-visible .cl-map-label__inner {
  opacity: 1;
  color: var(--clcim-hover-label-color, var(--clcim-label-color, #0f2f45));
  box-shadow: 0 0 0 3px rgba(42, 92, 138, 0.12);
  transform: translate(-50%, calc(-50% + var(--clcim-label-offset-y, 0px)))
    scale(calc((0.95 + 0.05 * var(--clcim-label-scale, 0)) * 1.03));
}

.cl-community-index-map .cl-map-label.is-interactive:focus,
.cl-community-index-map .cl-map-label.is-interactive:focus-visible {
  outline: none;
}

.cl-community-index-map .cl-community-tooltip {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(22, 50, 74, 0.18);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  color: #16324a;
  padding: 6px 8px;
}

.cl-community-index-map .cl-community-tooltip__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.cl-community-index-map .cl-community-tooltip__count {
  font-size: 12px;
  line-height: 1.3;
  margin-top: 2px;
}

.cl-community-index-map .cl-map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  z-index: 700;
}

.cl-community-index-map__state {
  position: absolute;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cl-community-index-map[data-map-state="loading"] .cl-community-index-map__state,
.cl-community-index-map[data-map-state="empty"] .cl-community-index-map__state,
.cl-community-index-map[data-map-state="error"] .cl-community-index-map__state {
  opacity: 1;
}

.cl-community-index-map[data-map-state="ready"] .cl-community-index-map__state {
  opacity: 0;
  visibility: hidden;
}

.cl-community-index-map__state-panel {
  display: none;
  max-width: min(28rem, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--clcim-border);
  background: var(--clcim-state-bg);
  color: var(--clcim-state-text);
  box-shadow: var(--clcim-shadow);
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cl-community-index-map[data-map-state="loading"] .cl-community-index-map__state-panel[data-state="loading"],
.cl-community-index-map[data-map-state="empty"] .cl-community-index-map__state-panel[data-state="empty"],
.cl-community-index-map[data-map-state="error"] .cl-community-index-map__state-panel[data-state="error"] {
  display: block;
}

.cl-community-index-map__state-panel::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto 10px;
  border-radius: 999px;
  border: 2px solid rgba(22, 50, 74, 0.18);
  border-top-color: rgba(42, 92, 138, 0.85);
}

.cl-community-index-map[data-map-state="empty"] .cl-community-index-map__state-panel::before,
.cl-community-index-map[data-map-state="error"] .cl-community-index-map__state-panel::before {
  border-top-color: rgba(22, 50, 74, 0.35);
}

.cl-community-index-map[data-map-state="ready"] .cl-community-index-map__state-panel::before {
  display: none;
}

.cl-community-index-map .leaflet-top,
.cl-community-index-map .leaflet-bottom {
  z-index: 800;
}

/* Slight control inset so map chrome has breathing room. */
.cl-community-index-map .leaflet-control-container {
  padding: 10px;
  pointer-events: none;
}

.cl-community-index-map .leaflet-control-container .leaflet-control {
  pointer-events: auto;
}

.cl-community-index-map .leaflet-control-zoom,
.cl-community-index-map .leaflet-bar,
.cl-community-index-map .leaflet-control-attribution {
  border: 1px solid var(--clcim-border);
  background: var(--clcim-surface);
  box-shadow: var(--clcim-shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cl-community-index-map .leaflet-control-zoom {
  overflow: hidden;
  border-radius: var(--clcim-control-radius);
}

.cl-community-index-map .leaflet-control-zoom a,
.cl-community-index-map .leaflet-bar a {
  width: var(--clcim-control-size);
  height: var(--clcim-control-size);
  line-height: calc(var(--clcim-control-size) - 2px);
  font-size: 17px;
  color: #16324a;
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cl-community-index-map .leaflet-control-zoom a:hover,
.cl-community-index-map .leaflet-control-zoom a:focus,
.cl-community-index-map .leaflet-control-zoom a:focus-visible,
.cl-community-index-map .leaflet-bar a:hover,
.cl-community-index-map .leaflet-bar a:focus,
.cl-community-index-map .leaflet-bar a:focus-visible {
  background: var(--clcim-control-accent);
  color: #0f2f45;
  outline: none;
  box-shadow: inset 0 0 0 1px var(--clcim-control-accent-strong);
}

.cl-community-index-map .leaflet-control-zoom a:active,
.cl-community-index-map .leaflet-bar a:active {
  transform: translateY(1px);
}

.cl-community-index-map .leaflet-control-attribution {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(22, 50, 74, 0.86);
}

.cl-community-index-map .leaflet-control-attribution a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

@media (max-width: 767px) {
  .cl-community-index-map {
    min-height: 360px;
    --clcim-control-size: 48px;
  }

  .cl-community-index-map .leaflet-control-container {
    padding: 12px;
  }

  .cl-community-index-map__state {
    padding: 20px 14px;
  }

  .cl-community-index-map__state-panel {
    max-width: calc(100% - 24px);
  }
}
