/* Article sidebar (templates/components/docs-nav): an Overview link, then
 * sections with small-caps headings over items with line icons. The active
 * item takes the accent colour with a bar on the left edge; groups open with a
 * chevron. The shell (docs.css) places #docs-sidebar-root; this styles inside
 * it. */

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 8px 14px 24px;
  font-family: var(--d-font);
}

.docs-nav__heading {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 18px;
  text-transform: uppercase;
  color: var(--d-fg);
}

.docs-nav__list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-nav__list--nested {
  margin: 2px 0 4px 21px;
  padding-left: 10px;
  border-left: 1px solid var(--d-line);
}

.docs-nav__item {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--d-radius-sm);
  font-size: 14px;
  line-height: 20px;
  color: var(--d-fg-2);
  text-decoration: none;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.docs-nav__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-nav__list--nested .docs-nav__item {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13.5px;
  color: var(--d-muted);
}

.docs-nav__icon {
  flex: none;
  color: var(--d-muted);
  transition: color 0.12s ease;
}

.docs-nav__item:hover {
  background: var(--d-hover);
  color: var(--d-fg);
}

.docs-nav__item:focus-visible {
  outline: 2px solid var(--d-focus);
  outline-offset: -2px;
}

.docs-nav__item.docs-nav__item--active,
.docs-nav__item.docs-nav__item--active .docs-nav__icon {
  color: var(--d-accent);
}

.docs-nav__item.docs-nav__item--active {
  font-weight: 500;
}

/* The bar sits on the sidebar's left edge, outside the item. */
.docs-nav__list:not(.docs-nav__list--nested) > li > .docs-nav__item--active::before,
.docs-nav__group > summary > .docs-nav__item.docs-nav__item--active::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: -14px;
  width: 2px;
  border-radius: 2px;
  background: var(--d-accent);
}

.docs-nav__list--nested .docs-nav__item--active {
  background: var(--d-accent-soft);
}

.docs-nav__overview {
  flex: none;
}

/* Groups: the summary holds the link and a chevron that opens it. */
.docs-nav__group > summary {
  display: flex;
  align-items: center;
  list-style: none;
  border-radius: var(--d-radius-sm);
  cursor: pointer;
}

.docs-nav__group > summary::-webkit-details-marker {
  display: none;
}

.docs-nav__group > summary:hover {
  background: var(--d-hover);
}

.docs-nav__group > summary .docs-nav__item:hover {
  background: transparent;
}

.docs-nav__toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 2px;
  color: var(--d-faint);
}

.docs-nav__chevron {
  transition: transform 0.15s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .docs-nav__item,
  .docs-nav__chevron {
    transition: none;
  }
}
