/* ==========================================================================
   1. Header da Seção (Título e Link Ver Todos)
   ========================================================================== */
.recent-posts-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  margin-bottom: 24px !important;
}

.recent-posts-title {
  color: var(--wp--preset--color--primary, #265244) !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

.recent-posts-see-all {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--wp--preset--color--accent, #438B42) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: transform 0.2s ease !important;
}

.recent-posts-see-all::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 12px;
  background-color: var(--wp--preset--color--accent, #438B42);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12' fill='none'%3E%3Cpath d='M8 1L13 6M13 6L8 11M13 6H1' stroke='%23438B42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12' fill='none'%3E%3Cpath d='M8 1L13 6M13 6L8 11M13 6H1' stroke='%23438B42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform 0.2s ease;
}

.recent-posts-see-all:hover::after {
  transform: translateX(3px);
}

/* ==========================================================================
   2. Grid Fluida e Desbloqueio de Layout Gutenberg
   ========================================================================== */
.wp-block-column .wp-block-query,
.wp-block-column .wp-block-query.is-layout-grid,
.wp-block-column .wp-block-query.wp-block-query-is-layout-grid {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: none !important;
}

ul.recent-posts-grid,
ul.wp-block-post-template.recent-posts-grid,
.wp-block-column:first-child .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 24px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  align-items: stretch !important;
}

ul.recent-posts-grid > li,
.wp-block-column:first-child .wp-block-post-template > li {
  width: 100% !important;
  max-width: 100% !important;
}

/* ==========================================================================
   3. Card Individual
   ========================================================================== */
.recent-posts-grid > li,
.wp-block-post-template.recent-posts-grid > li {
  margin: 0 !important; /* Zera margens automáticas do WordPress para alinhar no topo */
  padding: 12px !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  background-color: var(--wp--preset--color--surface, #F3F3F3) !important;
  border-radius: 12px 24px 12px 12px !important;
  box-sizing: border-box !important;
}

li.wp-block-post {
  position: relative !important;
  cursor: pointer !important;
}

li.wp-block-post .wp-block-post-title a::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
}

li.wp-block-post .wp-block-post-terms,
li.wp-block-post .wp-block-post-terms a,
li.wp-block-post .recent-post-card-footer a {
  position: relative !important;
  z-index: 2 !important;
}

/* ==========================================================================
   4. Imagem Destacada Fixa
   ========================================================================== */
.recent-posts-grid .wp-block-post-featured-image {
  margin: 0 0 14px 0 !important;
  width: 100% !important;
  height: 220px !important;
  min-height: 220px !important;
  max-height: 220px !important;
  border-radius: 8px 18px 8px 8px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  background-color: #e2e2e2;
}

.recent-posts-grid .wp-block-post-featured-image a,
.recent-posts-grid .wp-block-post-featured-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* ==========================================================================
   5. Corpo do Card e Tipografia
   ========================================================================== */
.recent-post-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
}

.recent-posts-grid .wp-block-post-terms {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 0 0 10px 0 !important;
}

.wp-block-post-terms__separator {
  display: none;
}

.recent-posts-grid .wp-block-post-terms a {
  background-color: var(--wp--preset--color--background, #FFFFFF) !important;
  border: 1px solid var(--wp--preset--color--border-light, #E5E5E5) !important;
  border-radius: 4px !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  color: var(--wp--preset--color--tag-text, #484848) !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
}

/* Data */
.recent-posts-grid .wp-block-post-date {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--wp--preset--color--primary, #265244) !important;
  margin: 0 0 8px 0 !important;
  line-height: 1 !important;
}

/* Título */
.recent-posts-grid .wp-block-post-title {
  margin: 0 0 10px 0 !important;
  line-height: 1.25 !important;
}

.recent-posts-grid .wp-block-post-title a {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--wp--preset--color--primary, #265244) !important;
  text-decoration: none !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* Resumo */
.recent-posts-grid .wp-block-post-excerpt {
  margin: 0 0 0px 0 !important;
  flex: 1 1 auto !important;
}

.recent-posts-grid .wp-block-post-excerpt__excerpt {
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--wp--preset--color--muted-alt, #848484) !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 7 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* ==========================================================================
   6. Rodapé do Card (Botão + Likes)
   ========================================================================== */
.recent-post-card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-top: auto !important;
  padding-top: 8px !important;
  width: 100% !important;
}

.recent-posts-grid .wp-block-read-more {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--wp--preset--color--accent, #438B42) !important;
  text-decoration: none !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.recent-posts-grid .wp-block-read-more::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 12px;
  background-color: var(--wp--preset--color--accent, #438B42);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12' fill='none'%3E%3Cpath d='M8 1L13 6M13 6L8 11M13 6H1' stroke='%23438B42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12' fill='none'%3E%3Cpath d='M8 1L13 6M13 6L8 11M13 6H1' stroke='%23438B42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform 0.2s ease;
}

.recent-posts-grid .wp-block-read-more:hover::after {
  transform: translateX(3px);
}

.recent-post-likes {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  color: var(--wp--preset--color--primary, #265244) !important;
}

/* ==========================================================================
   7. Responsividade
   ========================================================================== */
@media (max-width: 768px) {
  .wp-block-post-template.recent-posts-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ==========================================================================
   Paginação de Posts Recentes
   ========================================================================== */
nav.wp-block-query-pagination {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  width: 100% !important;
  margin-top: 40px !important;
  margin-bottom: 20px !important;
}

/* Números de Página */
.wp-block-query-pagination-numbers {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.wp-block-query-pagination-numbers .page-numbers {
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #438b42 !important;
  text-decoration: none !important;
  line-height: 1 !important;
  padding-bottom: 2px !important;
  transition: opacity 0.2s ease !important;
}

/* Página Ativa: sublinhada com cor primary */
.wp-block-query-pagination-numbers .page-numbers.current {
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 4px !important;
  text-decoration-thickness: 2px !important;
}

/* Hover nos números */
.wp-block-query-pagination-numbers a.page-numbers:hover {
  opacity: 0.7 !important;
}

/* Botões Anterior e Próximo (Flechinhas < e >) */
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0 !important; /* Esconde qualquer texto nativo do WordPress */
  width: 20px !important;
  height: 20px !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

/* Seta Anterior: < */
.wp-block-query-pagination-previous::before {
  content: "" !important;
  display: inline-block !important;
  width: 10px !important;
  height: 14px !important;
  background-color: #438b42 !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14' fill='none'%3E%3Cpath d='M7 1L1 7L7 13' stroke='%23265244' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14' fill='none'%3E%3Cpath d='M7 1L1 7L7 13' stroke='%23265244' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Seta Próximo: > */
.wp-block-query-pagination-next::before {
  content: "" !important;
  display: inline-block !important;
  width: 10px !important;
  height: 14px !important;
  background-color: #438b42 !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14' fill='none'%3E%3Cpath d='M1 1L7 7L1 13' stroke='%23265244' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14' fill='none'%3E%3Cpath d='M1 1L7 7L1 13' stroke='%23265244' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
  opacity: 0.7 !important;
}
