@define-mixin docs-nav-ui-light {
  .docs-nav__content {
    background-color: var(--ld-col-neutral-010);
    box-shadow: var(--ld-sp-1) 0 0 0 var(--ld-col-neutral-100);
  }
  .docs-nav::before {
    background-color: var(--ld-col-neutral-010);
  }
  .docs-nav__section {
    border-bottom-color: var(--ld-col-neutral-100);
  }
  .docs-nav__li {
    color: var(--ld-col-neutral-600);

    a:hover,
    &.docs-nav__li--active {
      color: var(--ld-col-neutral-900);
    }
  }
  .docs-nav__summary--introduction,
  .docs-nav__summary--introduction + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-introduction-dark.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-rb);
    }
  }
  .docs-nav__summary--guides,
  .docs-nav__summary--guides + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-guides-dark.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-vc-200);
    }
  }
  .docs-nav__summary--globals,
  .docs-nav__summary--globals + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-globals-dark.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-rp);
    }
  }
  .docs-nav__summary--components,
  .docs-nav__summary--components + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-components-dark.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-rg);
    }
  }
  .docs-nav__summary--data-visualization,
  .docs-nav__summary--data-visualization + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-data-visualization-dark.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-vm);
    }
  }
  .docs-nav__li--active .docs-nav__summary--introduction {
    color: var(--ld-col-rb);
  }
  .docs-nav__li--active .docs-nav__summary--guides {
    color: var(--ld-col-vc);
  }
  .docs-nav__li--active .docs-nav__summary--globals {
    color: var(--ld-col-rp);
  }
  .docs-nav__li--active .docs-nav__summary--components {
    color: var(--ld-col-rg);
  }
  .docs-nav__li--active .docs-nav__summary--data-visualization {
    color: var(--ld-col-vm);
  }
}
@define-mixin docs-nav-ui-dark {
  .docs-nav__content {
    background-color: var(--ld-col-neutral-900);
    box-shadow: none;
  }
  .docs-nav::before {
    background-color: var(--ld-col-neutral-900);
  }
  .docs-nav__section {
    border-bottom-color: var(--ld-col-neutral-800);
  }
  .docs-nav__li {
    color: var(--ld-col-neutral-200);

    a:hover,
    &.docs-nav__li--active {
      color: var(--ld-col-wht);
    }
  }
  .docs-nav__summary--introduction,
  .docs-nav__summary--introduction + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-introduction-light.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-rb);
    }
  }
  .docs-nav__summary--guides,
  .docs-nav__summary--guides + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-guides-light.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-vc);
    }
  }
  .docs-nav__summary--globals,
  .docs-nav__summary--globals + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-globals-light.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-rp);
    }
  }
  .docs-nav__summary--components,
  .docs-nav__summary--components + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-components-light.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-rg);
    }
  }
  .docs-nav__summary--data-visualization,
  .docs-nav__summary--data-visualization + ul .docs-nav__summary {
    .docs-nav__arrow {
      background-image: url('dist/build/assets/chevron-data-visualization-light.svg');
    }
    .docs-nav__summary-toggle {
      background-color: var(--ld-col-vm);
    }
  }
  .docs-nav__li--active .docs-nav__summary--introduction {
    color: var(--ld-col-rb-400);
  }
  .docs-nav__li--active .docs-nav__summary--guides {
    color: var(--ld-col-vc-400);
  }
  .docs-nav__li--active .docs-nav__summary--globals {
    color: var(--ld-col-rp-400);
  }
  .docs-nav__li--active .docs-nav__summary--components {
    color: var(--ld-col-rg-400);
  }
  .docs-nav__li--active .docs-nav__summary--data-visualization {
    color: var(--ld-col-vm-400);
  }
}

@mixin docs-nav-ui-light;

@media (prefers-color-scheme: dark) {
  @mixin docs-nav-ui-dark;
}
.docs-ui-dark {
  @mixin docs-nav-ui-dark;
}
.docs-ui-light {
  @mixin docs-nav-ui-light;
}

.docs-nav {
  font: var(--ld-typo-body-s);
  overscroll-behavior: contain;
  overflow: hidden auto;
  z-index: 2;
  flex-shrink: 0;
  pointer-events: none;

  &::before {
    content: '';
    position: fixed;
    height: 100%;
    left: 0;
    z-index: -1;
    display: block;
    width: calc(50vw - var(--docs-max-width) / 2 + 2rem);
  }

  ul {
    pointer-events: all;
    list-style: none;
  }

  details[open] > summary .docs-nav__arrow {
    transform: rotate(90deg);
  }

  .docs-switch-dark-light {
    margin-bottom: var(--ld-sp-32);
    display: block;
  }
}

