/* ==========================================================================
   ABI VISUALIZATION BLOG — styles specific to /blog/ and /en/blog/.
   Loaded AFTER /assets/css/style.css and /assets/css/responsive.css on
   every blog page — this file defines NO color/font tokens of its own on
   purpose. Every var(--...) below resolves against style.css's :root, so
   there is nothing here to fall out of sync with the site's palette or
   typography (see blog-src/build.js header comment for the full context).
   Header/footer/nav/mobile-menu styling and behavior also come from
   style.css + responsive.css + main.js — this file only adds the classes
   that are unique to blog pages.
   ========================================================================== */

/* ---------- Blog hero (index only) ----------
   Los estilos viven ahora en .hero-dark, en /assets/css/style.css, que
   esta pagina tambien carga. El indice del blog y el hub de
   /herramientas/ comparten hero, asi que comparten definicion: una sola.
   El marcado lleva las dos clases (blog-hero hero-dark); .blog-hero se
   conserva como gancho por si el blog necesita algo propio algun dia. */

/* ---------- Category pills (only rendered when there's more than 1 tag) ---------- */
.blog-categories { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 32px; }
.blog-category-pill {
  font-family: var(--font-cta);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--abi-cyan);
  border: 1px solid var(--abi-cyan);
  border-radius: 999px;
  padding: 6px 16px;
}

/* ---------- Article grid (index) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; } }

.post-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 24px;
  font-size: 1.0625rem;
}

.post-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 38, 44, 0.05), 0 8px 24px rgba(15, 38, 44, 0.07);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(15, 38, 44, 0.08), 0 16px 32px rgba(15, 38, 44, 0.1); }
.post-card__img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-card__body { padding: 24px; }
.post-card__body .tag {
  display: inline-block;
  font-family: var(--font-cta);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--abi-cyan);
  margin-bottom: 10px;
}
.post-card__body h2 { font-size: 1.125rem; margin-bottom: 0.5em; }
.post-card__excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__meta { color: var(--text-secondary); font-size: 0.8125rem; }

/* ---------- Article page ---------- */
.article-header { max-width: 780px; margin: 0 auto 32px; text-align: center; }
.article-header .tag {
  display: inline-block;
  font-family: var(--font-cta);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--abi-cyan);
  margin-bottom: 0.75em;
}
.article-header h1 { font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem); }
.title-rule { width: 56px; height: 3px; background: var(--abi-cyan); border-radius: 2px; margin: 20px auto; }
.meta { display: flex; justify-content: center; gap: 8px; color: var(--text-secondary); font-size: 0.9375rem; margin: 0; }

/* ---------- Article hero band (dark, same brand color as the homepage hero) ---------- */
.article-hero { background: var(--abi-dark); }
.article-hero h1 { color: #fff; }
.article-hero .meta { color: rgba(255, 255, 255, 0.78); }
.article-content { padding-top: 0; }

.article-hero-img {
  max-width: 960px;
  margin: 0 auto 40px;
}
.article-hero-img img { width: 100%; height: auto; border-radius: var(--radius-md); }

.article-body {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
}
.article-body h2 { font-size: 1.5rem; margin: 1.6em 0 0.6em; }
.article-body h3 { font-size: 1.1875rem; margin: 1.4em 0 0.5em; }
.article-body p { margin: 0 0 1.2em; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.4em; display: flex; flex-direction: column; gap: 0.5em; }
.article-body a { color: var(--abi-cyan); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.article-body strong { color: var(--text); }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1.5em 0; }

/* ---------- Checklists ("- [ ] ..." en el markdown fuente) ----------
   marked emite <li><input type="checkbox" disabled> texto</li> sin
   clase propia — se apunta por :has() en vez de agregar una clase en
   el panel/build.js. Checkbox nativo oculto, marcador de lista propio. */
.article-body li:has(> input[type="checkbox"]) { list-style: "\2713\2002\2002"; }
.article-body li:has(> input[type="checkbox"])::marker { color: #7DC242; font-weight: 700; }
.article-body li:has(> input[type="checkbox"]) input[type="checkbox"] { display: none; }

/* ---------- Tablas (Markdown tables) ---------- */
.article-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9375rem;
}
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.article-body thead th { background: var(--abi-tint); font-weight: 700; color: var(--text); }

/* ---------- Imágenes insertadas en el cuerpo (vía el panel) ---------- */
.article-img { margin: 1.75em 0; }
.article-img img { display: block; width: 100%; margin: 0; }
.article-img figcaption { font-size: 0.875rem; color: var(--text-secondary); text-align: center; margin-top: 10px; }

/* ---------- Video embebido (YouTube, vía el panel) ---------- */
.video-embed { position: relative; aspect-ratio: 16 / 9; margin: 1.75em 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--abi-dark); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.article-cta { max-width: 780px; margin: 56px auto 0; }
.article-cta__box {
  background: var(--abi-tint);
  border-left: 4px solid var(--abi-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 32px;
  text-align: center;
}
.article-cta__box h2 { font-size: 1.375rem; margin-bottom: 0.5em; }
.article-cta__box p { color: var(--text-secondary); margin-bottom: 24px; }
.article-cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

.related { padding-top: 0; }
.related__inner { max-width: 780px; margin: 0 auto; border-top: 1px solid var(--border); padding-top: 32px; }
.related__inner h2 { font-size: 1.125rem; margin-bottom: 1em; }
.related__inner ul { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 640px) {
  .article-body { font-size: 1rem; }
}
