/* ============================================================
   Brasil Escolas — Feed de Artigos
   Estilos para /artigos/ (grid, cards, paginação, filtros, busca)
   ============================================================ */

/* ------ Filtros de categoria ------ */
.filtros-categoria {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 24px 16px;
  background: #f5f8ff;
}
.filtros-categoria .chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1.5px solid #003f7f;
  background: #fff;
  color: #003f7f;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.filtros-categoria .chip:hover {
  background: #e6eefc;
}
.filtros-categoria .chip.ativa,
.filtros-categoria .chip[aria-pressed="true"] {
  background: #003f7f;
  color: #fff;
}

/* ------ Info do filtro ativo ------ */
.filtro-info {
  text-align: center;
  color: #4a5568;
  font-size: 15px;
  padding: 8px 16px 0;
  min-height: 1.2em;
}

/* ------ Grid de artigos ------ */
.artigos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 32px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ------ Card individual ------ */
.artigo-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.artigo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.artigo-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, #003f7f 0%, #0066cc 100%);
  display: block;
}
.artigo-card__img[src=""], 
.artigo-card__img:not([src]) {
  background: linear-gradient(135deg, #003f7f 0%, #0066cc 100%);
}
.artigo-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}
.artigo-card__categoria {
  display: inline-block;
  padding: 4px 12px;
  background: #e6f4ff;
  color: #003f7f;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}
.artigo-card__titulo {
  font-size: 18px;
  font-weight: 700;
  color: #003f7f;
  line-height: 1.3;
  margin: 0;
}
.artigo-card__excerpt {
  color: #4a5568;
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.artigo-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #718096;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

/* ------ Loading state ------ */
.artigos-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: #4a5568;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e6eefc;
  border-top-color: #003f7f;
  border-radius: 50%;
  animation: bes-spin .8s linear infinite;
  display: inline-block;
}
@keyframes bes-spin { to { transform: rotate(360deg); } }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ------ Estado vazio ------ */
.artigos-vazio {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #4a5568;
}
.artigos-vazio h3 {
  color: #003f7f;
  margin-bottom: 8px;
}

/* ------ Estado de erro ------ */
.artigos-erro {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #fff5f5;
  border-radius: 12px;
  color: #742a2a;
}
.artigos-erro button {
  margin-top: 16px;
  padding: 10px 24px;
  background: #003f7f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.artigos-erro button:hover {
  background: #002d5c;
}

/* ------ Paginação ------ */
.paginacao {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 60px;
  flex-wrap: wrap;
}
.paginacao-btn {
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid #003f7f;
  color: #003f7f;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.paginacao-btn:hover:not(:disabled) {
  background: #003f7f;
  color: #fff;
}
.paginacao-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.paginacao-numeros {
  display: flex;
  gap: 4px;
}
.paginacao-num {
  min-width: 40px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #4a5568;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.paginacao-num:hover {
  background: #e6eefc;
}
.paginacao-num.ativa,
.paginacao-num[aria-current="page"] {
  background: #003f7f;
  color: #fff;
}

/* ------ Responsivo ------ */
@media (max-width: 640px) {
  .artigos-grid {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 16px;
  }
  .filtros-categoria {
    padding: 16px 12px;
    gap: 6px;
  }
  .filtros-categoria .chip {
    font-size: 13px;
    padding: 6px 14px;
  }
}
