/* Config */
$sidebar-width: 320px;

.docs-container {
  display: block;

  @media screen and (min-width: 860px) {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
}

.sidebar {
  height: 0;
  position: sticky;
  top: 6rem;
  transform: translateX(-$sidebar-width);
  transition: transform 0.15s linear;
  width: 0;
  will-change: scroll-position;

  h3 .button,
  li a + .button {
    margin-left: 0.5rem;
  }

  a {
    font-weight: inherit;
    text-decoration: none;
    transition: opacity 0.15s ease;

    &:hover {
      opacity: 0.6;
    }
  }

  @media screen and (min-width: 860px) {
    flex: 0 0 $sidebar-width;
    height: calc(100vh - 6rem);
    transform: translateX(0);
    vertical-align: top;
    width: $sidebar-width;
  }
}

.sidebar-inner {
  background: $color-white;
  font-size: 0.86rem;
  height: 100%;
  left: 0;
  overflow: auto;
  padding: 2rem 2rem 2rem 4rem;
  position: relative;
  width: 100%;
  z-index: 10;

  h2 {
    margin-bottom: 2rem;
  }

  h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  ul {
    color: $color-copy-dark;
    margin-bottom: 2rem;
  }

  li {
    line-height: 1.4;
    margin-bottom: 0.5rem;

    a {
      color: $color-copy-dark;
      font-weight: 400;
      text-decoration: none;
    }

    &.active a,
    & a.active {
      color: $color-brand;
      font-weight: 600;
    }
  }
}

.docs-nav-items .table-of-contents {
  border-left: 2px solid $color-grey;
  margin-bottom: 1rem;
  margin-left: 0;
  padding-left: 1rem;

  .level-3 {
    padding-left: 0.5rem;
  }

  .level-4 {
    padding-left: 1rem;
  }
}

.docs-content,
.section-docs-list {
  background: $color-white;
  color: $color-dark;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 700px;
  min-height: 100vh;
  padding: unset;
  padding-top: 7rem;
  position: relative;
  width: 100%;
  word-spacing: 0.05em;

  .container {
    padding: 0 2rem;
  }

  @media screen and (min-width: 1100px) {
    left: calc($sidebar-width / 4 * -1);
    margin: 0 auto;
  }
}

.docs-content .pagination {
  align-items: center;
  color: $color-brand;
  display: flex;
  flex-wrap: nowrap;
  font-weight: 600;
  justify-content: space-between;
  line-height: 1em;
  margin: 4rem 0 2rem;

  span {
    display: block;
    position: relative;
  }

  span::before {
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    content: "";
    height: 1em;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1em;
  }

  a:first-of-type {
    margin-right: 4rem;
  }

  .prev-doc {
    padding-left: 1.5rem;
  }

  .prev-doc::before {
    background-image: url("/img/chevron-left.svg");
    left: 0;
  }

  .next-doc {
    padding-right: 1.5rem;
  }

  .next-doc::before {
    background-image: url("/img/chevron-right.svg");
    right: 0;
  }
}

.section-docs-list {
  padding-top: 8rem;

  .doc {
    margin-bottom: 6rem;
    max-width: 700px;
  }

  .doc-title {
    font-size: 2.5rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    margin-top: 0;
  }

  .doc-meta {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
  }

  .doc-date {
    color: $color-medium-dark;
    font-weight: 600;
  }

  .doc-category {
    font-weight: 600;
    margin-left: 0.5rem;
  }
}

.subscribe-feed {
  a:hover {
    opacity: 0.6;
  }
}
