/**
 * Suporte completo aos blocos nativos do WordPress (Gutenberg + Editor Clássico)
 * dentro de `.afagu-post-content`, compatível com Tailwind Typography (.prose),
 * posts legados (Laravel/TipTap) e modo Alto Contraste.
 */

/* ==========================================================================
   1. Container, ritmo vertical e alinhamentos
   ========================================================================== */
.afagu-post-content {
  display: flow-root;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.afagu-post-content > *:first-child {
  margin-top: 0;
}

.afagu-post-content > *:last-child {
  margin-bottom: 0;
}

/* Alinhamentos nativos do WordPress */
.afagu-post-content .aligncenter {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.afagu-post-content .alignleft {
  float: left;
  margin: 0.35rem 1.5rem 1rem 0;
  max-width: 50%;
}

.afagu-post-content .alignright {
  float: right;
  margin: 0.35rem 0 1rem 1.5rem;
  max-width: 50%;
}

.afagu-post-content .alignwide,
.afagu-post-content .alignfull {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  clear: both;
}

@media (max-width: 640px) {
  .afagu-post-content .alignleft,
  .afagu-post-content .alignright {
    float: none;
    display: block;
    max-width: 100%;
    margin: 1.25rem auto;
  }
}

/* Listas de conteúdo (sem vazar bullets para blocos estruturais que usam <ul>) */
.afagu-post-content ul:not([class*="wp-block-"]):not(.blocks-gallery-grid):not(.gallery),
.afagu-post-content ul.wp-block-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 1.25rem 0;
}

.afagu-post-content ol:not([class*="wp-block-"]),
.afagu-post-content ol.wp-block-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 1.25rem 0;
}

.afagu-post-content ul.wp-block-list li,
.afagu-post-content ol.wp-block-list li,
.afagu-post-content ul:not([class*="wp-block-"]):not(.blocks-gallery-grid) li,
.afagu-post-content ol:not([class*="wp-block-"]) li {
  margin: 0.4rem 0;
}

/* ==========================================================================
   2. Galeria de Fotos — Gutenberg (.wp-block-gallery) + Clássica ([gallery])
   ========================================================================== */
.afagu-post-content .wp-block-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--style--unstable-gallery-gap, 0.75rem);
  margin: 1.75rem 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  clear: both;
}

/* Galeria moderna (WP 5.9+ com nested .wp-block-image) */
.afagu-post-content .wp-block-gallery.has-nested-images {
  display: flex;
  flex-wrap: wrap;
  align-items: normal;
}

.afagu-post-content .wp-block-gallery.has-nested-images > figure.wp-block-image {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  margin: 0;
  padding: 0;
  max-width: 100%;
  box-sizing: border-box;
  flex-grow: 1;
  overflow: hidden;
  border-radius: 0.875rem;
  background: #f1f5f9;
}

.afagu-post-content .wp-block-gallery.has-nested-images > figure.wp-block-image > a,
.afagu-post-content .wp-block-gallery.has-nested-images > figure.wp-block-image > div {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
}

.afagu-post-content .wp-block-gallery.has-nested-images > figure.wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0;
  border-radius: 0.875rem;
  transition: transform 0.25s ease;
}

