/* Proyección del resultado final: el bloque de la portada, el gráfico "conteo y proyección" (proyeccion.js)
   y lo propio de la página del método. Usa las variables de estilos.css. Color sólo en los candidatos. */

/* ---------- gráfico ---------- */
.proy-lienzo { position: relative; min-width: 0; }
.proy-lienzo svg { display: block; overflow: visible; touch-action: pan-y; }
.proy-lienzo text { font-family: var(--texto); font-size: 12px; fill: var(--gris); font-variant-numeric: tabular-nums lining-nums; }
.proy-lienzo text.fuerte { fill: var(--tinta-2); font-weight: 600; }
.proy-lienzo text.tenue { font-size: 11.5px; }
.proy-lienzo text.proy-nombre { fill: var(--tinta); font-size: 14px; font-weight: 600; }
.proy-lienzo text.proy-valor { fill: var(--tinta); font-size: 14px; }
.proy-regla { stroke: var(--linea); stroke-width: 1; }
.proy-mitad { stroke: var(--tinta); stroke-width: 1; stroke-dasharray: 5 4; }
.proy-corte { stroke: var(--gris-claro); stroke-width: 1; }
.proy-mira { stroke: var(--tinta-2); stroke-width: 1; pointer-events: none; }
.proy-linea { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.proy-puntos { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: round; stroke-dasharray: .1 6.5; }
.proy-despues { fill: none; stroke: var(--c); stroke-width: 1.2; opacity: .6; }
.proy-hasta { fill: none; stroke: var(--c); stroke-width: 1.2; stroke-dasharray: 2 4; opacity: .7; }
.proy-margen { fill: var(--c); opacity: .14; }
.proy-rango { fill: var(--c); opacity: .3; }
.proy-ahora { fill: var(--c); stroke: var(--papel); stroke-width: 2; }
.proy-final { fill: var(--papel); stroke: var(--c); stroke-width: 2; }
.proy-lienzo .lula { --c: var(--lula); }
.proy-lienzo .flavio { --c: var(--flavio); }
.proy-globo { position: absolute; top: 6px; z-index: 2; padding: 7px 10px; border-radius: 6px; background: var(--tinta); color: #fff;
              font-size: 13px; line-height: 1.4; white-space: nowrap; pointer-events: none; }
.proy-globo[hidden] { display: none; }
.proy-globo b { font-weight: 600; }

/* qué es cada trazo */
.proy-leyenda { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 13.5px; color: var(--tinta-2); }
.proy-leyenda li { display: flex; align-items: center; gap: 8px; }
.proy-leyenda li[hidden] { display: none; }
.proy-leyenda svg { flex: none; }

/* ---------- bloque de la portada: va debajo de todo ---------- */
.proyeccion { margin-top: var(--aire, 28px); padding-top: 22px; border-top: 1px solid var(--tinta); }
.proyeccion[hidden] { display: none; }
.proyeccion h2 { font-family: var(--titulos); font-weight: 700; font-size: clamp(21px, 2.6vw, 26px); line-height: 1.15; margin: 0; }
.proy-sub { margin: 8px 0 0; max-width: 40em; font-size: 16px; color: var(--tinta-2); }
.proy-sub[hidden] { display: none; }
.proyeccion h2::before { content: ""; display: inline-block; width: .62em; height: .65em; margin-right: .45em;
                         background: url(/publico/flecha.svg) no-repeat center / contain; }
/* primero las cifras y el gráfico; la explicación y el aviso van debajo */
/* a lo ancho del gráfico, como pidió el equipo; el [hidden] alterna el texto de antes del balotaje y el del conteo */
.proy-aviso { margin: 22px 0 0; font-size: 16px; line-height: 1.5; color: var(--tinta-2); }
.proy-aviso[hidden] { display: none; }
.proy-aviso strong { font-weight: 600; color: var(--tinta); }
.proy-aviso a, .proy-estado a { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--naranja);
                                text-decoration-thickness: 2px; text-underline-offset: 3px; white-space: nowrap; }
