// from index.scss
// $column: 85px;
// $gutter: 20px;

.ma__sticky-nav {

  @include clearfix;
  position: relative;
  transition: top .3s;
  width: 100%;
  z-index: $z-sticky-content;

  &:before {
    content: "true"; // hook for JS to do the mobile sticky
    display: none;

    @media ($bp-medium-min) {
      content: "false"; // hook for JS to do the mobile sticky
    }
  }

  @media ($bp-medium-max) {
    background-color: $c-gray-lightest;
    border: 1px solid $c-gray-light;
    left: 0;
  }

  .page-content & {

    @media ($bp-medium-min) {
      margin-bottom: 0;
      padding-right: $gutter * 2;
      position: absolute;
        top: 0;
      width: 160px;

      .main-content--two & {
        margin-left: -160px;
      }
    }

    @media ($bp-x-large-min) {
      width: $column-with-gutter * 2;

      .main-content--two & {
        margin-left: -$column-with-gutter * 2;
      }
    }
  }

  @media print {
    display: none;
  }

  &[data-sticky='middle'] {
    position: fixed;
      top: 40px;

    .translated-rtl &,
    .translated-ltr & {
      top: 80px;
    }

    @media ($bp-medium-min) {
      top: 15px;

      .translated-rtl &,
      .translated-ltr & {
        top: 55px;
      }
    }
  }

  &[data-sticky='bottom'] {
    position: absolute;
      top: auto; // height of one line of text
      bottom: -30px; // compensate for bottom margin

    @media ($bp-medium-min) {
      top: auto;
      bottom: -15px;
    }
  }


  &__link {
    cursor: pointer;
    display: none;
    font-size: 20px;
    line-height: 1.2;
    padding: 10px 15px;
    min-height: 47px;

    @media ($bp-small-min) {
      line-height: 1.5;
    }

    @media ($bp-medium-min) {
      display: block;
      padding: 0;
      padding-bottom: 12px;
    }

    &.is-title {

      a {
        color: $c-gray-dark !important;

        &:focus {
          border-bottom-width: 0;
        }
      }

      &:hover a {
        border-bottom-color: transparent;
      }

      @media ($bp-medium-min) {
        display: none;
        
        &.is-active {
          display: none;
        }
      }
    }

    &.is-active {
      display: block;

      a {
        color: $c-font-base;
        font-weight: 700;
      }

      &:hover a {
        color: $c-font-base;
        border-bottom-color: transparent;
      }

      @media ($bp-medium-min) {
        cursor: default;
      }
    }

    &:hover a {
      border-bottom-color: rgba($c-font-link,.5);
    }

    a {

      @include ma-link-underline;
      font-weight: 500;
    }
  }

  
    &__link + &__link {
    border-top-color: $c-gray-light;

    &.is-open {
      border-top-color: $c-gray-light;
    }

    &.is-top {

      @media ($bp-medium-min) {
        border-top-width: 0;
      }
    }

    @media ($bp-medium-min) {
      border-top-width: 1px;
      border-top-style: solid;
      padding-top: 12px;
    }
  }

  &.is-open &__link {
    display: block;
  }

  &.is-open &__link + &__link {
    border-top-width: 1px;
    border-top-style: solid;
  }

  &__toggle-link {

    @include ma-button-reset;
    color: $c-primary-alt;
    font-size: 3rem;
    line-height: .65em;
    overflow: hidden;
    position: absolute;
    right: 10px;
    top: 9px;
    transition: all .2s ease;
    transform-origin: center center;

    .is-open & {
      transform: rotate(135deg);
    }

    @media ($bp-medium-min) {
      display: none;
    }
  }
}
