/* pagination.css : Styles de structure et d'apparence communs */

/* ------------------------------------------- */
/* 1. CONTENEUR PRINCIPAL DE PAGINATION */
/* ------------------------------------------- */
.pagination-control {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1rem auto;
  padding: 5px 0;
  gap: var(--space-sm);
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}


/* ------------------------------------------- */
/* 2. BOUTONS PRÉCÉDENT / SUIVANT */
/* ------------------------------------------- */

/* --- Mode Clair (Par défaut) --- */
.page-btn.pag-prev,
.page-btn.pag-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 calc(12 / 16 * 1rem);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-pagination-btn);
  height: calc(32 / 16 * 1rem);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 1px solid #222222; /* Ajuste l'intensité de la bordure ici */
  background-color: #f5f5f5;
  color: #333333;
}

.page-btn.pag-prev:hover,
.page-btn.pag-next:hover {
  background-color: #e2e2e2;
  border-color: #000000;
}

/* --- Mode Sombre --- */
html[data-theme="dark"] .page-btn.pag-prev,
html[data-theme="dark"] .page-btn.pag-next {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .page-btn.pag-prev:hover,
html[data-theme="dark"] .page-btn.pag-next:hover {
  background-color: #3a3a3a;
  border-color: rgba(255, 255, 255, 0.5);
}


/* ------------------------------------------- */
/* 3. ICÔNES TRIANGLES (Précédent / Suivant) */
/* ------------------------------------------- */
.pag-prev::before {
  content: "◀";
  margin-right: 0.4rem;
  font-size: 0.8em;
  vertical-align: middle;
}

.pag-next::after {
  content: "▶";
  margin-left: 0.4rem;
  font-size: 0.8em;
  vertical-align: middle;
}


/* ------------------------------------------- */
/* 4. COMPTEUR CENTRAL (Rondelle / Numéro Actif) */
/* ------------------------------------------- */

/* --- Structure du groupe --- */
.page-num-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
}

/* --- Mode Clair (Par défaut) --- */
.page-btn.page-num {
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: var(--fw-bold);
  font-size: var(--font-size-pagination-num);
  width: calc(32 / 16 * 1rem);
  height: calc(32 / 16 * 1rem);
  margin: 0;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background-color: #f5f5f5;
  color: #333333;
}

.page-btn.page-num.active {
  cursor: default;
  background-color: #333333;
  color: #ffffff;
  border: 2px solid #000000;
}

/* --- Mode Sombre --- */
html[data-theme="dark"] .page-btn.page-num {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .page-btn.page-num.active {
  background-color: #d1d1d1;
  color: #000000;
  border: 2px solid #ffffff;
}


/* ------------------------------------------- */
/* 5. ÉTATS DÉSACTIVÉS & ÉLÉMENTS ANNEXES */
/* ------------------------------------------- */

/* --- Mode Clair (Par défaut) --- */
.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(100%);
}

.pagination-ellipsis {
  padding: 0 0.2rem;
  font-weight: bold;
}

/* --- Mode Sombre --- */
html[data-theme="dark"] .page-btn.disabled {
  opacity: 0.3;
}


/* ------------------------------------------- */
/* 6. MEDIA QUERIES (Écrans étroits) */
/* ------------------------------------------- */
@media (max-width: calc(620 / 16 * 1rem)) {
  .pagination-control {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    margin: 0.8rem auto;
  }
}