/* Huelgas en España 1982–2026 · @poloi */
:root {
  --rojo: #e8401a;
  --rojo-claro: #fbd9ce;
  --negro: #1a1a1a;
  --tinta: #222;
  --tinta2: #555;
  --tinta3: #767676;
  --rejilla: #e8e8e8;
  --fondo: #ffffff;
  --fondo2: #f6f5f3;
  --ancho: 1080px;
  --fuente: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; font-family: var(--fuente); color: var(--tinta); background: var(--fondo); line-height: 1.55; font-size: 17px; }
a { color: var(--rojo); }
.wrap { max-width: var(--ancho); margin: 0 auto; padding: 0 20px; }

/* índice fijo */
nav.indice { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--rejilla);
  backdrop-filter: blur(4px); }
nav.indice ul { list-style: none; margin: 0 auto; padding: 8px 20px; display: flex; gap: 6px 14px; flex-wrap: nowrap; overflow-x: auto;
  max-width: 1400px; scrollbar-width: thin; }
nav.indice a { color: var(--tinta2); text-decoration: none; font-size: 13px; white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
nav.indice a:hover, nav.indice a.activo { color: var(--negro); border-bottom-color: var(--rojo); }

/* cabecera */
header.portada { padding: 36px 0 12px; }
.firma { font-size: 14px; color: var(--tinta2); }
.firma a { color: var(--tinta2); }
h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.05; margin: 14px 0 18px; letter-spacing: -0.02em; font-weight: 800; }
h1 .acento { color: var(--rojo); }
.entradilla { font-size: 19px; max-width: 820px; }
.lecturas li { margin-bottom: 8px; }
.lecturas strong { color: var(--negro); }
.aviso { background: var(--fondo2); border-left: 4px solid var(--rojo); padding: 12px 16px; font-size: 15px; margin: 18px 0; max-width: 860px; }

/* secciones */
section.sec { padding: 46px 0 34px; border-top: 1px solid var(--rejilla); }
section.sec:nth-of-type(even) { background: #fcfcfb; }
.num { font-size: 13px; font-weight: 600; color: var(--rojo); text-transform: uppercase; letter-spacing: .06em; }
h2 { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.15; margin: 6px 0 8px; letter-spacing: -0.01em; font-weight: 800; max-width: 920px; }
.h2b { color: var(--tinta2); font-size: 17px; margin: 0 0 14px; max-width: 880px; }
h3 { font-size: 18px; margin: 26px 0 8px; }

/* controles */
.ctrl { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 14px 0 10px; }
.seg { display: inline-flex; border: 1px solid #cfcfcf; border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 14px; background: #fff; border: 0; border-right: 1px solid #cfcfcf; padding: 6px 12px; cursor: pointer; color: var(--tinta2); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--negro); color: #fff; }
.seg button:focus-visible, .btn:focus-visible { outline: 2px solid var(--rojo); outline-offset: 2px; }
.btn { font: inherit; font-size: 13px; background: #fff; border: 1px solid #cfcfcf; border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--tinta2); }
.btn:hover { border-color: var(--negro); color: var(--negro); }
.dl { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.msg { font-size: 13px; color: var(--tinta3); }

/* cifras destacadas */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 22px; margin: 16px 0 10px; }
.fig-n { font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }
.fig-t { font-size: 14px; color: var(--tinta2); }

/* gráficos */
.graf { position: relative; width: 100%; min-height: 200px; margin-top: 8px; }
.graf svg { display: block; width: 100%; height: auto; overflow: visible; }
.graf text { font-family: var(--fuente); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--tinta2); margin: 4px 0 2px; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.leyenda i.linea { height: 3px; }
.leyenda i.disc { height: 0; border-top: 2px dashed currentColor; background: none !important; }
.nota { font-size: 13px; color: var(--tinta3); margin: 8px 0 0; max-width: 900px; }
.lectura { max-width: 860px; }
.lectura p { margin: 10px 0; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: #fff; border: 1px solid #ccc; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.35; max-width: 300px; display: none; }
.tip b { color: var(--negro); }
.tip .fila { display: flex; justify-content: space-between; gap: 14px; }
.tip .fila i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* tablas */
.tabla-wrap { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { padding: 5px 10px; border-bottom: 1px solid var(--rejilla); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--negro); border-bottom: 2px solid var(--negro); }
details { margin: 12px 0; }
summary { cursor: pointer; color: var(--tinta2); font-size: 14px; }

/* metodología y pie */
.metodo h3 { margin-top: 30px; }
.metodo p, .metodo li { max-width: 880px; }
footer.pie { padding: 30px 0 60px; border-top: 1px solid var(--rejilla); font-size: 14px; color: var(--tinta2); }
.descargas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 18px; margin: 12px 0; }
.descargas a { display: block; padding: 10px 12px; border: 1px solid var(--rejilla); border-radius: 8px; text-decoration: none; color: var(--negro); }
.descargas a small { display: block; color: var(--tinta3); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .dl { margin-left: 0; }
  .fig-n { font-size: 26px; }
}
@media print { nav.indice, .ctrl, .dl { display: none; } section.sec { break-inside: avoid; } }

/* explicación bajo los botones y tabla de huelgas generales */
.explica { font-size: 15px; color: var(--tinta2); background: var(--fondo2); border-left: 3px solid var(--rojo); padding: 8px 12px; margin: 10px 0 6px; max-width: 900px; }
.tabla-gen summary { font-weight: 600; color: var(--negro); }
.tabla-scroll { overflow: auto; max-height: 460px; margin: 10px 0; }
.tabla-scroll table td:nth-child(2), .tabla-scroll table th:nth-child(2), .tabla-scroll table td:last-child, .tabla-scroll table th:last-child { text-align: left; }
.tabla-scroll thead th { position: sticky; top: 0; background: #fff; }
.tabla-scroll tr.ss td { color: var(--tinta2); }
