/* Blog público: lista de publicaciones y página de un post. */

.blog-main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 72px;
  flex: 1;
}

/* ---------- Encabezado de la lista ---------- */
.blog-hero {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.blog-hero h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.blog-hero p { color: var(--text-secondary); font-size: 1.05rem; margin-top: 8px; }
.tag-filter { font-size: 0.95rem !important; }

.empty { color: var(--text-secondary); padding: 40px 0; text-align: center; }

/* ---------- Lista: estilo índice, sin tarjetas ---------- */
.post-list { display: flex; flex-direction: column; }

.post-card {
  display: flex;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.post-card:first-child { padding-top: 0; }

.post-card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }

.post-card-cover {
  order: 2;
  flex: 0 0 168px;
  height: 112px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--code-bg);
  display: block;
  align-self: flex-start;
  margin-top: 4px;
}
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-card h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
}
.post-card h2 a { color: var(--text-main); text-decoration: none; }
.post-card h2 a:hover { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; }

.summary { color: var(--text-secondary); font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.6; }

.post-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.read-more { font-weight: 500; font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.read-more:hover { text-decoration: underline; }

.post-meta {
  color: var(--text-faint);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.post-meta a { text-transform: none; letter-spacing: 0; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  color: var(--text-faint);
  font-size: 0.92rem;
}
.pagination a { font-weight: 500; text-decoration: none; }
.pagination a:hover { text-decoration: underline; }

/* ---------- Post individual ---------- */
.back a { text-decoration: none; font-size: 0.92rem; color: var(--text-secondary); }
.back a:hover { color: var(--primary); }
.back.bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.post-header {
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-header h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.post-cover { width: 100%; border-radius: 4px; margin-bottom: 32px; display: block; }

.notice, .draft-banner {
  background: var(--primary-tint);
  border-left: 3px solid var(--primary);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.draft-banner { font-weight: 600; }

/* ---------- Celulares ---------- */
@media (max-width: 700px) {
  /* Cabecera: una sola fila; fija, pero se esconde al bajar y reaparece al subir (assets/js/header-autohide.js) */
  .site-header { position: sticky; flex-wrap: nowrap; transition: transform 0.25s ease; will-change: transform; }
  .site-header.header-hidden { transform: translateY(-100%); }
  .top-nav { flex-wrap: nowrap; gap: 6px; }

  .blog-main { padding: 32px 16px 48px; }
  .blog-hero { margin-bottom: 24px; padding-bottom: 20px; }
  .blog-hero h1 { font-size: 1.9rem; }
  .post-card { flex-direction: column; gap: 14px; padding: 22px 0; }
  .post-card-cover { order: 0; flex-basis: auto; width: 100%; height: 180px; margin-top: 0; }
  .post-card h2 { font-size: 1.3rem; }
  .post-header { margin: 18px 0 24px; }
  .post-header h1 { font-size: 1.85rem; }
}

/* Celulares muy estrechos (≈320 px): botones de la cabecera más compactos para que quepan en una fila */
@media (max-width: 380px) {
  .site-header { padding: 6px 12px; }
  .top-nav { gap: 2px; }
  .icon-btn { width: 28px; }
  .top-nav .home-link { display: none; } /* el logo ya lleva a las simulaciones */
  .top-nav .lang-switch a { padding: 4px 8px; }
  .logo { font-size: 1.1rem; }
  .header-left { gap: 8px; }
  .logo-sub { padding-left: 8px; font-size: 0.95rem; }
}
