/**
 * Listing results pagination.
 *
 * Deliberately its own stylesheet rather than part of style.css: that file is
 * the compiled output of assets/css/style.scss and hand edits to it are lost
 * on the next build.
 *
 * Every control -- numbers included -- wears the slider arrow's chrome
 * (.services-prev / .services-next in modules/_services.scss): a 49px square,
 * white on a 1px #103255 border, filling with navy on hover.
 */

.listing-pager {
  width: 100%;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 51px;
}

@media (max-width: 767.98px) {
  .pager {
    gap: 10px;
    margin-top: 32px;
  }
}

@media (max-width: 575.98px) {
  .pager {
    gap: 6px;
  }
}

.pager-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 49px;
  height: 49px;
  padding: 0;
  box-sizing: border-box;
  background-color: #ffffff;
  border: 1px solid #103255;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  color: #103255;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
}

@media (max-width: 767.98px) {
  .pager-link {
    width: 39px;
    height: 39px;
    font-size: 15px;
  }
}

@media (max-width: 575.98px) {
  .pager-link {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
}

.pager-link:hover {
  background-color: #103255;
  color: #ffffff;
}

.pager-link.is-active {
  background-color: #103255;
  color: #ffffff;
  cursor: default;
  pointer-events: none;
}

/* Prev/Next are rendered as spans at the ends so the control keeps its shape
   on the first and last page. */
.pager-link.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* The icon font ships its own colour on :before, which would keep the arrow
   navy on the filled hover state. */
.pager-link i {
  font-size: 19px;
  line-height: 1;
  color: inherit;
}

.pager-link i:before {
  font-size: 19px;
  color: inherit;
}

@media (max-width: 767.98px) {
  .pager-link i,
  .pager-link i:before {
    font-size: 15px;
  }
}

@media (max-width: 575.98px) {
  .pager-link i,
  .pager-link i:before {
    font-size: 13px;
  }
}

.pager-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 49px;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  color: #103255;
  user-select: none;
}

@media (max-width: 767.98px) {
  .pager-gap {
    height: 39px;
    min-width: 10px;
    font-size: 15px;
  }
}

@media (max-width: 575.98px) {
  .pager-gap {
    height: 34px;
    min-width: 6px;
    font-size: 14px;
  }
}

/* Map view pages the cards in the left-hand column, so the pager lines up with
   that column instead of running under the map as well. */
.listing.is-map .listing-pager .pager {
  flex: 0 0 49%;
  max-width: 49%;
  justify-content: flex-start;
  margin-top: 40px;
}

@media (max-width: 991.98px) {
  .listing.is-map .listing-pager .pager {
    flex: 0 0 100%;
    max-width: 100%;
    justify-content: center;
  }
}

/* While a page is loading the grid fades rather than jumping to empty. */
.ajax-list.is-loading .listing-grid {
  opacity: 0.45;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.ajax-list.is-loading .pager {
  pointer-events: none;
}
