/* ============================================================
   images-styles.css — estilos para imágenes (figure/figcaption)
   ============================================================ */

/* Figuras dentro del flujo de la artículo (no hero) */
[data-content] figure {
  margin: 2rem auto;
  max-width: var(--wide-width, 880px);
  padding: 0;
}

[data-content] figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, 0.08);
  background: var(--muted, #e8e2e1);
}

[data-content] figcaption {
  margin-top: 0.85rem;
  padding: 0 0.25rem;
  font-family: var(--font-body, 'Lora', Georgia, serif);
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary, #5a4e4d);
  text-align: center;
  border-top: 1px solid var(--muted, #e8e2e1);
  padding-top: 0.75rem;
}

/* Hero figure: sin marco ni fondo, sin figcaption */
.hero figure {
  margin: 1.75rem auto 1.5rem;
  max-width: 100%;
  padding: 0;
}

.hero figure img {
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(26, 26, 26, 0.12);
}

/* Hero no lleva figcaption — el H1 da contexto */
.hero figcaption { display: none; }

/* Loading states: fondo claro antes de que cargue la imagen */
figure img[loading="lazy"] {
  background: var(--accent-soft, #fbeaed);
  min-height: 120px;
}

/* Adaptaciones móviles */
@media (max-width: 768px) {
  [data-content] figure {
    margin: 1.5rem auto;
  }
  [data-content] figcaption {
    font-size: 0.82rem;
    padding-top: 0.6rem;
    margin-top: 0.65rem;
  }
  .hero figure {
    margin: 1.25rem auto 1rem;
  }
  .hero figure img {
    border-radius: 4px;
  }
}

@media (max-width: 480px) {
  [data-content] figure img {
    border-radius: 3px;
  }
}

/* Respeta prefer-reduced-motion en cualquier transición futura */
@media (prefers-reduced-motion: reduce) {
  figure img { transition: none !important; }
}
