/*==========================
=        VARIABLES         =
==========================*/
:root {
  --primary: #4DA68B;
  --primary-light: #6fc0a4;
  --primary-dark: #3a7d6a;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.08);
}

/*==========================
=        GLOBAL           =
==========================*/
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f7f6;
  color: #333;
}

.main-content {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 1rem;
  color: var(--white);
  text-align: center;
}

.articles-title {
  font-size: 2.2rem;
  font-weight: bold;
  letter-spacing: 1px;
}

/*==========================
=        ARTICLES GRID     =
==========================*/
/* Mobile first : une colonne */
.liste-articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  justify-items: center;
}

/* Tablette et desktop : deux colonnes */
@media screen and (min-width: 768px) {
  .liste-articles {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop large : centrer le grid */
@media screen and (min-width: 1024px) {
  .liste-articles {
    max-width: 1000px;
    margin: 0 auto;
  }
}

/* Article */
.article {
  background-color: var(--white);
  border-radius: 1rem;
  box-shadow: 0 4px 20px var(--shadow);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 350px; /* Hauteur uniforme */
  justify-content: space-between; /* Pour pousser le bouton vers le bas */
}

.article:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.article-header h3 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #000; /* Titre en noir */
  margin: 0;
}

.article-image {
  width: 100%;
  max-width: 250px;
  border-radius: 0.5rem;
  align-self: center;
  box-shadow: 0 2px 6px var(--shadow);
}

.article-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  flex-grow: 1; /* Remplit l'espace disponible */
  text-align: justify; /* Justifie le texte */
}

/*==========================
=        PAGINATION       =
==========================*/
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: auto; /* pousse la pagination en bas du conteneur */
  padding: 1rem 0;
}

.pagination a,
.pagination span {
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--white);
  border-radius: 1rem;
  text-decoration: none;
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  user-select: none;
}

.pagination a:hover {
  background-color: var(--white);
  color: var(--primary);
  box-shadow: 0 0 8px rgba(77, 166, 139, 0.6);
}

.pagination .active span {
  background-color: var(--primary-light);
  color: var(--white);
  cursor: default;
  box-shadow: 0 0 10px rgba(77, 166, 139, 0.8);
  border-color: var(--primary-light);
}

.pagination .disabled span {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #a0a0a0;
  color: #a0a0a0;
}

/* Flèches */
.pagination a.prev::before,
.pagination a.next::after {
  content: '';
  border: solid var(--primary);
  border-width: 0 3px 3px 0;
  display: inline-block;
  padding: 3px;
  margin: 0 6px;
  vertical-align: middle;
  transition: border-color 0.3s ease;
}

.pagination a.prev::before {
  transform: rotate(135deg);
}

.pagination a.next::after {
  transform: rotate(-45deg);
}

.pagination a.prev:hover::before,
.pagination a.next:hover::after {
  border-color: var(--white);
}

/* Assure que le conteneur principal pousse la pagination en bas */
.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.articles {
  flex: 1;
}

/*==========================
=        BOUTONS          =
==========================*/
.btn-retour-accueil,
.btn-voirArticle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow);
}

.btn-voirArticle {
  background-color: #2C3E50;
  color: var(--white);
  margin-top: auto; /* Force le bouton en bas */
  align-self: flex-start; /* Aligne à gauche */
}

.btn-retour-accueil {
  background-color: var(--white);
  color: var(--primary);
}

.btn-retour-accueil:hover,
.btn-retour-accueil:focus {
  background-color: var(--primary);
  color: var(--white);
  outline: 1px solid var(--white);
  outline-offset: 2px;
}

.btn-voirArticle:hover,
.btn-voirArticle:focus {
  background-color: var(--white);
  color: var(--primary);
  outline: 1px solid var(--primary);
  outline-offset: 2px;
}

/*==========================
=      RESPONSIVE         =
==========================*/
@media screen and (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
  .articles-title {
    font-size: 1.8rem;
  }
}

@media screen and (min-width: 1024px) {
  .main-content {
    padding: 3rem;
  }
  .articles-title {
    font-size: 3rem;
  }
  .article-header h3 {
    font-size: 2rem;
  }
@media screen and (min-width: 1024px) {
  .liste-articles {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px; /* On peut ajuster pour que ça remplisse mieux */
    margin: 0 auto;
  }

  .article {
    max-width: none; /* Permet à chaque article de s'étendre dans sa colonne */
    width: 100%;
  }
}

}
