/* =========================================================
   29-N · Monográfico electoral
   Hoja de estilo única. Sin dependencias.
   ========================================================= */

:root {
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --paper: #f4f0e6;
  --paper-2: #ebe5d7;
  --surface: #fbf8f1;
  --surface-2: #f7f2e7;
  --ink: #17130e;
  --ink-2: #3f382e;
  --muted: #6f6657;
  --line: rgba(23, 19, 14, 0.14);
  --line-2: rgba(23, 19, 14, 0.28);
  --hl: rgba(214, 164, 65, 0.36);
  --shadow: 0 18px 40px -28px rgba(30, 22, 12, 0.45);
  --radius: 3px;
  --max: 1240px;
  --pad: clamp(18px, 4vw, 44px);
  --footer-bg: #17130e;
  --footer-ink: #f4f0e6;
}

html[data-theme="dark"] {
  --paper: #0e0d0b;
  --paper-2: #15130f;
  --surface: #1a1712;
  --surface-2: #201c16;
  --ink: #f5f0e4;
  --ink-2: #d9d1c1;
  --muted: #a0978a;
  --line: rgba(245, 240, 228, 0.14);
  --line-2: rgba(245, 240, 228, 0.3);
  --hl: rgba(230, 181, 84, 0.28);
  --shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
b, strong { font-weight: 650; }
p { margin: 0 0 0.9em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -0.018em; line-height: 1.04; text-wrap: balance; }
section[id], details[id] { scroll-margin-top: 84px; }

.wrap {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; top: -100px; left: 16px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 2px;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Barra superior ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding: 0 var(--pad);
  height: 66px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand__mark {
  font-family: var(--serif); font-size: 1.4rem; letter-spacing: -0.04em;
  border: 1.5px solid var(--ink); padding: 1px 6px 2px; line-height: 1;
}
.brand__text {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}

.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a {
  font-size: 12.5px; text-decoration: none; color: var(--ink-2);
  letter-spacing: 0.02em; padding: 4px 0; border-bottom: 1px solid transparent;
}
.nav a:hover { border-color: var(--ink); color: var(--ink); }

.topbar__actions { display: flex; gap: 4px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

.progress {
  position: absolute; bottom: -1px; left: 0; height: 2px; width: 0;
  background: var(--ink); transition: width 80ms linear;
}

@supports not (backdrop-filter: blur(1px)) {
  .topbar { background: var(--paper); }
}

/* ---------- Buscador ---------- */

.search-panel {
  position: sticky; top: 66px; z-index: 45;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.search-panel .wrap { padding-block: 18px 12px; }
.search-panel input {
  width: 100%; background: transparent; border: 0; border-bottom: 1.5px solid var(--ink);
  padding: 8px 2px 12px; font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  color: var(--ink); outline: none;
}
.search-panel input::placeholder { color: var(--muted); opacity: .75; }
.search-meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.search-results { list-style: none; margin: 10px 0 0; padding: 0; max-height: 52vh; overflow: auto; }
.search-results a {
  display: grid; grid-template-columns: 116px 1fr; gap: 16px;
  padding: 12px 2px; border-top: 1px solid var(--line); text-decoration: none;
}
.search-results a:hover { background: var(--paper-2); }
.search-results .sr-party { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.search-results .sr-topic { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.search-results .sr-text { font-size: 14.5px; line-height: 1.45; }
.search-results mark { background: var(--hl); color: inherit; }

/* ---------- Portada ---------- */

.hero { padding: clamp(48px, 8vw, 104px) 0 40px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 100%;
  background-image: radial-gradient(rgba(23,19,14,.055) 1px, transparent 1px);
  background-size: 5px 5px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
  pointer-events: none;
}
html[data-theme="dark"] .hero::before { background-image: radial-gradient(rgba(245,240,228,.06) 1px, transparent 1px); }
.hero__grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: end;
}
.kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 22px;
}
.kicker span { color: var(--ink); }
.kicker::before {
  content: ""; display: inline-block; width: 32px; height: 1px; margin-right: 12px;
  vertical-align: 3px; background: var(--ink);
}

.hero h1 {
  font-size: clamp(3rem, 7.4vw, 6.3rem);
  line-height: .92;
  letter-spacing: -.045em;
  margin-bottom: 26px;
}
.hero h1 em { font-style: italic; font-weight: 400; }

.deck {
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.55vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 36ch;
  margin-bottom: 28px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .16s, color .16s, transform .16s;
}
.btn:hover { transform: translateY(-1px); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--ink-2); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--small { min-height: 38px; padding: 0 14px; font-size: 9.5px; }

.hero__note {
  margin-top: 20px; font-size: 12.5px; color: var(--muted); max-width: 52ch;
}

.hero__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-2);
  padding: 30px 26px 22px;
  box-shadow: var(--shadow);
}
.hero__card::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--line); pointer-events: none;
}
.stamp {
  position: absolute; top: -18px; right: 18px;
  font-family: var(--serif); font-size: 1.05rem; letter-spacing: -.02em;
  background: var(--ink); color: var(--paper); padding: 6px 10px 7px;
  transform: rotate(3deg);
}
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; }
.facts dt { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1; letter-spacing: -.03em; }

