/*
 * Accessible pagination of the GSite core (patterns/kernel/control_a11y.html)
 * Minimal styles: 40px click area, visible focus, contrasts 4.5:1 for texts
 * and 3:1 for borders and icons, current page not shown by color only.
 * Each site can override these rules in its own CSS.
 */

.gs-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gs-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 16px 0;
}

.gs-pagination__total {
  margin: 0;
}

.gs-pagination__liste {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gs-pagination__liste li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gs-pagination__liste li::before {
  content: none;
}

.gs-pagination .gs-pagination__liste a,
.gs-pagination .gs-pagination__liste button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #555555;
  background: #fff;
  color: #555555;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.gs-pagination .gs-pagination__liste a:hover,
.gs-pagination .gs-pagination__liste button:hover {
  text-decoration: underline;
  outline: 1px solid #333333;
}

.gs-pagination .gs-pagination__liste a:focus,
.gs-pagination .gs-pagination__liste button:focus {
  outline: 3px solid #555555;
  outline-offset: 2px;
}

/* current page: filled background and thicker border */
.gs-pagination .gs-pagination__liste .gs-pagination__actif {
  background: #555555;
  color: #fff;
  border-width: 2px;
}

.gs-pagination__ellipse {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 4px;
}

/* chevron drawn in CSS, color of the text */
.gs-pagination__icone {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-style: solid;
  border-color: currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(45deg);
}

.gs-pagination__suiv .gs-pagination__icone {
  transform: rotate(-135deg);
}

@media (forced-colors: active) {
  .gs-pagination .gs-pagination__liste a,
  .gs-pagination .gs-pagination__liste button {
    border-color: LinkText;
  }
  .gs-pagination .gs-pagination__liste .gs-pagination__actif {
    background: Highlight;
    color: HighlightText;
  }
}
