/* =========================================================
   elecciones.realmadrid.com.co — Hoja de estilos global
   Diseño neutral, accesible (WCAG 2.2 AA) y responsive.
   ========================================================= */

:root {
  --navy: #002F5F;
  --navy-700: #00254a;
  --gold: #C9A24B;          /* dorado sobrio, mejor contraste que #FFD700 */
  --gold-soft: #f3ebd6;
  --ink: #1a1d24;
  --grey-600: #5a6472;
  --grey-300: #d4d9e0;
  --grey-100: #f4f6f9;
  --white: #ffffff;
  --ok: #1f7a4d;
  --pending: #8a8f99;
  --max: 1140px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,18,40,.06);
  --font-display: "Libre Franklin", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

[data-theme="dark"] {
  --navy: #e8eef6;
  --navy-700: #c9d6e6;
  --ink: #eef1f5;
  --grey-600: #aab3c0;
  --grey-300: #3a4250;
  --grey-100: #1c2230;
  --white: #12161f;
  --gold-soft: #2a2616;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; color: var(--navy); font-weight: 700; }
a { color: var(--navy); }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* --- Accesibilidad: salto al contenido --- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ===================== AVISO DE NEUTRALIDAD ===================== */
.neutral-bar {
  background: var(--navy);
  color: #eef2f7;
  font-size: .82rem;
  text-align: center;
  padding: .5rem 1rem;
}
.neutral-bar strong { color: var(--gold); }

/* ===================== HEADER ===================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--grey-300);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.25rem; max-width: var(--max); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand .crest {
  width: 38px; height: 38px; flex-shrink: 0;
}
.brand-text strong {
  display: block; font-family: var(--font-display); color: var(--navy);
  font-size: 1.02rem; line-height: 1.1;
}
.brand-text span { font-size: .72rem; color: var(--grey-600); }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: .3rem; list-style: none; flex-wrap: wrap; }
.main-nav a {
  text-decoration: none; color: var(--ink); font-size: .92rem;
  padding: .45rem .6rem; border-radius: 6px; font-weight: 600;
  display: block;
}
.main-nav a:hover { background: var(--grey-100); }
.main-nav a[aria-current="page"] {
  color: var(--navy); box-shadow: inset 0 -3px 0 var(--gold);
}

.header-actions { display: flex; align-items: center; gap: .5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--navy); color: #fff; text-decoration: none;
  padding: .55rem 1rem; border-radius: 8px; font-weight: 700;
  font-size: .9rem; border: 0; cursor: pointer;
}
.btn:hover { background: var(--navy-700); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--grey-300); }
.btn.ghost:hover { border-color: var(--navy); background: var(--grey-100); }

.icon-btn {
  background: var(--grey-100); border: 1px solid var(--grey-300);
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer;
  font-size: 1rem; color: var(--ink); display: flex;
  align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--grey-300); }

.nav-toggle { display: none; }

/* ===================== HERO ===================== */
.hero {
  background:
    linear-gradient(180deg, rgba(0,47,95,.92), rgba(0,37,74,.97)),
    radial-gradient(circle at 80% -10%, rgba(201,162,75,.5), transparent 55%);
  color: #fff; text-align: center; padding: 3.5rem 1.25rem 3rem;
}
.hero .status-pill {
  display: inline-block; background: rgba(201,162,75,.18);
  border: 1px solid var(--gold); color: var(--gold);
  padding: .3rem .9rem; border-radius: 999px; font-size: .8rem;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.9rem); margin: 1rem 0 .5rem; }
