/* ══════════════════════════════════════════
   PLANTILLA 3 — MiVoto Blog
   Concepto: 3 columnas — barra lateral izquierda
   navy oscura con anuncios + artículo central
   amplio + TOC derecho flotante.
   Modo claro con bloques oscuros estructurales.
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Source+Sans+Pro:wght@300;400;600;700;900&family=Source+Serif+4:ital,wght@0,300;0,400;1,400&display=swap');

/* ── VARIABLES ── */
:root {
  --navy:          #0a1628;
  --navy-mid:      #112240;
  --navy-light:    #1a3358;
  --red:           #E63946;
  --red-dark:      #C71C30;
  --red-grad:      linear-gradient(135deg, #E63946 0%, #C71C30 100%);
  --blue:          #3686d3;
  --blue-dark:     #2563a6;
  --blue-bright:   #4a9fe8;
  --blue-pale:     #eaf3fc;
  --white:         #ffffff;
  --off-white:     #fafaf8;
  --cream:         #f5f0e8;
  --text:          #181828;
  --text-mid:      #3a3a50;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  /* sidebar dark */
  --side-bg:       #0c1a2e;
  --side-surface:  #112240;
  --side-border:   rgba(255,255,255,0.07);
  --side-text:     #c8d8f0;
  --side-muted:    #7a93b8;
  /* sidebar left width */
  --sidebar-w:     260px;
  /* toc right width */
  --toc-w:         210px;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.7;
}

/* ══════════════════════════════════════════
   NAVBAR — estructura idéntica al original
   ══════════════════════════════════════════ */
nav {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 3px solid var(--red);
  box-shadow: 0 2px 12px rgba(10,22,40,0.06);
}
.nav-inner {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 68px;
}
.logo {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1.4rem; font-weight: 900;
  color: var(--navy); letter-spacing: 0.05em;
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.logo img { height: 32px; width: 32px; object-fit: contain; }
.logo span { color: var(--blue); }

.nav-links {
  display: flex; align-items: center;
  list-style: none; gap: 4px; margin: 0;
}
.nav-links a {
  color: var(--text-mid); text-decoration: none;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.06em;
  padding: 7px 14px; border-radius: 4px;
  transition: color 0.18s, background 0.18s;
  display: flex; align-items: center; gap: 6px;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--blue);
  background: var(--blue-pale);
}

.nav-social { display: flex; align-items: center; gap: 8px; }
.nav-social a {
  color: var(--navy);
  background: var(--white);
  border-radius: 7px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  border: 1.5px solid var(--border);
  transition: background 0.18s, border 0.18s, color 0.18s;
  padding: 0; margin: 0 2px;
}
.nav-social a i { font-size: 1.05rem; font-weight: 900; }
.nav-social a:hover {
  background: var(--blue-pale);
  border-color: var(--blue);
  color: var(--blue);
}

.nav-desktop-block { display: flex; align-items: center; }
.nav-row-mobile    { display: none; }

@media (max-width: 900px) {
  .nav-row-mobile {
    display: flex; flex-direction: row; align-items: center;
    justify-content: flex-start; width: 100%; margin: 10px 0 6px;
  }
  .nav-row-mobile .logo       { margin-right: auto; }
  .nav-row-mobile .nav-social { margin-left: auto; }
  .nav-desktop-block          { display: none !important; }
  .nav-inner { flex-direction: column; height: auto; padding: 0 12px; align-items: stretch; }
  .nav-links { gap: 4px; flex-wrap: wrap; justify-content: center; width: 100%; padding-bottom: 8px; }
  .nav-links a { font-size: 0.82rem; padding: 6px 10px; }
  .nav-social a { width: 28px; height: 28px; border-radius: 5px; }
  .nav-social a i { font-size: 0.9rem; }
}


/* ══════════════════════════════════════════
   HERO — mismo contenido, diseño inclinado
   ══════════════════════════════════════════ */
.hero {
  background:
    linear-gradient(135deg, rgba(10,22,40,0.86) 0%, rgba(54,134,211,0.48) 100%),
    url('encuestas.jpg') center center / cover no-repeat;
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px 80px;
}
/* Corte diagonal inferior */
.hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 52px;
  background: var(--off-white);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
/* Línea roja izquierda decorativa */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(10,22,40,0.25);
  pointer-events: none;
}

