body.page-template-blog,
body.blog,
body.archive {
  background-color: #FFFFFF;
  padding-top: 68px;
}

body.page-template-blog .mg-navbar,
body.blog .mg-navbar,
body.archive .mg-navbar,
body.single .mg-navbar {
  box-shadow: none;
}

@media (max-width: 1049px) {
  body.page-template-blog,
  body.blog,
  body.archive {
    /* Navbar mobile = 60px (navbar.css @media max-width:1049px) */
    padding-top: 60px;
  }
}

@media (max-width: 430px) {
  body.page-template-blog,
  body.blog,
  body.archive {
    /* Navbar volta a 68px nessa faixa (navbar.css @media max-width:430px) */
    padding-top: 68px;
  }
}

.blog-section {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  color: #0D0D0D;
}

.blog-filters {
  background-color: #131313;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(20px, calc(50vw - 620px));
  padding-right: max(20px, calc(50vw - 620px));
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  justify-content: space-between;
}

@media (min-width: 992px) {
  .blog-filters {
    height: 77px;
    padding-top: 0;
    padding-bottom: 0;
    flex-direction: row;
    align-items: center;
  }
}

.filters-top-row {
  display: contents;
}

@media (max-width: 991px) {
  .filters-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }
  .filters-top-row .category-filter {
    flex: 0 0 auto;
    width: auto;
  }
  .filters-top-row .filter-button {
    width: auto;
    justify-content: flex-start;
  }
}

/* ---------- Botão "Artigos recentes" (mobile-only) ---------- */
.recent-posts-btn {
  display: none;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 10px;
  background-color: var(--color-primary);
  border: none;
  border-radius: 35px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.recent-posts-btn:hover {
  filter: brightness(0.95);
}

.recent-posts-btn.is-active {
  background-color: var(--color-primary-darker);
}

@media (max-width: 991px) {
  .recent-posts-btn {
    display: inline-flex;
  }
}

/* ---------- Campo de busca ---------- */
.search-bar {
  position: relative;
  width: 100%;
}

@media (min-width: 992px) {
  .search-bar {
    flex: 0 0 572px;
    width: 572px;
    max-width: 572px;
  }
}

.search-bar input {
  width: 100%;
  height: 45px;
  padding: 8px 50px 8px 20px;
  border: none;
  border-radius: 68px;
  background-color: #FFFFFF;
  font-size: 14px;
  line-height: 24px;
  color: #212121;
  font-family: inherit;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23E57C26' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}

.search-bar input::placeholder {
  color: #757575;
}

.search-bar input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

.search-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.search-button img {
  width: 12px;
  height: 12px;
  cursor: pointer;
}

/* ---------- Filtro de categorias (dropdown) ---------- */
.category-filter {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

@media (min-width: 992px) {
  .category-filter {
    width: auto;
  }
}

.filter-button__label--desktop {
  display: inline;
}
.filter-button__label--mobile {
  display: none;
}

@media (max-width: 991px) {
  .filter-button__label--desktop {
    display: none;
  }
  .filter-button__label--mobile {
    display: inline;
  }
}

.filter-button {
  height: 40px;
  padding: 8px 16px;
  font-weight: 500;
  background-color: transparent;
  border: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  line-height: 24px;
  color: #FFFFFF;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  justify-content: space-between;
}

.filter-button::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1,1 5,5 9,1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease;
}

.filter-button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

@media (min-width: 992px) {
  .filter-button {
    width: auto;
    justify-content: flex-start;
  }
}

.categories__dropdown {
  list-style: none;
  margin: 0;
  padding: 12px;
  min-width: 400px;
  max-width: min(90vw, 480px);
  max-height: 60vh;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  background-color: #fff;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.categories__dropdown.is-open {
  display: grid;
}

@media (max-width: 991px) {
  .categories__dropdown {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
}

.categories__dropdown li {
  padding: 8px 16px;
  font-size: 14px;
  line-height: 24px;
  color: #212121;
  cursor: pointer;
  transition: background-color 0.2s;
  list-style: none;
}

.categories__dropdown li::marker {
  color: var(--color-primary-dark);
}

.categories__dropdown li:hover {
  background-color: #F5F5F5;
}

.categories__dropdown li.active {
  background-color: #E3F2FD;
  color: #1976D2;
}

.categories__dropdown li a {
  display: block;
  margin: -8px -16px;
  padding: 8px 16px;
  color: inherit;
  text-decoration: none;
}

.posts-grid {
  padding: 52px 20px 64px;
}

.posts-grid h2 {
  margin: 0 0 41px;
  font-size: 25px;
  font-weight: 600;
  color: #1A1A1A;
  text-transform: uppercase;
}

.posts-grid h2 span {
  color: var(--color-primary-dark);
}

.archive-title {
  margin: 0 0 41px;
  font-size: 25px;
  font-weight: 600;
  color: #1A1A1A;
  text-transform: uppercase;
}

.posts-empty {
  color: #333;
  text-align: center;
  padding: 40px 0;
  font-size: 16px;
}

.posts-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 992px) {
  .posts-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .posts-container {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .post-card-link {
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E3E3E3;
  }

  .post-card-link:first-child {
    padding-top: 0;
  }

  .post-card-link:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .post-card .post-image,
  .post-card .post-image img {
    border-radius: 18px;
  }

  .posts-grid {
    padding-bottom: 24px;
  }

  .page_wrap {
    margin: 16px 0;
  }
}

/* ============================================================
   CARD DE POST (.post-card-link > article.post-card)
   ============================================================ */

.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}


.post-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 21px;
  color: #0D0D0D;
  transition: transform 0.2s ease;
}

.post-card-link:hover .post-card {
  transform: translateY(-2px);
}

.post-card .post-image {
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 400 / 297;
}

.post-card .post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
}

