/*
Theme Name: Brújula del Voto
Theme URI: https://brujuladelvoto.com
Author: Brújula del Voto
Description: Tema propio, neutral y accesible para informar sobre los partidos en las elecciones generales del 29-N de 2026: fichas, comparador por temas y propuestas más debatidas. Sin recursos externos.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: brujula
*/

/* ---------- Variables (paleta neutral: sin colores de partido) ---------- */
:root {
	--ink: #1f2328;
	--ink-2: #4a4f57;
	--muted: #6b6f76;
	--paper: #faf8f3;
	--card: #ffffff;
	--line: #e4dfd4;
	--sand: #f1ece1;
	--accent: #a8742a;      /* latón de brújula */
	--accent-ink: #7a5216;
	--favor: #2f5d50;
	--contra: #6b3b3b;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(31,35,40,.06), 0 6px 20px rgba(31,35,40,.06);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--w: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font: 17px/1.6 var(--sans);
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2.5rem, var(--w)); margin-inline: auto; }
.wrap--narrow { max-width: 760px; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--ink); color: #fff; padding: .6em 1em; border-radius: 8px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; margin-top: 1.5rem; }

/* ---------- Barra superior y cabecera ---------- */
.topbar { background: var(--ink); color: #e9e6df; font-size: .88rem; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem 0; flex-wrap: wrap; }
.pill { background: rgba(255,255,255,.1); border-radius: 99px; padding: .1rem .7rem; }
.pill--now { background: var(--accent); color: #fff; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.2) blur(6px); background: rgba(250,248,243,.92); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.logo-mark { color: var(--ink); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; }
.brand__name em { font-weight: 400; color: var(--accent-ink); }
.brand__tag { font-size: .78rem; color: var(--muted); }

.nav .menu { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.nav a { display: block; padding: .5rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a { background: var(--sand); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 20px; height: 2px; background: var(--ink); margin: auto; position: relative; content: ""; transition: .2s; }
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after { position: absolute; top: 6px; }
@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); display: none; }
	.nav.is-open { display: block; }
	.nav .menu { flex-direction: column; padding: .5rem 1.25rem 1rem; }
	.brand__tag { display: none; }
}

/* ---------- Botones, chips, etiquetas ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .8rem 1.3rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid var(--ink); transition: .15s; cursor: pointer; font-size: 1rem; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--small { padding: .5rem .9rem; font-size: .9rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .95rem; cursor: pointer; font: inherit; font-size: .95rem; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active, .chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip--radio input, .chip--check input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0 0 .8rem; }
.tags li { font-size: .78rem; background: var(--sand); color: var(--ink-2); padding: .15rem .6rem; border-radius: 6px; }
.tags--lg li { font-size: .9rem; padding: .3rem .8rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }

/* Insignia neutral igual para todos */
.badge { display: inline-grid; place-items: center; min-width: 3.4rem; height: 3.4rem; padding: 0 .5rem; border-radius: 12px; border: 2px solid var(--ink); background: var(--card); font-weight: 800; font-size: .85rem; letter-spacing: .02em; text-align: center; line-height: 1; flex: none; }
.badge--sm { min-width: 2.6rem; height: 2.2rem; font-size: .72rem; border-radius: 8px; border-width: 1.5px; }
.badge--xl { min-width: 5.5rem; height: 5.5rem; font-size: 1.1rem; border-radius: 18px; border-width: 3px; }

/* ---------- Secciones ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--alt { background: var(--sand); }
.section__head { margin-bottom: 1.6rem; }
.section__head p { color: var(--ink-2); margin: 0; }
.section__head--sub { margin-top: 3.5rem; }
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--sand), var(--paper)); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--accent-ink); }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem); background: radial-gradient(1200px 400px at 80% -10%, #efe4cf, transparent 60%), var(--paper); }
.hero__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); }
.hero .u { background: linear-gradient(transparent 62%, rgba(168,116,42,.28) 0); }
.hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero__compass { display: grid; place-items: center; }
.hero__compass .logo-mark { width: min(300px, 70%); height: auto; animation: wobble 9s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .hero__compass .logo-mark { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 800px) { .hero__inner { grid-template-columns: 1fr; } .hero__compass { display: none; } }

/* Línea temporal */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.timeline li { padding: 1.1rem 1.2rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.timeline li:last-child { border-right: 0; }
.timeline__date { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; }
.timeline__label { color: var(--ink-2); font-size: .92rem; }
.timeline .is-key { background: var(--ink); color: #fff; }
.timeline .is-key .timeline__label { color: #e2ddd2; }
@media (max-width: 720px) { .timeline { grid-template-columns: 1fr 1fr; } .timeline li:nth-child(2) { border-right: 0; } .timeline li:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* Tarjetas de partido */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.grid-cards > [hidden] { display: none; }
.card-partido { height: 100%; }
.card-partido__link { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.card-partido__link:hover { transform: translateY(-3px); border-color: var(--ink); color: var(--ink); }
.card-partido__head { display: flex; gap: .9rem; align-items: center; margin-bottom: .9rem; }
.card-partido__title { font-size: 1.1rem; margin: 0; }
.card-partido__meta { font-size: .82rem; color: var(--muted); margin: .15rem 0 0; }
.card-partido__cand { font-weight: 600; margin-bottom: .6rem; }
.card-partido__cand span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.card-partido__resumen { font-size: .93rem; color: var(--ink-2); flex: 1; }
.card-partido__more { font-weight: 600; color: var(--accent-ink); font-size: .92rem; }

/* Encuestas */
.bars { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .55rem; max-width: 760px; }
.bars__row { display: grid; grid-template-columns: 7.5rem 1fr 4.5rem; gap: .8rem; align-items: center; }
.bars__label { font-weight: 700; text-decoration: none; color: var(--ink); }
.bars__track { height: 14px; background: #fff; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bars__fill { display: block; height: 100%; background: var(--ink-2); border-radius: 99px; }
.bars__value { text-align: right; font-variant-numeric: tabular-nums; }

/* Bloque neutralidad */
.neutral { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.neutral > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
@media (max-width: 760px) { .neutral { grid-template-columns: 1fr; } }

/* ---------- Ficha de partido ---------- */
.ficha__hero { padding: 2rem 0 2.2rem; background: linear-gradient(180deg, var(--sand), var(--paper)); border-bottom: 1px solid var(--line); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1.3rem; }
.crumbs a { color: var(--muted); }
.ficha__title { display: flex; gap: 1.4rem; align-items: flex-start; }
.ficha__title h1 { margin-bottom: .3rem; }
@media (max-width: 640px) { .ficha__title { flex-direction: column; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin: 1.8rem 0 0; }
.facts > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.facts dd { margin: .2rem 0 0; font-weight: 600; }
.facts small { font-weight: 400; color: var(--muted); }
.ficha__layout { display: grid; grid-template-columns: 230px 1fr; gap: 3rem; padding: 2.5rem 0 3rem; }
.toc { position: sticky; top: 90px; align-self: start; }
.toc__title { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
.toc ol { list-style: none; padding: 0; margin: 0 0 1.2rem; border-left: 2px solid var(--line); }
.toc a { display: block; padding: .3rem 0 .3rem .9rem; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.toc a:hover { color: var(--ink); border-left: 2px solid var(--accent); margin-left: -2px; }
@media (max-width: 900px) { .ficha__layout { grid-template-columns: 1fr; gap: 1rem; } .toc { position: static; } .toc ol { display: flex; flex-wrap: wrap; border: 0; gap: .3rem; } .toc a { padding: .3rem .7rem; background: var(--sand); border-radius: 6px; } }
.prose { max-width: 760px; }
.prose section { margin-bottom: 2.8rem; scroll-margin-top: 90px; }
.prose h2 { padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.note { background: var(--sand); border-left: 4px solid var(--accent); padding: .8rem 1rem; border-radius: 0 10px 10px 0; font-size: .95rem; }

.acc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .7rem; }
.acc summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 1.3rem; font-weight: 400; margin-left: .6rem; }
.acc[open] summary::after { content: "–"; }
.acc__count { margin-left: auto; font-size: .78rem; background: var(--sand); padding: .1rem .5rem; border-radius: 99px; color: var(--ink-2); }
.acc ul { margin: 0; padding: 0 1.2rem 1rem 2.4rem; }

.sources li { margin-bottom: .5rem; }

/* Propuestas debatidas */
.debate { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.debate[hidden] { display: none; }
.debate__head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .5rem; }
.debate__head h3 { margin: 0; flex: 1; min-width: 12rem; }
.debate__head a { text-decoration: none; color: var(--ink); }
.debate__tema { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.debate__sides { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .8rem; }
.side { padding: .9rem 1rem; border-radius: 10px; font-size: .94rem; }
.side p { margin: .3rem 0 0; }
.side strong { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.side--favor { background: #eef3f0; border-left: 4px solid var(--favor); }
.side--favor strong { color: var(--favor); }
.side--contra { background: #f5eeee; border-left: 4px solid var(--contra); }
.side--contra strong { color: var(--contra); }
@media (max-width: 640px) { .debate__sides { grid-template-columns: 1fr; } }
.debates { max-width: 900px; }
.filter, .filter-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.filter-row label { display: flex; flex-direction: column; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); gap: .3rem; }
.filter-row select { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: .55rem 2rem .55rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); min-width: 13rem; }

/* ---------- Comparador ---------- */
.comparador__controls { display: grid; gap: 1.2rem; margin-bottom: 2rem; padding: 1.3rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 74px; z-index: 5; box-shadow: var(--shadow); }
.comparador__controls fieldset { border: 0; padding: 0; margin: 0; }
.comparador__controls legend { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
@media (max-width: 900px) { .comparador__controls { position: static; } }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.comp-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; font-size: .94rem; }
.comp-col[hidden], .comp-tema[hidden] { display: none; }
.comp-col header { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.comp-col header a { font-weight: 600; color: var(--ink); text-decoration: none; font-size: .9rem; }
.comp-col ul { margin: 0; padding-left: 1.1rem; }
.comp-col li { margin-bottom: .45rem; }

/* ---------- Páginas y entradas ---------- */
.entry { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.prose h2.wp-block-heading { margin-top: 2rem; }
.wp-block-image img { border-radius: 10px; }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: #d9d5cc; padding: 3rem 0 1.2rem; margin-top: 0; font-size: .95rem; }
.site-footer a { color: #f1e6cf; }
.site-footer .logo-mark { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
.site-footer__title { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: #a9a49a; }
.site-footer .menu, .site-footer .menu-pie { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.site-footer .muted { color: #a9a49a; }
.brand--footer { color: #fff; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; color: #a9a49a; }
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr; } }

@media print {
	.topbar, .site-header, .site-footer, .toc, .comparador__controls { display: none !important; }
	body { background: #fff; }
}
.prose .tags { padding-left: 0; }

/* Logos (imagen destacada del partido): misma caja y tamaño para todos */
.badge--logo { padding: .3rem; border-color: var(--line); overflow: hidden; }
.badge__img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; display: block; }
.badge--logo.badge { width: 3.4rem; }
.badge--logo.badge--sm { width: 2.6rem; padding: .2rem; }
.badge--logo.badge--xl { width: 5.5rem; padding: .5rem; }
