/* ==========================================================================
   blog.css — el índice del blog y la lectura de un artículo.

   Se carga después de tokens.css y style.css, y solo en /blog y /blog-*.
   Los colores salen todos de tokens.css: si necesitas uno nuevo, agrégalo
   allí con un nombre que diga para qué sirve, no lo escribas aquí suelto.
   ========================================================================== */

/* --- Índice ------------------------------------------------------------ */

.blog-intro {
  background: var(--pine);
  color: var(--on-dark);
  padding: 72px 0 88px;
}

.blog-intro .eyebrow {
  color: var(--on-dark-muted);
}

.blog-intro h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.1;
  margin: 14px 0 18px;
  color: var(--on-dark);
}

.blog-intro h1 em {
  font-style: italic;
  color: var(--on-dark-soft);
}

.blog-intro .lead {
  max-width: 62ch;
  color: var(--on-dark-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.blog-listado {
  padding: 56px 0 88px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.post-vacio {
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.7;
}

/* --- Tarjeta de artículo ----------------------------------------------- */

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--paper-deep);
  border: 1px solid var(--accent-line);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}

.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(25, 83, 43, .16);
}

.post-card-pic {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--sage);
}

.post-card-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-cuerpo {
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.post-card h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.22;
  margin: 0;
  color: var(--ink);
}

.post-card p {
  margin: 0;
  color: var(--muted-ink);
  line-height: 1.6;
  font-size: .95rem;
}

.post-card-mas {
  margin-top: auto;
  padding-top: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
}

/* --- Fecha y etiquetas -------------------------------------------------- */

.post-card-meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .02em;
}

.post-tag {
  background: var(--sage);
  color: var(--pine-deep);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: lowercase;
}

/* --- Artículo ----------------------------------------------------------- */

.post {
  padding: 40px 0 24px;
}

/* Una columna estrecha no es decoración: pasadas las ~75 letras por línea el
   ojo pierde el renglón al volver, y un artículo se lee entero o no se lee. */
.post-ancho {
  max-width: 760px;
}

.post-migas {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.post-migas a {
  color: var(--muted-ink);
  text-decoration: none;
}

.post-migas a:hover {
  text-decoration: underline;
}

.post-cabecera h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12;
  margin: 14px 0 18px;
  color: var(--ink);
}

.post-cabecera h1 em {
  font-style: italic;
  color: var(--accent);
}

.post-entrada {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--muted-ink);
  margin: 0 0 32px;
}

.post-portada {
  margin: 0 0 40px;
  border-radius: 20px;
  overflow: hidden;
}

.post-portada img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Cuerpo del artículo ------------------------------------------------ */

.post-cuerpo {
  font-size: 1.06rem;
  line-height: 1.78;
  color: var(--ink);
}

.post-cuerpo p {
  margin: 0 0 22px;
}

.post-cuerpo h2,
.post-cuerpo h3,
.post-cuerpo h4 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--pine);
  line-height: 1.2;
  /* Más aire arriba que abajo: así el título se lee pegado a lo que
     introduce y no flotando entre dos secciones. */
  margin: 44px 0 14px;
}

.post-cuerpo h2 {
  font-size: 1.95rem;
}

.post-cuerpo h3 {
  font-size: 1.45rem;
}

.post-cuerpo h4 {
  font-size: 1.18rem;
  font-family: var(--body);
  font-weight: 700;
}

.post-cuerpo a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-cuerpo strong {
  color: var(--pine-deep);
}

.post-lista {
  margin: 0 0 22px;
  padding-left: 1.3em;
}

.post-lista li {
  margin-bottom: 10px;
}

.post-lista li::marker {
  color: var(--accent);
}

.post-cita {
  margin: 32px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  font-family: var(--display);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--pine);
}

.post-figura {
  margin: 32px 0;
  border-radius: 16px;
  overflow: hidden;
}

.post-figura img {
  width: 100%;
  height: auto;
  display: block;
}

.post-hr {
  border: 0;
  border-top: 1px solid var(--accent-line);
  margin: 40px 0;
}

.post-cuerpo code {
  background: var(--paper-deep);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: .9em;
}

/* --- Cierre y relacionados ---------------------------------------------- */

.post-cierre {
  margin: 56px 0 0;
  padding: 32px;
  background: var(--pine);
  color: var(--on-dark);
  border-radius: 20px;
}

.post-cierre h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--on-dark);
}

.post-cierre p {
  color: var(--on-dark-soft);
  line-height: 1.65;
  margin: 0 0 22px;
}

.post-relacionados {
  padding: 64px 0 88px;
}

.post-relacionados h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  color: var(--pine);
  margin: 0 0 24px;
}

@media (max-width: 640px) {
  .blog-intro {
    padding: 52px 0 60px;
  }

  .post-cierre {
    padding: 26px 22px;
  }
}
