// Copyright (C) 2018 The Trustees of Indiana University
// SPDX-License-Identifier: BSD-3-Clause

@use '../core' as *;
@use 'sass:map';
@use 'sass:math';

.#{$prefix}-pagination {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;

  &__item {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-top: 0;
    min-width: $spacing-lg;
    height: $spacing-xl;
    width: $spacing-xl;

    svg {
      width: 1rem;
      height: 1rem;
      flex-shrink: 0;
    }

    > *:not(a) {
      color: $color-black-200;
    }

    > * {
      align-items: center;
      display: inline-flex;
      justify-content: center;
    }

    a {
      color: $color-black-500;
      flex-grow: 1;
      height: 100%;
      text-decoration: none;
      z-index: map.get($z-index, '100');
    }

    a:hover {
      background-color: $color-blue-000;
      color: $color-blue-500;
      box-shadow: 0 $spacing-xxs 0 $color-blue-500;
    }

    a:focus,
    a[aria-current='page']:focus {
      border-radius: inherit;
      outline: solid math.div($spacing-xxs, 2) $color-blue-400;
      outline-offset: math.div($spacing-xxs, 2);
      z-index: map.get($z-index, '1000');
    }

    a[aria-current='page'] {
      background-color: $color-orange-000;
      box-shadow: 0 $spacing-xxs 0 $color-crimson-500;
    }
  }
}
