@mixin list-link{
  @include font-weight($btn-font-weight);
  text-align: left;
  letter-spacing: 1px;
  white-space: normal;
  vertical-align: middle;
  user-select: none;
  background-color: transparent;
  color: $body-copy;//color: $black;
  border: 0;//$btn-border-width solid transparent;
  @include button-size(
    $btn-padding-y,
    $btn-padding-x,
    $font-size-base,
    $btn-line-height,
    0
  );
  @include transition($btn-transition);
  width: 100%;
  display: block;
  text-decoration: none;
  @include hover-focus{
    background-color: $smoke;
    text-decoration: none;
  }

  &:focus-visible{
    box-shadow: inset 0px 0px 0px 2px $primary;
    color: $header-copy;
    outline:0;
  }
}

@mixin header-list-link{
  @include list-link;
  @include text-type(6, $font-weight-medium);
  color: $header-copy;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  &:after{
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: .25rem;
    background-color: $primary;
    transition: all .3s ease-out;
  }
  &:hover{
    background-color: transparent;
    &:after{
      // 48px = $btn-padding-x * 2 | % and rem are not compatible for calc
      width: calc(100% - 24px);
    }
  }
  &:focus{
    background-color: transparent;
    &:after{
      width: calc(100% - 24px);
    }
  }
}

@mixin header-dropdown-link{
  @include list-link;
  @include text-type(6, $font-weight-medium);
}

@mixin sidebar-list-link{
  @include list-link;
  @include text-type(6, $font-weight-medium);
  padding: .5rem .5rem .5rem 1.5rem;
  color: $header-copy;

  &:hover {
    background-color: $smoke;
  }

  &:focus-visible {
    color: $header-copy;
  }
}

@mixin sidebar-child-list-link {
  @include list-link;
  @include text-type(6, $font-weight-medium);
  padding: .5rem .5rem .5rem 2.5rem;
  color: $gray-50;
  text-decoration: none;

  &:hover {
    background-color: $smoke;
    color: $header-copy;
  }

  &:focus-visible {
    color: $header-copy;
  }
}

@mixin panel-list-link{
  @include list-link;
  padding: .75rem 1rem;
}

@mixin panel-child-list-link {
  @include list-link;
  @include text-type(5, $font-weight-medium);
  padding: .75rem 1rem .75rem 2rem;

  &:hover {
    background-color: $smoke;
    color: $header-copy;
  }

  &:focus-visible {
    color: $header-copy;
  }
}

@mixin panel-active-link {
  &.active {
    position: relative;
    background: $light-gray;

    &::slotted(a) {
      color: $header-copy;
    }

    &::slotted(a:focus-visible) {
      &:after {
        display: block;
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 6px;
        height: 100%;
        background-color: $primary;
      }
    }

    &:after {
      display: block;
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background-color: $primary;
    }
  }
}