.hero-bg, .hero-grid { display: none; }

.hero-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; max-width: 700px; margin: 0 auto;
  animation: fadeUp 0.65s ease forwards;
}
.hero-left { display: flex; flex-direction: column; align-items: center; width: 100%; }

.hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 900; font-style: italic;
  color: #fff; line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hero p {
  color: rgba(255,255,255,0.86);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1.08rem; font-weight: 400;
  line-height: 1.65; margin-bottom: 10px;
  max-width: 500px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}
.hero span { display: none; }

.hero-buttons { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-block; font-family: 'Source Sans Pro', sans-serif;
  font-weight: 700; letter-spacing: 0.07em;
  text-decoration: none; cursor: pointer; border: none;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.hero .btn-primary {
  background: var(--white); color: var(--navy);
  padding: 12px 30px; border-radius: 4px; font-size: 0.92rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
}
.hero .btn-primary:hover { background: rgba(255,255,255,0.9); transform: translateY(-2px); }
.hero .btn-light {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
  padding: 12px 30px; border-radius: 4px; font-size: 0.92rem;
}
.hero .btn-light:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.8); transform: translateY(-2px); }

@media (max-width: 900px) { .hero { min-height: 360px; } .hero h1 { font-size: 1.9rem; } .hero::before { display: none; } }
@media (max-width: 700px) {
  .hero { min-height: 310px; padding: 48px 20px 72px; }
  .hero h1 { font-size: 1.55rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero .btn-primary, .hero .btn-light { width: 100%; max-width: 280px; text-align: center; }
}


/* ══════════════════════════════════════════
   LAYOUT PRINCIPAL — 3 COLUMNAS
   [sidebar-izq: navy] [artículo: ancho] [toc: derecha]
   ══════════════════════════════════════════ */
.page-wrap {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 0 80px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  grid-template-areas: "left center right";
  gap: 0;
  align-items: start;
}

/* ── SIDEBAR IZQUIERDO (oscuro) ── */
.sidebar-left {
  grid-area: left;
  background: var(--side-bg);
  min-height: 100%;
  position: sticky;
  top: 71px;
  /* Que cubra hasta el final del artículo visualmente */
  align-self: stretch;
}
.sidebar-left-inner {
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 88px;
}

/* Separador decorativo en la sidebar */
.side-divider {
  height: 1px;
  background: var(--side-border);
  margin: 4px 0;
}

/* Tarjeta de anuncio — sidebar izquierda oscura */
.ad-card {
  background: var(--side-surface);
  border: 1px solid var(--side-border);
  border-top: 3px solid var(--blue);
  overflow: hidden;
  border-radius: 2px;
  transition: box-shadow 0.25s, transform 0.2s;
}
.ad-card:nth-child(even) { border-top-color: var(--red); }
.ad-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  transform: translateY(-2px);
}
.ad-card a { text-decoration: none; color: inherit; display: block; }
.ad-img-wrap { overflow: hidden; height: 130px; }
.ad-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s; filter: brightness(0.82) saturate(0.9);
}
.ad-card:hover .ad-img-wrap img { transform: scale(1.06); filter: brightness(0.95) saturate(1); }
.ad-card-body { padding: 12px 14px 14px; }
.ad-card-body h4 {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  color: var(--side-text); margin-bottom: 4px; line-height: 1.3;
}
.ad-card-body p {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.76rem; color: var(--side-muted);
  line-height: 1.5; margin: 0;
}
.ad-card-cta {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; color: var(--blue-bright);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.ad-card-cta i { font-size: 0.6rem; transition: transform 0.2s; }
.ad-card:hover .ad-card-cta i { transform: translateX(4px); }


/* ── ARTÍCULO CENTRAL ── */
.article-wrap {
  grid-area: center;
  padding: 44px 48px 60px 44px;
  background: var(--white);
  border-right: 1px solid var(--border);
  min-width: 0;
}

/* Etiqueta de categoría */
.article-category {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--red-grad);
  color: #fff; font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 2px; margin-bottom: 14px;
}

