@use "core/functions" as *;
@use "core/mixins" as *;

.pagination {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  white-space: nowrap;
  width: 100%;
  padding: 1rem 0;

  a {
    font-size: 0.8rem;
    color: fi-var(pagination-link-color);
    letter-spacing: 0.1rem;
    font-weight: 700;
    padding: 5px 5px;
    text-decoration: none;
    transition: 0.3s;
  }

  li {
    padding: 5px;
    margin: 0 10px;
    box-sizing: border-box;
    position: relative;
    display: inline;

    &.disabled {
      display: none;
    }

    &:hover a {
      color: fi-var(pagination-link-hover-color);
    }

    &::before,
    &::after {
      position: absolute;
      content: '';
      width: 0;
      height: 3px;
      background: fi-var(pagination-link-hover-color);
      bottom: 0px;
      transition: 0.3s;
    }

    &::before {
      left: 50%;
    }

    &::after {
      right: 50%;
    }

    &:hover {
      &::before,
      &::after {
        width: 50%;
      }
    }

    &.active {
      a {
        color: fi-var(pagination-link-hover-color);
      }

      &::before,
      &::after {
        width: 50%;
      }
    }

    @include media('xs') {
      margin: 0 5px;
    }
  }
}
