.articles-page {
  padding: 2rem 0;
}

.articles-title {
  text-align: center;
}

.articles-page .page-header {
  margin-bottom: 2rem;
}

.articles-page .page-header h1 {
  font-size: 2.5rem;
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.articles-page .posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.articles-page .post-item {
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.articles-page .post-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.articles-page .post-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.articles-page .post-title a {
  color: var(--dark-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.articles-page .post-title a:hover {
  color: var(--primary-color);
}

.articles-page .post-meta {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.articles-page .post-excerpt {
  color: var(--text-color);
  line-height: 1.6;
  height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.articles-page .pagination {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  grid-column: 1 / -1; /* Prend toute la largeur de la grille */
}

.articles-page .pagination a,
.articles-page .pagination span {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  color: var(--dark-color);
  transition: all 0.3s ease;
}

.articles-page .pagination a:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.articles-page .pagination .current {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* --- Ajout : styles extraits de page-articles.php et harmonisation --- */

.articles-wrapper {
  padding-top: 7rem; /* espace pour le header */
  padding-left: 2vw;
  padding-right: 2vw;
  background-color: var(--water-color-alt);
}

.articles-wrapper .posts-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.post-item {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  height: 400px; /* Hauteur fixe pour toutes les cartes */
}

.post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.post-thumb {
  flex-shrink: 0;
  height: 200px; /* Hauteur fixe pour l'image */
  overflow: hidden;
  background-color: #f5f5f5; /* Couleur de fond si pas d'image */
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 200px; /* Hauteur fixe pour le contenu */
}

.post-cats {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  /* Limite la hauteur du titre à 2 lignes */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-title a {
  color: #222;
  text-decoration: none;
}

.post-title a:hover {
  color: #007acc;
}

.post-meta {
  font-size: 0.75rem;
  color: #aaa;
  margin-bottom: 0.5rem;
}

.post-excerpt {
  font-size: 0.9rem;
  color: #444;
  /* Limite l'extrait à 3 lignes */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.pagination {
  display: flex;
  justify-content: center;
  margin: 3rem 0;
  width: 100%;
  grid-column: 1 / -1; /* Prend toute la largeur de la grille */
}

.pagination .page-numbers {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  background: #f0f0f0;
  text-decoration: none;
  color: #333;
  transition: background .2s;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: #007acc;
  color: #fff;
}

@media (max-width: 1024px) {
  .articles-wrapper {
    padding-left: 1vw;
    padding-right: 1vw;
  }
}

@media (max-width: 768px) {
  .articles-wrapper .posts-list {
    grid-template-columns: 1fr;
  }
  .articles-wrapper {
    padding-left: 0.5vw;
    padding-right: 0.5vw;
  }
}