main > h1 {
  font-family: Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700; font-style: italic;
  color: var(--navy); line-height: 1.22;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-strong);
}

/* Línea roja decorativa bajo el título */
main > h1 + * { margin-top: 0; }

main h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--navy); margin: 44px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  position: relative;
}
/* Punto rojo en el borde */
main h2::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0;
  width: 40px; height: 3px;
  background: var(--red-grad);
  border-radius: 2px;
}

main p {
  font-size: 1.02rem; color: var(--text-mid);
  margin-bottom: 20px; font-weight: 300; line-height: 1.88;
}

/* Lead paragraph */
.lead-paragraph {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.08rem; font-weight: 400; font-style: italic;
  color: var(--navy); line-height: 1.9;
  background: var(--blue-pale);
  border-left: 4px solid var(--blue);
  padding: 16px 20px; margin-bottom: 32px;
  border-radius: 0 4px 4px 0;
}

/* ── DATA CALLOUT ── */
.data-callout {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 32px 0; overflow: hidden;
  background: var(--navy);
  border-radius: 4px;
}
.data-item {
  padding: 24px 18px; text-align: center;
  border-right: 1px solid rgba(255,255,255,0.07);
  position: relative; transition: background 0.22s;
}
.data-item:last-child { border-right: none; }
.data-item:hover { background: var(--navy-mid); }
.data-item::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--red-grad);
  transform: scaleX(0); transition: transform 0.3s; transform-origin: left;
}
.data-item:nth-child(2)::after { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%); }
.data-item:hover::after { transform: scaleX(1); }
.data-item .num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem; font-weight: 900;
  color: var(--white); display: block; line-height: 1; margin-bottom: 8px;
}
.data-item:nth-child(2) .num { color: var(--blue-bright); }
.data-item .desc {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.62rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: rgba(255,255,255,0.48); line-height: 1.5;
}
@media (max-width: 700px) {
  .data-callout { grid-template-columns: 1fr; }
  .data-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .data-item:last-child { border-bottom: none; }
}

/* ── HIGHLIGHT BOX ── */
.highlight-box {
  background: var(--navy);
  padding: 28px 32px; margin: 32px 0;
  position: relative; overflow: hidden; border-radius: 3px;
}
.highlight-box::before {
  content: '"';
  position: absolute; top: -28px; left: 14px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 10rem; color: var(--red);
  opacity: 0.15; line-height: 1; pointer-events: none;
}
.highlight-box p {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.1rem !important; font-style: italic;
  color: rgba(255,255,255,0.92) !important;
  margin: 0 !important; line-height: 1.7; position: relative; z-index: 1;
}

/* ── REFERENCIAS ── */
.refs {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  padding: 22px 26px; margin-top: 44px;
}
.refs-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
}
.refs ul { list-style: none; padding: 0; }
.refs ul li {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.82rem; color: var(--text-muted);
  padding: 5px 0 5px 16px;
  border-bottom: 1px dashed var(--border);
  position: relative;
}
.refs ul li:last-child { border-bottom: none; }
.refs ul li::before { content: '→'; position: absolute; left: 0; top: 7px; color: var(--red); font-size: 0.7rem; }


