.navbar {
  position: relative;
  @include above-mobile {
    position: fixed;
    left: 0;
    top: 0;
  }

  @include theme-background-color;
  z-index: 1;
  height: 100vh;
  display: inline-block;
  min-width: $navWidthMin;
  font-size: 0;

  @include mobile {
    width: 100%;
    left: auto;
    height: auto;
  }

  &:after {
    @include navbar_white_line__pseudo;
    z-index: 1;
    @include above-mobile {
      top: 0;
      bottom: 0;
      right: 0;
      width: 1px;
    }
    @include mobile {
      left: 0;
      right: 0;
      bottom: 0;
      height: 1px;
    }
  }
}

.navbar--logo {
  padding: $gutter 0;
  //width: $navWidthMin;
  text-align: left;

  @include above-mobile {
    z-index: 1;
  }

  @include above-mobile {
    position: relative;
    &:after {
      @include navbar_white_line__pseudo;
      right: 0;
      left: 0;
      bottom: 0px;
      height: 1px;
    }
  }
}

.navbar--container {
  height: 100vh;
  display: flex;
  flex-direction: column;

  .navbar--logo {
    flex: 0 0 auto;
    align-self: auto;
  }

  .navbar--inner {
    flex: 1 1 auto;
    align-self: auto;
    overflow: auto;
  }
  //@include theme-background-color;
}

.navbar--container {
  @include font-xs;

  @include mobile {
    height: auto;
  }
}

.navbar--inner {
  overflow: auto;
  width: $navWidthMax;
  @include above-desktop {
    width: $navWidthMax + 100px;
  }

  @include mobile {
    width: auto;
  }

  padding-right: $gutter;
  max-width: 100vw;
  padding-top: $gutter;
  padding-bottom: $gutter;
}

@include mobile {
  .logo-title {
    display: inline-block;
  }
}

@include max-width($navWidthMax) {
  .logo-title {
    display: none;
  }
}
@include tablet {
  .navbar--inner {
    display: none;
  }
  .navbar.is-active {
    .navbar--inner {
      display: block;
    }
    .logo-title {
      display: inline-block;
    }
  }
}

@include above-mobile {
  .footer,
  .site-content {
    padding-left: $navWidthMin;
  }
  .site-content {
    width: $navWidthMin + $site-maxWidth;
    @media (max-width: $navWidthMin + $site-maxWidth) {
      width: 100%;
    }
  }
  .navbar.is-active ~ .footer,
  .navbar.is-active ~ .site-content {
    padding-left: $navWidthMax;
    width: $navWidthMax + $site-maxWidth;
    @media (max-width: $navWidthMax + $site-maxWidth) {
      width: 100%;
    }
  }
}

@include above-tablet {
  .footer,
  .site-content {
    padding-left: $navWidthMax;
    @include above-desktop {
      padding-left: $navWidthMax + 100px;
    }
  }
  .navbar--toggle {
    display: none;
  }
  // Avoid focus for checkbox when toggeling of the menu is not needed

  .logo-title {
    display: inline-block;
  }
}

.navbar--toggle {
  cursor: pointer;
  position: absolute;
  right: 0;
  top: $logo_height + 2 * $gutter;
  bottom: 0px;
  width: $navWidthMin;

  @include mobile {
    height: 40px;
    bottom: auto;
    left: auto;
    right: 10px;
    top: 30px;
  }
  &:focus {
    outline: none;
    .navbar--toggle--inner {
      @include btn-focus-style;
    }
  }
}

.navbar--toggle--inner {
  z-index: 1;
  padding: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  @media screen and (-ms-high-contrast: active) {
    background-color: ButtonFace;
  }

  &:hover {
    .navbar--toggle--line {
      background-color: var(--theme-color-dark);

      @media screen and (-ms-high-contrast: active) {
        background-color: ButtonText;
      }
    }
  }
}

.navbar--toggle--line {
  display: block;
  width: 30px;
  height: 4px;
  position: relative;
  background-color: $c-black;
  border-radius: 3px;
  z-index: 1;
  transform-origin: 50% 50%;
  transition: transform 0.3s cubic-bezier(0.77, 0.2, 0.05, 1),
    background-color 0.3s cubic-bezier(0.77, 0.2, 0.05, 1), opacity 0.35s ease;

  &:nth-last-child(2) {
    margin: 6px 0;
  }

  @media (-ms-high-contrast: active) {
    background-color: ButtonText;
  }

  .navbar.is-active .navbar--toggle & {
    opacity: 1;
    transform: translateY(10px) rotate(45deg);

    &:nth-last-child(2) {
      opacity: 0;
      transform: rotate(0deg) scale(0.2, 0.2);
    }

    &:nth-last-child(1) {
      transform: translateY(-10px) rotate(-45deg);
    }
  }
}