.afagu-post-content .wp-block-gallery.has-nested-images.is-cropped > figure.wp-block-image img {
  width: 100%;
  height: 100%;
  flex: 1 0 0%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.afagu-post-content .wp-block-gallery.has-nested-images > figure.wp-block-image a:hover img {
  transform: scale(1.03);
}

/* Colunas da galeria Gutenberg (1 a 8) */
.afagu-post-content .wp-block-gallery.has-nested-images.columns-1 > figure.wp-block-image {
  width: 100%;
}
.afagu-post-content .wp-block-gallery.has-nested-images.columns-2 > figure.wp-block-image {
  width: calc(50% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.5);
}
.afagu-post-content .wp-block-gallery.has-nested-images.columns-3 > figure.wp-block-image,
.afagu-post-content .wp-block-gallery.has-nested-images.columns-default > figure.wp-block-image {
  width: calc(33.3333% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.6667);
}
.afagu-post-content .wp-block-gallery.has-nested-images.columns-4 > figure.wp-block-image {
  width: calc(25% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.75);
}
.afagu-post-content .wp-block-gallery.has-nested-images.columns-5 > figure.wp-block-image {
  width: calc(20% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.8);
}
.afagu-post-content .wp-block-gallery.has-nested-images.columns-6 > figure.wp-block-image {
  width: calc(16.6667% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.8333);
}
.afagu-post-content .wp-block-gallery.has-nested-images.columns-7 > figure.wp-block-image {
  width: calc(14.2857% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.8571);
}
.afagu-post-content .wp-block-gallery.has-nested-images.columns-8 > figure.wp-block-image {
  width: calc(12.5% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.875);
}

@media (max-width: 640px) {
  .afagu-post-content .wp-block-gallery.has-nested-images.columns-3 > figure.wp-block-image,
  .afagu-post-content .wp-block-gallery.has-nested-images.columns-default > figure.wp-block-image,
  .afagu-post-content .wp-block-gallery.has-nested-images.columns-4 > figure.wp-block-image,
  .afagu-post-content .wp-block-gallery.has-nested-images.columns-5 > figure.wp-block-image,
  .afagu-post-content .wp-block-gallery.has-nested-images.columns-6 > figure.wp-block-image,
  .afagu-post-content .wp-block-gallery.has-nested-images.columns-7 > figure.wp-block-image,
  .afagu-post-content .wp-block-gallery.has-nested-images.columns-8 > figure.wp-block-image {
    width: calc(50% - var(--wp--style--unstable-gallery-gap, 0.75rem) * 0.5);
  }
}

/* Legenda individual sobre a foto na galeria */
.afagu-post-content .wp-block-gallery.has-nested-images > figure.wp-block-image figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 1.5rem 0.75rem 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.35) 65%, transparent 100%);
  text-align: center;
  font-style: normal;
  pointer-events: none;
}

.afagu-post-content .wp-block-gallery.has-nested-images > figure.wp-block-image figcaption a {
  color: #ffffff;
  pointer-events: auto;
}

/* Legenda geral da galeria */
.afagu-post-content .wp-block-gallery > figcaption.blocks-gallery-caption {
  display: block;
  width: 100%;
  flex: 0 0 100%;
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
  font-style: italic;
  text-align: center;
}

/* Galeria Gutenberg antiga (ul.blocks-gallery-grid) */
.afagu-post-content .wp-block-gallery ul.blocks-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.afagu-post-content .wp-block-gallery.columns-2 ul.blocks-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.afagu-post-content .wp-block-gallery.columns-4 ul.blocks-gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.afagu-post-content .wp-block-gallery ul.blocks-gallery-grid li.blocks-gallery-item {
  margin: 0;
  padding: 0;
  list-style: none;
}
.afagu-post-content .wp-block-gallery ul.blocks-gallery-grid figure {
  display: block;
  margin: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 0.875rem;
}
.afagu-post-content .wp-block-gallery ul.blocks-gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  margin: 0;
  border-radius: 0.875rem;
}

/* Galeria Clássica ([gallery] shortcode) */
.afagu-post-content .gallery {
  display: grid;
  gap: 0.75rem;
  margin: 1.75rem 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.afagu-post-content .gallery.gallery-columns-1 { grid-template-columns: 1fr; }
.afagu-post-content .gallery.gallery-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.afagu-post-content .gallery.gallery-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.afagu-post-content .gallery.gallery-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.afagu-post-content .gallery.gallery-columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.afagu-post-content .gallery.gallery-columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .afagu-post-content .gallery:not(.gallery-columns-1) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.afagu-post-content .gallery .gallery-item {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.afagu-post-content .gallery .gallery-icon {
  overflow: hidden;
  border-radius: 0.75rem;
  background: #f1f5f9;
  aspect-ratio: 4 / 3;
}
.afagu-post-content .gallery .gallery-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0.75rem;
  transition: transform 0.25s ease;
}
.afagu-post-content .gallery .gallery-icon a:hover img {
  transform: scale(1.03);
}
.afagu-post-content .gallery .gallery-caption {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: #64748b;
  font-style: italic;
  text-align: center;
}

/* ==========================================================================
   3. Imagem Individual (.wp-block-image e .wp-caption clássico)
   ========================================================================== */
.afagu-post-content .wp-block-image:not(.wp-block-gallery .wp-block-image) {
  margin: 1.75rem 0;
}

.afagu-post-content .wp-block-image:not(.wp-block-gallery .wp-block-image) img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  border-radius: 1rem;
}