.majority { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.majority__bar { display: block; height: 8px; background: var(--paper-2); border: 1px solid var(--line); position: relative; }
.majority__bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.majority__legend { display: block; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.majority__legend b { color: var(--ink); }
.hero__card-foot { margin: 18px 0 0; font-size: 10px; color: var(--muted); line-height: 1.4; }

.partyjump {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-top: clamp(38px, 5vw, 58px);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.partyjump button {
  flex: 1 1 0; min-width: 140px;
  display: flex; align-items: center; gap: 9px;
  padding: 13px 12px; background: transparent; border: 0; border-right: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; text-align: left;
}
.partyjump button:last-child { border-right: 0; }
.partyjump button:hover { background: var(--paper-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--party, var(--ink)); flex: 0 0 auto; }

/* ---------- Secciones ---------- */

.section { padding: clamp(58px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.section--alt { background: var(--paper-2); }
.section-head { max-width: 760px; margin-bottom: clamp(30px, 4vw, 48px); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); margin-bottom: 14px; }
.section-deck { font-size: 15px; color: var(--ink-2); max-width: 62ch; margin: 0; }

/* ---------- Selector ---------- */

.picker {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: end;
  padding: 18px; border: 1px solid var(--line-2); background: var(--surface);
}
.picker__label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px; border: 1px solid var(--line-2); background: transparent;
  font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .dot { width: 8px; height: 8px; }
.swap {
  width: 40px; height: 40px; border: 1px solid var(--line-2); background: transparent;
  display: grid; place-items: center; cursor: pointer; margin-bottom: 1px;
}
.swap:hover { background: var(--ink); color: var(--paper); }
.swap svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Temas ---------- */

.topicbar {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 1px; background: var(--line-2);
  border: 1px solid var(--line-2); border-top: 0;
  margin-bottom: 28px;
}
.topic-tab {
  background: var(--surface); border: 0; padding: 12px 10px;
  text-align: left; cursor: pointer; display: flex; gap: 8px; align-items: baseline;
  font-size: 12px; line-height: 1.25; transition: background .15s;
}
.topic-tab:hover { background: var(--paper-2); }
.topic-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.topic-tab .n { font-family: var(--mono); font-size: 9px; opacity: .6; }
.topic-tab .t { font-weight: 600; }

/* ---------- Cara a cara ---------- */

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 38px); }
.panel { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); padding: 26px clamp(18px, 2.6vw, 32px) 24px; }
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--party); }
.panel__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel__party { font-family: var(--serif); font-size: clamp(1.55rem, 2.6vw, 2.1rem); line-height: 1; letter-spacing: -.03em; margin: 0; }
.panel__candidate { font-size: 12px; color: var(--muted); margin-top: 5px; }
.panel__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.panel__text { font-family: var(--serif); font-size: clamp(1.02rem, 1.3vw, 1.16rem); line-height: 1.55; color: var(--ink-2); margin: 0 0 18px; }
.panel__text mark { background: linear-gradient(transparent 58%, var(--hl) 58%); color: inherit; font-weight: 600; }
.panel__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.panel__link { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--ink); }
.panel__link:hover { opacity: .7; }
.panel__coverage { font-size: 10px; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid currentColor; white-space: nowrap;
}
.badge--complete { color: #1f6b3a; }
.badge--none { color: #9a3b26; }
.badge--partial { color: #8a6511; }
html[data-theme="dark"] .badge--complete { color: #79c894; }
html[data-theme="dark"] .badge--none { color: #e39a82; }
html[data-theme="dark"] .badge--partial { color: #e0bd6a; }

.debate {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin-top: 28px; background: var(--line-2); border: 1px solid var(--line-2);
}
.debate__col { background: var(--surface); padding: 18px 20px; }
.debate__col h3 {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; font-weight: 500;
}
.debate__col p { margin: 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; }

.compare-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.compare-foot__hint { font-size: 11.5px; color: var(--muted); }

/* ---------- Matriz ---------- */

.matrix-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.switch input { accent-color: var(--ink); width: 15px; height: 15px; }
.matrix-hint { font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
@media (min-width: 1100px) { .matrix-hint { display: none; } }

.matrix-wrap { overflow-x: auto; border: 1px solid var(--line-2); background: var(--surface); }
.matrix { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 12.5px; }
.matrix thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line-2);
  border-right: 1px solid var(--line); vertical-align: bottom;
}
.matrix thead th:first-child { z-index: 3; left: 0; }
.matrix thead th .m-party { font-family: var(--serif); font-size: 1.05rem; display: block; line-height: 1.1; }
.matrix thead th .m-cand { font-size: 9.5px; color: var(--muted); display: block; margin-top: 3px; }
.matrix thead th::after { content: ""; display: block; height: 3px; background: var(--party); margin: 8px -10px -11px; }
.matrix tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-2); vertical-align: top; min-width: 136px;
}
.matrix tbody th .m-n { font-family: var(--mono); font-size: 8.5px; color: var(--muted); display: block; }
.matrix tbody th .m-t { font-weight: 600; font-size: 12px; display: block; margin-top: 2px; }
.matrix td { padding: 11px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.matrix td:last-child, .matrix th:last-child { border-right: 0; }
.matrix tbody tr:hover td { background: color-mix(in srgb, var(--paper-2) 65%, transparent); }
.cell {
  display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 58ch; cursor: pointer; color: var(--ink-2); line-height: 1.4;
}
.cell:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); }
.cell mark { background: transparent; font-weight: 600; color: var(--ink); }
.matrix td.is-muted { opacity: .28; }

/* ---------- Fichas ---------- */

.profiles-tools { display: flex; justify-content: flex-end; margin: -18px 0 14px; }
.profiles { display: grid; gap: 12px; }
.profile { background: var(--surface); border: 1px solid var(--line); }
.profile[open] { border-color: var(--line-2); box-shadow: var(--shadow); }
.profile__summary {
  list-style: none; cursor: pointer; padding: 16px 20px;
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 24px; gap: 18px; align-items: center;
  border-left: 6px solid var(--party);
}
.profile__summary::-webkit-details-marker { display: none; }
.profile__summary:hover { background: var(--surface-2); }
.profile__num { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.profile__name { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.05; }
.profile__tag { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.profile__side { display: flex; align-items: center; gap: 10px; }
.profile__chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .2s; }
.profile[open] .profile__chev { transform: rotate(180deg); }
.profile__body { padding: 6px 20px 24px 84px; border-top: 1px solid var(--line); }
.profile__intro { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; padding: 20px 0 22px; }
.profile__intro p { font-size: 14.5px; color: var(--ink-2); margin: 0; }
.profile__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-content: start; }
.profile__facts div { border-top: 1px solid var(--line); padding-top: 6px; }
.profile__facts dt { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.profile__facts dd { margin: 2px 0 0; font-size: 12.5px; }
.stars-title { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.stars { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.stars li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; display: flex; gap: 9px; }
.stars li::before { content: "→"; font-family: var(--mono); font-size: 10px; color: var(--muted); padding-top: 2px; }

.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.mini { background: var(--surface); padding: 13px 14px; }
.mini h4 { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 5px; font-weight: 500; }
.mini p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.mini p mark { background: transparent; font-weight: 650; color: var(--ink); }

/* ---------- Otras candidaturas ---------- */

.others { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.other { background: var(--surface); border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.other__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.other__name { font-family: var(--serif); font-size: 1.35rem; line-height: 1; }
.other__full { font-size: 10.5px; color: var(--muted); display: block; margin-top: 4px; }
.other__cand { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.other__line { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.other ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.other li { font-size: 12px; padding-left: 12px; position: relative; line-height: 1.42; }
.other li::before { content: "·"; position: absolute; left: 2px; color: var(--party); font-weight: 700; }
.other__why { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; font-size: 11.5px; color: var(--muted); }
.other__why b { color: var(--ink); }
.other__badge { font-family: var(--mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 3px 6px; white-space: nowrap; }
.other--note { grid-column: 1 / -1; background: transparent; border-style: dashed; justify-content: flex-start; }
.other--note .other__name { font-size: 1.15rem; }

.footnote { margin-top: 18px; font-size: 11.5px; color: var(--muted); max-width: 80ch; }

/* ---------- Claves ---------- */

.claves-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.timeline { position: relative; }
.tl-item { display: grid; grid-template-columns: 74px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); position: relative; }
.tl-item:first-child { border-top: 0; }
.tl-item__date { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.tl-item__title { font-family: var(--serif); font-size: 1.12rem; line-height: 1.2; margin: 0 0 3px; }
.tl-item__text { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.tl-item--key .tl-item__date { color: var(--ink); font-weight: 700; }
.tl-item--key { background: linear-gradient(90deg, var(--hl), transparent 70%); }

.explainer { position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line-2); padding: 24px; }
.explainer h3 { font-size: 1.5rem; margin-bottom: 14px; }
.explainer p { font-size: 13px; color: var(--ink-2); }
.explainer__bar { height: 12px; background: var(--paper-2); border: 1px solid var(--line); margin: 14px 0 6px; position: relative; }
.explainer__bar span { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.explainer__small { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Método ---------- */

.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.method h3 { font-size: 1.45rem; margin-bottom: 12px; }
.method p { font-size: 13.5px; color: var(--ink-2); }
.sources { margin-top: 32px; border-top: 1px solid var(--line-2); padding-top: 24px; }
.sources h3 { font-size: 1.35rem; margin-bottom: 12px; }
.sources ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sources li { font-size: 12.5px; color: var(--muted); padding-left: 14px; position: relative; }
.sources li::before { content: "↗"; position: absolute; left: 0; font-family: var(--mono); font-size: 9px; }
.sources a { color: var(--ink); text-decoration-color: var(--line-2); }
.party-sources { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.party-sources h4 { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 500; }
.party-sources ul { grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.party-sources li { font-size: 12px; }
.party-sources li::before { content: "·"; color: var(--muted); }
.party-sources b { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.sources__date { margin-top: 16px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* ---------- Pie ---------- */

.footer { background: var(--footer-bg); color: var(--footer-ink); padding: 48px 0; }
.footer__inner { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer__mark { font-family: var(--serif); font-size: 2.2rem; line-height: 1; margin: 0 0 10px; }
.footer p { font-size: 11.5px; opacity: .72; margin: 0; }
.footer .footer__mark { opacity: 1; }
.footer__links { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.footer__links a { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; opacity: .8; }
.footer__links a:hover { opacity: 1; text-decoration: underline; }

.noscript {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--ink); color: var(--paper); padding: 14px; text-align: center; font-size: 13px;
}

/* ---------- Animaciones suaves ---------- */

@media (prefers-reduced-motion: no-preference) {
  .panel, .other, .hero__card { transition: box-shadow .2s, transform .2s; }
  .panel:hover, .other:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .nav { gap: 14px; }
  .nav a { font-size: 11.5px; }
  .hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); }
  .topicbar { grid-template-columns: repeat(4, 1fr); }
  .others { grid-template-columns: repeat(2, 1fr); }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .hero__grid { grid-template-columns: 1fr; align-items: start; }
  .hero__card { max-width: 420px; }
  .compare { grid-template-columns: 1fr; gap: 14px; }
  .debate { grid-template-columns: 1fr; }
  .picker { grid-template-columns: 1fr; }
  .swap { justify-self: start; transform: rotate(90deg); margin: 0; }
  .profile__body { padding-left: 20px; }
  .profile__intro { grid-template-columns: 1fr; gap: 16px; }
  .claves-grid { grid-template-columns: 1fr; }
  .explainer { position: static; }
  .method-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .topbar__inner { height: 58px; }
  .brand__text { display: none; }
  html { scroll-padding-top: 74px; }
  .topicbar {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .topic-tab { flex: 0 0 auto; min-width: 148px; scroll-snap-align: start; padding: 10px 12px; }
  .topicbar::-webkit-scrollbar { height: 4px; }
  .topicbar::-webkit-scrollbar-thumb { background: var(--line-2); }
  .profile__summary { grid-template-columns: 42px minmax(0,1fr) 20px; gap: 10px; padding: 14px; }
  .profile__side { grid-column: 2; align-items: flex-start; }
  .profile__chev { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .stars { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr; }
  .others { grid-template-columns: 1fr; }
  .facts { gap: 14px 10px; }
  .profile__facts { grid-template-columns: 1fr; }
  .party-sources ul { grid-template-columns: 1fr; }
  .search-results a { grid-template-columns: 1fr; gap: 4px; }
  .search-panel { position: fixed; top: 58px; left: 0; right: 0; max-height: 80vh; overflow: auto; }
  .hero h1 { letter-spacing: -.035em; }
  .partyjump { flex-wrap: nowrap; overflow-x: auto; }
  .partyjump button { flex: 0 0 auto; min-width: 132px; border-bottom: 1px solid var(--line); }
}

@media (max-width: 420px) {
  .hero__actions .btn { width: 100%; }
  .facts dd { font-size: 1.45rem; }
}

/* ---------- Impresión ---------- */

@media print {
  :root {
    --paper: #fff; --paper-2: #fff; --surface: #fff; --surface-2: #fff;
    --ink: #000; --ink-2: #222; --muted: #555;
    --line: #ddd; --line-2: #999; --hl: transparent; --shadow: none;
    --footer-bg: #fff; --footer-ink: #000;
  }
  html { scroll-padding-top: 0; }
  .topbar, .search-panel, .hero__actions, .picker, .topicbar, .compare-foot,
  .matrix-tools, .profiles-tools, .footer__links, .icon-btn, .partyjump, .profile__chev { display: none !important; }
  body { font-size: 11pt; }
  .section, .hero { padding: 18pt 0; }
  .panel, .other, .tl-item, .profile, .hero__card { break-inside: avoid; }
  .hero h1 { font-size: 34pt; }
  .compare { grid-template-columns: 1fr 1fr; gap: 12pt; }
  .panel { break-inside: avoid; box-shadow: none; }
  .matrix-wrap { overflow: visible; }
  .matrix { min-width: 0; font-size: 7.5pt; table-layout: fixed; }
  .cell { -webkit-line-clamp: unset; display: block; }
  .profile__body { display: block !important; }
  details:not([open]) > *:not(summary) { display: block !important; }
  .pagebreak { page-break-before: always; }
}
