/*
 * charts_demografia.css — ÚNICO CSS del proyecto "demografía que decide 2026".
 * Estructura (igual que el JS): 1) BLOQUE BASE (copia de shared/tokens.css + base.css);
 * 2) ESPECÍFICO del proyecto bajo .chart-demografia.
 */

/* =====================================================================
   1) BLOQUE BASE — copia de shared/styles/tokens.css + shared/styles/base.css
   ===================================================================== */
:root {
  --ed-rojo: #D0021B;
  --ed-negro: #1a1a1a;
  --ed-amarillo: #ECDC19;
  --ed-azul: #4A90E2;
  --ed-azul-principal: #005695;
  --ed-gris-900: #333333;
  --ed-gris-700: #4a4a4a;
  --ed-gris-500: #939393;
  --ed-gris-300: #c5c5c5;
  --ed-gris-200: #dedede;
  --ed-gris-100: #eaeaea;
  --ed-texto: #1a1a1a;
  --ed-texto-suave: #4a4a4a;
  --ed-radio: 4px;
  --ed-fuente: 'Encode Sans', 'Helvetica Neue', Arial, sans-serif;
  --ed-fuente-titulo: 'Sanomat-Bold', Georgia, 'Times New Roman', serif;
}
.ed-chart, .ed-chart *, .ed-chart *::before, .ed-chart *::after { box-sizing: border-box; }
.ed-chart {
  font-family: var(--ed-fuente); color: var(--ed-texto); line-height: 1.4;
  margin: 24px 0; text-align: left; clear: left;
}
.ed-titulo { font-family: var(--ed-fuente); font-weight: 700; color: var(--ed-negro); font-size: 22px; line-height: 1.2; margin: 0 0 4px; }
.ed-subtitulo { font-family: var(--ed-fuente); color: var(--ed-texto-suave); font-size: 14px; margin: 0 0 16px; }
.ed-fuente { font-family: var(--ed-fuente); color: var(--ed-gris-500); font-size: 12px; margin-top: 8px; }
.ed-chart .ed-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ed-chart .ed-svg text { font-family: var(--ed-fuente); }
.ed-chart .ed-eje text { font-size: 14px; fill: var(--ed-gris-500); }
.ed-chart .ed-eje path { stroke-width: 0; }
.ed-chart .ed-eje line { stroke: var(--ed-gris-500); stroke-width: 1; }
.ed-chart .ed-eje-grid line { stroke: var(--ed-gris-300); stroke-width: 0.5; stroke-dasharray: 3; }
.ed-chart .ed-halo { stroke: #fff; stroke-width: 3px; stroke-opacity: 0.9; paint-order: stroke; }
.ed-chart .ed-highlight-layer rect,
.ed-chart .ed-highlight-layer circle,
.ed-chart .ed-highlight-layer path { fill: none; stroke: var(--ed-negro); stroke-width: 2px; }

/* =====================================================================
   2) ESPECÍFICO DEL PROYECTO (.chart-demografia)
   ===================================================================== */

/* Leyenda de partidos + nota */
.chart-demografia .ed-leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 10px; }
.chart-demografia .ed-leyenda .item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ed-texto); }
.chart-demografia .ed-leyenda .punto { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.chart-demografia .ed-nota { font-size: 12px; color: var(--ed-gris-500); margin: 0 0 14px; }

/* Leyenda clicable (filtro del scatter) */
.chart-demografia .ed-leyenda .ed-clicable { cursor: pointer; user-select: none; }
.chart-demografia .ed-leyenda .ed-clicable.apagado { opacity: 0.35; }

/* Celdas del heatmap */
.chart-demografia .ed-celda { cursor: pointer; }

/* Scatter */
.chart-demografia .ed-punto { cursor: pointer; }
.chart-demografia .ed-cero { stroke: var(--ed-negro); stroke-width: 1; }
.chart-demografia .ed-dir { font-size: 12px; fill: var(--ed-gris-500); }

/* Cuadrantes (sombreado de "mucho peso") + divisoria */
.chart-demografia .ed-cuad-zona { fill: var(--ed-negro); opacity: 0.045; }
.chart-demografia .ed-cuad-linea { stroke: var(--ed-gris-500); stroke-width: 1; stroke-dasharray: 4 3; }
.chart-demografia .ed-cuad-label { font-size: 12px; font-weight: 700; fill: var(--ed-gris-700); }

/* Call-outs sobre grupos concretos */
.chart-demografia .ed-call-linea { stroke: var(--ed-negro); stroke-width: 1; }
.chart-demografia .ed-call-punto { fill: none; stroke: var(--ed-negro); stroke-width: 2; }
.chart-demografia .ed-call-texto { font-size: 12px; font-weight: 700; fill: var(--ed-negro); }

/* Selector de variable */
.chart-demografia .ed-selector { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.chart-demografia .ed-selector label { font-size: 13px; color: var(--ed-texto-suave); }
.chart-demografia .ed-selector select {
  height: 34px; padding: 4px 30px 4px 10px; border: 1px solid #cecece; border-radius: var(--ed-radio);
  font-family: var(--ed-fuente); font-size: 14px; background-color: #fff; color: var(--ed-texto); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.chart-demografia .ed-selector select:focus { outline: none; border-color: var(--ed-gris-500); }

/* Stepper del pictograma de composición */
.chart-demografia .ed-pasos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chart-demografia .ed-pasos button {
  height: 34px; padding: 4px 12px; border: 1px solid #cecece; border-radius: var(--ed-radio);
  background: #fff; color: var(--ed-texto); font-family: var(--ed-fuente); font-size: 13px; cursor: pointer;
}
.chart-demografia .ed-pasos button:hover { background: var(--ed-gris-100); }
.chart-demografia .ed-pasos button.activo { background: var(--ed-negro); color: #fff; border-color: var(--ed-negro); }
.chart-demografia .ed-seg, .chart-demografia .ed-cuadro { cursor: pointer; }

/* Barras variwide (minis) */
.chart-demografia .ed-minis { display: grid; gap: 26px 26px; }
.chart-demografia .ed-mini-titulo { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.chart-demografia .ed-barra { cursor: pointer; }
.chart-demografia .ed-cat { font-size: 12px; fill: var(--ed-texto); }
.chart-demografia .ed-val { font-size: 11px; font-weight: 700; }
.chart-demografia .ed-fam { font-size: 11px; font-weight: 700; fill: var(--ed-gris-500); text-transform: uppercase; letter-spacing: .03em; }

/* Scrollytelling (gráfico fijo por JS + pasos de texto editables). Patrón tipo "gran transferencia". */
.chart-demografia .ed-scrolly { position: relative; }
.chart-demografia .ed-scrolly figure { position: absolute; top: 0; left: 0; width: 100%; margin: 0; z-index: 0; }
.chart-demografia .ed-scrolly article { position: relative; z-index: 1; padding: 0; pointer-events: none; }
/* min-height = cuánto hay que scrollear en cada paso antes de cambiar de gráfico (sube este valor para que cada gráfico se aprecie más tiempo). */
.chart-demografia .ed-step { min-height: 120vh; display: flex; align-items: center; justify-content: flex-start; padding: 0 clamp(14px, 4vw, 56px); }
.chart-demografia .ed-step.ed-step--der { justify-content: flex-end; }
.chart-demografia .ed-step.ed-step--centro { justify-content: center; }
.chart-demografia .ed-step-inner { pointer-events: auto; background: rgba(255,255,255,.96); box-shadow: 0 1px 8px rgba(0,0,0,.16); padding: 14px 16px; max-width: 300px; font-size: 14px; line-height: 1.5; color: var(--ed-texto); border-radius: 4px; opacity: .55; transition: opacity .3s; }
.chart-demografia .ed-step.ed-activo .ed-step-inner { opacity: 1; }
.chart-demografia .ed-step-inner b, .chart-demografia .ed-step-inner strong { font-weight: 700; }
@media (max-width: 720px) {
  .chart-demografia .ed-step { min-height: 88vh; justify-content: center; }
  .chart-demografia .ed-step-inner { font-size: 14px; max-width: 92vw; }
}

/* =====================================================================
   3) PÁGINA (charts-demografia-29N.html) — lo que estaba en el <style> del HTML.
      Todo el texto alineado a la izquierda.
   ===================================================================== */
body {
  margin: 0; padding: 0; background: #fff;
  font-family: var(--ed-fuente); color: var(--ed-negro); text-align: left;
}

.intro, .outro { max-width: 680px; margin: 0; padding: 40px 0; text-align: left; }
.intro h2 { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.intro p { font-size: 16px; color: var(--ed-gris-700); margin: 0; line-height: 1.5; }
.outro .outro-nota { color: var(--ed-gris-500); font-size: 13px; margin: 0; }

/* --- Scroll --- */
#scroll29n { position: relative; text-align: left; }
#scroll29n figure { position: sticky; top: 0; width: 100%; height: 100vh; margin: 0; z-index: 1; }
#scroll29n article { position: relative; z-index: 2; margin-top: -100vh; pointer-events: none; }
#scroll29n .step { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
#scroll29n .step .box {
  pointer-events: auto; background: rgba(255,255,255,.96); box-shadow: 0 1px 12px rgba(0,0,0,.16);
  border-radius: 6px; padding: 14px 18px; max-width: 320px; font-size: 15px; line-height: 1.5;
  color: var(--ed-negro); opacity: .55; transition: opacity .3s; margin: 0 auto; text-align: left;
}
#scroll29n .step.is-active .box { opacity: 1; }
#scroll29n .step .box b { font-weight: 700; }
@media (max-width: 720px) { #scroll29n .step .box { max-width: 88vw; font-size: 14px; } }

/* --- Bloques de gráfico (después del scroll), ancho completo --- */
.bloque { padding: 24px 0 8px; text-align: left; }
.bloque .ed-titulo { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.bloque .ed-subtitulo { max-width: 820px; font-size: 14px; color: var(--ed-gris-700); margin: 0 0 12px; line-height: 1.45; }
.bloque .ed-sub { font-size: 18px; font-weight: 700; margin: 0 0 8px; color: var(--ed-negro); }
.bloque .pista { font-size: 13px; color: var(--ed-gris-500); margin: 0 0 12px; }
