@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --red: #e8461c;
  --red-dark: #c23815;
  --pink: #ffd000;
  --pink-soft: #fff5b0;
  --black: #ffffff;
  --surface: #ffffff;
  --surface2: #f5f5f5;
  --surface3: #ececec;
  --border: #e6e6e6;
  --text: #17151c;
  --text-muted: #767680;
  --header-bg: #ffd230;
  --sidebar-w: 260px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--black);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; right: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--surface); border-left: 1px solid var(--border); z-index: 200;
  transform: translateX(100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar-header { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sidebar-header img { height: 30px; object-fit: contain; }
.sidebar-close { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; line-height: 1; transition: color .2s; }
.sidebar-close:hover { color: var(--red); }
.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar nav a { display: block; padding: 14px 20px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--border); transition: color .2s, background .2s; letter-spacing: .02em; }
.sidebar nav a:hover { color: var(--red); background: var(--surface2); }
.sidebar-cats { padding: 16px 20px 8px; }
.sidebar-cats h4 { font-size: 11px; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.cat-pill { display: inline-block; padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text-muted); text-decoration: none; margin: 3px 3px 3px 0; transition: all .2s; }
.cat-pill:hover { border-color: var(--red); color: var(--red); }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 199; opacity: 0; pointer-events: none; transition: opacity .35s; }
.overlay.show { opacity: 1; pointer-events: all; }

.menu-btn {
  margin-left: 6px; background: #fff; border: none; color: #111 !important;
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity .2s;
}
.menu-btn:hover { opacity: .7; }
.menu-btn svg { width: 17px; height: 17px; color: #111 !important; stroke: #111 !important; }
body.dark-mode .menu-btn { background: #fff !important; color: #111 !important; }
body.dark-mode .menu-btn svg { color: #111 !important; stroke: #111 !important; }

/* ── MODAL ── */
.modal-bg {
  position: fixed; inset: 0; z-index: 1100000; background: rgba(0,0,0,.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-bg.show { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; max-width: 560px; width: 100%; padding: 32px; transform: translateY(20px); transition: transform .3s; max-height: 80vh; overflow-y: auto; }
.modal-bg.show .modal { transform: translateY(0); }
.modal h2 { font-family: 'Bebas Neue', sans-serif; font-size: 28px; margin-bottom: 14px; }
.modal p { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin-bottom: 10px; }
.modal-close { display: block; margin-top: 20px; margin-left: auto; background: var(--red); color: #fff; border: none; padding: 9px 22px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 58px;
  background: var(--header-bg);
  border-bottom: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  padding: 0 20px 0 12px;
  gap: 12px;
}
.logo-wrap { display: flex; align-items: center; flex-shrink: 0; max-width: 220px; overflow: hidden; }
.logo-wrap img { height: 30px; object-fit: contain; }
.logo-wrap span { font-family:'Bebas Neue',sans-serif; font-size:22px; letter-spacing:.05em; color:var(--red); }

.topbar-cats { display: flex; gap: 4px; margin-left: 20px; flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.topbar-cats::-webkit-scrollbar { display: none; }
.topbar-cats a {
  white-space: nowrap; padding: 5px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; border: 1px solid transparent; transition: all .2s;
}
.topbar-cats a:hover, .topbar-cats a.active { color: var(--text); border-color: var(--red); background: rgba(224,28,36,.12); }

.admin-link {
  margin-left: auto; flex-shrink:0;
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 14px; border-radius: 8px;
  font-size: 12px; text-decoration: none; transition: border-color .2s, color .2s;
}
.admin-link:hover { border-color: var(--red); color: var(--red); }

/* ── MAIN ── */
.main { padding-bottom: 60px; }

/* ── SLIDER DE DESTACADOS ── */
.slider-wrap { position: relative; max-width: 1280px; margin: 20px auto 0; padding: 0 20px; }
.slider { position: relative; width: 100%; aspect-ratio: 21/9; border-radius: 14px; overflow: hidden; background: var(--surface2); }
@media (max-width: 700px) { .slider { aspect-ratio: 4/5; } }
.slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .6s ease;
  text-decoration: none; display: block;
}
.slide.active { opacity: 1; pointer-events: all; }
.slide img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.slide-empty {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  background: var(--surface2); cursor: default;
}
.slide-empty .slide-empty-icon { font-size: 34px; opacity: .35; }
.slide-empty .slide-empty-text { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.slide-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 24px 22px;
  background: linear-gradient(to top, rgba(0,0,0,.92) 10%, rgba(0,0,0,.4) 60%, transparent 100%);
}
.slide-info h3 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(20px,3vw,32px); color: #fff; margin: 4px 0 4px; line-height: 1.1; max-width: 640px; }
.slide-info .post-cat { margin-bottom: 0; }
.slide-info .post-date { color: #ccc; }

.slider-arrow { display: none !important; }
.slider-arrow:hover { background: var(--red); }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }
.slider-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; gap: 6px; z-index: 5; justify-content: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; transition: background .2s, width .2s; }
.dot.active { background: var(--red); width: 20px; border-radius: 4px; }
.grid-section { padding: 36px 20px 0; max-width: 1280px; margin: 0 auto; }
.section-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .05em;
  margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
}
.section-title span { color: var(--text-muted); font-size: 14px; font-family: 'Inter', sans-serif; font-weight: 400; }

.posts-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 1100px) { .posts-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px) { .posts-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 460px) { .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.post-card {
  background: var(--surface2); border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); transition: transform .25s, border-color .25s;
  text-decoration: none; color: inherit; display: block;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--pink); }
.post-thumb { width: 100%; height: 220px; object-fit: cover; display: block; background: var(--surface3); }
@media (max-width: 1100px) { .post-thumb { height: 195px; } }
@media (max-width: 700px)  { .post-thumb { height: 165px; } }
@media (max-width: 460px)  { .post-thumb { height: 140px; } }
.post-info { padding: 8px 9px 10px; }
.post-cat { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 3px; }
.post-title { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-date { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.empty-state { text-align:center; padding: 60px 20px; color: var(--text-muted); }

/* ── PAGINACIÓN ── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 44px 0 24px; flex-wrap: wrap; }
.page-arrow, .page-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.page-arrow { font-size: 18px; color: var(--text-muted); }
.page-arrow:hover, .page-num:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(232,70,28,.18); }
.page-num.active,
.page-num[aria-current="page"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px rgba(232,70,28,.28);
  font-weight: 800;
}
.page-num.active:hover,
.page-num[aria-current="page"]:hover {
  transform: none;
  color: #fff;
  background: var(--red-dark);
  border-color: var(--red-dark);
}
.page-arrow.disabled { opacity: .35; pointer-events: none; }
.page-ellipsis { color: var(--text-muted); font-size: 14px; padding: 0 4px; }

/* ── FOOTER ── */
.footer { border-top: 1px solid var(--border); padding: 30px 20px; text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 20px; }
.footer p { margin-top: 4px; }

/* ── POST PAGE ── */
.post-hero { position: relative; width: 100%; height: 300px; overflow: hidden; background: var(--surface); }
.post-hero img { width: 100%; height: 300px; object-fit: cover; object-position: center 20%; display: block; }
@media (max-width: 600px) { .post-hero, .post-hero img { height: 220px; } }
.post-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35) 0%, rgba(0,0,0,.08) 60%, transparent 100%);
}

