// This file contains the styles for the contents of the right sidebar, which
// contains the table of contents for the current page.

.toc-title-container
  padding: var(--toc-title-padding)
  padding-top: var(--toc-spacing-vertical)

.toc-title
  font-size: var(--toc-title-font-size)
  padding-left: var(--toc-spacing-horizontal)
  text-transform: uppercase

// If the ToC is not present, hide these elements coz they're not relevant.
.no-toc
  display: none

.toc-tree
  font-size: var(--toc-font-size)
  line-height: 1.3

  padding-left: calc(var(--toc-spacing-horizontal) - var(--toc-item-spacing-horizontal))
  margin-bottom: var(--toc-spacing-vertical)

  // Hide the "top level" bullet.
  > ul > li
    padding-top: 0
    & > ul
      padding-left: 0
    & > a
      display: none

  ul
    list-style-type: none
    margin-top: 0
    margin-bottom: 0
    padding-left: var(--toc-item-spacing-horizontal)
  li
    padding-top: var(--toc-item-spacing-vertical)

    .reference
      text-decoration: none

    &.scroll-current >.reference
      font-weight: bold

.toc-scroll
  max-height: 100vh

  // Hide scrollbar until hover
  overflow-y: hidden
  &:hover
    overflow-y: auto

// Be very annoying when someone includes the table of contents
.contents
  color: var(--color-problematic)
  background: rgba(255, 0, 0, 0.25)
  &::before
    content: "ERROR: Adding a table of contents in Furo-based documentation is unnecessary, and does not work well with existing styling."
