/* @anchor-links */

.anchor-links {
  @media (max-width: $medium-screen) {
    display: none !important;
  }
  background-image: linear-gradient(to left, $blue-ribbon, $regal-blue);
  padding: $base-spacing/2 $base-spacing;
  top: 120px;
  display: block;
  z-index: 300;
  width: 100%;
  position: sticky;

  @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { 
    &.fixed {   
      position: fixed;
    }
 }

  .admin-bar & {
    top: 152px;
  }

  @include themify($themes) {
    background-image: linear-gradient(to right, themed('ctaGradient'), themed('ctaColor'));
  }

  &__inner {
    width: 100%;
    max-width: $container-width;
    margin: 0 auto;
    list-style: none;
    padding: 0;

    li {
      display: inline-block;
      width: 20%;

      &::after {
        content: "";
        position: absolute;
        bottom: 17px;
        width: 100%;
        left: 0;
        height: 1px;
        background-color: white;
        z-index: 1;
      }

      &:first-child {
        &::after {
          width: 50%;
          left: 50%;
        }
      }

      &:last-child {
        &::after {
          width: 50%;
        }
      }

      a {
        color: white;
        padding: 0 $base-spacing;
        text-align: center;
        white-space: nowrap;
        display: block;
        margin: 0 $small-spacing;
        font-weight: 400;
        font-size: 12px;
        position: relative;
        z-index: 10;

        .is-selected & {
          font-weight: 900 !important;
        }

        &:focus,
        &:hover {
          color: white;
        }
      }
    }
  }

  &__label {
    display: block;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  &__dot {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin: 0 8px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid $white;
    position: relative;
    transition: 0.3s;

    .is-selected &, .in-page-link:hover & {
      @include themify($themes) {
        background-color: themed('ctaColor');
      }
    }

    &::before, &::after {
      position: absolute;
      top: 50%;
      left: 50%;
      margin: -18px 0 0 -18px;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      content: '';
      opacity: 0;
      pointer-events: none;
    }

    &::before,
    &::after {
      box-shadow: 0 0 0 2px white;
    }

    .is-selected & {
      &::before {
        animation: anim-pulse-1 4s forwards;
      }

      &::after {
        animation: anim-pulse-2 4s forwards;
      }
    }
  }
}