.post-card .post-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 21px;
  flex: 1;
}

.post-card .post-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #0D0D0D;
  line-height: 1.1;
}

.post-card .post-content .category {
  color: var(--color-primary-dark);
  font-weight: 500;
  font-size: 16px;
  margin: 0;
  display: inline-block;
  width: fit-content;
}

.post-card .post-content p {
  margin: 0;
  color: #4A4A4A;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
}

.post-card .post-content .date {
  font-weight: 500;
  color: #0D0D0D;
  font-size: 14px;
  margin: auto 0 0;
}

/* .read-more (não usado no nosso markup hoje — estilo para futuro uso) */
.post-card .post-content .read-more {
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  margin-top: 15px;
}

.page_wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.page_list {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.page_item {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.page_item a,
.page_item span {
  color: #4B4B4B;
  text-decoration: none;
  font-size: 20px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ativo: círculo/pílula 31x29 laranja com número branco 24px */
.page_item.is-current {
  background-color: var(--color-primary-dark);
  width: 31px;
  height: 29px;
  border-radius: 53px;
}

.page_item.is-current span {
  color: #fff;
  font-size: 24px;
  font-weight: 500;
  width: 100%;
  height: 100%;
}

.page_item a:hover {
  text-decoration: underline;
}

.page_item.page_ellipsis span {
  color: #999;
  font-weight: bold;
  font-size: 20px;
}

/* "Próximo" recebe underline conforme Figma; "Anterior" não. */
.page_item.page_next a {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .page_list {
    gap: 16px;
  }

  .page_item a,
  .page_item span {
    font-size: 16px;
  }

  .page_item.is-current span {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .page_list {
    gap: 10px;
  }

  .page_item.page_prev a,
  .page_item.page_next a {
    font-size: 14px;
  }
}

/* ============================================================
   RESPONSIVO — ajustes finos no card
   ============================================================ */

@media (max-width: 768px) {
  .post-card {
    gap: 16px;
  }

  .post-card .post-content {
    gap: 16px;
  }

  .post-card .post-content h3 {
    font-size: 24px;
  }

  .post-card .post-content .category,
  .post-card .post-content p,
  .post-card .post-content .date {
    font-size: 17px;
  }
}

@media (max-width: 480px) {
  .post-card .post-content h3 {
    font-size: 26px;
  }

  .post-card .post-content .category,
  .post-card .post-content p,
  .post-card .post-content .date {
    font-size: 16px;
  }
}
