/* =========================================================================
   Elecciones 29N — hoja de estilos
   Base: blanco de papeleta, tinta azul-negra y gris de urna.
   El único elemento decorativo es la franja con los colores de todos los partidos.
   Los colores de partido solo se usan para identificar datos.
   ========================================================================= */

@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --papel: #ffffff;
  --urna: #eef1f4;
  --urna-2: #e2e7ec;
  --tinta: #141a26;
  --tinta-2: #475066;
  --tinta-3: #5f6880;
  --linea: #cfd5dd;
  --linea-suave: #e3e7ec;
  --foco: #141a26;
  --ok: #1f7a4d;
  --aviso: #8a5a00;
  --aviso-fondo: #fff6e0;

  --fuente: "Atkinson", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Escala tipográfica 1.25 sobre 17px */
  --t-xs: 0.8125rem;
  --t-s: 0.9375rem;
  --t-m: 1.0625rem;
  --t-l: 1.3125rem;
  --t-xl: 1.625rem;
  --t-2xl: 2.0625rem;
  --t-3xl: clamp(2.25rem, 5vw, 3.25rem);
  --t-hero: clamp(2.6rem, 7.4vw, 5.4rem);

  --ancho: 72rem;
  --ancho-texto: 42rem;
  --margen: clamp(1rem, 4vw, 2.5rem);
  --radio: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papel: #121824;
    --urna: #0b1019;
    --urna-2: #1a2232;
    --tinta: #eef1f6;
    --tinta-2: #b9c1d1;
    --tinta-3: #9aa3b5;
    --linea: #33405a;
    --linea-suave: #243047;
    --foco: #ffffff;
    --ok: #5fd39a;
    --aviso: #ffcf70;
    --aviso-fondo: #2b2310;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: var(--t-m);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--t-3xl); letter-spacing: -0.025em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.02em; }
h3 { font-size: var(--t-l); }
h4 { font-size: var(--t-m); }
p { margin: 0 0 1em; max-width: var(--ancho-texto); }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: 0.35em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }
small { font-size: var(--t-s); }

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--papel);
}
main:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--tinta); color: var(--papel); padding: 0.6rem 1rem; border-radius: var(--radio);
}
.saltar:focus { top: 1rem; }