.afagu-post-content .wp-block-image.aligncenter img,
.afagu-post-content .wp-block-image:not(.alignleft):not(.alignright):not(.wp-block-gallery .wp-block-image) img {
  margin-left: auto;
  margin-right: auto;
}

.afagu-post-content .wp-block-image.is-style-rounded img {
  border-radius: 9999px;
}

.afagu-post-content .wp-block-image:not(.wp-block-gallery .wp-block-image) figcaption,
.afagu-post-content .wp-caption .wp-caption-text {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
  font-style: italic;
  text-align: center;
}

.afagu-post-content .wp-caption {
  max-width: 100%;
  margin: 1.75rem auto;
}

.afagu-post-content .wp-caption img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 0 auto;
}

/* ==========================================================================
   4. Capa (.wp-block-cover)
   ========================================================================== */
.afagu-post-content .wp-block-cover {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 340px;
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 1.25rem;
  overflow: hidden;
  clear: both;
  box-sizing: border-box;
}

.afagu-post-content .wp-block-cover img.wp-block-cover__image-background,
.afagu-post-content .wp-block-cover video.wp-block-cover__video-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

.afagu-post-content .wp-block-cover .wp-block-cover__inner-container {
  position: relative;
  z-index: 1;
  width: 100%;
  color: #ffffff;
}

.afagu-post-content .wp-block-cover .wp-block-cover__inner-container h1,
.afagu-post-content .wp-block-cover .wp-block-cover__inner-container h2,
.afagu-post-content .wp-block-cover .wp-block-cover__inner-container h3,
.afagu-post-content .wp-block-cover .wp-block-cover__inner-container h4,
.afagu-post-content .wp-block-cover .wp-block-cover__inner-container p:not(.has-text-color) {
  color: inherit;
}

.afagu-post-content .wp-block-cover.is-light .wp-block-cover__inner-container {
  color: #0f172a;
}

/* ==========================================================================
   5. Mídia e Texto (.wp-block-media-text)
   ========================================================================== */
.afagu-post-content .wp-block-media-text {
  display: grid;
  grid-template-columns: 50% 1fr;
  align-items: center;
  gap: 1.75rem;
  margin: 2rem 0;
  clear: both;
}

.afagu-post-content .wp-block-media-text.has-media-on-the-right {
  grid-template-columns: 1fr 50%;
}

.afagu-post-content .wp-block-media-text .wp-block-media-text__media {
  margin: 0;
  overflow: hidden;
  border-radius: 1rem;
}

.afagu-post-content .wp-block-media-text .wp-block-media-text__media img,
.afagu-post-content .wp-block-media-text .wp-block-media-text__media video {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 1rem;
}

.afagu-post-content .wp-block-media-text .wp-block-media-text__content {
  padding: 0.5rem 0;
}

.afagu-post-content .wp-block-media-text.has-background {
  border-radius: 1.25rem;
  overflow: hidden;
  gap: 0;
}

.afagu-post-content .wp-block-media-text.has-background .wp-block-media-text__media,
.afagu-post-content .wp-block-media-text.has-background .wp-block-media-text__media img {
  border-radius: 0;
  height: 100%;
  object-fit: cover;
}

.afagu-post-content .wp-block-media-text.has-background .wp-block-media-text__content {
  padding: 1.75rem;
}

