/* ============================================================
   BLOG — grid de artículos, tarjeta y modal de lectura.
   Comparte utilidades con estilos.css y web.css.
   ============================================================ */

/* ---------- Sección "Blog" del inicio ---------- */
.blog-grid { display: grid; gap: 1.2rem; margin-top: 2.2rem; grid-template-columns: repeat(3, 1fr); }
.blog-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radio-card-lg);
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-borde);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--glass-sombra); }
.blog-card .bc-foto {
  position: relative;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--primary);
  overflow: hidden;
}
.blog-card .bc-foto img { width: 100%; height: 100%; object-fit: cover; }
.blog-card .bc-cat {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  background: rgba(95, 116, 94, 0.85);
  color: #F3EEE4;
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radio-pildora);
}
.blog-card .bc-cuerpo { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.blog-card .bc-fecha { font-size: var(--t-xs); color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.blog-card h3 { font-size: var(--t-lg); line-height: 1.3; }
.blog-card .bc-resumen { font-size: var(--t-md); color: var(--text-soft); line-height: 1.6; flex: 1; }
.blog-card .bc-leer { margin-top: 0.3rem; font-size: var(--t-xs); font-weight: 700; color: var(--terra); display: inline-flex; align-items: center; gap: 0.35rem; }

@media (max-width: 899px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .blog-grid { grid-template-columns: 1fr; } }

/* ---------- Cabecera de blog.html ---------- */
.blog-hero { padding: 2.8rem 0 1rem; }
/* Sin esta regla el h1 caia al 2em del navegador: 32px fijos, sin clamp,
   con el line-height 1.5 del body. Rompia la escala del resto del sitio. */
.blog-hero h1 {
  margin-top: 0.7rem;
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
}
.blog-hero-intro { max-width: 560px; margin: 0.8rem auto 0; color: var(--text-soft); font-size: 0.9rem; line-height: 1.7; }

/* ---------- Filtro de categorías ---------- */
.blog-filtros { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-bottom: 2.4rem; }
.blog-filtro {
  padding: 0.5rem 1rem;
  border-radius: var(--radio-pildora);
  border: 1.5px solid var(--border);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--text-soft);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.blog-filtro:hover { border-color: var(--primary); color: var(--primary); }
.blog-filtro.sel { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.blog-grid-completo { display: grid; gap: 1.4rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 899px) { .blog-grid-completo { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .blog-grid-completo { grid-template-columns: 1fr; } }

.blog-vacio { text-align: center; padding: 3rem 1rem; color: var(--text-soft); }
.blog-vacio h3 { margin-top: 1rem; color: var(--text); }
.blog-vacio p { margin-top: 0.4rem; font-size: 0.85rem; }

/* ---------- Modal de lectura de artículo ---------- */
.popup-post {
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 0;
}
.popup-post .pp-cerrar { position: absolute; top: 1rem; right: 1rem; z-index: 2; background: rgba(0,0,0,0.35); color: #fff; border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.post-portada {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--primary);
  overflow: hidden;
}
.post-portada img { width: 100%; height: 100%; object-fit: cover; }
.post-cuerpo { padding: 1.6rem 1.8rem 2rem; }
.post-cuerpo .post-cat { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--terra); }
.post-cuerpo h2 { margin-top: 0.5rem; font-size: 1.5rem; line-height: 1.3; }
.post-cuerpo .post-fecha { margin-top: 0.4rem; font-size: var(--t-xs); color: var(--text-soft); }
.post-cuerpo .post-texto { margin-top: 1.2rem; font-size: 0.88rem; line-height: 1.85; color: var(--text); white-space: pre-line; }