.proy-estado { margin: 12px 0 0; font-size: 15px; color: var(--gris); }
.proy-lectura[hidden], .proy-cuerpo[hidden] { display: none; }
.proy-demo { margin: 14px 0 0; max-width: 760px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.proy-demo[hidden] { display: none; }
.proy-lectura { margin: 14px 0 0; font-size: 16px; font-weight: 600; max-width: 66ch; }
.proy-lectura + .proy-lectura { margin-top: 4px; }
.proy-cuerpo { margin-top: 22px; }
.desactualizado .proyeccion, .desactualizado #lado-proyeccion { opacity: .55; transition: opacity .3s; }
/* en la portada, el bloque queda pegado al duelo: título, leyenda y gráfico; sus textos van al costado
   (#lado-proyeccion, una caja centrada respecto del gráfico) y el aviso, debajo, a todo el ancho */
.tablero .proyeccion { margin-top: 14px; padding-top: 16px; }
.tablero .proy-cuerpo { margin-top: 12px; }
.tablero .proy-leyenda { gap: 4px 14px; font-size: 13px; }
.tablero .proy-leyenda svg[width="34"] { width: 28px; }   /* así la leyenda entra en un renglón sobre el gráfico */
#lado-proyeccion .proy-estado { margin-top: 0; }
#lado-proyeccion .proy-estado + .proy-estado { margin-top: 6px; }
@media (min-width: 1000px) {
  #lado-proyeccion .proy-demo { margin-top: 16px; }
  /* angosto: «Urnas cargadas» y el momento elegido arriba, el deslizador debajo a todo el ancho */
  #lado-proyeccion .deslizador { flex-wrap: wrap; flex-basis: 100%; gap: 6px 12px; }
  #lado-proyeccion .deslizador input { order: 3; flex-basis: 100%; margin: 0; }
  #lado-proyeccion .deslizador output { margin-left: auto; min-width: 0; }
  #lado-proyeccion .proy-lectura { margin-top: 16px; font-size: 15.5px; }
}

/* ---------- página del método ---------- */
.metodo-cab { max-width: 760px; }
.metodo-cab .copete { margin: 12px 0 0; font-size: 19px; line-height: 1.45; color: var(--tinta-2); }
/* el aviso: lo primero que se lee, con el filete de la marca */
.advertencia { margin: 26px 0 0; max-width: 760px; padding: 18px 22px 20px; background: var(--pista); border-left: 4px solid; border-image: linear-gradient(180deg, #ff6633, #be08ef) 1; }
.advertencia h2, .advertencia h3 { font-family: var(--titulos); font-weight: 800; font-size: 20px; line-height: 1.2; margin: 0 0 8px; }
/* la misma caja, más abajo, para la nota metodológica de «Por qué este modelo» */
.advertencia.nota { margin-top: 28px; max-width: 720px; }
.advertencia p { margin: 0 0 10px; font-size: 16.5px; line-height: 1.5; }
.advertencia p:last-child { margin-bottom: 0; }
.texto { max-width: 720px; }
.texto p { margin: 14px 0 0; font-size: 17px; line-height: 1.55; }
.texto strong { font-weight: 600; }
/* subtítulo dentro de un bloque, sobre su gráfico */
.bloque > h3.subtitulo { margin: 30px 0 0; font-family: var(--titulos); font-weight: 700; font-size: 19px; line-height: 1.25; }
.texto a { color: inherit; text-decoration: underline; text-decoration-color: var(--naranja); text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* ficha del modelo: qué estima, con qué variables, de dónde aprende */
.ficha { margin: 18px 0 0; max-width: 760px; }
.ficha div { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 2px 22px; padding: 12px 0; border-top: 1px solid var(--linea); }
.ficha div:last-child { border-bottom: 1px solid var(--linea); }
.ficha dt { font-family: var(--titulos); font-weight: 700; font-size: 15.5px; line-height: 1.5; }
.ficha dd { margin: 0; font-size: 16.5px; line-height: 1.5; }
.figura { margin-top: 30px; }
.figura .grafico-titulo { margin-bottom: 8px; }
.figura .proy-leyenda { margin: 10px 0 14px; }
.proy-leyenda.lula svg { color: var(--lula); }
/* dos noches ya contadas, una al lado de la otra y con el mismo eje */
.noches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 44px; max-width: 980px; }
.noche { min-width: 0; }
.noche h3 { margin: 0 0 2px; font-family: var(--titulos); font-weight: 700; font-size: 15.5px; }
.noche p { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--tinta-2); }
.noche .proy-lienzo text.proy-nombre, .noche .proy-lienzo text.proy-valor { font-size: 13px; }
.noche .proy-lienzo text.proy-valor { font-weight: 600; }
.deslizador { flex: 1 1 260px; display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 14.5px; color: var(--tinta-2); }
.deslizador label { white-space: nowrap; }
.deslizador input { flex: 1; min-width: 0; accent-color: var(--tinta); }
.deslizador output { min-width: 7.5em; text-align: right; font-weight: 600; color: var(--tinta); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* el modelo en otros balotajes: por cada uno, la barra del conteo y debajo la del modelo */
.balotajes { max-width: 760px; margin-top: 12px; gap: 10px; }
.balotajes .fila > b { display: flex; align-items: center; gap: 9px; font-family: var(--titulos); font-weight: 700; font-size: 14.5px; }
.balotajes .barra-h i { height: 11px; min-width: 2px; }
.balotajes .barra-h + .barra-h { margin-top: 3px; }
/* a la derecha, la parte de las proyecciones con el resultado dentro del margen; arriba, el nombre de esa columna */
.balotajes .fila { grid-template-columns: var(--col) minmax(0, 1fr) 5.6em; }
.balotajes .fila > span { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.balotajes .fila.cabeza > span { font-size: 12.5px; line-height: 1.2; color: var(--gris); }
.tabla { margin-top: 12px; overflow-x: auto; }
.tabla table { border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums lining-nums; }
.tabla th, .tabla td { padding: 7px 22px 7px 0; text-align: right; white-space: nowrap; }
.tabla th:first-child, .tabla td:first-child { text-align: left; white-space: normal; }
#metodos td:first-child { min-width: 230px; max-width: 430px; }
.tabla thead th { font-weight: 600; border-bottom: 1px solid var(--tinta); vertical-align: bottom; white-space: normal; max-width: 9.5em; line-height: 1.25; }
.tabla tbody td { border-bottom: 1px solid var(--linea); }
.tabla tr.elegido td { font-weight: 600; background: var(--pista); }
.tabla tr.elegido td:first-child { padding-left: 8px; }
.tabla thead tr.sobre th { border-bottom: 0; padding-bottom: 0; max-width: none; text-align: center; font-weight: 400; font-size: 13.5px; color: var(--tinta-2); }
.tabla td b { font-weight: 600; }
.tabla .sello { display: inline-block; margin-left: 9px; padding: 0 8px; border: 1px solid var(--tinta); border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tabla td small { display: block; font-size: 13.5px; font-weight: 400; color: var(--tinta-2); }
.tabla .marca { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; background: var(--c); }

@media (max-width: 700px) {
  .advertencia { padding: 16px 16px 18px; }
  .ficha div, .noches { grid-template-columns: 1fr; }
  .tabla th, .tabla td { padding-right: 14px; }
  /* otros balotajes: el nombre arriba y, debajo, las barras con la parte dentro del margen a la derecha */
  .balotajes .fila { grid-template-columns: minmax(0, 1fr) 4.8em; gap: 4px 12px; }
  .balotajes .fila > b { grid-column: 1 / -1; }
}