@media (max-width: 640px) {
  .afagu-post-content .wp-block-media-text.is-stacked-on-mobile {
    grid-template-columns: 100% !important;
    gap: 1rem;
  }
}

/* ==========================================================================
   6. Vídeo, Áudio, Embeds e Arquivo/Download
   ========================================================================== */
.afagu-post-content .wp-block-video,
.afagu-post-content .wp-block-audio,
.afagu-post-content .wp-block-embed {
  margin: 1.75rem 0;
  width: 100%;
  max-width: 100%;
  clear: both;
}

.afagu-post-content .wp-block-video video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1rem;
  background: #0f172a;
}

.afagu-post-content .wp-block-audio audio {
  width: 100%;
  min-width: 240px;
}

.afagu-post-content .wp-block-video figcaption,
.afagu-post-content .wp-block-audio figcaption,
.afagu-post-content .wp-block-embed figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  font-style: italic;
  text-align: center;
}

/* Embeds responsivos (YouTube, Vimeo, Spotify, Maps, etc.) */
.afagu-post-content .wp-block-embed .wp-block-embed__wrapper {
  position: relative;
  width: 100%;
}

.afagu-post-content .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.afagu-post-content .wp-block-embed.wp-embed-aspect-4-3 .wp-block-embed__wrapper::before { padding-top: 75%; }
.afagu-post-content .wp-block-embed.wp-embed-aspect-1-1 .wp-block-embed__wrapper::before { padding-top: 100%; }
.afagu-post-content .wp-block-embed.wp-embed-aspect-9-16 .wp-block-embed__wrapper::before { padding-top: 177.77%; }
.afagu-post-content .wp-block-embed.wp-embed-aspect-21-9 .wp-block-embed__wrapper::before { padding-top: 42.85%; }

.afagu-post-content .wp-block-embed.wp-has-aspect-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 1rem;
}

.afagu-post-content .wp-block-embed:not(.wp-has-aspect-ratio) iframe {
  max-width: 100%;
  border-radius: 0.875rem;
}

/* Bloco Arquivo (Download) */
.afagu-post-content .wp-block-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
}

.afagu-post-content .wp-block-file > a:first-child {
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
}

.afagu-post-content .wp-block-file > a:first-child:hover {
  color: #0070c8;
  text-decoration: underline;
}

.afagu-post-content .wp-block-file .wp-block-file__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: 0.625rem;
  background: #0070c8;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  margin-left: auto;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.afagu-post-content .wp-block-file .wp-block-file__button:hover {
  background: #005fa8;
  transform: translateY(-1px);
}

/* ==========================================================================
   7. Botões (.wp-block-buttons / .wp-block-button)
   ========================================================================== */
.afagu-post-content .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0;
  clear: both;
}

.afagu-post-content .wp-block-button {
  margin: 0;
}

.afagu-post-content .wp-block-button .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  background-color: #0070c8;
  color: #ffffff;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.afagu-post-content .wp-block-button .wp-block-button__link:hover {
  transform: translateY(-1px);
  opacity: 0.94;
  text-decoration: none;
}

.afagu-post-content .wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
  color: #0070c8;
  border: 2px solid currentColor;
}

.afagu-post-content .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: #0070c8;
  color: #ffffff;
  border-color: #0070c8;
}

/* ==========================================================================
   8. Colunas, Grupo, Linha, Pilha e Grade
   ========================================================================== */
.afagu-post-content .wp-block-columns {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5rem;
  margin: 1.75rem 0;
  box-sizing: border-box;
  clear: both;
}

.afagu-post-content .wp-block-column {
  flex-grow: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.afagu-post-content .wp-block-column > *:first-child { margin-top: 0; }
.afagu-post-content .wp-block-column > *:last-child { margin-bottom: 0; }

@media (max-width: 781px) {
  .afagu-post-content .wp-block-columns:not(.is-not-stacked-on-mobile) {
    flex-wrap: wrap;
  }
  .afagu-post-content .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    flex-basis: 100% !important;
  }
}