.post-wrap { max-width: 860px; margin: 0 auto; padding: 0 20px 60px; }
.post-header { padding: 22px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.post-cat-badge {
  display: inline-block; background: var(--red); color: #fff; font-size: 11px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px; margin-bottom: 10px;
}
.post-h1 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(28px,5vw,44px); line-height: 1.1; margin-bottom: 10px; }
.post-meta { font-size: 13px; color: var(--text-muted); display:flex; gap: 16px; flex-wrap: wrap; }

.post-toc {
  background: #fff6a8;
  border: 1px solid #e8d84a;
  border-radius: 12px;
  padding: 12px 18px 14px;
  margin-bottom: 30px;
  margin-top: 46px; /* espacio para: separación de la fecha + label flotante */
  position: relative;
}
.post-toc-label {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #888;
  /* Centrado fuera del modal, pegado 2px encima del borde */
  position: absolute;
  top: -20px;          /* sale del box hacia arriba */
  left: 50%;
  transform: translateX(-50%);
  margin: 0 0 2px 0;  /* 2px de margen respecto al modal */
  padding: 0 6px;
  background: transparent; /* sin fondo para que no tape nada */
  white-space: nowrap;
  display: block;
}
.post-toc ol { list-style: none; padding: 0; margin: 0; }
.post-toc li { margin-bottom: 8px; }
.post-toc li:last-child { margin-bottom: 0; }
/* "Parte N:" + título en el mismo flujo inline, sin salto forzado */
.post-toc a {
  text-decoration: none;
  display: block;
  line-height: 1.45;
  font-size: 13px;
}
.post-toc a:hover .toc-title { text-decoration: underline; }
.toc-part {
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  display: inline;
  margin-right: 4px;
}
.toc-title {
  font-weight: 600;
  color: #e8461c;
  display: inline;
}

.post-body {
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--text);
  /* Evita que texto largo rompa el layout en móvil */
  word-break: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  /* Evita que el contenedor se desborde horizontalmente */
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
.post-body p { margin-bottom: 18px; }
/* Asegurar que imágenes e iframes dentro del artículo no rompan el ancho */
.post-body img,
.post-body iframe,
.post-body video,
.post-body table {
  max-width: 100%;
  height: auto;
}
.post-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── H1 dentro del cuerpo (raro, solo si el admin lo usa) ── */
.post-body-h1 {
  font-size: clamp(22px,4vw,32px); font-weight: 700; line-height: 1.2;
  margin: 36px 0 14px; color: var(--text);
}

/* ── H2: título de sección — estilo editorial, sin fuente decorativa ── */
.post-h2 {
  font-size: 19px; font-weight: 700; line-height: 1.3;
  margin: 40px 0 14px; color: var(--text);
  scroll-margin-top: 70px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0;
}

/* ── H3: subsección ── */
.post-h3 {
  font-size: 16px; font-weight: 600; line-height: 1.4;
  margin: 28px 0 10px; color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  scroll-margin-top: 70px;
}

/* ── H4: etiqueta / nota lateral ── */
.post-h4 {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  margin: 24px 0 8px; font-family: 'Inter', sans-serif;
}

/* ── Cita / diálogo de personaje ── */
.post-quote {
  background: var(--surface2);
  border-left: 3px solid #ccc;
  border-radius: 0 6px 6px 0;
  padding: 10px 16px 10px 18px;
  margin: 16px 0 16px 4px;
}
.quote-speaker {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 5px; letter-spacing: .01em;
}
.quote-text {
  margin: 0; font-style: italic;
  color: var(--text); font-size: 15.5px; line-height: 1.65;
}

/* ── Caja de revelación / dato clave (fondo rosado) !! ── */
.post-reveal {
  background: rgba(224,28,36,.05);
  border: 1px solid rgba(224,28,36,.22);
  border-left: 4px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px; margin: 28px 0;
  font-size: 15px; line-height: 1.75; color: var(--text);
}

