/* ============================================================
   Imagens de noticia - responsivas, sem corte, sem layout shift
   Escopo: .ac-post (pagina de noticia). Nada fora dele muda.
   ============================================================ */

/* 1) Base segura: so dentro do artigo */
.ac-post img,
.ac-post picture,
.ac-post video,
.ac-post iframe {
  max-width: 100%;
}

.ac-post img {
  display: block;
  height: auto;
  width: 100%;
  background: #eef1f4;
}

/* 2) Destaque (LCP): ratio fixo */
.ac-post__figure {
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: 12px;
}
.ac-post__figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 768px) {
  .ac-post__figure img { aspect-ratio: 4 / 3; }
}

/* 3) Fotos internas do texto */
.ac-post__body img { width: auto; max-width: 100%; height: auto; }
.ac-post__body figure { margin: 20px 0; }
.ac-post__body figcaption {
  font-size: 13px;
  line-height: 1.45;
  color: #5a6472;
  padding-top: 8px;
}

/* 4) Galeria/cards */
.ac-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.ac-gallery img { aspect-ratio: 1 / 1; object-fit: cover; }

/* 5) Conteudo que costuma vazar a viewport */
.ac-post__body > table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}
.ac-post__body iframe,
.ac-post__body video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}
.ac-post__body pre,
.ac-post__body blockquote { overflow-x: auto; }

/* 6) Lazy fade */
.ac-post img[loading="lazy"] { opacity: 0; transition: opacity .35s ease; }
.ac-post img[loading="lazy"].is-loaded,
.no-js .ac-post img[loading="lazy"] { opacity: 1; }

/* 7) Performance */
@media (max-width: 768px) {
  .ac-post__body { content-visibility: auto; contain-intrinsic-size: 1px 1200px; }
}