/* ════════════════════════════════════════════════════════════════════
   GH · Blog (módulo ghblog) · portada, categorías y artículo.
   Prefijo .ghblog-*; tokens del tema (--gh-*). Sin media queries de
   anchura (lienzo fijo, CONVENTIONS.md §4).
   ════════════════════════════════════════════════════════════════════ */

.ghblog {
  max-width: var(--gh-container);
  margin: 0 auto;
  padding: var(--gh-space-6) 0 var(--gh-space-20);
  font-family: var(--gh-font-body);
  color: var(--gh-grey-800);
}

/* ─── Cabecera de la portada / categoría ─── */
.ghblog-hero {
  max-width: 880px;
  margin: 0 0 var(--gh-space-8);
}
.ghblog-hero__eyebrow {
  margin: 0 0 var(--gh-space-2);
  font-size: var(--gh-text-sm);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gh-green-700);
}
.ghblog-hero__eyebrow a { color: inherit; text-decoration: none; }
.ghblog-hero__eyebrow a:hover { text-decoration: underline; }
.ghblog-hero__title {
  margin: 0 0 var(--gh-space-4);
  font-family: var(--gh-font-display);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--gh-grey-950);
}
.ghblog-hero__intro {
  font-size: 18px;
  line-height: 1.6;
  color: var(--gh-grey-600);
}
.ghblog-hero__intro p { margin: 0 0 var(--gh-space-3); }

/* ─── Chips de categorías ─── */
.ghblog-chips { margin: 0 0 var(--gh-space-10); }
.ghblog-chips__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gh-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ghblog-chips__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--gh-space-2);
  padding: 8px 16px;
  border: 1px solid var(--gh-grey-200);
  border-radius: var(--gh-radius-full);
  background: var(--gh-white);
  font-size: var(--gh-text-sm);
  font-weight: 600;
  color: var(--gh-grey-700);
  text-decoration: none;
  transition: border-color var(--gh-duration-fast) var(--gh-ease-out), color var(--gh-duration-fast) var(--gh-ease-out);
}
.ghblog-chips__chip:hover { border-color: var(--gh-green-500); color: var(--gh-green-700); }
.ghblog-chips__chip.is-current {
  border-color: var(--gh-green-700);
  background: var(--gh-green-700);
  color: var(--gh-white);
}
.ghblog-chips__count {
  font-size: var(--gh-text-xs);
  font-weight: 500;
  opacity: .7;
}

/* ─── Rejilla de tarjetas ─── */
.ghblog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gh-space-8) var(--gh-space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ghblog-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ghblog-card { display: flex; }
.ghblog-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--gh-grey-200);
  border-radius: var(--gh-radius-xl);
  overflow: hidden;
  background: var(--gh-white);
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--gh-duration-base) var(--gh-ease-out), transform var(--gh-duration-base) var(--gh-ease-out);
}
.ghblog-card__link:hover { box-shadow: var(--gh-shadow-lg); transform: translateY(-2px); }
.ghblog-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--gh-green-50);
}
.ghblog-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Sin portada (artículos que nunca la tuvieron): fondo de marca con la categoría. */
.ghblog-card__placeholder {
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding: var(--gh-space-5);
  background: var(--gh-green-grad);
}
.ghblog-card__placeholder-label {
  font-family: var(--gh-font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--gh-white);
}
.ghblog-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--gh-space-2);
  padding: var(--gh-space-5) var(--gh-space-5) var(--gh-space-6);
}
.ghblog-card__date {
  font-size: var(--gh-text-xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gh-grey-500);
}
.ghblog-card__title {
  font-family: var(--gh-font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gh-grey-950);
}
.ghblog-card__excerpt {
  font-size: var(--gh-text-sm);
  line-height: 1.6;
  color: var(--gh-grey-600);
}
.ghblog-card__more {
  margin-top: auto;
  padding-top: var(--gh-space-2);
  font-size: var(--gh-text-sm);
  font-weight: 700;
  color: var(--gh-green-700);
}

.ghblog-empty { font-size: 17px; color: var(--gh-grey-600); }

/* ─── Paginación ─── */
.ghblog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gh-space-4);
  margin: var(--gh-space-16) 0 0;
}
.ghblog-pagination__list {
  display: flex;
  gap: var(--gh-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ghblog-pagination__page,
.ghblog-pagination__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--gh-grey-200);
  border-radius: var(--gh-radius-full);
  font-weight: 600;
  color: var(--gh-grey-700);
  text-decoration: none;
}
.ghblog-pagination__page:hover,
.ghblog-pagination__step:hover { border-color: var(--gh-green-500); color: var(--gh-green-700); }
.ghblog-pagination__page.is-current { border-color: var(--gh-green-700); background: var(--gh-green-700); color: var(--gh-white); }
.ghblog-pagination__gap { align-self: center; color: var(--gh-grey-400); }