.visualmente-oculto {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.envoltorio { max-width: var(--ancho); margin: 0 auto; padding: 0 var(--margen); }

/* ---------- Franja de todos los partidos ---------- */
.franja { display: flex; width: 100%; }
.franja__seg { flex: 1 1 0; background: var(--c, var(--linea)); }
.franja--fina { height: 6px; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--papel) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--linea-suave);
}
.cabecera__in {
  max-width: var(--ancho); margin: 0 auto; padding: 0.7rem var(--margen);
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.marca { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; margin-right: auto; }
.marca__fecha { font-weight: 800; font-size: var(--t-xl); letter-spacing: -0.03em; }
.marca__texto { font-size: var(--t-s); color: var(--tinta-2); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav li { margin: 0; }
.nav a {
  display: block; padding: 0.45rem 0.75rem; border-radius: var(--radio);
  text-decoration: none; font-weight: 700; font-size: var(--t-s);
}
.nav a:hover { background: var(--urna); }
.nav a[aria-current="page"] { background: var(--tinta); color: var(--papel); }

.menu-boton { display: none; }

@media (max-width: 760px) {
  .menu-boton {
    display: inline-block; font: inherit; font-weight: 700; font-size: var(--t-s);
    background: none; color: var(--tinta); border: 1px solid var(--linea); border-radius: var(--radio);
    padding: 0.4rem 0.8rem; cursor: pointer;
  }
  .nav { display: none; width: 100%; }
  .nav[data-abierto] { display: block; }
  .nav ul { flex-direction: column; padding-bottom: 0.5rem; }
  .nav a { padding: 0.7rem 0.5rem; font-size: var(--t-m); }
}

main { min-height: 70vh; }

/* ---------- Pie ---------- */
.pie { margin-top: 5rem; border-top: 1px solid var(--linea-suave); background: var(--urna); color: var(--tinta-2); font-size: var(--t-s); }
.pie__in { padding-top: 2rem; padding-bottom: 2.5rem; }
.pie__meta { color: var(--tinta-3); margin-bottom: 0; }

/* ---------- Botones y controles ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 700; font-size: var(--t-m); line-height: 1.2;
  padding: 0.8rem 1.3rem; border-radius: var(--radio);
  background: var(--tinta); color: var(--papel); border: 2px solid var(--tinta);
  text-decoration: none; cursor: pointer;
}
.boton:hover { background: var(--tinta-2); border-color: var(--tinta-2); text-decoration: none; }
.boton--sec { background: transparent; color: var(--tinta); border-color: var(--linea); }
.boton--sec:hover { background: var(--urna); border-color: var(--tinta-3); }
.boton--peq { font-size: var(--t-s); padding: 0.5rem 0.9rem; }
.boton[disabled] { opacity: 0.45; cursor: not-allowed; }

.acciones { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.acciones--pegadas { margin-top: 0; }

.campo { display: flex; flex-direction: column; gap: 0.35rem; max-width: 24rem; }
.campo label { font-weight: 700; font-size: var(--t-s); }
.campo select {
  font: inherit; color: var(--tinta); background: var(--papel);
  border: 1px solid var(--linea); border-radius: var(--radio); padding: 0.6rem 0.75rem;
}
.campo__ayuda { font-size: var(--t-s); color: var(--tinta-3); margin: 0; }

/* Píldora de partido: siglas sobre su color */
.pildora {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--c, var(--tinta)); color: var(--ct, #fff);
  font-weight: 800; font-size: var(--t-xs); line-height: 1; letter-spacing: 0.01em;
  padding: 0.32rem 0.5rem; border-radius: 2px; white-space: nowrap; text-decoration: none;
}
a.pildora:hover { text-decoration: underline; }

/* Chips de filtro (partidos) */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.chips li { margin: 0; }
.chip {
  font: inherit; font-size: var(--t-s); font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem; border-radius: 2px;
  background: var(--papel); color: var(--tinta); border: 1px solid var(--linea);
}
.chip::before { content: ""; width: 0.8rem; height: 0.8rem; border-radius: 1px; background: var(--c); border: 1px solid rgba(0,0,0,.15); }
.chip[aria-pressed="false"] { color: var(--tinta-3); background: var(--urna); border-style: dashed; }
.chip[aria-pressed="false"]::before { background: transparent; border-color: var(--tinta-3); }

/* Avisos */
.aviso {
  border-left: 4px solid var(--aviso); background: var(--aviso-fondo);
  padding: 0.8rem 1rem; font-size: var(--t-s); margin: 1.25rem 0; max-width: var(--ancho-texto);
}
.aviso p:last-child { margin-bottom: 0; }

.estado { display: inline-block; font-size: var(--t-xs); font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 2px; border: 1px solid currentColor; }
.estado--ok { color: var(--ok); }
.estado--aviso { color: var(--aviso); }

.fuente { font-size: var(--t-s); color: var(--tinta-3); margin: 0.6rem 0 0; }
.fuente a { color: var(--tinta-2); }

/* ---------- Inicio ---------- */
.portada { padding: clamp(2.5rem, 7vw, 5rem) 0 0; }
.portada__fecha { font-size: var(--t-l); color: var(--tinta-2); margin-bottom: 0.75rem; }
.portada__titulo { font-size: var(--t-hero); line-height: 0.98; letter-spacing: -0.035em; max-width: 14ch; margin-bottom: 1.5rem; }
.portada__entradilla { font-size: var(--t-l); color: var(--tinta-2); max-width: 36rem; }

/* La franja grande: es la navegación por partidos */
.papeletas-franja {
  display: grid; grid-template-columns: repeat(var(--n, 13), minmax(0, 1fr));
  margin: 2.5rem 0 0; list-style: none; padding: 0;
  border-top: 1px solid var(--tinta); border-bottom: 1px solid var(--tinta);
}
.papeletas-franja li { margin: 0; }
.papeletas-franja a {
  display: flex; flex-direction: column; justify-content: flex-end;
  height: clamp(9rem, 22vw, 15rem); padding: 0.6rem 0.45rem;
  background: var(--c); color: var(--ct, #fff); text-decoration: none;
  transition: transform 160ms ease;
  transform-origin: bottom;
}
.papeletas-franja a:hover, .papeletas-franja a:focus-visible { transform: scaleY(1.06); }
.papeletas-franja__siglas { font-weight: 800; font-size: clamp(0.72rem, 1.12vw, 0.98rem); line-height: 1.05; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.papeletas-franja__ambito { font-size: 0.7rem; opacity: 0.85; margin-top: 0.2rem; }
.leyenda-franja { font-size: var(--t-s); color: var(--tinta-3); margin-top: 0.6rem; }

@media (max-width: 760px) {
  .papeletas-franja { grid-template-columns: repeat(4, minmax(0, 1fr)); border: 0; gap: 2px; }
  .papeletas-franja a { height: 5.5rem; }
  .papeletas-franja a:hover, .papeletas-franja a:focus-visible { transform: none; }
}

.entradas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 4rem; border-top: 1px solid var(--linea); }
@media (max-width: 1100px) and (min-width: 761px) {
  .entradas { grid-template-columns: repeat(2, 1fr); }
  .entrada:nth-child(2n) { border-right: 0; }
  .entrada:nth-child(n+3) { border-top: 1px solid var(--linea-suave); }
  .entrada:nth-child(3) { padding-left: 0; }
}
.entrada { padding: 1.75rem 1.75rem 1.75rem 0; border-right: 1px solid var(--linea-suave); }
.entrada + .entrada { padding-left: 1.75rem; }
.entrada:last-child { border-right: 0; }
.entrada h2 { font-size: var(--t-xl); }
.entrada p { color: var(--tinta-2); }
.entrada a.enlace-fuerte { font-weight: 800; font-size: var(--t-l); }
@media (max-width: 760px) {
  .entradas { grid-template-columns: 1fr; }
  .entrada, .entrada + .entrada { padding: 1.5rem 0; border-right: 0; border-bottom: 1px solid var(--linea-suave); }
}

.bloque-privacidad { margin-top: 3.5rem; padding: 1.5rem; background: var(--urna); border-radius: var(--radio); }
.bloque-privacidad h2 { font-size: var(--t-l); }
.bloque-privacidad ul { margin: 0; max-width: var(--ancho-texto); }

/* ---------- Cabeceras de sección ---------- */
.seccion { padding-top: clamp(2rem, 5vw, 3.5rem); }
.seccion__intro { color: var(--tinta-2); font-size: var(--t-l); max-width: 40rem; }

/* ---------- Papeletas (listado de programas) ---------- */
.papeletas { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 2rem 0 0; }
.papeletas > li { margin: 0; }
.papeleta {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--papel); border: 1px solid var(--tinta); border-radius: 2px;
  padding: 1rem 1rem 1rem 1.6rem; text-decoration: none; min-height: 13rem;
}
.papeleta::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.6rem; background: var(--c); }
.papeleta:hover { background: var(--urna); text-decoration: none; }
.papeleta__siglas { font-weight: 800; font-size: var(--t-2xl); letter-spacing: -0.02em; line-height: 1; margin-bottom: 0.35rem; }
.papeleta__nombre { font-weight: 700; font-size: var(--t-s); margin-bottom: 0.75rem; }
.papeleta__dato { font-size: var(--t-s); color: var(--tinta-2); margin: 0 0 0.2rem; }
.papeleta__pie { margin-top: auto; padding-top: 0.9rem; }

.filtros { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: flex-end; margin-top: 1.5rem; padding: 1rem; background: var(--urna); border-radius: var(--radio); }
.filtros__grupo { display: flex; flex-direction: column; gap: 0.4rem; }
.filtros__titulo { font-weight: 700; font-size: var(--t-s); }

/* ---------- Página de partido ---------- */
.partido-cab { background: var(--c); color: var(--ct, #fff); }
.partido-cab__in { max-width: var(--ancho); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--margen) 2rem; }
.partido-cab__volver { color: inherit; font-size: var(--t-s); font-weight: 700; }
.partido-cab__siglas { font-size: var(--t-hero); line-height: 0.95; letter-spacing: -0.04em; margin: 1rem 0 0.4rem; }
.partido-cab__nombre { font-size: var(--t-l); font-weight: 700; margin-bottom: 1rem; }
.partido-cab__datos { display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; margin: 0; }
.partido-cab__datos div { margin: 0; }
.partido-cab__datos dt { font-size: var(--t-xs); opacity: 0.85; }
.partido-cab__datos dd { margin: 0; font-weight: 700; }
.partido-cab__nota { font-size: var(--t-s); margin: 1rem 0 0; max-width: 46rem; opacity: 0.92; }

.partido-cuerpo { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; margin-top: 2.5rem; }
.indice { position: sticky; top: 5.5rem; align-self: start; font-size: var(--t-s); }
.indice h2 { font-size: var(--t-s); color: var(--tinta-3); font-weight: 700; letter-spacing: 0; }
.indice ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--linea); }
.indice li { margin: 0; }
.indice a { display: block; padding: 0.3rem 0 0.3rem 0.8rem; text-decoration: none; color: var(--tinta-2); }
.indice a:hover { color: var(--tinta); text-decoration: underline; }
@media (max-width: 900px) {
  .partido-cuerpo { grid-template-columns: 1fr; gap: 1.5rem; }
  .indice { position: static; }
  .indice ul { display: flex; flex-wrap: wrap; gap: 0.3rem; border: 0; }
  .indice a { border: 1px solid var(--linea); border-radius: 2px; padding: 0.25rem 0.55rem; }
}

