@use "variables";

.toc-wrapper {
  position: relative;
  display: flex;

  .title {
    margin-top: 20px;
  }
}

.toc {
  height: 100vh;
  box-sizing: border-box;

  ul {
    list-style-type: none;
    padding-inline-start: 0;

    li {
      font-size: 14px;
      display: block;

      &:hover {
        // background-color: var(--link-hover-color);
      }

      a {
        display: block;
        // padding: 10px;
        color: var(--text-color);
        border-left: 4px solid transparent;
        border-radius: unset;

        &:hover {
          background-color: unset;
          border-left-color: var(--link-color);
          color: var(--link-color);
        }
      }

      &.active {
        &:first {
          border: 1px solid orange;
        }

        a {
          background-color: var(--link-hover-color);
        }
      }
    }
  }
}

@media screen and (max-width: variables.$tocBreakpoint) {
  .toc {
    display: none;
  }
}

@media screen and (min-width: variables.$tocBreakpoint) {
  .article {
    flex-grow: 1;
  }

  .toc {
    flex: 0 0 variables.$tocWidth;
    max-width: variables.$tocWidth;

    position: sticky;
    top: 0;
    padding: 20px;

    overflow-y: auto;
  }
}
