/* Build: 2026-09-27 */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --papel: #FFFFFF;
  --tinta: #17231D;
  --gris: #4A5550;
  --verde: #1D6B48;
  --verde-oscuro: #134A31;
  --verde-claro: #E7F1EB;
  --piedra: #E4E0D6;
  --piedra-clara: #F6F4EF;
  --ambar: #7A4E0B;
  --ambar-claro: #FBF0D9;
  --sobre-verde: #FFFFFF;
  --cita-fondo: #134A31;
  --cita-texto: #FFFFFF;
  --texto: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --titular: "Newsreader", Georgia, "Times New Roman", serif;
  --lectura: 42rem;
  --ancho: 62rem;
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papel); color: var(--tinta); font-family: var(--texto); line-height: 1.6; }
img, svg { max-width: 100%; height: auto; }

a { color: var(--verde); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--verde-oscuro); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; border-radius: 3px; }

.saltar { position: absolute; left: -9999px; }
.saltar:focus { left: 1rem; top: 1rem; background: var(--papel); padding: 0.6rem 1rem; z-index: 10; }

/* Cabecera */
.cabecera { border-bottom: 1px solid var(--piedra); }
.cabecera-dentro { max-width: var(--ancho); margin: 0 auto; padding: 0.9rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; }
.marca { font-family: var(--titular); font-weight: 600; font-size: 1.45rem; color: var(--tinta); text-decoration: none; }
.menu { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gris); text-decoration: none; }
.menu a:hover { color: var(--tinta); text-decoration: underline; }
.menu a[aria-current="page"] { color: var(--tinta); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }

/* Contenido */
main { max-width: var(--ancho); margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.lectura { max-width: var(--lectura); }
.migas { font-size: 0.9rem; color: var(--gris); margin-bottom: 1.25rem; }
.migas a { color: var(--gris); }

h1, h2 { font-family: var(--titular); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; line-height: 1.12; margin: 0 0 1.25rem; max-width: 22ch; }
h2 { font-size: 1.6rem; line-height: 1.2; margin: 3rem 0 0.75rem; }
h3 { font-size: 1.12rem; line-height: 1.35; margin: 0; }
p { margin: 0 0 1rem; }
.entrada p { font-size: 1.12rem; line-height: 1.65; }
.nota { color: var(--gris); font-size: 0.9rem; }

/* Lista de categorías y distritos */
.rejilla { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); column-gap: 2.5rem; border-top: 1px solid var(--piedra); }
.rejilla li { border-bottom: 1px solid var(--piedra); }
.rejilla a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; min-height: 3.25rem; padding: 0.75rem 0; color: var(--tinta); text-decoration: none; }
.rejilla a:hover .nombre { text-decoration: underline; }
.rejilla .cuantos { color: var(--gris); font-size: 0.9rem; }

/* Saltos dentro de una categoría */
.saltos { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.saltos a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--piedra); border-radius: 999px; color: var(--tinta); text-decoration: none; font-size: 0.95rem; }
.saltos a:hover { border-color: var(--verde); }

/* Entidades */
.entidades { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--piedra); max-width: var(--lectura); }
.entidad { padding: 1.35rem 0; border-bottom: 1px solid var(--piedra); max-width: var(--lectura); scroll-margin-top: 1rem; }
.entidad h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.titularidad { font-family: var(--texto); font-weight: 400; font-size: 0.85rem; color: var(--verde-oscuro); background: var(--verde-claro); padding: 0.05rem 0.55rem; border-radius: 4px; }
.entidad .que { margin: 0.35rem 0 0.35rem; }
.entidad .donde { margin: 0 0 0.5rem; color: var(--gris); }
.acciones { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0 0 0.5rem; }
.acciones a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.origen { font-size: 0.9rem; color: var(--gris); margin: 0; }
.falta { font-size: 0.9rem; color: var(--ambar); background: var(--ambar-claro); display: inline-block; padding: 0.35rem 0.7rem; border-radius: 4px; margin: 0.6rem 0 0; }
.falta a { color: var(--ambar); font-weight: 700; }

/* Bloques */
.aviso { background: var(--verde-claro); border-radius: 6px; padding: 1.5rem 1.5rem 1.25rem; margin: 3rem 0 0; max-width: var(--lectura); }
.aviso h2 { margin-top: 0; font-size: 1.4rem; }
.boton { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.25rem; background: var(--verde); color: var(--sobre-verde); border-radius: 6px; font-weight: 700; text-decoration: none; }
.boton:hover { background: var(--verde-oscuro); color: var(--sobre-verde); }
.boton-sec { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.25rem; border: 1px solid var(--verde); color: var(--verde); border-radius: 6px; font-weight: 700; text-decoration: none; }
.botones { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 0.5rem; }

