/* cendra VLC · estilos del atlas
 * Paleta inspirada en ceniza tras incendio:
 *  - fondo: blanco hueso casi crema
 *  - acento: rojo brasa profundo para el riesgo
 *  - secundario: gris ceniza para texto y mapas
 */
:root {
  --bg: #fbf8f3;
  --bg-panel: #fffefb;
  --texto: #222220;
  --texto-suave: #5e5a52;
  --brasa: #b03a1d;
  --brasa-claro: #d76a45;
  --ceniza: #8a8478;
  --linea: #e2dcd1;
  --acento: #1f4f8b;
  --sombra: 0 1px 2px rgba(20, 15, 5, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--texto);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

header {
  padding: 1rem 1.5rem 0.5rem;
  border-bottom: 1px solid var(--linea);
  background: var(--bg-panel);
}
header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--texto);
}
header h1 .vlc {
  color: var(--brasa);
  font-weight: 400;
}
header .tagline {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--texto-suave);
}

main {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - 110px);
}

#panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--linea);
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.bloque {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--linea);
}
.bloque:last-child { border-bottom: none; }
.bloque h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--texto-suave);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.bloque .ayuda {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ceniza);
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
label > input[type="range"] {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
}
label > output {
  float: right;
  font-weight: 600;
  color: var(--brasa);
  font-variant-numeric: tabular-nums;
}
label > select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--linea);
  border-radius: 4px;
  background: white;
  font-family: inherit;
  font-size: 0.9rem;
}
label > input[type="checkbox"] {
  margin-right: 0.5rem;
  vertical-align: middle;
}

.botones {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.botones button {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--linea);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.botones button:hover {
  border-color: var(--brasa);
  color: var(--brasa);
}

#mapa-wrap {
  position: relative;
}
#mapa {
  width: 100%;
  height: 100%;
}

.resultado {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 280px;
  background: var(--bg-panel);
  border: 1px solid var(--linea);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  box-shadow: var(--sombra);
  z-index: 10;
}
.cabecera-resultado {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.numero {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brasa);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.etiqueta {
  font-size: 0.8rem;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.barra {
  margin: 0.75rem 0;
  height: 8px;
  background: var(--linea);
  border-radius: 4px;
  overflow: hidden;
}
.barra-relleno {
  height: 100%;
  background: linear-gradient(to right, #6e9d4c, #f5b400, var(--brasa));
  width: 0%;
  transition: width 0.2s ease;
}
.componentes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.componentes > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--texto-suave);
}
.componentes span:first-child {
  font-weight: 600;
  color: var(--texto);
  font-variant-numeric: tabular-nums;
}
.contexto {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--linea);
  font-size: 0.8rem;
  color: var(--ceniza);
}

.leyenda {
  position: absolute;
  bottom: 1.5rem; left: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--linea);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  box-shadow: var(--sombra);
  font-size: 0.75rem;
  color: var(--texto-suave);
  z-index: 10;
  max-width: 220px;
}
.leyenda strong {
  color: var(--texto);
  font-size: 0.8rem;
}
.leyenda .gradiente {
  margin: 0.4rem 0 0.2rem;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #6e9d4c 0%, #b8c155 25%, #f5b400 50%, #e57a37 75%, #b03a1d 100%);
}
.leyenda .ejes {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ceniza);
  margin-bottom: 0.5rem;
}
.leyenda .explica {
  padding-top: 0.4rem;
  border-top: 1px solid var(--linea);
  font-size: 0.72rem;
  line-height: 1.5;
}
.leyenda .punto {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.leyenda .punto.parque { background: #1f4f8b; border: 1px solid white; }
.leyenda .punto.edif { background: #b03a1d; }

footer {
  padding: 0.5rem 1.5rem;
  font-size: 0.8rem;
  color: var(--ceniza);
  border-top: 1px solid var(--linea);
  background: var(--bg-panel);
}
footer a {
  color: var(--acento);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }

/* Responsive: en móvil, panel sobre el mapa */
@media (max-width: 800px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  #panel {
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--linea);
  }
  #mapa { min-height: 60vh; }
  .resultado {
    width: calc(100% - 2rem);
    top: 0.5rem; right: 0.5rem; left: 0.5rem;
  }
}