.afagu-post-content .wp-block-group {
  margin: 1.75rem 0;
  box-sizing: border-box;
  clear: both;
}

.afagu-post-content .wp-block-group.has-background {
  padding: 1.5rem 1.75rem;
  border-radius: 1.25rem;
}

.afagu-post-content .wp-block-group > *:first-child { margin-top: 0; }
.afagu-post-content .wp-block-group > *:last-child { margin-bottom: 0; }

/* ==========================================================================
   9. Citação, Pullquote, Tabela, Acordeão (Details), Código, Separador
   ========================================================================== */
.afagu-post-content .wp-block-quote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid #0070c8;
  background: #f8fafc;
  border-radius: 0 1rem 1rem 0;
  font-style: normal;
  quotes: none;
}

.afagu-post-content .wp-block-quote p::before,
.afagu-post-content .wp-block-quote p::after {
  content: none;
}

.afagu-post-content .wp-block-quote p:first-child { margin-top: 0; }
.afagu-post-content .wp-block-quote p:last-of-type { margin-bottom: 0; }

.afagu-post-content .wp-block-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 600;
  color: #64748b;
}

.afagu-post-content .wp-block-quote.is-style-plain {
  border-left: 0;
  background: transparent;
  padding: 0.5rem 0;
}

/* Pullquote */
.afagu-post-content .wp-block-pullquote {
  margin: 2rem 0;
  padding: 1.75rem 1.5rem;
  border-top: 3px solid #0070c8;
  border-bottom: 3px solid #0070c8;
  text-align: center;
  clear: both;
}

.afagu-post-content .wp-block-pullquote blockquote {
  border: 0;
  margin: 0;
  padding: 0;
  quotes: none;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.45;
  color: #0f172a;
}

.afagu-post-content .wp-block-pullquote blockquote p::before,
.afagu-post-content .wp-block-pullquote blockquote p::after {
  content: none;
}

.afagu-post-content .wp-block-pullquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

/* Tabela (.wp-block-table) */
.afagu-post-content .wp-block-table {
  margin: 1.75rem 0;
  width: 100%;
  clear: both;
}

.afagu-post-content .wp-block-table .afagu-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
}

.afagu-post-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9375rem;
}

.afagu-post-content .wp-block-table th,
.afagu-post-content .wp-block-table td {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.afagu-post-content .wp-block-table thead th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}

.afagu-post-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background: #f8fafc;
}

.afagu-post-content .wp-block-table figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  font-style: italic;
  text-align: center;
}

/* Detalhes / Acordeão (.wp-block-details) */
.afagu-post-content .wp-block-details {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
}

.afagu-post-content .wp-block-details summary {
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.afagu-post-content .wp-block-details summary::-webkit-details-marker {
  display: none;
}

.afagu-post-content .wp-block-details summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 600;
  color: #0070c8;
  line-height: 1;
  transition: transform 0.2s ease;
}

.afagu-post-content .wp-block-details[open] summary::after {
  content: "−";
}

.afagu-post-content .wp-block-details[open] > *:not(summary) {
  margin-top: 0.75rem;
}