.docs-nav__content {
  pointer-events: all;
  bottom: 0;
  overflow: hidden scroll;
  overscroll-behavior: contain;
  padding: var(--ld-sp-24) var(--ld-sp-24) var(--ld-sp-24) var(--ld-sp-32);
  position: fixed;
  top: 3.125rem;
  width: var(--docs-nav-width);

  @media (width <= 52rem) {
    position: fixed;
    top: 0;
  }
}

.docs-nav__section {
  padding: var(--ld-sp-24) var(--ld-sp-8) var(--ld-sp-24) 0;
  border-bottom-style: solid;
  border-bottom-width: var(--ld-sp-1);

  &:first-of-type {
    padding-top: 0;
  }

  &:last-of-type {
    padding-bottom: 0;
    border-bottom: 0;
  }
}
.docs-nav__nav > ul > li:first-of-type {
  margin-top: 0;
}

.docs-nav__summary {
  cursor: pointer;
  display: inline-block;
  font: var(--ld-typo-label-s);
  font-weight: 700;
  margin: var(--ld-sp-24) 0 var(--ld-sp-6);
  outline: none;
  position: relative;
  text-transform: uppercase;
  user-select: none;
  width: 100%;
  pointer-events: none;

  &::marker,
  &::-webkit-details-marker {
    display: none;
  }

  a {
    padding-left: var(--ld-sp-40);
    pointer-events: all;

    &::before {
      position: absolute;
      width: var(--ld-sp-24);
      height: var(--ld-sp-24);
      transform: translate(-170%, -20%);
      outline: none;
      opacity: 0.5;
    }

    &:hover::before,
    .docs-nav__li--active &::before {
      opacity: 1;
    }
  }

  li ul & {
    font-weight: inherit;
    margin-top: 0;
    text-transform: none;

    + ul {
      margin-left: var(--ld-sp-12);
    }
  }

  li ul li.docs-nav__li--active > details > & {
    font-weight: 700;
  }
}

.docs-nav__arrow {
  position: absolute;
  right: 0;
  top: calc(-1 * var(--ld-sp-1));
  background-repeat: no-repeat;
  background-position: center;
  width: 0.8rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.docs-nav__summary-toggle {
  position: absolute;
  right: 0;
  top: calc(-1 * var(--ld-sp-1));
  width: var(--ld-sp-24);
  height: var(--ld-sp-24);
  pointer-events: all;
  transform: translate(25%, -20%);
  outline: none;
  opacity: 0;
  border-radius: var(--ld-br-m);

  &:hover {
    opacity: 0.5;
  }
}

body:not(.safari) {
  .docs-nav__summary:focus:focus-visible {
    outline: auto;
    outline: auto 5px -webkit-focus-ring-color; /* stylelint-disable-line declaration-block-no-duplicate-properties */
  }
}

.docs-nav__summary--introduction a::before {
  background-image: url('dist/build/assets/introduction.svg');
  content: '';
}

.docs-nav__summary--guides a::before {
  background-image: url('dist/build/assets/guides.svg');
  content: '';
}

.docs-nav__summary--components a::before {
  background-image: url('dist/build/assets/components.svg');
  content: '';
}

.docs-nav__summary--data-visualization a::before {
  background-image: url('dist/build/assets/data-visualization.svg');
  content: '';
}

.docs-nav__summary--globals a::before {
  background-image: url('dist/build/assets/globals.svg');
  content: '';
}

.docs-nav__li {
  margin-top: var(--ld-sp-12);

  ul {
    padding-left: var(--ld-sp-40);
  }

  > a {
    display: block;
  }

  .docs-nav__li ul,
  .docs-nav__li .docs-nav__summary a {
    padding: 0;
  }
}

.docs-nav__li--active > a {
  font-weight: 700;
}

.docs-nav__contact-links,
.docs-nav__legal-links {
  display: flex;

  a {
    opacity: 0.8;

    @media (hover: hover) {
      &:hover {
        opacity: 1;
      }
    }
  }
}

.docs-nav__contact-links {
  flex-wrap: wrap;
  margin-top: var(--ld-sp-12);

  a {
    margin-right: var(--ld-sp-24);
  }
}

.docs-nav__legal-links {
  flex-direction: column;

  a:not(:first-of-type) {
    margin-top: var(--ld-sp-12);
  }
}

.docs-nav__dimmed {
  opacity: 0.8;
}