.programa-oficial {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between;
  border: 1px solid var(--tinta); padding: 1.1rem 1.25rem; border-radius: 2px; margin-bottom: 2rem;
}
.programa-oficial p { margin: 0; }
.programa-oficial__titulo { font-weight: 800; font-size: var(--t-l); }

.tema { padding: 2rem 0; border-top: 1px solid var(--linea-suave); }
.tema__cab { display: flex; align-items: baseline; gap: 0.6rem; }
.tema__icono { font-size: var(--t-l); color: var(--tinta-3); width: 1.4rem; flex: none; text-align: center; }
.tema h2, .tema h3 { margin-bottom: 0.6rem; }
.medidas { margin: 0.75rem 0 0; max-width: var(--ancho-texto); }
.medidas li::marker { color: var(--c, var(--tinta-3)); }
.sin-datos { color: var(--tinta-3); font-style: italic; }

/* ---------- Escala de posiciones (afirmación × partidos) ---------- */
.posicion { padding: 1.4rem 0; border-top: 1px solid var(--linea-suave); }
.posicion__enunciado { font-weight: 700; font-size: var(--t-m); margin-bottom: 0.8rem; max-width: var(--ancho-texto); }
.escala { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 0.8fr); gap: 2px; }
.escala__col { background: var(--urna); padding: 0.45rem 0.35rem 0.55rem; min-height: 4.2rem; }
.escala__col--sin { background: transparent; border: 1px dashed var(--linea); }
.escala__titulo { display: block; font-size: 0.72rem; line-height: 1.2; color: var(--tinta-2); margin-bottom: 0.4rem; min-height: 1.8em; }
.escala__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.escala__col li { margin: 0; }
.escala__col .pildora { font-size: 0.7rem; padding: 0.26rem 0.38rem; }
.escala__tu { outline: 3px solid var(--tinta); outline-offset: -3px; }
.escala__tu .escala__titulo::after { content: " · tu respuesta"; font-weight: 800; color: var(--tinta); }
@media (max-width: 560px) {
  .escala { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .escala__col--sin { grid-column: 1 / -1; min-height: 0; }
  .escala__titulo { font-size: 0.66rem; }
}

/* ---------- Comparar ---------- */
.comparar { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; margin-top: 2rem; }
.temas-nav { position: sticky; top: 5.5rem; align-self: start; }
.temas-nav ul { list-style: none; padding: 0; margin: 0; }
.temas-nav li { margin: 0; }
.temas-nav a {
  display: flex; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0.6rem;
  text-decoration: none; border-radius: var(--radio); font-size: var(--t-s); font-weight: 700; color: var(--tinta-2);
}
.temas-nav a:hover { background: var(--urna); color: var(--tinta); }
.temas-nav a[aria-current="true"] { background: var(--tinta); color: var(--papel); }
.temas-nav__icono { width: 1.1rem; text-align: center; flex: none; }
.temas-select { display: none; }
@media (max-width: 900px) {
  .comparar { grid-template-columns: 1fr; gap: 1rem; }
  .temas-nav { display: none; }
  .temas-select { display: flex; }
}

.propuestas { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 0; margin-top: 1rem; border-top: 1px solid var(--tinta); }
.propuesta { padding: 1.25rem 1.25rem 1.5rem 0; border-bottom: 1px solid var(--linea-suave); }
.propuesta__cab { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.propuesta__cab a { font-weight: 700; font-size: var(--t-s); }
.propuesta p { font-size: var(--t-s); }
.propuesta .medidas { font-size: var(--t-s); }

/* ---------- Pactos ---------- */
.bloque-pactos { margin-top: 3rem; }
.bloque-pactos > p { color: var(--tinta-2); }
.pactos-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0 2rem; border-top: 1px solid var(--tinta); }
.pacto { padding: 1.1rem 0 1.3rem; border-bottom: 1px solid var(--linea-suave); font-size: var(--t-s); }
.pacto p { margin-bottom: 0.6rem; }
.pacto__titulo { font-size: var(--t-m); margin-bottom: 0.2rem; }
.pacto__meta { color: var(--tinta-3); font-size: var(--t-xs); }
.pacto__cab { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.6rem; flex-wrap: wrap; }
.pacto__linea { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.pacto__linea > span:first-child { font-weight: 700; margin-right: 0.3rem; }
.pacto__nota { color: var(--tinta-2); font-style: italic; }
.pildoras { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0 0.7rem; }
.pildora--otro { background: var(--urna-2); color: var(--tinta); font-weight: 700; }
.chip--todos::before { background: conic-gradient(#1d84ce 0 25%, #e30613 0 50%, #7cbd2a 0 75%, #ffdd00 0); }
a.chip { text-decoration: none; }
a.chip[aria-current="true"] { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }

.cronologia { list-style: none; padding: 0; margin: 1.5rem 0 0; border-left: 2px solid var(--linea); }
.cronologia__item { position: relative; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.25rem; padding: 0 0 1.75rem 1.25rem; margin: 0; }
.cronologia__item::before { content: ""; position: absolute; left: -0.45rem; top: 0.35rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--papel); border: 2px solid var(--tinta); }
.cronologia__fecha { font-weight: 700; font-size: var(--t-s); color: var(--tinta-2); padding-top: 0.1rem; }
.cronologia__cuerpo { font-size: var(--t-s); max-width: var(--ancho-texto); }
@media (max-width: 640px) { .cronologia__item { grid-template-columns: 1fr; gap: 0.25rem; } }

.lista-acuerdos { list-style: none; padding: 0; font-size: var(--t-s); }
.lista-acuerdos li { padding: 0.5rem 0; border-bottom: 1px solid var(--linea-suave); margin: 0; }

.matriz { border-collapse: collapse; font-size: var(--t-xs); margin-top: 1rem; }
.matriz th, .matriz td { border: 1px solid var(--linea-suave); padding: 0.3rem; text-align: center; min-width: 2.6rem; }
.matriz thead th { vertical-align: bottom; }
.matriz tbody th { text-align: left; }
.matriz__si { font-weight: 800; font-size: var(--t-m); }
.matriz__no { font-weight: 800; font-size: var(--t-m); color: var(--tinta-3); }
.matriz__mismo { background: var(--urna); }

/* ---------- Test ---------- */
.test { max-width: 46rem; margin: 0 auto; padding-top: clamp(1.5rem, 5vw, 3rem); }
.progreso { display: flex; align-items: center; gap: 1rem; font-size: var(--t-s); color: var(--tinta-2); margin-bottom: 2rem; }
.progreso__barra { flex: 1; height: 6px; background: var(--urna-2); border-radius: 3px; overflow: hidden; }
.progreso__relleno { height: 100%; background: var(--tinta); width: var(--p, 0%); transition: width 200ms ease; }

.pregunta__tema { display: inline-flex; gap: 0.4rem; align-items: baseline; font-size: var(--t-s); font-weight: 700; color: var(--tinta-2); margin-bottom: 0.75rem; }
.pregunta__enunciado { font-size: clamp(1.6rem, 4vw, 2.35rem); line-height: 1.18; letter-spacing: -0.02em; margin-bottom: 1rem; }
.contexto { margin-bottom: 1.75rem; font-size: var(--t-s); color: var(--tinta-2); }
.contexto summary { cursor: pointer; font-weight: 700; color: var(--tinta); width: fit-content; }
.contexto p { margin: 0.5rem 0 0; }


.opciones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.opciones li { margin: 0; }
.opcion {
  width: 100%; height: 100%; min-height: 5.2rem; font: inherit; font-weight: 700; font-size: var(--t-s); line-height: 1.2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--papel); color: var(--tinta); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 0.75rem 0.5rem; cursor: pointer; text-align: center;
}
.opcion:hover { border-color: var(--tinta); background: var(--urna); }
.opcion[aria-pressed="true"] { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.opcion__marca { display: block; border-radius: 50%; border: 2px solid currentColor; }
.opcion--2 .opcion__marca, .opcion--n2 .opcion__marca { width: 1.3rem; height: 1.3rem; }
.opcion--1 .opcion__marca, .opcion--n1 .opcion__marca { width: 0.95rem; height: 0.95rem; }
.opcion--0 .opcion__marca { width: 0.65rem; height: 0.65rem; }
.opcion__tecla { font-weight: 400; font-size: 0.72rem; color: var(--tinta-3); }
.opcion[aria-pressed="true"] .opcion__tecla { color: inherit; opacity: 0.75; }
@media (max-width: 600px) {
  .opciones { grid-template-columns: 1fr; }
  .opcion { flex-direction: row; justify-content: flex-start; min-height: 3.2rem; padding: 0.7rem 1rem; gap: 0.9rem; }
  .opcion__marca { flex: none; }
  .opcion__tecla { display: none; }
}

.navegacion-test { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Último paso: elegir hasta 3 temas importantes */
.contador { font-weight: 700; font-size: var(--t-s); margin: 0.5rem 0 1rem; min-height: 1.5em; }
.temas-elegir { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.temas-elegir li { margin: 0; }
.tema-opcion {
  width: 100%; height: 100%; display: flex; align-items: center; gap: 0.75rem; text-align: left;
  font: inherit; color: var(--tinta); background: var(--papel); cursor: pointer;
  border: 1px solid var(--linea); border-radius: var(--radio); padding: 0.8rem 0.9rem;
}
.tema-opcion:hover { border-color: var(--tinta); background: var(--urna); }
.tema-opcion__icono { width: 1.4rem; text-align: center; font-size: var(--t-l); color: var(--tinta-3); flex: none; }
.tema-opcion__texto { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tema-opcion__nombre { font-weight: 700; line-height: 1.25; }
.tema-opcion__n { font-size: var(--t-xs); color: var(--tinta-3); }
.tema-opcion__marca { width: 1.3rem; height: 1.3rem; border: 2px solid var(--linea); border-radius: 2px; flex: none; position: relative; }
.tema-opcion[aria-pressed="true"] { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.tema-opcion[aria-pressed="true"] .tema-opcion__icono,
.tema-opcion[aria-pressed="true"] .tema-opcion__n { color: inherit; opacity: 0.8; }
.tema-opcion[aria-pressed="true"] .tema-opcion__marca { border-color: var(--papel); background: var(--papel); }
.tema-opcion[aria-pressed="true"] .tema-opcion__marca::after {
  content: ""; position: absolute; left: 0.32rem; top: 0.08rem; width: 0.35rem; height: 0.7rem;
  border: solid var(--tinta); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.tema-opcion[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.tema-opcion[aria-disabled="true"]:hover { border-color: var(--linea); background: var(--papel); }
@media (max-width: 600px) { .temas-elegir { grid-template-columns: 1fr; } }

/* ---------- Resultados ---------- */
.ranking { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--tinta); }
.ranking > li { margin: 0; border-bottom: 1px solid var(--linea-suave); }
.resultado { display: grid; grid-template-columns: 2.2rem minmax(7rem, 13rem) minmax(0, 1fr) 5.2rem; gap: 1rem; align-items: center; padding: 1rem 0; }
.resultado__pos { font-weight: 800; color: var(--tinta-3); font-size: var(--t-l); text-align: right; }
.resultado__nombre { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; }
.resultado__nombre small { color: var(--tinta-3); line-height: 1.25; }
.resultado__barra { display: block; height: 1.25rem; background: var(--urna); border-radius: 2px; overflow: hidden; }
.resultado__relleno { display: block; height: 100%; width: var(--p, 0%); background: var(--c); }
.resultado__pct { font-weight: 800; font-size: var(--t-xl); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.resultado--poco-fiable .resultado__relleno { background: repeating-linear-gradient(135deg, var(--c) 0 6px, transparent 6px 10px); }
@media (max-width: 600px) {
  .resultado { grid-template-columns: 1.6rem minmax(0, 1fr) 4.4rem; gap: 0.4rem 0.75rem; }
  .resultado__barra { grid-column: 2 / 4; grid-row: 2; }
  .resultado__pct { font-size: var(--t-l); }
}

.porque { padding: 0 0 1.5rem 3.2rem; }
.porque summary { cursor: pointer; font-weight: 700; font-size: var(--t-s); width: fit-content; padding: 0.25rem 0; }
.porque__cuerpo { margin-top: 1rem; display: grid; gap: 1.5rem; }
.porque h3 { font-size: var(--t-m); }
.porque ul { list-style: none; padding: 0; margin: 0; }
.porque li { padding: 0.75rem 0; border-top: 1px solid var(--linea-suave); margin: 0; font-size: var(--t-s); }
.porque li p { margin: 0.25rem 0 0; }
.porque__frase { font-weight: 700; color: var(--tinta); }
.porque__posturas { color: var(--tinta-3); }
.porque__cita { font-style: italic; color: var(--tinta-2); }
.porque--todas { padding-left: 0; margin-top: 2rem; }
@media (max-width: 600px) { .porque { padding-left: 0; } }

.temas-afinidad { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.4rem 1.5rem; list-style: none; padding: 0; margin: 0; }
.temas-afinidad li { margin: 0; font-size: var(--t-s); display: grid; grid-template-columns: 1fr 2.6rem; gap: 0.2rem 0.6rem; align-items: center; }
.temas-afinidad__barra { grid-column: 1 / -1; height: 5px; background: var(--urna-2); border-radius: 3px; overflow: hidden; }
.temas-afinidad__barra span { display: block; height: 100%; width: var(--p); background: var(--c); }
.temas-afinidad b { text-align: right; font-variant-numeric: tabular-nums; }

.compartir { margin-top: 2.5rem; padding: 1.25rem; background: var(--urna); border-radius: var(--radio); }
.compartir p { font-size: var(--t-s); color: var(--tinta-2); }
.compartir__estado { font-weight: 700; color: var(--ok); }

/* ---------- Metodología ---------- */
.texto-largo { max-width: var(--ancho-texto); }
.texto-largo h2 { margin-top: 2.5rem; font-size: var(--t-xl); }
.texto-largo code { font-size: 0.92em; background: var(--urna); padding: 0.1em 0.35em; border-radius: 2px; }
.tabla { width: 100%; border-collapse: collapse; font-size: var(--t-s); margin: 1rem 0; }
.tabla th, .tabla td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--linea-suave); vertical-align: top; }
.tabla th { font-weight: 700; border-bottom-color: var(--tinta); }
.tabla-scroll { overflow-x: auto; }

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .cabecera, .pie, .temas-nav, .indice, .acciones, .compartir { display: none; }
  body { background: #fff; color: #000; }
}