/* ── TOC — columna derecha ── */
.toc-col {
  grid-area: right;
  padding: 44px 20px 44px 24px;
}
.toc-sticky {
  position: sticky;
  top: 88px;
}
.toc-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  padding: 18px 16px;
}
.toc-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 12px;
}
.toc-list { list-style: none; counter-reset: toc; }
.toc-list li {
  counter-increment: toc;
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.toc-list li:last-child { border-bottom: none; }
.toc-list li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: 'Source Sans Pro', monospace;
  font-size: 0.6rem; font-weight: 800;
  color: var(--red); flex-shrink: 0;
}
.toc-list a {
  font-family: 'Source Sans Pro', sans-serif;
  color: var(--text-muted); text-decoration: none;
  font-size: 0.8rem; line-height: 1.35;
  transition: color 0.18s;
}
.toc-list a:hover { color: var(--navy); }

/* Etiqueta extra en la columna derecha */
.toc-meta {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--navy);
  border-radius: 2px;
}
.toc-meta p {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin: 0;
}
.toc-meta strong {
  display: block;
  font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 6px;
}


/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
footer {
  background: var(--navy);
  border-top: 3px solid var(--red);
}
.footer-main { padding: 48px 0; background: var(--navy); }
.footer-main hr { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 0 0 16px; }

.footer-container {
  max-width: 1340px;
  margin: 0 auto; padding: 32px 32px;
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-start; gap: 32px;
}
.footer-col { flex: 1; min-width: 180px; }
.footer-brand { min-width: 220px; max-width: 340px; }
.footer-brand .logo img { height: 38px; width: auto; object-fit: contain; display: block; margin-bottom: 10px; }
.footer-brand .logo span { color: var(--blue-bright); }
.footer-brand p {
  font-family: 'Source Sans Pro', sans-serif;
  color: rgba(255,255,255,0.45); font-size: 0.9rem; line-height: 1.6;
}
.footer-col strong {
  display: block; margin-bottom: 12px;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.9);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  font-family: 'Source Sans Pro', sans-serif;
  color: var(--blue-bright); text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.88rem; transition: color 0.18s;
}
.footer-col ul li a:hover { color: var(--white); }
.footer-col ul li a i { font-size: 0.8rem; }

.footer-copy-wrap {
  max-width: 1340px; margin: 0 auto; padding: 0 32px;
}
.footer-copy {
  text-align: center; font-family: 'Source Sans Pro', sans-serif;
  color: rgba(255,255,255,0.3); font-size: 0.85rem; padding-bottom: 18px;
}
@media (max-width: 900px) { .footer-container { flex-direction: column; gap: 24px; } }


/* ══════════════════════════════════════════
   RESPONSIVE — colapso a 1 columna
   ══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .page-wrap {
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-areas:
      "left center"
      "left center";
  }
  .toc-col { display: none; }
}

@media (max-width: 760px) {
  .page-wrap {
    grid-template-columns: 1fr;
    grid-template-areas: "center" "left";
  }
  .sidebar-left {
    position: static;
    background: var(--side-bg);
    min-height: unset;
  }
  .sidebar-left-inner { position: static; }
  .article-wrap { padding: 28px 20px 48px; border-right: none; }
  .hero::before { display: none; }
}


/* ══════════════════════════════════════════
   WHATSAPP FLOTANTE
   ══════════════════════════════════════════ */
.whatsapp-float {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  background: #25d366; color: #fff;
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22); text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.whatsapp-float:hover { background: #1ebe57; transform: translateY(-2px); }
.whatsapp-float svg { width: 32px; height: 32px; fill: #fff; display: block; }
@media (max-width: 700px) {
  .whatsapp-float { width: 44px; height: 44px; bottom: 16px; right: 16px; }
  .whatsapp-float svg { width: 22px; height: 22px; }
}


/* ══════════════════════════════════════════
   ANIMACIONES
   ══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content    { animation: fadeUp 0.6s ease forwards; }
main             { animation: fadeUp 0.55s 0.1s ease both; }
.toc-sticky      { animation: fadeUp 0.55s 0.15s ease both; }
.sidebar-left-inner { animation: fadeUp 0.55s 0.05s ease both; }
