/* ============================================================
   Base CSS — sitio público del blog (look "Breek").
   Cada tema sobreescribe las variables y detalles en su style.css.
   ============================================================ */
:root {
  --accent: #f5316c;
  --accent-2: #ff6a9a;
  --bg-1: #3f1d63;
  --bg-2: #0f7d84;
  --ink: #1f2540;
  --muted: #7b8194;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 18px 40px -22px rgba(20, 18, 60, .55);
  --maxw: 1160px;
  --nav-ink: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(150deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: rgba(255,255,255,.8); }
.empty { color: rgba(255,255,255,.85); padding: 28px 0; }

/* ---------- Header / nav ---------- */
/* Transparente arriba (se funde con el gradiente del body) y sólido al scrollear. */
.site-header { padding: 16px 0; position: sticky; top: 0; z-index: 50; background: transparent; transition: background .25s ease, box-shadow .25s ease, padding .25s ease; }
.site-header.scrolled { background: linear-gradient(90deg, var(--bg-1), var(--bg-2)); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 10px 0; }
.header-inner { display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--nav-ink); font-weight: 700; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.05rem;
}
.brand-name { font-size: 1.15rem; line-height: 1.05; }
.brand.sm .brand-logo { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav-link { color: var(--nav-ink); font-size: .92rem; font-weight: 500; opacity: .9; cursor: pointer; background: none; border: 0; font-family: inherit; padding: 4px 0; white-space: nowrap; }
.nav-link:hover { opacity: 1; }

.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-drop-btn::after { content: " ▾"; font-size: .7em; }
.nav-drop-menu {
  position: absolute; top: 150%; left: 50%; transform: translateX(-50%); min-width: 210px; background: #fff; border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; display: none; z-index: 60;
}
.nav-dropdown:hover .nav-drop-menu, .nav-dropdown.open .nav-drop-menu { display: block; }
.nav-drop-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: .9rem; }
.nav-drop-menu a:hover { background: #f4f5fa; }
.nav-drop-menu small { color: var(--muted); }
.nav-drop-menu a.nav-drop-all { margin-top: 6px; padding-top: 12px; border-top: 1px solid #eceef5; font-weight: 600; color: var(--accent); }

/* Acciones (buscar + suscribirse), separadas del menú por una línea sutil. */
.nav-actions { display: flex; align-items: center; gap: 14px; padding-left: 20px; margin-left: 6px; border-left: 1px solid rgba(255,255,255,.18); }
.nav-icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); color: #fff; border: 0; cursor: pointer; transition: background .15s; }
.nav-icon-btn:hover { background: var(--accent); }

.nav-search-wrap { position: relative; }
.nav-search {
  position: absolute; right: 0; top: 150%; display: none; align-items: center; gap: 6px;
  background: #fff; border-radius: 999px; padding: 5px 5px 5px 16px; box-shadow: var(--shadow); z-index: 60;
}
.nav-search-wrap.open .nav-search { display: flex; }
.nav-search input { background: none; border: 0; outline: none; color: var(--ink); width: 200px; font-family: inherit; font-size: .9rem; }
.nav-search input::placeholder { color: var(--muted); }
.nav-search button { background: var(--accent); color: #fff; border: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.nav-search button:hover { background: var(--accent-2); }

.nav-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.nav-cta:hover { background: var(--accent-2); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; margin-left: auto; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; border-radius: 2px; }

/* ---------- Slider de destacados ---------- */
.hero-slider { margin: 8px auto 24px; }
.slider-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.slider-track::-webkit-scrollbar { height: 6px; }
.slider-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,.4); border-radius: 6px; }
.slide {
  position: relative; flex: 0 0 clamp(220px, 24%, 280px); height: 150px; border-radius: 14px;
  background-size: cover; background-position: center; scroll-snap-align: start; overflow: hidden;
  display: flex; align-items: flex-end; background-color: #3a2f63;
}
.slide-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.6)); }
.slide-body { position: relative; padding: 14px; color: #fff; }
.slide-date { font-size: .72rem; opacity: .85; display: block; }
.slide-title { font-size: .95rem; line-height: 1.25; }

/* ---------- Main ---------- */
.site-main { padding: 14px 0 50px; }
.archive-head { color: #fff; margin: 4px 0 22px; }
.archive-title { margin: 0; font-size: 1.8rem; }
.archive-desc { opacity: .85; margin: 6px 0 0; }

/* ---------- Grid de tarjetas ---------- */
.grid { display: grid; gap: 22px; align-items: start; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* Masonry real con columnas CSS (alturas variables, estilo Breek). */
.masonry { column-gap: 22px; }
.masonry.cols-4 { column-count: 4; }
.masonry.cols-3 { column-count: 3; }
.masonry.cols-2 { column-count: 2; }
.masonry > .card { width: 100%; margin: 0 0 22px; break-inside: avoid; -webkit-column-break-inside: avoid; }

.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-media {
  position: relative; aspect-ratio: 16/10; background-size: cover; background-position: center;
  background-color: #e9ecf5; display: grid; place-items: center;
}
.card-noimg { font-size: 2.4rem; font-weight: 700; color: #c2c8db; }
/* Portada como <img> (SEO: alt + indexable en Google Imágenes). Llena el contenedor
   con aspect-ratio fijo, igual que hacía el background-image que reemplaza. */
.media-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-overlay > .media-img { z-index: 0; }
.card-cat {
  position: absolute; top: 12px; left: 12px; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  text-transform: lowercase;
}
.card-body { padding: 16px 18px 4px; }
.card-date { color: var(--accent); font-size: .76rem; font-weight: 600; }
.card-title { margin: 8px 0 8px; font-size: 1.08rem; line-height: 1.35; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.card-foot { padding: 0 18px 16px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; }

.author { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.author-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 600; flex-shrink: 0; }
.author-avatar.sm { width: 24px; height: 24px; font-size: .72rem; }
img.author-avatar { object-fit: cover; }
.card-stats { display: flex; gap: 12px; }
.stat { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* Tarjeta destacada con texto sobre la imagen (primera del masonry). */
.card-overlay { position: relative; min-height: 360px; background-size: cover; background-position: center; background-color: #3a2f63; display: flex; align-items: flex-end; color: #fff; overflow: hidden; }
.card-overlay-link { position: absolute; inset: 0; z-index: 1; }
.card-overlay-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,.9) 100%); }
.card-overlay .card-cat { z-index: 3; }
.card-overlay-body { position: relative; z-index: 2; padding: 22px; width: 100%; text-shadow: 0 1px 6px rgba(0,0,0,.55); }
.card-overlay .card-title { font-size: 1.35rem; margin: 6px 0 8px; }
.card-overlay .card-title a { color: #fff; }
.card-overlay .card-excerpt { color: rgba(255,255,255,.85); }
.card-overlay .card-foot { padding: 0; margin-top: 14px; }
.card-overlay .author, .card-overlay .stat { color: rgba(255,255,255,.92); }
.card-date.light { color: #fff; opacity: .9; }

/* ---------- Página "Todas las categorías" ---------- */
.cat-card {
  position: relative; min-height: 190px; border-radius: 14px; overflow: hidden;
  background-size: cover; background-position: center; display: flex; align-items: flex-end;
  color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.12); transition: transform .18s ease, box-shadow .18s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.2); }
.cat-card-link { position: absolute; inset: 0; z-index: 3; }
.cat-card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.cat-card-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.82) 100%); }
.cat-card-shade.soft { background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45) 100%); }
.cat-card-icon { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.55); }
.cat-card-icon svg { width: 60px; height: 60px; }
.cat-card-meta { position: relative; z-index: 2; padding: 16px 18px; width: 100%; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.cat-card-name { display: block; font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.cat-card-count { display: block; font-size: .82rem; opacity: .92; margin-top: 3px; }

.card-ad { align-items: stretch; justify-content: center; }
.card-ad .ad-box { display: grid; place-items: center; min-height: 220px; padding: 16px; text-align: center; }
.masonry > .card-ad { width: 100%; margin: 0 0 22px; break-inside: avoid; }

/* ---------- Layout columna + sidebar ---------- */
.with-sidebar { display: grid; grid-template-columns: 1fr 330px; gap: 28px; align-items: start; }
.content-col { min-width: 0; display: flex; flex-direction: column; gap: 26px; }

.feature { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.feature-media { position: relative; aspect-ratio: 16/8; background-size: cover; background-position: center; background-color: #e9ecf5; display: grid; place-items: center; }
.feature-body { padding: 22px 26px 26px; }
.feature-title { margin: 0 0 10px; font-size: 1.5rem; line-height: 1.25; }
.feature-title a:hover { color: var(--accent); }
.feature-meta { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: .82rem; margin-bottom: 12px; }
.feature-excerpt { color: var(--muted); margin: 0 0 18px; }
.btn-read { display: inline-block; background: var(--accent); color: #fff; padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: .88rem; }
.btn-read:hover { background: var(--accent-2); }

/* ---------- Sidebar widgets ---------- */
.sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 90px; }
.widget { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.widget-title { margin: 0 0 16px; font-size: 1.05rem; position: relative; padding-bottom: 10px; }
.widget-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; background: var(--accent); border-radius: 3px; }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mini-list li { display: flex; gap: 12px; align-items: center; }
.mini-thumb { flex: 0 0 56px; height: 56px; border-radius: 10px; background-size: cover; background-position: center; background-color: #e9ecf5; }
.mini-date { color: var(--muted); font-size: .72rem; display: block; }
.mini-title { font-size: .88rem; font-weight: 500; line-height: 1.3; }
.mini-title:hover { color: var(--accent); }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { border-top: 1px solid #eef0f6; }
.cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; font-size: .92rem; text-transform: lowercase; }
.nav-drop-menu a { text-transform: lowercase; }
.archive-title.lower { text-transform: lowercase; }
.cat-list a:hover { color: var(--accent); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; padding: 2px 10px; }

.ad-box { background: #eef6f6; border-radius: 12px; color: var(--muted); }
.widget-ad .ad-box { min-height: 240px; display: grid; place-items: center; padding: 14px; text-align: center; }
.ad-banner { background: rgba(255,255,255,.14); border: 1px dashed rgba(255,255,255,.4); border-radius: 14px; min-height: 90px; display: grid; place-items: center; color: #fff; margin-bottom: 22px; padding: 12px; text-align: center; }
.ad-footer { margin: 10px 0 0; }

/* ---------- Single (post / página) ---------- */
.single { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.single-cover { position: relative; aspect-ratio: 16/7; background-size: cover; background-position: center; background-color: #e9ecf5; }
.single-cover .card-cat { top: 16px; left: 16px; }
.single-head { padding: 26px 32px 0; }
.single-title { margin: 0 0 12px; font-size: 2rem; line-height: 1.2; }
.single-meta { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: .85rem; }
/* Post infográfico: la infografía (vertical) se muestra completa, centrada. */
.single-infographic { margin: 22px 32px 6px; text-align: center; }
.single-infographic .infographic-img { max-width: min(640px, 100%); width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow); }
/* Infografía AntV incrustada inline: SVG con foreignObject (el navegador sí lo dibuja). */
.single-infographic .infographic-svg { max-width: min(760px, 100%); margin: 0 auto; border-radius: 16px; box-shadow: var(--shadow); background: #fff; padding: 12px; overflow: hidden; }
.single-infographic .infographic-svg svg { display: block; width: 100%; height: auto; }
.single-infographic .infographic-download { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 9px 18px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 600; }
.single-infographic .infographic-download:hover { background: var(--accent-2); }
/* En un post infográfico, el cuerpo (los pasos en texto) es la transcripción accesible. */
.single-infografia .single-body { color: #4a4f66; }
/* Badge "Infografía" en las tarjetas del listado (la imagen vertical se recorta). */
.card-badge-info { position: absolute; top: 12px; right: 12px; background: rgba(20,17,31,.82); color: #fff; font-size: .68rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.single-audio { margin: 20px 32px 0; padding: 14px 16px; border: 1px solid rgba(120,120,150,.16); border-left: 3px solid var(--accent); border-radius: 12px; background: rgba(245,49,108,.04); }
.single-audio-label { display: block; font-weight: 600; font-size: .88rem; color: var(--accent); margin-bottom: 8px; }
.single-audio audio { width: 100%; height: 40px; }
.single-body { padding: 18px 32px 30px; color: #353b52; }
.single-body p { margin: 0 0 16px; }
.single-body h1, .single-body h2, .single-body h3 { line-height: 1.3; margin: 26px 0 12px; }
.single-body img { border-radius: 12px; margin: 14px 0; }
.single-body pre { background: #1f2540; color: #eaecf5; padding: 16px; border-radius: 12px; overflow: auto; }
.single-body code { background: #f0f1f7; padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.single-body pre code { background: none; padding: 0; }
.single-body blockquote { border-left: 4px solid var(--accent); margin: 16px 0; padding: 6px 18px; color: var(--muted); background: #faf7f9; border-radius: 0 10px 10px 0; }
.single-tags { padding: 0 32px 28px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Compartir artículo (share) ---------- */
.single-share { padding: 22px 32px 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; border-top: 1px solid var(--border, #eceef5); }
.share-label { font-weight: 700; color: #2a2f45; }
.share-btns { display: flex; gap: 10px; }
.share-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .15s ease, opacity .15s ease; }
.share-btn:hover { transform: translateY(-2px); opacity: .92; }
.share-btn svg { width: 18px; height: 18px; }
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.mail { background: #e9508a; }
.share-btn.wa { background: #25d366; }
.share-copy { display: flex; align-items: center; gap: 6px; background: #eef0f6; border-radius: 999px; padding: 4px 6px 4px 16px; flex: 1; min-width: 220px; max-width: 420px; }
.share-copy input { flex: 1; border: 0; background: transparent; color: var(--muted); font-size: .9rem; outline: none; text-overflow: ellipsis; }
.share-copy-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); cursor: pointer; display: grid; place-items: center; flex: none; }
.share-copy-btn svg { width: 18px; height: 18px; }
.share-copy-btn:hover { background: rgba(0,0,0,.05); }
.share-copy-btn.copied { color: #16b98a; }

/* Barra flotante de compartir (fija al costado izquierdo) */
.share-float { position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 10px; padding: 12px 8px; background: var(--card, #fff); border-radius: 999px; box-shadow: var(--shadow, 0 8px 30px rgba(20,23,45,.12)); }
.share-fbtn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .15s ease, opacity .15s ease; }
.share-fbtn:hover { transform: scale(1.12); }
.share-fbtn svg { width: 15px; height: 15px; }
.share-fbtn.fb { background: #1877f2; }
.share-fbtn.tw { background: #1da1f2; }
.share-fbtn.mail { background: #e9508a; }
.share-fbtn.wa { background: #25d366; }
/* Se oculta cuando no hay espacio lateral (tablet/móvil); ahí queda la sección inline. */
@media (max-width: 1100px) { .share-float { display: none; } }

/* Contenido que cuelga directo del .single necesita el mismo padding lateral. */
.single > .alert { margin: 0 32px 16px; }
.contact-form { padding: 4px 32px 30px; }
.sitemap-grid { padding: 8px 32px 4px; }
.sitemap-page > .muted { padding: 16px 32px 30px; margin: 0; }

.tag { background: #eef0f6; color: #5a6075; padding: 6px 14px; border-radius: 999px; font-size: .8rem; }
.tag:hover { background: var(--accent); color: #fff; }

/* ---------- Nube de etiquetas (tag cloud) ---------- */
.tagcloud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; line-height: 1.35; }
.tagcloud .tag { line-height: 1.15; transition: background .15s, color .15s; }
.tagcloud .tc-s1 { font-size: .72rem; opacity: .8; }
.tagcloud .tc-s2 { font-size: .82rem; opacity: .9; }
.tagcloud .tc-s3 { font-size: .95rem; }
.tagcloud .tc-s4 { font-size: 1.12rem; font-weight: 600; }
.tagcloud .tc-s5 { font-size: 1.32rem; font-weight: 700; }
.tagcloud .tc-n { opacity: .55; font-size: .72em; font-weight: 400; }
.single-tagcloud { padding: 4px 32px 30px; }
.single-tagcloud .block-title { margin: 0 0 14px; }

/* ---------- Posts relacionados (serie del cronograma) ---------- */
.related-posts { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 32px; margin-bottom: 28px; }
.related-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.related-head .block-title { margin: 0; }
.related-seeall-link { color: var(--accent); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.related-seeall-link:hover { text-decoration: underline; }
.related-carousel-wrap { position: relative; }
.related-carousel {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 10px; scroll-behavior: smooth;
  /* Ocultamos la barra de scroll (se navega con las flechas / swipe). */
  scrollbar-width: none; -ms-overflow-style: none;
  /* Degradado en los bordes para insinuar que hay más contenido al costado. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.related-carousel::-webkit-scrollbar { width: 0; height: 0; display: none; }
.related-item { flex: 0 0 auto; width: 300px; max-width: 78vw; scroll-snap-align: start; }
.related-item .card { width: 100%; height: 100%; margin: 0; transition: transform .25s ease, box-shadow .25s ease; }
.related-item:hover .card { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0, 0, 0, .12); }
/* Cuando todo entra sin scroll, no aplicamos el degradado (no hay nada que cortar). */
.related-posts.sin-scroll .related-carousel { -webkit-mask-image: none; mask-image: none; }
.related-arrow {
  position: absolute; top: 42%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow); color: var(--text, #333);
  font-size: 1.7rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.related-arrow:hover { color: var(--accent); }
.related-arrow.prev { left: -14px; }
.related-arrow.next { right: -14px; }
.related-posts.sin-scroll .related-arrow { display: none; }
/* Tarjeta final "ver todos" */
.related-seeall {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 20px; border: 2px dashed var(--border, #dfe3ee);
  border-radius: var(--radius); color: var(--accent); text-decoration: none;
}
.related-seeall:hover { background: rgba(127, 127, 127, .06); }
.related-seeall-plus { font-size: 2rem; font-weight: 700; line-height: 1; }
.related-seeall-txt { font-weight: 700; }
.related-seeall-count { font-size: .8rem; color: var(--muted, #7a7f95); }
@media (max-width: 700px) {
  .related-arrow { display: none; }
  .related-carousel { scroll-snap-type: x proximity; }
}

/* ---------- Comentarios ---------- */
.comments { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 32px; }
.block-title { margin: 0 0 18px; font-size: 1.2rem; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.comment { display: flex; gap: 12px; }
.comment p { margin: 4px 0 0; color: #3a4059; }
.comment time { margin-left: 8px; }

/* ---------- Formularios ---------- */
.comment-form, .contact-form, .subscribe-form { margin-top: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, textarea, .single input, .single textarea {
  width: 100%; font-family: inherit; font-size: .92rem; padding: 12px 14px; border: 1px solid #e2e5ef;
  border-radius: 10px; outline: none; margin-bottom: 12px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { border-color: var(--accent); }
.comment-form button, .contact-form button {
  background: var(--accent); color: #fff; border: 0; padding: 12px 26px; border-radius: 999px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.comment-form button:hover, .contact-form button:hover { background: var(--accent-2); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }
.alert.ok { background: #e7f8ef; color: #1d7a4d; }
.alert.error { background: #fdECEC; color: #b3261e; }

/* ---------- Paginación ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 30px 0 0; }
.page-info { color: #fff; font-size: .85rem; }
.page-btn { background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: .85rem; }
.page-btn:hover { background: var(--accent-2); }

/* ---------- Suscripción ---------- */
.subscribe { padding: 36px 0; }
.subscribe-inner { background: rgba(255,255,255,.12); border-radius: 20px; padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: #fff; }
.subscribe-text h3 { margin: 0 0 4px; font-size: 1.4rem; }
.subscribe-text p { margin: 0; opacity: .85; }
.subscribe-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.subscribe-row { display: flex; gap: 10px; align-items: center; }
.subscribe-form input { margin: 0; width: 260px; max-width: 60vw; }
.subscribe-form button { background: var(--accent); color: #fff; border: 0; padding: 12px 24px; border-radius: 10px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
.subscribe-form button:hover { background: var(--accent-2); }

/* ---------- Footer ---------- */
.site-footer { color: #fff; }
.footer-cols { display: grid; grid-template-columns: 1.2fr 1fr 1.3fr; gap: 36px; padding: 30px 0; }
.footer-title { font-size: 1.1rem; margin: 0 0 18px; position: relative; padding-bottom: 10px; }
.footer-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; background: var(--accent); border-radius: 3px; }
.footer-col .mini-title { color: #fff; }
.footer-col .mini-date { color: rgba(255,255,255,.7); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .tag { background: rgba(255,255,255,.16); color: #fff; }
.tag-cloud .tag:hover { background: var(--accent); }
.about { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.about-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.about-avatar.txt { background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.about-name { display: block; }
.about-role { font-size: .82rem; opacity: .8; }
.about-text { font-size: .88rem; opacity: .9; margin-bottom: 14px; }
.about-text p { margin: 0 0 8px; }
.social { display: flex; gap: 10px; }
.social-link { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; font-weight: 600; }
.social-link:hover { background: var(--accent); }
.footer-bar { background: rgba(0,0,0,.18); padding: 18px 0; }
.footer-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-bar p { margin: 0; opacity: .8; font-size: .85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; }
.footer-links a { opacity: .8; }
.footer-links a:hover { opacity: 1; color: var(--accent); }

/* ---------- Sitemap / 404 ---------- */
.sitemap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.link-list { list-style: none; margin: 0 0 16px; padding: 0; }
.link-list li { padding: 6px 0; border-bottom: 1px solid #eef0f6; }
.link-list a:hover { color: var(--accent); }
.notfound { display: flex; justify-content: center; padding: 50px 0 70px; }
.notfound-card {
  width: 100%; max-width: 620px; text-align: center; color: #fff;
  background: linear-gradient(150deg, var(--bg-1), var(--bg-2));
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 54px 32px 48px;
}
.notfound-icon {
  width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14); color: #fff;
}
.notfound-card h1 { font-size: 5rem; line-height: 1; margin: 0; font-weight: 700; }
.notfound-lead { font-size: 1.7rem; font-weight: 600; margin: 6px 0 22px; }
.notfound-sub { font-size: 1.5rem; font-weight: 600; margin: 0 0 8px; }
.notfound-text { color: rgba(255, 255, 255, .82); margin: 0 auto 26px; max-width: 420px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .masonry.cols-4 { column-count: 3; }
}
@media (max-width: 980px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .masonry.cols-3, .masonry.cols-4 { column-count: 2; }
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: column; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .sitemap-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; inset: 0 0 0 auto; width: min(82vw, 320px); background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
    flex-direction: column; align-items: stretch; gap: 14px; padding: 80px 24px 24px; transform: translateX(100%); transition: transform .25s ease; z-index: 70;
  }
  body.nav-open .site-nav { transform: translateX(0); }
  /* En el drawer móvil: acciones en columna, buscador siempre visible e inline. */
  .nav-actions { flex-direction: column; align-items: stretch; gap: 12px; padding-left: 0; margin-left: 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.18); padding-top: 14px; margin-top: 6px; }
  .nav-search-toggle { display: none; }
  .nav-search { position: static; display: flex; width: 100%; }
  .nav-search input { width: 100%; }
  .nav-cta { justify-content: center; }
  .grid.cols-3, .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .masonry.cols-2, .masonry.cols-3, .masonry.cols-4 { column-count: 1; }
  .footer-cols, .sitemap-grid { grid-template-columns: 1fr; }
  .single-title { font-size: 1.5rem; }
  .single-head, .single-body, .single-tags, .single-tagcloud, .single-share, .comments, .contact-form, .sitemap-grid { padding-left: 20px; padding-right: 20px; }
  .single > .alert, .sitemap-page > .muted { margin-left: 20px; margin-right: 20px; padding-left: 0; padding-right: 0; }
  .row2 { grid-template-columns: 1fr; }
  .subscribe-inner { flex-direction: column; align-items: stretch; }
  .subscribe-row { flex-direction: column; }
  .subscribe-form input { width: 100%; max-width: none; }
}

/* Botón volver arriba */
.to-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; border: 0; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 80; font-size: 1.1rem; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Frase del día (widget, se rellena por fetch) ---------- */
/* La imagen va de fondo (con opacidad vía overlay) y el texto encima. La
   POSICIÓN depende del tema: 'card' (primera celda de la grilla/masonry) o
   'sidebar' (primer widget de la barra lateral). */
.frase-dia-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--card); background-size: cover; background-position: center;
}
/* Overlay que "opaca" la imagen para que el texto oscuro se lea. */
.frase-dia-card.has-img::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.78) 55%, rgba(255,255,255,.62) 100%);
}
.frase-dia-body { position: relative; z-index: 1; padding: 24px 26px; }
.frase-dia-kicker { color: var(--accent); font-weight: 700; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.frase-dia blockquote { margin: 10px 0 14px; font-size: 1.2rem; line-height: 1.4; font-weight: 600; color: var(--ink); }
.frase-dia blockquote::before { content: "\201C"; color: var(--accent); margin-right: 2px; }
.frase-dia blockquote::after { content: "\201D"; color: var(--accent); margin-left: 2px; }
.frase-dia-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.frase-dia-cat { background: var(--accent); color: #fff; border-radius: 999px; padding: 4px 12px; font-size: .74rem; font-weight: 600; text-transform: capitalize; }
.frase-dia-tono { color: var(--muted); font-size: .8rem; text-transform: capitalize; }
.frase-dia-tono::before { content: "· "; }

/* Variante TARJETA (grilla/masonry): primera celda antes de los posts. */
.masonry > .frase-dia--card { width: 100%; margin: 0 0 22px; break-inside: avoid; -webkit-column-break-inside: avoid; }
.frase-dia--card .frase-dia-card { height: 100%; }
.frase-dia--card .frase-dia-body { min-height: 200px; display: flex; flex-direction: column; justify-content: center; }

/* Variante SIDEBAR: primer widget de la barra lateral (columna angosta). */
.frase-dia--sidebar { margin-bottom: 22px; }
.frase-dia--sidebar .frase-dia-body { padding: 20px; }
.frase-dia--sidebar blockquote { font-size: 1.05rem; }

@media (max-width: 760px) {
  .frase-dia blockquote { font-size: 1.08rem; }
  .frase-dia-card.has-img::before { background: rgba(255,255,255,.85); }
}

/* ---- Playground de código ejecutable ---- */
/* Antes de hidratar, .playground contiene el <pre><code> estático (fallback). */
.playground { margin: 22px 0; }
.playground.pg-ready {
  background: #0f1226; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.pg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.pg-lang { color: #c7c9e0; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.pg-run {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 6px 14px; font-weight: 600; font-size: .82rem; cursor: pointer;
}
.pg-run:hover { background: var(--accent-2); }
.pg-run:disabled { opacity: .6; cursor: default; }
.pg-code {
  width: 100%; box-sizing: border-box; border: 0; resize: vertical; display: block;
  background: transparent; color: #e7e9f5; padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .88rem; line-height: 1.55; outline: none; tab-size: 2;
}
.pg-output {
  margin: 0; padding: 12px 14px; background: #0a0c1c; color: #b7f5c8;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .84rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
}
.pg-output.err { color: #ff9aa8; }