/* ── Caja de pregunta al lector (fondo azul) ?? ── */
.post-question {
  scroll-margin-top: 70px;
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(59,130,246,.07);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 8px; padding: 14px 18px; margin: 28px 0;
}
.post-question .q-icon {
  font-size: 15px; font-weight: 700; color: #3b82f6;
  flex-shrink: 0; margin-top: 2px; line-height: 1;
}
.post-question p { margin: 0; color: #1e3a6e; font-size: 14.5px; font-weight: 500; line-height: 1.65; }

/* ── Nota / manuscrito (fondo crema) "" ── */
.post-note {
  background: #fdf8ef;
  border: 1px solid #e8dfc8;
  border-radius: 6px;
  padding: 16px 20px; margin: 24px 0;
  font-size: 14.5px; line-height: 1.75; color: #4a3f2a;
  position: relative;
}
.post-note p { margin: 0; font-style: italic; }
.post-note p::before { content: '\201C'; font-size: 20px; color: #c9a96e; margin-right: 2px; vertical-align: -3px; }
.post-note p::after  { content: '\201D'; font-size: 20px; color: #c9a96e; margin-left:  2px; vertical-align: -3px; }

/* ── Separador de escena · · · ── */
.post-divider {
  display: flex; justify-content: center; gap: 10px;
  margin: 36px 0; color: var(--text-muted);
  font-size: 18px; letter-spacing: 2px;
}
.post-divider span { opacity: .5; }

.back-link { display:inline-block; margin: 24px 0; color: var(--text-muted); text-decoration:none; font-size: 13px; }
.back-link:hover { color: var(--red); }

/* Espacio reservado para anuncios AdSense */
.ad-slot { max-width: 860px; margin: 30px auto; padding: 0 20px; text-align:center; }
.ad-slot .ad-box { border: 1px dashed var(--border); border-radius: 8px; padding: 18px; color: var(--text-muted); font-size: 12px; }

/* ══════════════════════════════════════════
   CAMBIOS Y CORRECCIONES — NUEVAS REGLAS
   ══════════════════════════════════════════ */

/* ── Quitar categorías del header (ya no están) ── */
.topbar-cats { display: none; }

/* ── Calificación de estrellas en el slider ── */
.slide-rating {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,204,0,.45);
  border-radius: 10px;
  padding: 6px 10px 5px;
  backdrop-filter: blur(4px);
}
.slide-rating-num {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Bebas Neue', sans-serif;
  color: #ffcc00;
  line-height: 1;
  letter-spacing: .03em;
}
.slide-stars {
  display: flex;
  gap: 1px;
}
.star {
  font-size: 11px;
  line-height: 1;
}
.star-full  { color: #ffcc00; }
.star-half  { color: #ffcc00; opacity: .6; }
.star-empty { color: rgba(255,255,255,.25); }

/* ── Post-cat en el slider: fondo amarillo ── */
.slide-info .post-cat {
  background: #ffcc00;
  color: #111;
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── Post-cat en las tarjetas del home: mismo fondo amarillo ── */
.post-info .post-cat {
  background: #ffcc00;
  color: #111;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

/* ── Categorías del sidebar con fondo amarillo ── */
.sidebar-cats .cat-pill {
  background: #ffcc00;
  color: #111 !important;
  border-color: #ffcc00;
  font-weight: 700;
}
.sidebar-cats .cat-pill:hover,
.sidebar-cats .cat-pill.active {
  background: #e6b800;
  border-color: #e6b800;
  color: #000 !important;
}

/* ── Footer con links ── */
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.footer-links a {
  color: #9a7355;
  text-decoration: none;
  font-size: 12px;
  transition: color .2s;
}
.footer-links a:hover { color: #6f4f38; }
.footer-sep { color: #9a7355; font-size: 12px; opacity: .65; }

/* ── Imagen de portada en post: asegurar visibilidad ── */
.post-hero img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center 20%;
}

/* post-h3 defined in post body section above */

/* ── Ocultar espacios de anuncios ── */
.ad-slot { display: none !important; }

/* ── Línea divisora entre Categorías y nav en sidebar ── */
.sidebar-cats {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 0;
}

/* ── Ocultar encabezados genéricos "Parte N" del artículo ── */
.post-section > .post-h2 {
  display: none;
}

/* ── Dark Mode ── */
body.dark-mode {
  --bg: #111113;
  --surface: #1c1c1f;
  --text: #e8e8ec;
  --text-muted: #888;
  --border: #2e2e34;
  --black: #000;
}
body.dark-mode .post-card,
body.dark-mode .modal,
body.dark-mode .sidebar,
body.dark-mode .post-wrap,
body.dark-mode .post-body,
body.dark-mode .post-header,
body.dark-mode .dialog-box {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
body.dark-mode .post-quote {
  background: rgba(255,255,255,.04); border-left-color: #555;
}
body.dark-mode .quote-text { color: var(--text); }
body.dark-mode .post-reveal {
  background: rgba(224,28,36,.08); border-color: rgba(224,28,36,.3); color: var(--text);
}
body.dark-mode .post-question {
  background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.2);
}
body.dark-mode .post-question p { color: #93c5fd; }
body.dark-mode .post-question .q-icon { color: #60a5fa; }
body.dark-mode .post-note {
  background: rgba(253,248,239,.06); border-color: rgba(232,223,200,.15); color: #c8b896;
}
/* Dark mode: do NOT change header or category pill colors */
body.dark-mode .topbar { background: var(--header-bg) !important; }
body.dark-mode .menu-btn, body.dark-mode .menu-btn svg { color: #111 !important; stroke: #111 !important; }
body.dark-mode .cat-pill,
body.dark-mode .sidebar-cats .cat-pill { background: #ffd000 !important; border-color: #ffd000 !important; color: #111 !important; }
body.dark-mode .post-cat,
body.dark-mode .post-cat-badge { background: #ffd000 !important; color: #111 !important; }
body.dark-mode .post-toc { background: #222; border-color: #cfb742; }
body.dark-mode .post-toc-label { color: #aaa; }
body.dark-mode .toc-part { color: #e2e2e6; }
body.dark-mode .toc-title { color: #b0543a; }

/* ── Botón Scroll to Top ── */
#scroll-top {
  position: fixed;
  bottom: 32px;
  right: 24px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(102,102,102,0.75);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, background .2s;
}
#scroll-top:hover {
  background: rgba(80,80,80,0.9);
}
#scroll-top::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2.5px solid #fff;
  border-right: 2.5px solid #fff;
  transform: rotate(-45deg);
  margin-top: 4px;
}
#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
body.dark-mode #scroll-top { background: rgba(102,102,102,0.75); }
body.dark-mode #scroll-top:hover { background: rgba(120,120,120,0.9); }

/* ── Botón Luna/Sol (theme toggle) ── */
/* ── Theme Switch ── */
.theme-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-right: 8px;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}
.switch-track {
  width: 44px;
  height: 24px;
  background: #fff;
  border-radius: 12px;
  position: relative;
  transition: background .3s;
  border: none;
}
.theme-switch.is-dark .switch-track {
  background: #555;
  
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.theme-switch.is-dark .switch-thumb {
  transform: translateX(20px);
  background: #fff;
}
.icon-moon { display: block; color: #555; }
.icon-sun  { display: none;  color: #111; }
.theme-switch.is-dark .icon-moon { display: none; }
.theme-switch.is-dark .icon-sun  { display: block; }

/* ── Sidebar nav links — igualar padding/espaciado ── */
.sidebar nav a {
  display: block;
  padding: 14px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  transition: color .2s;
}
.sidebar nav a:first-child { border-top: 1px solid var(--border); }
.sidebar nav a:hover { color: #ffd000; }

body.dark-mode .page-num.active { background: #ffd230 !important; color: #111 !important; border-color: transparent !important; }

/* ── Reproductor de audio ── */
.audio-player {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.audio-player-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
}
.audio-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  background: #e8461c; border: none; border-radius: 50%;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .15s;
}
.audio-btn:hover { background: #c73a16; transform: scale(1.06); }
.audio-info {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 44px;
}
.audio-label {
  font-size: 13px; font-weight: 600; color: #222;
  white-space: nowrap; flex-shrink: 0;
}
.audio-progress-wrap {
  display: flex; align-items: center; gap: 8px; flex: 1;
}
.audio-progress-bar {
  flex: 1; height: 4px; background: #eee; border-radius: 2px; overflow: hidden;
}
.audio-progress-fill {
  height: 100%; width: 0%; background: #e8461c;
  border-radius: 2px; transition: width .4s linear;
}
.audio-time {
  font-size: 11px; color: #999; white-space: nowrap; min-width: 28px; text-align: right;
}
.audio-stop {
  width: 34px; height: 34px; flex-shrink: 0;
  background: #f0f0f0; border: none; border-radius: 8px;
  color: #555; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.audio-stop:hover { background: #e0e0e0; }

/* dark mode audio */
body.dark-mode .audio-player { background: #1e1e22; border-color: #35353d; box-shadow: none; }
body.dark-mode .audio-label { color: #d8d8dc; }
body.dark-mode .audio-progress-bar { background: #35353d; }
body.dark-mode .audio-stop { background: #2a2a2f; color: #aaa; }
body.dark-mode .audio-stop:hover { background: #35353d; }

/* ══════════════════════════════════════════
   CORRECCIONES MÓVIL — LECTURA DEL ARTÍCULO
   ══════════════════════════════════════════ */

/* Evitar desbordamiento horizontal en toda la página */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 600px) {
  /* Ajustar tamaño de fuente del cuerpo del artículo en móvil */
  .post-body {
    font-size: 15px;
    line-height: 1.85;
  }

  /* Asegurar que el contenedor del post no se salga */
  .post-wrap {
    padding: 0 14px 50px;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Cajas especiales: reducir padding en móvil */
  .post-quote,
  .post-reveal,
  .post-question,
  .post-note {
    padding: 12px 14px;
    margin: 16px 0;
    box-sizing: border-box;
  }

  /* H2 de secciones más pequeño en móvil */
  .post-h2 {
    font-size: 17px;
  }

  /* TOC: ajustar para pantallas pequeñas */
  .post-toc {
    padding: 10px 14px 12px;
  }
  .post-toc a {
    font-size: 12px;
  }
  .toc-part,
  .toc-title {
    font-size: 12px;
  }

  /* Reproductor de audio en móvil */
  .audio-player {
    padding: 10px 12px;
  }
  .audio-label {
    font-size: 12px;
  }
}

/* ══════════════════════════════════════════
   TTS — RESALTADO DE LECTURA + BOCINA FLOTANTE
   ══════════════════════════════════════════ */

/* Oración que se está leyendo — marrón suave */
.tts-sentence {
  transition: background-color .25s ease, color .25s ease;
  border-radius: 3px;
}
.tts-highlight {
  background-color: rgba(150, 111, 66, 0.22); /* marrón suave */
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
body.dark-mode .tts-highlight {
  background-color: rgba(193, 154, 107, 0.28);
}

/* Bocina flotante */
.floating-speaker {
  position: fixed;
  bottom: 32px;
  left: 24px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: #e8461c;
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 10px 0 7px;
  box-shadow: 0 3px 12px rgba(232,70,28,.35);
  transition: transform .15s, background .2s;
}
.floating-speaker:hover { transform: scale(1.07); }
.floating-speaker:active { transform: scale(0.96); }
/* Pausada: más oscura */
.floating-speaker:not(.is-playing) { background: #a33010; }

.fs-icon { flex-shrink: 0; }

.fs-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  margin-left: 2px;
}
.fs-bar {
  width: 3px;
  height: 6px;
  background: rgba(255,255,255,.9);
  border-radius: 2px;
  animation: fsWave 0.9s ease-in-out infinite;
  animation-play-state: paused;
}
.floating-speaker.is-playing .fs-bar {
  animation-play-state: running;
}
.fs-bar:nth-child(1) { animation-delay: 0s; }
.fs-bar:nth-child(2) { animation-delay: 0.15s; }
.fs-bar:nth-child(3) { animation-delay: 0.3s; }

@keyframes fsWave {
  0%, 100% { height: 5px; }
  50%       { height: 18px; }
}
.floating-speaker:not(.is-playing) .fs-bar { height: 4px; }

@media (max-width: 600px) {
  .floating-speaker {
    bottom: 24px;
    left: 16px;
    width: 46px;
    height: 46px;
  }
}

/* ── Sección de comentarios ── */
.comments-section {
  max-width: 680px;
  margin: 48px auto 0;
  padding: 0 16px 48px;
}
.comments-title {
  font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--text);
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.comment-form {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 28px;
}
.cf-step { margin-bottom: 14px; }
.cf-step:last-child { margin-bottom: 0; }
.cf-question {
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 12px;
}
.cf-gender-btns {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.cf-gender-btn {
  flex: 1; min-width: 110px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .2s, background .2s;
}
.cf-gender-btn:hover { border-color: #e8461c; }
.cf-gender-btn.active { border-color: #e8461c; background: rgba(232,70,28,.07); color: #e8461c; }
.cf-gender-icon { font-size: 16px; }
.cf-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 7px;
}
.cf-wordcount { font-weight: 400; font-size: 12px; }
.cf-input, .cf-textarea {
  width: 100%; box-sizing: border-box;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px; font-family: inherit;
  color: var(--text);
  transition: border-color .2s;
}
.cf-input:focus, .cf-textarea:focus { outline: none; border-color: #e8461c; }
.cf-textarea { min-height: 100px; resize: vertical; }
.cf-actions { display: flex; gap: 10px; margin-top: 12px; }
.cf-submit {
  background: #e8461c; color: #fff;
  border: none; border-radius: 10px;
  padding: 10px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.cf-submit:hover { background: #c73a16; }
.cf-reset {
  background: transparent; color: var(--text-muted);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 16px; font-size: 14px;
  cursor: pointer; transition: border-color .2s;
}
.cf-reset:hover { border-color: #999; }

/* Lista de comentarios */
.comments-empty { font-size: 14px; color: var(--text-muted); text-align: center; padding: 20px 0; }
.comment-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--surface2);
  object-fit: cover;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px;
}
.comment-name { font-size: 14px; font-weight: 700; color: var(--text); }
.comment-date { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; line-height: 1.65; color: var(--text); margin: 0; }

/* dark mode comments */
body.dark-mode .cf-input, body.dark-mode .cf-textarea {
  background: #1e1e22; border-color: #35353d; color: #d8d8dc;
}
body.dark-mode .cf-input::placeholder, body.dark-mode .cf-textarea::placeholder { color: #55555f; }
body.dark-mode .cf-gender-btn { background: #1e1e22; }
body.dark-mode .cf-gender-btn.active { background: rgba(232,70,28,.12); }

/* ── Likes en comentarios ─────────────────────────────────── */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 20px;
  transition: background .18s, transform .12s;
  color: #bbb;
  font-size: 13px;
  line-height: 1;
}
.comment-like-btn:hover {
  background: rgba(220,50,50,.09);
  transform: scale(1.08);
}
.comment-like-btn.liked {
  color: #e8231c;
}
.comment-like-btn .like-heart {
  fill: currentColor;
  flex-shrink: 0;
  transition: transform .15s;
}
.comment-like-btn:hover .like-heart {
  transform: scale(1.2);
}
.like-count {
  font-size: 12px;
  font-weight: 600;
  min-width: 12px;
  text-align: center;
}

/* Modo oscuro */
.dark-mode .comment-like-btn {
  color: #666;
}
.dark-mode .comment-like-btn.liked {
  color: #ff5252;
}
.dark-mode .comment-like-btn:hover {
  background: rgba(255,82,82,.12);
}

/* ── Mejoras de comentarios públicos y respuestas ── */
.cf-gender-icon.male-symbol { color: #1687e8; font-size: 21px; font-weight: 800; }
.cf-gender-icon.female-symbol { color: #ef5f9b; font-size: 21px; font-weight: 800; }
.cf-gender-icon.lock-symbol { font-size: 14px; letter-spacing: -1px; }
.cf-alert {
  margin-bottom: 10px; padding: 10px 12px; border-radius: 9px;
  color: #a22518; background: rgba(232,70,28,.10); border: 1px solid rgba(232,70,28,.28);
  font-size: 13px; font-weight: 650;
}
.cf-alert.success { color: #176b39; background: rgba(35,160,90,.10); border-color: rgba(35,160,90,.28); }
.cf-replying {
  align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; padding: 9px 11px; border-radius: 9px;
  background: rgba(22,135,232,.08); border: 1px solid rgba(22,135,232,.22);
  color: #176eb6; font-size: 13px; font-weight: 650;
}
.cf-replying button { border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; line-height: 1; }
.comment-thread { border-bottom: 1px solid var(--border); }
.comment-thread:last-child { border-bottom: none; }
.comment-thread > .comment-item { border-bottom: none; }
.comment-replies { margin-left: 58px; padding-left: 14px; border-left: 2px solid var(--border); }
.comment-reply { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-reply:last-child { border-bottom: none; }
.comment-reply .comment-avatar { width: 36px; height: 36px; }
.comment-reply-btn {
  margin-top: 7px; padding: 0; border: 0; background: transparent;
  color: #1687e8; font-size: 12px; font-weight: 700; cursor: pointer;
}
.comment-reply-btn:hover { text-decoration: underline; }
.comment-like-btn { color: #e8231c; }
.comment-like-btn:not(.liked) { color: #d84b47; opacity: .72; }
.comment-like-btn .like-heart { width: 17px; height: 17px; }
@media (max-width: 560px) {
  .comment-replies { margin-left: 30px; padding-left: 10px; }
  .comment-meta { gap: 6px; }
  .comment-like-btn { margin-left: 0; }
}

/* ── Ajustes solicitados: índice, audio y comentarios ── */
.post-toc a {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 4px;
  align-items: start;
}
.toc-part, .toc-title { display: block; }
.toc-title { min-width: 0; overflow-wrap: anywhere; }

.audio-reader-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text);
}
.audio-info { width: 100%; }
.audio-progress-wrap { width: 100%; }

/* Candado propio, dibujado con CSS: sin emoji ni corchetes */
.cf-gender-icon.lock-custom {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 12px;
  margin-right: 1px;
  border: 2px solid currentColor;
  border-radius: 3px;
  color: #7d8793;
  box-sizing: border-box;
  font-size: 0;
  letter-spacing: 0;
}
.cf-gender-icon.lock-custom::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: 8px;
  height: 9px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  transform: translateX(-50%);
  box-sizing: border-box;
}
.cf-gender-icon.lock-custom::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  transform: translateX(-50%);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
}
.comment-actions .comment-reply-btn { margin-top: 0; }
.mobile-like { display: none; }
.desktop-like { display: inline-flex; margin-left: auto; }

/* Bocina flotante: play al pausar, bocina con ondas al reproducir */
.fs-speaking { display: none; align-items: center; gap: 3px; }
.floating-speaker.is-playing .fs-speaking { display: flex; }
.floating-speaker.is-playing .fs-play-icon { display: none; }
.floating-speaker:not(.is-playing) .fs-play-icon { display: block; }
.fs-bar { background: #8edcff; }
.floating-speaker:not(.is-playing) { background: #e8461c; }

@media (max-width: 560px) {
  .comment-body { position: relative; }
  .desktop-like { display: none; }
  .mobile-like { display: inline-flex; }
  .comment-actions {
    justify-content: flex-end;
    width: 100%;
    min-height: 28px;
    gap: 8px;
  }
  .comment-actions .comment-reply-btn,
  .comment-actions .comment-like-btn {
    flex: 0 0 auto;
  }
  .comment-like-btn { margin-left: 0; }
}


/* ── Ajustes finales del reproductor y formulario ── */
.audio-player {
  background: var(--surface2);
  border-color: var(--border);
}

/* Reproduciendo: azul. Pausado/detenido: azul mucho más oscuro. */
.audio-btn,
.audio-btn:not(.is-playing) {
  background: #075a9c;
  color: #fff;
  box-shadow: 0 3px 10px rgba(7, 90, 156, .22);
}
.audio-btn.is-playing {
  background: #168eea;
  color: #fff;
  box-shadow: 0 3px 10px rgba(22, 142, 234, .28);
}
.audio-btn:hover,
.audio-btn:not(.is-playing):hover {
  background: #064b83;
}
.audio-btn.is-playing:hover {
  background: #087bd1;
}
.audio-progress-fill { background: #168eea; }

.floating-speaker,
.floating-speaker:not(.is-playing) {
  background: #075a9c;
  color: #fff;
  box-shadow: 0 3px 12px rgba(7, 90, 156, .32);
}
.floating-speaker.is-playing {
  background: #168eea;
  color: #fff;
  box-shadow: 0 3px 12px rgba(22, 142, 234, .36);
}
.floating-speaker:not(.is-playing):hover { background: #064b83; }
.floating-speaker.is-playing:hover { background: #087bd1; }
.fs-bar { background: #8edcff; }

/* Alinear Cancelar y Comentar juntos al extremo derecho. */
.cf-actions {
  justify-content: flex-end;
  width: 100%;
}

body.dark-mode .audio-player {
  background: var(--surface2);
  border-color: var(--border);
}


/* ── Ajustes solicitados: audio, selector y botones ── */
.audio-player {
  background: #dedede;
  border-color: #cfcfcf;
}
body.dark-mode .audio-player {
  background: #303036;
  border-color: #44444c;
}

/* Ambos iconos usan azul; al pausar, azul más oscuro. */
.audio-btn,
.audio-btn:not(.is-playing),
.floating-speaker,
.floating-speaker:not(.is-playing) {
  background: #eeeeee;
  color: #064b83;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
}
.audio-btn.is-playing,
.floating-speaker.is-playing {
  background: #eeeeee;
  color: #168eea;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
}
.audio-btn:hover,
.audio-btn:not(.is-playing):hover,
.floating-speaker:hover,
.floating-speaker:not(.is-playing):hover {
  background: #e4e4e4;
  color: #043a66;
}
.audio-btn.is-playing:hover,
.floating-speaker.is-playing:hover {
  background: #e4e4e4;
  color: #087bd1;
}
.floating-speaker .fs-bar,
.floating-speaker.is-playing .fs-bar {
  background: currentColor;
}

/* Cancelar a la izquierda y Comentar a la derecha. */
.cf-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 24px;
}

/* Flotante alineado con el botón del footer y del mismo tamaño. */
.floating-speaker {
  bottom: 32px;
  left: 24px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
}
.floating-speaker .fs-speaking { gap: 1px; }
.floating-speaker .fs-icon,
.floating-speaker .fs-play-icon { width: 20px; height: 20px; }
.floating-speaker .fs-wave { gap: 1px; margin-left: 0; }
.floating-speaker .fs-bar { width: 2px; }

@media (max-width: 600px) {
  .floating-speaker {
    bottom: 24px;
    left: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ── Ajuste final del reproductor ── */
.audio-player,
body.dark-mode .audio-player {
  background: #d8c3a5; /* marrón claro */
  border-color: #c5ad8d;
}

/* Pausado: fondo amarillo del header y triángulo blanco. */
.audio-btn,
.audio-btn:not(.is-playing),
.floating-speaker,
.floating-speaker:not(.is-playing),
.audio-btn:hover,
.audio-btn:not(.is-playing):hover,
.floating-speaker:hover,
.floating-speaker:not(.is-playing):hover {
  background: #e8461c;
  color: #ffffff;
}

/* Reproduciendo: conserva el amarillo y muestra la bocina azul. */
.audio-btn.is-playing,
.floating-speaker.is-playing,
.audio-btn.is-playing:hover,
.floating-speaker.is-playing:hover {
  background: #e8461c;
  color: #fff;
}

/* Las ondas del flotante usan el mismo azul de la bocina. */
.floating-speaker.is-playing .fs-bar {
  background: #fff;
}

/* Color del porcentaje mostrado en el reproductor. */
.audio-time,
body.dark-mode .audio-time {
  color: #333333;
  font-weight: 600;
}

/* ── Alineación exacta de los dos botones flotantes ── */
#scroll-top,
.floating-speaker {
  bottom: 32px !important;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  margin: 0;
}

#scroll-top {
  right: 24px;
}

.floating-speaker {
  left: 24px;
}

@media (max-width: 600px) {
  #scroll-top,
  .floating-speaker {
    bottom: 24px !important;
    width: 40px;
    height: 40px;
  }

  #scroll-top {
    right: 16px;
  }

  .floating-speaker {
    left: 16px;
  }
}

/* ==========================================================
   AVISO DE COOKIES Y PRIVACIDAD
   ========================================================== */
.cookie-consent {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 1000000;
  max-width: 920px;
  margin: 0 auto;
  color: #262626;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

.cookie-consent[hidden] {
  display: none !important;
}

.cookie-consent__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
}

.cookie-consent__copy {
  flex: 1;
  min-width: 0;
}

.cookie-consent__copy h2 {
  margin: 0 0 7px;
  color: #222222;
  font-size: 20px;
  line-height: 1.2;
}

.cookie-consent__copy p {
  margin: 0;
  color: #4a4a4a;
  font-size: 14px;
  line-height: 1.55;
}

.cookie-consent__link {
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: #245fa8;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.cookie-consent__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.cookie-consent__btn {
  min-width: 130px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid #e8461c;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.cookie-consent__btn--reject {
  color: #333333;
  background: #ffffff;
}

.cookie-consent__btn--accept {
  color: #ffffff;
  background: #e8461c;
}

.cookie-consent__btn:hover {
  filter: brightness(.96);
}

.cookie-consent__btn:focus-visible,
.cookie-consent__link:focus-visible {
  outline: 3px solid rgba(36, 95, 168, .35);
  outline-offset: 3px;
}

body.dark-mode .cookie-consent {
  color: #f3f3f3;
  background: #242424;
  border-color: rgba(255, 255, 255, .18);
}

body.dark-mode .cookie-consent__copy h2 {
  color: #ffffff;
}

body.dark-mode .cookie-consent__copy p {
  color: #dddddd;
}

body.dark-mode .cookie-consent__btn--reject {
  color: #ffffff;
  background: #333333;
}

@media (max-width: 720px) {
  .cookie-consent {
    inset: auto 10px 10px;
    border-radius: 14px;
  }

  .cookie-consent__inner {
    display: block;
    padding: 16px;
  }

  .cookie-consent__copy h2 {
    font-size: 18px;
  }

  .cookie-consent__copy p {
    font-size: 13px;
  }

  .cookie-consent__actions {
    margin-top: 15px;
  }

  .cookie-consent__btn {
    flex: 1;
    min-width: 0;
  }
}


/* ==========================================================
   MODALES POR ENCIMA DEL AVISO DE COOKIES
   ========================================================== */
body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.modal-bg {
  z-index: 1100000;
}

.modal-bg.show {
  visibility: visible;
}

@media (max-width: 720px) {
  .modal-bg {
    align-items: flex-start;
    overflow-y: auto;
    padding: max(18px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  }

  .modal {
    width: 100%;
    max-height: none;
    margin: auto 0;
    padding: 22px 18px;
    border-radius: 14px;
    overflow: visible;
  }

  .modal h2 {
    font-size: 25px;
  }

  .modal-close {
    min-width: 112px;
    min-height: 44px;
  }
}

/* ============================================================
   Bloques editoriales adicionales desde etiquetas del editor
   Ejemplos: texto (PULLQUOTE), texto (IMPORTANTE), texto (ALERTA)
   ============================================================ */
.post-pullquote {
  margin: 30px 0;
  padding: 16px 0 16px 20px;
  border-left: 4px solid #c9c9c9;
  background: transparent;
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
}
.post-pullquote p {
  margin: 0;
  font-size: clamp(21px, 3.6vw, 34px);
  line-height: 1.22;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
}
.post-box {
  margin: 24px 0;
  padding: 15px 18px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.10);
  border-left-width: 4px;
  color: var(--text);
  background: var(--surface2);
}
.post-box-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.post-box p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
}
.post-box-important {
  background: rgba(255, 208, 0, .12);
  border-color: rgba(189, 141, 0, .30);
  border-left-color: #c89b00;
}
.post-box-warning {
  background: rgba(224, 28, 36, .06);
  border-color: rgba(224, 28, 36, .24);
  border-left-color: var(--red);
}
.post-box-tip {
  background: rgba(34, 197, 94, .07);
  border-color: rgba(34, 197, 94, .22);
  border-left-color: #22a455;
}
.post-box-info {
  background: rgba(59, 130, 246, .07);
  border-color: rgba(59, 130, 246, .22);
  border-left-color: #3b82f6;
}
body.dark-mode .post-pullquote {
  border-left-color: rgba(255,255,255,.26);
}
body.dark-mode .post-pullquote p {
  color: var(--text);
}
body.dark-mode .post-box {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
  color: var(--text);
}
body.dark-mode .post-box-important {
  background: rgba(255, 208, 0, .08);
  border-left-color: #ffd000;
}
body.dark-mode .post-box-warning {
  background: rgba(224, 28, 36, .08);
  border-left-color: var(--red);
}
body.dark-mode .post-box-tip {
  background: rgba(34, 197, 94, .08);
  border-left-color: #22c55e;
}
body.dark-mode .post-box-info {
  background: rgba(59, 130, 246, .08);
  border-left-color: #60a5fa;
}
@media (max-width: 600px) {
  .post-pullquote {
    margin: 22px 0;
    padding: 12px 0 12px 16px;
  }
  .post-pullquote p {
    font-size: 21px;
  }
  .post-box {
    padding: 12px 14px;
    margin: 16px 0;
  }
}


/* ── Placeholders cuando una publicación no tiene portada ── */
.slide-cover-placeholder,
.post-thumb-placeholder{
  width:100%;
  height:100%;
  min-height:inherit;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, var(--surface2), var(--surface3));
  color:var(--text-muted);
  font-size:13px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.slide-cover-placeholder span{opacity:.75;}
.post-thumb-placeholder{height:220px;}
@media (max-width: 1100px) { .post-thumb-placeholder { height:195px; } }
@media (max-width: 700px)  { .post-thumb-placeholder { height:165px; } }
@media (max-width: 460px)  { .post-thumb-placeholder { height:140px; } }

/* ============================================================
   AJUSTE FINAL PORTADAS — usuario público
   Mantiene admin sin cambios, pero restaura cómo se ven
   las imágenes en slider, home y post público.
   ============================================================ */

/* Slider: la imagen vuelve a ocupar todo el ancho/alto del contenedor */
.slide img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center 15%;
  display:block;
}

/* Home: portadas más altas SOLO en las tarjetas, no afecta el slider ni la portada del post */
.post-thumb{
  width:100%;
  height:245px;
  object-fit:cover;
  object-position:center center;
  display:block;
  background:var(--surface3);
}

.post-thumb-placeholder{
  height:245px;
}

@media (max-width:1100px){
  .post-thumb,
  .post-thumb-placeholder{ height:220px; }
}

@media (max-width:700px){
  .post-thumb,
  .post-thumb-placeholder{ height:205px; }
}

@media (max-width:460px){
  .post-thumb,
  .post-thumb-placeholder{ height:185px; }
}

/* Dentro del post: vuelve al tamaño anterior */
.post-hero{
  position:relative;
  width:100%;
  height:300px;
  overflow:hidden;
  background:var(--surface);
}

.post-hero img{
  width:100%;
  height:300px;
  object-fit:cover;
  object-position:center 20%;
  display:block;
}

.post-hero::after{
  display:block;
}

@media (max-width:600px){
  .post-hero,
  .post-hero img{
    height:220px;
  }
}



/* ============================================================
   HOME RESTAURADO — estilo anterior a las modificaciones de hoy
   Conserva el grid original responsive: 6 / 4 / 3 / 2 columnas.
   En móvil vuelve a las 2 columnas pequeñas de antes.
   ============================================================ */
.post-excerpt{
  margin:6px 0 0;
  color:var(--text-muted);
  font-size:10px;
  line-height:1.4;
  font-weight:400;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
@media (max-width:460px){
  .post-excerpt{
    font-size:9px;
    line-height:1.35;
    -webkit-line-clamp:4;
  }
}

/* ============================================================
   PAGINACIÓN — la página actual SIEMPRE queda marcada
   ============================================================ */
.pagination .page-num.active,
.pagination .page-num[aria-current="page"],
body.dark-mode .pagination .page-num.active,
body.dark-mode .pagination .page-num[aria-current="page"]{
  background:#ffd230 !important;
  border-color:#ffd230 !important;
  color:#111 !important;
  box-shadow:0 6px 16px rgba(255,210,48,.38) !important;
  font-weight:900 !important;
  cursor:default !important;
  transform:none !important;
}
.pagination .page-num.active:hover,
.pagination .page-num[aria-current="page"]:hover,
body.dark-mode .pagination .page-num.active:hover,
body.dark-mode .pagination .page-num[aria-current="page"]:hover{
  background:#ffd230 !important;
  border-color:#ffd230 !important;
  color:#111 !important;
  transform:none !important;
}
