/* =============================================================================
 * Layouts de imagem no corpo da notícia (Cms::Article#body_layout).
 * O wrapper .article-body--<full|gallery|float> envolve o ActionText renderizado.
 * ActionText emite <figure class="attachment attachment--preview"> e, quando há
 * imagens adjacentes, <div class="attachment-gallery">.
 * ===========================================================================*/

.article-body { }
.article-body::after { content: ""; display: block; clear: both; }

.article-body figure.attachment {
  margin: 2rem 0;
}
.article-body figure.attachment img {
  border-radius: 0.75rem;
  display: block;
}
.article-body .attachment__caption {
  margin-top: 0.5rem;
  text-align: center;
  font-style: italic;
  font-size: 0.875rem;
  color: #64748b;
}

/* --- Layout: largura total -------------------------------------------------- */
.article-body--full figure.attachment img {
  width: 100%;
  height: auto;
}

/* --- Layout: galeria -------------------------------------------------------- */
.article-body--gallery figure.attachment img { width: 100%; height: auto; }
/* imagens inseridas juntas viram linha lado a lado */
.article-body--gallery .attachment-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
}
.article-body--gallery .attachment-gallery .attachment {
  flex: 1 1 0;
  margin: 0;
}
/* imagem solta na galeria: tamanho médio centralizado */
.article-body--gallery > figure.attachment {
  max-width: 60%;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 768px) {
  .article-body--gallery > figure.attachment { max-width: 100%; }
  .article-body--gallery .attachment-gallery { flex-direction: column; }
}

/* --- Layout: flutuando (canon: 50% à direita, texto contorna) --------------- */
.article-body--float figure.attachment {
  width: 40%;
  max-width: 40%;
  float: right;
  clear: both;
  shape-outside: inset(0 0 0 2rem);
  margin: 0.25rem 0 1.5rem 2rem;
  border-radius: 1rem;
  overflow: hidden;
}
.article-body--float figure.attachment img { width: 100%; height: auto; }
@media (max-width: 768px) {
  .article-body--float figure.attachment {
    float: none !important;
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
  }
}

/* =============================================================================
 * Canon "Editorial Sanctuary" — página da notícia (articles/show)
 * ===========================================================================*/
.canon-article { font-family: "Inter", system-ui, sans-serif; }
.canon-article .canon-heading,
.canon-article h1, .canon-article h2, .canon-article h3, .canon-article h4 {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

/* coluna de leitura editorial (720px) — alinhada à esquerda, na mesma margem
 * do cabeçalho (o wrapper externo .max-w-7xl define o alinhamento). */
.content-canvas { max-width: 720px; }

/* capa 16/9 arredondada + legenda em "vidro" */
.canon-hero { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 1.5rem; }
.canon-hero > img { width: 100%; height: 100%; object-fit: cover; }
.canon-hero .canon-hero-caption {
  position: absolute; left: 1.5rem; bottom: 1.5rem;
  background: rgba(251, 249, 248, 0.55); backdrop-filter: blur(10px);
  padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.75rem; color: #1b1c1c;
}

/* corpo: drop-cap (capitular) na 1ª letra do 1º parágrafo */
.canon-body .article-body > p:first-of-type::first-letter {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 3.5rem; font-weight: 700; color: #006971;
  float: left; line-height: 0.85; margin: 0.05em 0.12em 0 0;
}
.canon-body .article-body > p { line-height: 1.8; }
