/* map.css — #map-container, #map, #lasso-canvas, .map-toolbar, .map-tool */

#map-container {
  width: 100%; flex: 55 55 0; min-height: 120px;
  border-radius: 0;
  border: none; overflow: hidden; position: relative;
  margin-bottom: 0;
}
#map { width: 100%; height: 100%; }
#lasso-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 400; pointer-events: none;
}
#lasso-canvas.drawing { pointer-events: all; cursor: crosshair; }

.map-toolbar {
  position: absolute; top: 8px; left: 8px;
  z-index: 500; display: flex; flex-direction: column; gap: 2px;
}
.map-tool {
  width: 24px; height: 24px; border-radius: 6px; border: 0.5px solid #ccc;
  background: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); color: #555;
}
.map-tool:hover  { background: #f0f0f0; }
.map-tool.activo { background: #1a1a1a; color: white; border-color: #1a1a1a; }
.map-tool-sep    { height: 1px; background: #e0e0d8; margin: 1px 2px; }

/* — overrides de refinamiento visual — */
#map-container { border-radius: 0 !important; border: none !important; }
.map-tool { border-radius: 7px !important; }
.map-tool.activo { background: #1a1a1a !important; border-color: #1a1a1a !important; }

/* Marcador de sede o de departamento (divIcon): círculo dividido en partes con
   el color de la clase de cada caso y el número de casos dentro. La selección
   pone un anillo oscuro de 2,5 px y baja lo demás a 0,35. */
.odpe-marker { background: transparent; border: none; transition: opacity .12s ease; }
.odpe-dot {
  position: relative; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.odpe-dot svg { display: block; overflow: visible; }
.odpe-num {
  fill: #fff; stroke: #1B2638; stroke-width: 2.5px; paint-order: stroke;
  stroke-linejoin: round; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; font-family: inherit;
}
.odpe-marker.odpe-sel .odpe-dot { box-shadow: 0 0 0 2.5px var(--tinta, #1B2638); }
.odpe-marker.odpe-tenue { opacity: .35; }
@media (prefers-reduced-motion: reduce) { .odpe-marker { transition: none; } }

/* Tooltip: cuántos casos hay de cada clase. */
.map-tip-clases { margin-top: 4px; font-size: 12px; color: var(--tinta-2, #4A5567); }
.map-tip-clase { display: flex; align-items: center; gap: 6px; line-height: 1.5; white-space: nowrap; }
.map-ley-sw { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }

/* Título del panel («Mapa») y su leyenda, arriba a la derecha de la barra de herramientas. */
.map-cab {
  position: absolute; top: 0; left: 44px; z-index: 450; pointer-events: none;
  padding: 10px 10px 4px 0; max-width: calc(100% - 52px);
  background: linear-gradient(to bottom, rgba(255,255,255,.92) 70%, rgba(255,255,255,0));
}
.map-ley {
  margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 12px;
  font-size: 12px; line-height: 1.35; color: var(--tinta-3, #5F6B7D);
}
.map-ley-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.map-ley:empty { display: none; }

/* Foco de teclado en un marcador: anillo cobalto de 2 px separado del círculo. */
.odpe-marker:focus { outline: none; }
.odpe-marker:focus-visible .odpe-dot {
  outline: 2px solid var(--cobalto, #285A97); outline-offset: 3px;
}

/* El panel del mapa de Leaflet crea su propia capa (z-index 400) y dejaba los
   tooltips debajo del título y la leyenda (450). Sin esa capa, los paneles de
   Leaflet se ordenan con el resto: teselas 200 debajo de la leyenda, y
   marcadores 600 y tooltips 650 encima. Prueba simulada del 17 nov. */
#map .leaflet-map-pane { z-index: auto; }

/* Nombre de la sede junto a su marcador (pocas sedes a la vista). */
.map-etq { background: none; border: 0; pointer-events: none; }
.map-etq span { display: inline-block; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--tinta, #1B2638);
  background: rgba(255,255,255,.88); padding: 0 4px; border-radius: 2px; line-height: 16px; }

/* M1 (boceto del 21 nov 2026): con «situaciones adversas» el área del círculo es la
   cantidad de situaciones vigentes. El número de casos sigue en el marcador por las
   pruebas y los lectores de pantalla, pero no se dibuja: ya no es lo que mide el círculo. */
.odpe-vig .odpe-num { display: none; }
.map-vig .map-ley { display: none; }

/* Leyenda de tamaño, abajo a la izquierda (el mar queda libre). */
.map-tam {
  position: absolute; left: 44px; bottom: 22px; z-index: 450; pointer-events: none;
  font-size: 11.5px; line-height: 1.3; color: var(--tinta-3, #5F6B7D);
  background: rgba(255,255,255,.82); padding: 3px 6px 3px 4px; border-radius: 3px;
}
.map-tam[hidden] { display: none; }
.map-tam-tit { font-weight: 600; color: var(--tinta-2, #4A5567); margin-bottom: 1px; }
.map-tam svg { display: block; overflow: visible; }
.map-tam-n { font-size: 10.5px; fill: var(--tinta-3, #5F6B7D); font-variant-numeric: tabular-nums; }
.map-tam-gris { display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.map-tip-vig { margin-top: 4px; font-size: 12px; color: var(--tinta-2, #4A5567); }

/* Recuadro ampliado de Lima y Callao, abajo a la derecha. */
.map-inset {
  position: absolute; right: 8px; bottom: 22px; z-index: 460;
  background: #fff; border: 1px solid var(--tinta, #1B2638); border-radius: 3px;
  box-shadow: 0 1px 4px rgba(27,38,56,.18); padding: 3px 4px 2px;
}
.map-inset[hidden] { display: none; }
.map-inset-tit { font-size: 11.5px; font-weight: 700; color: var(--tinta, #1B2638); padding: 0 2px 1px; white-space: nowrap; }
.map-inset-tit span { font-weight: 400; color: var(--tinta-3, #5F6B7D); }
.map-inset svg { display: block; overflow: visible; }
.map-inset-sede { cursor: pointer; outline: none; transition: opacity .12s ease; }
.map-inset-sede.tenue { opacity: .35; }
.map-inset-aro { fill: none; stroke: none; pointer-events: all; }
.map-inset-sede.sel .map-inset-aro { stroke: var(--tinta, #1B2638); stroke-width: 2px; }
.map-inset-sede:focus-visible .map-inset-aro { stroke: var(--cobalto, #285A97); stroke-width: 2px; }
.map-inset-n { font-size: 9.5px; font-weight: 700; fill: #fff; stroke: #1B2638; stroke-width: 2px; paint-order: stroke; stroke-linejoin: round; pointer-events: none; font-variant-numeric: tabular-nums; }