.hero p.lead { color: #d4ddea; max-width: 620px; margin: 0 auto 1.5rem; }

.countdown { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.countdown .unit {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius); padding: .8rem 1.1rem; min-width: 82px;
}
.countdown .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #fff; }
.countdown .lbl { font-size: .72rem; text-transform: uppercase; color: var(--gold); letter-spacing: .05em; }

/* ===================== SECCIONES GENÉRICAS ===================== */
section { padding: 3rem 0; }
.section-title { font-size: 1.5rem; margin-bottom: .4rem; }
.section-intro { color: var(--grey-600); margin-bottom: 1.6rem; max-width: 640px; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .76rem;
  font-weight: 700; color: var(--gold); margin-bottom: .35rem;
}

/* --- tarjetas --- */
.card-grid { display: grid; gap: 1.25rem; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--grey-300);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.card p { color: var(--grey-600); font-size: .95rem; }
.card a.card-link {
  display: inline-block; margin-top: .8rem; font-weight: 700;
  font-size: .9rem; text-decoration: none; color: var(--navy);
}
.card a.card-link:hover { text-decoration: underline; }

/* --- caja de dato --- */
.stat { text-align: center; }
.stat .big { font-family: var(--font-display); font-size: 2rem; color: var(--navy); font-weight: 700; }
.stat .small { font-size: .85rem; color: var(--grey-600); }

/* ===================== CANDIDATOS ===================== */
.candidate-card { text-align: center; }
.candidate-card .photo {
  width: 100%; aspect-ratio: 4/3; border-radius: 8px;
  background: var(--grey-100); display: flex; align-items: center;
  justify-content: center; overflow: hidden; margin-bottom: .9rem;
}
.candidate-card .photo .initials {
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 700;
  color: var(--navy);
}
.candidate-card .links { display: flex; flex-direction: column; gap: .35rem; margin-top: .8rem; }
.candidate-card .links a {
  font-size: .88rem; text-decoration: none; color: var(--navy);
  border: 1px solid var(--grey-300); border-radius: 6px; padding: .35rem .5rem;
}
.candidate-card .links a:hover { background: var(--grey-100); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 999px; background: var(--gold-soft);
  color: var(--navy); margin-bottom: .5rem;
}

/* ===================== TABLAS ===================== */
.table-scroll { overflow-x: auto; border: 1px solid var(--grey-300); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: .85rem 1rem; text-align: left; font-size: .92rem; vertical-align: top; }
thead th { background: var(--navy); color: #fff; font-family: var(--font-display); font-size: .85rem; }
tbody tr:nth-child(even) { background: var(--grey-100); }
tbody td { border-top: 1px solid var(--grey-300); }
td.muted { color: var(--grey-600); font-style: italic; }

/* ===================== TIMELINE ===================== */
.timeline { list-style: none; position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: .4rem; bottom: .4rem;
  width: 2px; background: var(--grey-300);
}
.timeline li { position: relative; padding-bottom: 1.6rem; }
.timeline li::before {
  content: ""; position: absolute; left: -2rem; top: .25rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--grey-300);
}
.timeline li.done::before { border-color: var(--ok); background: var(--ok); }
.timeline li.active::before { border-color: var(--gold); background: var(--gold); }
.timeline li .when { font-weight: 700; color: var(--navy); }
.timeline li .state {
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; margin-left: .5rem;
}
.timeline li.done .state { color: var(--ok); }
.timeline li.active .state { color: var(--gold); }
.timeline li.todo .state { color: var(--pending); }
.timeline li p { color: var(--grey-600); font-size: .92rem; margin-top: .2rem; }

/* ===================== NOTICIAS ===================== */
.news-item {
  border-bottom: 1px solid var(--grey-300); padding: 1.2rem 0;
}
.news-item:last-child { border-bottom: 0; }
.news-meta { font-size: .8rem; color: var(--grey-600); margin-bottom: .3rem; }
.news-item h3 { font-size: 1.1rem; }
.label {
  display: inline-block; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; padding: .15rem .5rem; border-radius: 4px;
  background: var(--navy); color: #fff; margin-right: .4rem;
}
.label.media { background: var(--grey-600); }

/* ===================== ACORDEÓN FAQ ===================== */
details.faq {
  border: 1px solid var(--grey-300); border-radius: 8px;
  padding: .9rem 1.1rem; margin-bottom: .7rem; background: var(--white);
}
details.faq summary {
  cursor: pointer; font-weight: 700; color: var(--navy);
  list-style: none; font-family: var(--font-display);
}
details.faq summary::after { content: "+"; float: right; font-size: 1.2rem; }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin-top: .6rem; color: var(--grey-600); font-size: .93rem; }

/* ===================== AVISO / CALLOUT ===================== */
.callout {
  background: var(--gold-soft); border-left: 4px solid var(--gold);
  padding: 1rem 1.2rem; border-radius: 0 8px 8px 0; font-size: .92rem;
}
.callout strong { color: var(--navy); }

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--navy); color: #cdd8e6; padding: 2.5rem 0 1.5rem;
  margin-top: 1rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: .7rem; }
.site-footer a { color: #cdd8e6; text-decoration: none; font-size: .9rem; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-legal {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: .9rem 1rem; font-size: .85rem; line-height: 1.55;
}
.footer-legal strong { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.6rem;
  padding-top: 1rem; font-size: .8rem; display: flex;
  justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.updated { color: var(--gold); font-weight: 600; }

/* ===================== PAGE HEADER (interiores) ===================== */
.page-head {
  background: var(--grey-100); border-bottom: 1px solid var(--grey-300);
  padding: 2.2rem 0;
}
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-head p { color: var(--grey-600); margin-top: .4rem; max-width: 640px; }
.breadcrumb { font-size: .82rem; color: var(--grey-600); margin-bottom: .5rem; }
.breadcrumb a { color: var(--grey-600); }

/* ===================== UTILIDADES ===================== */
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.cta-band {
  background: var(--gold-soft); border-radius: var(--radius);
  padding: 2rem; text-align: center;
}
.cta-band h2 { font-size: 1.4rem; }
.cta-band p { color: var(--grey-600); margin: .4rem 0 1.1rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-toggle {
    display: flex; margin-left: auto; order: 2;
  }
  .main-nav {
    order: 4; flex-basis: 100%; margin-left: 0;
    display: none; padding-top: .6rem;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: .15rem; }
  .header-actions { order: 3; }
}
@media (max-width: 560px) {
  .cols-3, .cols-4, .cols-2 { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 1rem; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
