@import (reference) '../../styles';

@panel-width: 400px;

navigation-panel {
  display: block;

  .nav-panel {
    left: 10px;
    right: 0;
    top: @input-height-small + @grid-gutter-width/2;
    bottom: 0;
    height: 90vh;
    position: absolute;
    overflow-y: scroll;
    padding: @grid-gutter-width/4;
    background-color: #eaf6fd;
    list-style: none;

    .page-item {
      display: block;
      position: relative;
      font-size: @font-size-base;
    }

    button {
      cursor: pointer;
      height: 40px;
      display: block;
      width: 100%;
      text-align: left;
      white-space: nowrap;
      background: transparent;
      border: 2px solid transparent;
      padding: 0;
      color: black;
      &:hover {
        text-decoration: underline;
        border-color: black;
      }
    }

    .icon {
      font-size: @font-size-large;
      color: @gray-light;

      &::before {
        z-index: 5;
        position: relative;
        background: #eaf6fd;
      }

      &::after {
        content: "";
        height: 100%;
        border-left: 2px solid #C3CCD0; /* @gray-light at 0.33 opacity */
        width: 0px;
        position: absolute;
        bottom: 50%;
        left: 13px;
      }
    }

    .page-item:first-of-type .icon::after {
      content: none;
    }

    .pruned-branch::before {
      content: "";
      display: inline-block;
      border-left: 2px dotted #C3CCD0; /* @gray-light at 0.33 opacity */
      border-bottom: 2px dotted #C3CCD0; /* @gray-light at 0.33 opacity */
      border-bottom-left-radius: 500px;
      width: 1.2em;
      height: 1.2em;
      margin-left: 0.1em;
      margin-right: 0.5em;
      transform: translate(50%, -0.2em);
    }
    .pruned-branch::after {
      bottom: 0px;
    }
    .pruned-info {
      color: @gray;
      font-weight: normal;
    }
  }

  .active-nav-page-item {
    font-weight: bolder;

    .icon {
      color: @gray-base;
    }
  }

  .future-page-item {
    color: @gray;
    font-style: italic;
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;

    .icon::after {
      border-left-style: dotted;
    }
  }

  .nav-page-item {
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
  }

  .nav-header {
    position: absolute;
    left: 101px;
    font-weight: 300;
    font-size: 22px;
    font-style: inherit;
    background: none;
    border: none;
    cursor: auto;

    &:hover::after,
    &:focus::after {
      content: attr(aria-label);
      width: 130%;
      border-radius: 12px;
      border: 1px solid #cccccc;
      background: white;
      padding: 15px;
      position: absolute;
      top: ~"calc(100% + 10px)";
      left: -15%;
      box-sizing: border-box;
      z-index: 98;
      font-size: @font-size-small;
      text-align: left;
      pointer-events: none;
    }
    &:hover::before,
    &:focus::before {
      content: "";
      width: 20px;
      height: 20px;
      z-index: 99;
      position: absolute;
      left: 50%;
      top: 100%;
      transform: translateX(-50%) rotateZ(-45deg);
      border-top: 1px solid #cccccc;
      border-right: 1px solid #cccccc;
      background: white;
    }
  }

  .mobile-close {
    display: none;
  }

  .mobile-toggle  {
    position: absolute;
    z-index: 999;
    top: 20px;
    right: 20px;
    display: inline-block;
  }
  .mobile-open {
    position: absolute;
    top: 0;
    left: 0px;
    right: 0px;
    bottom: 0;
    background: white;
    z-index: 99;
    padding-right: 10px;
    .nav-panel {
      right: 10px;
    }
  }
}
