/* Maps page overlays and legend (CSP-safe) */
.map-shell {
  position: relative;
  min-height: 28rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #244c4014;
  background: var(--sand);
}

.map-shell .leaflet-container {
  width: 100%;
  height: 28rem;
  font: inherit;
}

.map-toolbar {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
}

.map-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}

.map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--charcoal);
}

.map-legend {
  background: var(--paper);
  border: 1px solid #244c4014;
  border-radius: calc(var(--radius) - 0.25rem);
  padding: 0.85rem 1rem;
}

.map-legend h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.map-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.map-legend-item {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.map-swatch {
  width: 1.1rem;
  height: 0.55rem;
  border-radius: 999px;
  flex: 0 0 auto;
  border: 1px solid #00000033;
}

.map-swatch[data-kind="closure"] { background: #c0392b; }
.map-swatch[data-kind="restriction"] { background: #e67e22; }
.map-swatch[data-kind="other"] { background: #f1c40f; }
.map-swatch[data-kind="alert"] { background: #8e44ad; height: 0.9rem; width: 0.9rem; border-radius: 0.2rem; }
.map-swatch[data-kind="wildfire"] { background: #e74c3c; height: 0.9rem; width: 0.9rem; border-radius: 0.2rem; }
.map-swatch[data-kind="forest"] { background: #27ae60; height: 0.9rem; width: 0.9rem; border-radius: 0.2rem; opacity: 0.7; }
.map-swatch[data-kind="station"] { background: #2980b9; height: 0.7rem; width: 0.7rem; border-radius: 999px; }
.map-swatch[data-kind="community"] { background: #c17b4d; height: 0.7rem; width: 0.7rem; border-radius: 999px; }

.map-updated {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.map-alert-banner {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: calc(var(--radius) - 0.3rem);
  background: #f4e4d4;
  color: var(--clay-ink);
}

.map-alert-banner[hidden] { display: none !important; }

.map-alert-banner a {
  color: var(--pine);
  font-weight: 700;
  text-decoration: none;
}

.map-alert-banner a:hover,
.map-alert-banner a:focus-visible {
  text-decoration: underline;
}

.map-source-line {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.leaflet-popup-content {
  margin: 0.7rem 0.85rem;
  color: #26312d;
  font-size: 0.92rem;
  line-height: 1.35;
}

.leaflet-popup-content .map-popup-title {
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.leaflet-popup-content p {
  margin: 0.2rem 0 0;
}

.leaflet-popup-content a {
  color: #244c40;
  font-weight: 700;
}
