//
// Left side navigation
//
.td-sidebar-nav {
    padding-right: 0.5rem;
    margin-right: -15px;
    margin-left: -15px;

    @include media-breakpoint-up(md) {
        @supports (position: sticky) {
            max-height: calc(100vh - 10rem);
            overflow-y: auto;
        }
    }

    &::-webkit-scrollbar {
    width: 8px;
    }
     
    &::-webkit-scrollbar-track {
        border-radius: 6px;
        @include themed() {
            background-color: t($theme-td-sidebar-scroll-color);
        }
    }
     
    &::-webkit-scrollbar-thumb {
        border-radius: 10px;
        -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.5); 
    }


    @include media-breakpoint-up(md) {
        display: block !important;
    }


    &__section {
        li {
            list-style: none;
        }

        ul {
            padding: 0;
            margin: 0;
        }

        @include media-breakpoint-up(md) {
            & > ul {
                padding-left: .5rem;
            }
        }


        padding-left: 0;
    }

    &__section-title {
        display: block;
        font-weight: $font-weight-medium;

        .active {
            font-weight: $font-weight-bold;
        }

        a {
          @include themed() {
            color: t($theme-td-sidebar-text-color);
          }
        }
    }

    .td-sidebar-link {
        display: block;
        padding-bottom: 0.375rem;

        &__page {
            @include themed() {
              color: t($theme-td-sidebar-link-color);
            }
            font-weight: $font-weight-light;

            &.active {
                @include themed() {
                  border-left: 3px solid t($theme-td-toc-border-color);
                }
                padding: 0 0 0 0.5rem;
                margin-bottom: 0.5 * $spacer;
                line-height: 1.2;
                font-weight: $font-weight-bold;
            }
        }
    }

    a {
        &:hover {
            @include themed() {
              color: t($theme-td-sidebar-hover-color);
            }
            text-decoration: none;
        }

        &.active {
            font-weight: $font-weight-bold;
        }
    }

    .dropdown {
        a {
            color: $gray-700;
        }

        .nav-link {
             padding: 0 0 1rem;
        }
    }
}

.td-sidebar {
    @include media-breakpoint-up(md) {
        padding-top: 4rem;
        padding-right: 1rem;

      @include themed() {
        background-color: t($theme-td-sidebar-bg-color);
        border-right: 1px solid t($theme-td-sidebar-border-color);
      }
    }


    padding-bottom: 1rem;

    &__toggle {
        line-height: 1;
        color: $gray-900;
        margin: 1rem;
    }

    &__search {
        padding: 1rem 15px;
        margin-right: -15px;
        margin-left: -15px;
    }

    &__inner {
        order: 0;

        @include media-breakpoint-up(md) {
            @supports (position: sticky) {
                position: sticky;
                top: 4rem;
                z-index: 10;
                height: calc(100vh - 6rem);
            }
        }


        @include media-breakpoint-up(xl) {
            flex: 0 1 320px;
        }


        .td-search-box {
            width: 100%;
        }
    }
}