/* Código, Pré-formatado e Verso */
.afagu-post-content .wp-block-code,
.afagu-post-content .wp-block-preformatted {
  margin: 1.5rem 0;
  padding: 1.15rem 1.25rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.875rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

.afagu-post-content .wp-block-code code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.afagu-post-content .wp-block-verse {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-radius: 0.875rem;
  font-family: inherit;
  font-style: italic;
  white-space: pre-wrap;
  color: #334155;
}

/* Separador e Espaçador */
.afagu-post-content .wp-block-separator {
  border: 0;
  border-top: 2px solid #e2e8f0;
  margin: 2rem auto;
  max-width: 120px;
  clear: both;
}

.afagu-post-content .wp-block-separator.is-style-wide {
  max-width: 100%;
}

.afagu-post-content .wp-block-separator.is-style-dots {
  border: 0;
  max-width: none;
  text-align: center;
  height: auto;
  background: none;
}

.afagu-post-content .wp-block-separator.is-style-dots::before {
  content: "···";
  color: #94a3b8;
  font-size: 1.5rem;
  letter-spacing: 1.25rem;
  padding-left: 1.25rem;
}

.afagu-post-content .wp-block-spacer {
  clear: both;
  margin: 0;
}

/* Capitular (Drop Cap) */
.afagu-post-content p.has-drop-cap:not(:focus)::first-letter {
  float: left;
  font-size: 3.5rem;
  line-height: 0.85;
  font-weight: 800;
  margin: 0.1rem 0.6rem 0 0;
  color: #0070c8;
}

/* Parágrafo com fundo */
.afagu-post-content p.has-background {
  padding: 1.15rem 1.35rem;
  border-radius: 0.875rem;
}

/* ==========================================================================
   10. Widgets / Blocos Dinâmicos (Social, Latest Posts, Search, Calendar)
   ========================================================================== */
.afagu-post-content .wp-block-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.afagu-post-content .wp-block-social-links li {
  list-style: none;
  margin: 0;
}

.afagu-post-content .wp-block-social-links a {
  text-decoration: none;
}

.afagu-post-content .wp-block-latest-posts {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.afagu-post-content .wp-block-latest-posts.is-grid {
  display: grid;
  gap: 1.25rem;
}

.afagu-post-content .wp-block-latest-posts li {
  margin: 0 0 0.75rem;
  list-style: none;
}

.afagu-post-content .wp-block-latest-posts__featured-image img {
  border-radius: 0.75rem;
  margin: 0 0 0.5rem;
}

.afagu-post-content .wp-block-search {
  margin: 1.5rem 0;
}

.afagu-post-content .wp-block-search__inside-wrapper {
  display: flex;
  gap: 0.5rem;
}

.afagu-post-content .wp-block-search__input {
  flex: 1 1 auto;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.9375rem;
}

.afagu-post-content .wp-block-search__button {
  background: #0070c8;
  color: #ffffff;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.6rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   11. Paginação de Post (<!--nextpage--> / wp_link_pages)
   ========================================================================== */
.afagu-post-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.afagu-post-pagination__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-right: 0.25rem;
}

.afagu-post-pagination .post-page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  background: #f1f5f9;
  color: #334155;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.afagu-post-pagination a.post-page-numbers:hover {
  background: #e8f4ff;
  color: #0070c8;
}

.afagu-post-pagination span.post-page-numbers.current {
  background: #0070c8;
  color: #ffffff;
}

/* ==========================================================================
   12. Lightbox de Galerias (.afagu-lightbox) + compatibilidade WP Lightbox
   ========================================================================== */
.afagu-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(4px);
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.afagu-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.afagu-lightbox__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(92vw, 1120px);
  max-height: 90vh;
}

.afagu-lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  object-fit: contain;
}

.afagu-lightbox__meta {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  text-align: center;
}

.afagu-lightbox__counter {
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.75rem;
  font-weight: 700;
}

.afagu-lightbox__btn {
  position: fixed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.afagu-lightbox__btn:hover {
  background: rgba(0, 112, 200, 0.9);
  transform: scale(1.06);
}

.afagu-lightbox__btn--close { top: 1rem; right: 1rem; }
.afagu-lightbox__btn--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.afagu-lightbox__btn--next { right: 1rem; top: 50%; transform: translateY(-50%); }
.afagu-lightbox__btn--prev:hover,
.afagu-lightbox__btn--next:hover { transform: translateY(-50%) scale(1.06); }

.afagu-lightbox__btn[hidden] {
  display: none;
}

/* ==========================================================================
   13. Compatibilidade com Alto Contraste (html.a11y-contrast)
   ========================================================================== */
html.a11y-contrast .afagu-post-content .wp-block-button__link,
html.a11y-contrast .afagu-post-content .wp-block-file__button,
html.a11y-contrast .afagu-post-pagination .post-page-numbers {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}

html.a11y-contrast .afagu-lightbox {
  background: #000000 !important;
}