/* ─── Artículo ─── */
.ghblog-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--gh-space-16);
  align-items: start;
}
.ghblog-article { max-width: 860px; }
.ghblog-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gh-space-2);
  margin: 0 0 var(--gh-space-4);
  padding: 0;
  list-style: none;
}
.ghblog-article__tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--gh-radius-full);
  background: var(--gh-green-100);
  font-size: var(--gh-text-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gh-green-800);
  text-decoration: none;
}
.ghblog-article__tag:hover { background: var(--gh-green-200); }
.ghblog-article__title {
  margin: 0 0 var(--gh-space-3);
  font-family: var(--gh-font-display);
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--gh-grey-950);
}
.ghblog-article__date {
  display: block;
  margin: 0 0 var(--gh-space-8);
  font-size: var(--gh-text-sm);
  color: var(--gh-grey-500);
}
.ghblog-article__cover {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 var(--gh-space-10);
  border-radius: var(--gh-radius-2xl);
}

/* Contenido del editor: tipografía de lectura; las imágenes y tablas antiguas
   (con anchos fijos en línea) no pueden desbordar la columna. */
.ghblog-article__content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--gh-grey-700);
}
.ghblog-article__content p { margin: 0 0 var(--gh-space-5); }
.ghblog-article__content h2,
.ghblog-article__content h3,
.ghblog-article__content h4 {
  margin: var(--gh-space-10) 0 var(--gh-space-4);
  font-family: var(--gh-font-display);
  font-weight: 800;
  line-height: 1.25;
  color: var(--gh-grey-950);
}
.ghblog-article__content h2 { font-size: 28px; }
.ghblog-article__content h3 { font-size: 22px; }
.ghblog-article__content h4 { font-size: 19px; }
.ghblog-article__content a { color: var(--gh-green-700); text-decoration: underline; text-underline-offset: 2px; }
.ghblog-article__content strong { color: var(--gh-grey-900); }
.ghblog-article__content ul,
.ghblog-article__content ol { margin: 0 0 var(--gh-space-5); padding-left: var(--gh-space-6); }
.ghblog-article__content li { margin: 0 0 var(--gh-space-2); }
.ghblog-article__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--gh-radius-lg);
}
.ghblog-article__content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 var(--gh-space-5);
  border-collapse: collapse;
}
.ghblog-article__content td,
.ghblog-article__content th { padding: 8px 12px; border: 1px solid var(--gh-grey-200); }
.ghblog-article__content iframe { max-width: 100%; }
.ghblog-article__content blockquote {
  margin: 0 0 var(--gh-space-5);
  padding: var(--gh-space-4) var(--gh-space-6);
  border-left: 4px solid var(--gh-green-600);
  background: var(--gh-green-50);
  border-radius: 0 var(--gh-radius-md) var(--gh-radius-md) 0;
}

/* ─── Barra lateral ─── */
.ghblog-sidebar {
  position: sticky;
  top: var(--gh-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--gh-space-6);
}
.ghblog-sidebar__box {
  padding: var(--gh-space-6);
  border: 1px solid var(--gh-grey-200);
  border-radius: var(--gh-radius-xl);
  background: var(--gh-white);
}
.ghblog-sidebar__title {
  margin: 0 0 var(--gh-space-4);
  font-family: var(--gh-font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--gh-grey-950);
}
.ghblog-sidebar__list { margin: 0; padding: 0; list-style: none; }
.ghblog-sidebar__list li + li { border-top: 1px solid var(--gh-grey-100); }
.ghblog-sidebar__link,
.ghblog-sidebar__post {
  display: flex;
  justify-content: space-between;
  gap: var(--gh-space-3);
  padding: 10px 0;
  color: var(--gh-grey-700);
  text-decoration: none;
}
.ghblog-sidebar__post { flex-direction: column; gap: 2px; }
.ghblog-sidebar__link:hover,
.ghblog-sidebar__post:hover .ghblog-sidebar__post-title { color: var(--gh-green-700); }
.ghblog-sidebar__count { font-size: var(--gh-text-sm); color: var(--gh-grey-400); }
.ghblog-sidebar__post-title { font-weight: 600; line-height: 1.4; }
.ghblog-sidebar__post-date { font-size: var(--gh-text-xs); color: var(--gh-grey-500); }
.ghblog-sidebar__all {
  display: block;
  padding: 14px;
  border-radius: var(--gh-radius-full);
  background: var(--gh-green-grad);
  font-weight: 700;
  color: var(--gh-white);
  text-align: center;
  text-decoration: none;
}
.ghblog-sidebar__all:hover { background: var(--gh-green-grad-hover); color: var(--gh-white); }

/* ─── Relacionados ─── */
.ghblog-related {
  margin: var(--gh-space-20) 0 0;
  padding: var(--gh-space-12) 0 0;
  border-top: 1px solid var(--gh-grey-200);
}
.ghblog-related__title {
  margin: 0 0 var(--gh-space-8);
  font-family: var(--gh-font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--gh-grey-950);
}
