/* css/map.css — Map base styles for CIAS Module 1 scaffold */

/* Override Leaflet defaults for dark theme */
.leaflet-container {
  background: var(--ground) !important;
  font-family: var(--font-sans);
}

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--secondary) !important;
  border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--surface-hover) !important;
  color: var(--primary) !important;
}

.leaflet-control-attribution {
  background: rgba(10, 9, 8, 0.7) !important;
  color: var(--muted) !important;
  font-size: 0.6em !important;
}

.leaflet-control-attribution a { color: var(--secondary) !important; }

.leaflet-control-zoom a:focus-visible {
  outline: 2px solid var(--copper) !important;
  outline-offset: 2px !important;
}

/* -- Map popup -- */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--primary) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--border);
}

.leaflet-popup-tip { background: var(--surface) !important; }

.map-popup {
  font-size: 0.85em;
  min-width: 160px;
}

.map-popup__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.map-popup__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9em;
  color: var(--secondary);
}

/* -- Hover tooltips (dark theme) -- */
.map-tooltip {
  background: var(--surface) !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xs) !important;
  box-shadow: var(--shadow) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.8em !important;
  padding: 6px 10px !important;
  line-height: 1.5 !important;
}

.map-tooltip::before {
  border-top-color: var(--surface) !important;
}

/* -- Network polylines (gazette segments, coloured by VGI band) -- */
.leaflet-interactive {
  transition: opacity 0.15s ease-out, stroke-width 0.15s ease-out;
  cursor: pointer;
}

.leaflet-interactive:hover {
  opacity: 1 !important;
  stroke-width: 4 !important;
}

/* -- Permanent polygon labels -- */
.polygon-label-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: none;
}

.polygon-label-tooltip::before {
  display: none !important;
}

.polygon-label {
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.6);
  font-family: var(--font-sans);
  line-height: 1.4;
}

.polygon-label strong {
  font-size: 0.75em;
  color: var(--primary);
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
