/* =========================================================
   images-styles.css — Estilos para figure / img / figcaption
   Se integra con el sistema de tokens (--surface, --border-muted,
   --text-muted, --accent, --content-width) del pillar.
   ========================================================= */

article figure {
  margin: 2.5rem 0;
  padding: 0;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-muted, #e8e3dc);
  border-radius: 6px;
  overflow: hidden;
}

article figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
  aspect-ratio: 1200 / 630;
  background: var(--surface-alt, #f3efe9);
}

article figure figcaption {
  padding: 0.9rem 1.1rem 1rem;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted, #5a5550);
  border-top: 1px solid var(--border-muted, #e8e3dc);
  background: var(--surface-alt, #f3efe9);
}

/* Hero image: sin figcaption, protagonismo visual */
.hero figure {
  margin: 1.8rem 0 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.hero figure img,
.hero-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: 8px;
}

/* Adaptabilidad tablet */
@media (max-width: 768px) {
  article figure {
    margin: 2rem 0;
    border-radius: 4px;
  }
  article figure figcaption {
    padding: 0.75rem 0.9rem 0.85rem;
    font-size: 0.88rem;
  }
  .hero figure {
    margin-top: 1.4rem;
    border-radius: 6px;
  }
}

/* Adaptabilidad móvil */
@media (max-width: 480px) {
  article figure {
    margin: 1.6rem 0;
  }
  article figure figcaption {
    padding: 0.7rem 0.8rem 0.8rem;
    font-size: 0.85rem;
    line-height: 1.45;
  }
  .hero figure {
    margin-top: 1.2rem;
  }
}

/* Accesibilidad: foco visible sobre figuras interactivas (futuro) */
article figure:focus-within {
  outline: 2px solid var(--accent, #e54219);
  outline-offset: 3px;
}

/* Evitar layout shift: la relación de aspecto ya reservada vía aspect-ratio
   + atributos width/height en el <img> (1200x630). */
