/* Mapa 3D das zonas — camada opcional sobre o mapa SVG */
.mapa3d-alternar {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1.5px solid var(--primary, #1351b4);
  border-radius: 999px;
  background: #fff;
  color: var(--primary, #1351b4);
  font: 700 0.78rem/1 inherit;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(19, 81, 180, 0.15);
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.mapa3d-alternar[hidden] { display: none; }
.mapa3d-alternar:hover { transform: translateY(-1px); }
.mapa3d-alternar:focus-visible { outline: 3px solid #e8a020; outline-offset: 2px; }
.mapa3d-alternar[aria-pressed='true'] { background: var(--primary, #1351b4); color: #fff; }
.mapa3d-alternar svg { width: 15px; height: 15px; }

.mapa3d {
  position: absolute;
  inset: 0;
  z-index: 10;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #eef3fd 55%, #dfe8f8 100%);
}
.mapa3d[hidden] { display: none; }
.mapa3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y; /* arrasto vertical continua rolando a página no celular */
}

.mapa3d-rotulos {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.mapa3d-rotulo {
  position: absolute;
  left: 0;
  top: 0;
  padding: 1px 6px;
  border: 1px solid rgba(15, 31, 61, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f1f3d;
  font: 700 12px/16px Inter, system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15, 31, 61, 0.2);
  opacity: 0;
  transition: opacity 0.15s;
  will-change: transform;
}
.mapa3d-rotulo--visivel { opacity: 1; }
.mapa3d-rotulo--ativo {
  background: #ffb400;
  border-color: #b88700;
  color: #3a2a00;
}
.mapa3d-dica {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(15, 31, 61, 0.92);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15, 31, 61, 0.25);
}
.mapa3d-dica strong { font-size: 0.875rem; }
.mapa3d-dica span { opacity: 0.85; }

.mapa3d-legenda {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-width: 16rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  font-size: 0.875rem;
  color: #53607d;
  pointer-events: none;
}
.mapa3d-legenda strong { color: #0f1f3d; font-size: 0.875rem; }

.mapa3d-botoes {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mapa3d-botoes button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #cfd8ec;
  border-radius: 10px;
  background: #fff;
  color: #0f1f3d;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 31, 61, 0.1);
}
.mapa3d-botoes button:hover { background: #f1f5fd; }
.mapa3d-botoes button:focus-visible { outline: 3px solid #e8a020; outline-offset: 1px; }

/* Celular/tablet estreito: sem mapa (2D nem 3D). Os municípios são pequenos demais para tocar;
   ficam o seletor "Ir para o município" e a tabela de zonas. Não usa display:none porque o
   getBBox do SVG (recorte e rótulos) só funciona com o mapa renderizado. */
@media (max-width: 899px) {
  #mapaZonasInterativo .mapa-area {
    height: 0;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    margin: 0;
    overflow: hidden;
    visibility: hidden;
  }
  #mapaZonasInterativo [aria-label='Legenda do mapa'],
  .mapa-nota {
    display: none;
  }
}

@media (max-width: 640px) {
  .mapa3d-legenda span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mapa3d-alternar { transition: none; }
}

/* Hero: contorno do RN em partículas (Three.js), no espaço livre à esquerda do painel de contagem */
.hero-particulas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }
