/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

$border-width: 2px;
$firstTitlePadding: 0.25rem;

demo-sidebar {
  position: fixed;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 1rem;
  padding-bottom: 1rem;
  right: 0;

  strong {
    padding-left: calc($border-width + $firstTitlePadding);
  }

  nav {
    ul {
      padding-left: 0;
    }

    > a {
      padding-left: $firstTitlePadding;
    }

    @mixin aPadding($level) {
      li {
        a {
          padding-left: calc($level * 0.75rem);
        }

        @if ($level < 10) {
          @include aPadding($level + 1);
        }
      }
    }
    @include aPadding(1);

    a {
      font-size: 0.875rem;
      color: var(--bs-secondary);
      text-decoration: none;
      border-left: $border-width solid transparent;
      display: block;
      margin-top: 3px;
      margin-bottom: 3px;

      &:hover {
        text-decoration: underline;
      }

      &.active {
        color: var(--bs-primary);
        border-left-color: var(--bs-primary);
      }
    }

    ul, li {
      list-style: none;
    }
  }
}