/* Observatorio */
.mapa { margin: 1.5rem 0 0.5rem; border: 1px solid var(--piedra); border-radius: 6px; background: var(--piedra-clara); }
.mapa svg { display: block; width: 100%; }
.mapa .distrito path { stroke: #FFFFFF; stroke-width: 2; }
.mapa .distrito:hover path, .mapa .distrito:focus path { stroke: var(--tinta); stroke-width: 3; }
.mapa .punto { fill: #17231D; fill-opacity: 0.6; stroke: #FFFFFF; stroke-width: 0.8; }
.mapa .etiqueta { font-family: var(--texto); font-size: 15px; font-weight: 700; fill: #17231D; paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round; }
.estado { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem 2rem; margin: 1.5rem 0 0; padding: 1.25rem 0; border-top: 1px solid var(--piedra); border-bottom: 1px solid var(--piedra); }
.estado div { font-size: 0.95rem; color: var(--gris); }
.estado strong { display: block; font-family: var(--titular); font-weight: 600; font-size: 2rem; line-height: 1.1; color: var(--tinta); }
.distritos { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--piedra); max-width: var(--lectura); }
.distritos > li { padding: 1.5rem 0; border-bottom: 1px solid var(--piedra); max-width: var(--lectura); scroll-margin-top: 1rem; }
.distritos h3 { font-family: var(--titular); font-weight: 600; font-size: 1.35rem; }
.distritos .total { color: var(--gris); margin: 0.2rem 0 0.6rem; }
.hay { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); column-gap: 1.5rem; }
.hay a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; }
.hay a:hover { text-decoration: underline; }
.echamos { margin: 0.6rem 0 0; color: var(--ambar); }


/* Tablas del Observatorio */
.tabla { overflow-x: auto; margin: 1rem 0 0.5rem; -webkit-overflow-scrolling: touch; }
.tabla:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; }
.tabla table { border-collapse: collapse; width: 100%; min-width: 38rem; font-variant-numeric: tabular-nums; }
.tabla caption { text-align: left; padding-bottom: 0.5rem; }
.tabla th, .tabla td { text-align: right; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--piedra); white-space: nowrap; }
.tabla th:first-child, .tabla td:first-child { text-align: left; padding-left: 0; }
.tabla thead th { font-size: 0.85rem; line-height: 1.3; color: var(--gris); vertical-align: bottom; white-space: normal; }
.tabla tbody th { font-weight: 700; }
.tabla th:first-child { position: sticky; left: 0; background: var(--papel); z-index: 1; }
.tabla-estrecha table { min-width: 24rem; }
.deslizar { display: none; margin: 0.5rem 0 0; }
.tabla tfoot th, .tabla tfoot td { border-top: 2px solid var(--piedra); border-bottom: 0; }
.sube { color: var(--verde-oscuro); font-weight: 700; }
.baja { color: var(--ambar); font-weight: 700; }
.barra { display: inline-block; width: 5rem; height: 0.5rem; margin-left: 0.6rem; background: var(--piedra); border-radius: 3px; vertical-align: middle; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); }
.selector { margin: 1rem 0; }
.selector label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.selector select { font: inherit; min-height: 48px; padding: 0 2.5rem 0 0.9rem; border: 1px solid var(--gris); border-radius: 6px; background: var(--papel); color: var(--tinta); max-width: 100%; }
.tabla-cat { margin-top: 1.5rem; }
.tabla-cat h3 { font-family: var(--titular); font-weight: 600; font-size: 1.3rem; margin-bottom: 0.25rem; }
.cobertura { max-width: var(--lectura); margin: -0.25rem 0 0.75rem; color: var(--gris); }

/* Mapa: indicador y leyenda */
.indicadores { border: 0; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.indicadores legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }
.indicadores label { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1rem; border: 1px solid var(--piedra); border-radius: 999px; cursor: pointer; background: var(--papel); }
.indicadores label:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); font-weight: 700; }
.indicadores input { accent-color: var(--verde); width: 1.1rem; height: 1.1rem; margin: 0; }
.leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 1rem; font-size: 0.9rem; color: var(--gris); border-top: 1px solid var(--piedra); background: var(--papel); }
.leyenda .rampa { flex: 0 1 10rem; height: 0.65rem; border-radius: 3px; }
.leyenda .texto { flex-basis: 100%; }
@media (min-width: 40rem) { .leyenda .texto { flex-basis: auto; } }

/* Cita */
.cita { margin: 1rem 0; padding: 1.25rem 1.4rem; background: var(--cita-fondo); color: var(--cita-texto); border-radius: 6px; font-family: var(--titular); font-weight: 600; font-size: 1.3rem; line-height: 1.35; }

/* Pie */
.pie { border-top: 1px solid var(--piedra); background: var(--piedra-clara); }
.pie-dentro { max-width: var(--ancho); margin: 0 auto; padding: 1.75rem 1.25rem 2.25rem; font-size: 0.9rem; color: var(--gris); }
.pie-dentro p { margin: 0 0 0.5rem; max-width: var(--lectura); }

@media (max-width: 40rem) {
  .deslizar { display: block; }
  .tabla-estrecha .barra { display: none; }
  .mapa .etiqueta { font-size: 28px; stroke-width: 8px; }
  .mapa .punto { r: 6px; }
  .mapa .distrito path { stroke-width: 3; }
  html { font-size: 106.25%; }
  h1 { font-size: 1.95rem; }
  h2 { font-size: 1.4rem; margin-top: 2.5rem; }
  main { padding-top: 1.5rem; }
}
@media print {
  .cabecera, .pie, .botones, .falta a { display: none; }
}
