.tutorial {
  align-items: center;
  background-color: var(--color-document-background);
  display: flex;
  flex-direction: column;
  padding-bottom: 80px;
}

.tutorial__breadcrumbs,
.tutorial__list {
  max-width: 1480px;
}

.tutorial__breadcrumbs,
.tutorial__content,
.tutorial__list {
  width: 100%;

  @media screen and (max-width: 1479px) {
    padding: 20px;
  }
  @media screen and (min-width: 1480px) {
    padding: 20px 60px;
  }
}

.tutorial__breadcrumbs {
  overflow-x: auto;
  max-width: 100vw;
}

.tutorial__comments {
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  margin: 80px 0 1em 0;
  padding: 20px 0;
  row-gap: 1em;
}

.tutorial__content {
  display: grid;
  padding-bottom: 60px;

  @media screen and (max-width: 1479px) {
    grid-template-areas:
      "header"
      "readme";
    max-width: 1024px;
  }
  @media screen and (min-width: 1480px) {
    column-gap: 40px;
    grid-template-areas:
      "header toc"
      "readme toc";
    grid-template-columns: 1024px 1fr;
    max-width: 1650px;
  }
}

.tutorial__header {
  display: flex;
  flex-direction: column;
  grid-area: header;
  row-gap: 1em;
  text-wrap: balance;
}

.tutorial__last-updated {
  font-size: var(--font-size-smaller);
  margin-bottom: 2em;
}

.tutorial__readme {
  grid-area: readme;
}

.tutorial__sub-title {
  line-height: 1.5;
}

.tutorial__title {
  font-weight: bold;
  hyphens: auto;
  max-width: calc(100vw - 40px);

  @media screen and (max-width: 1023px) {
    font-size: 2.25em;
  }
  @media screen and (min-width: 1024px) {
    font-size: 3.35em;
  }
}

@media screen and (max-width: 1479px) {
  .tutorial__toc {
    display: none;
  }
}

@media screen and (min-width: 1480px) {
  .tutorial__toc {
    grid-area: toc;
    border-left: 1px solid var(--color-border);
  }

  .tutorial__toc__links {
    display: flex;
    flex-direction: column;
    font-size: var(--font-size-smaller);
    padding: 0 20px;
    position: sticky;
    row-gap: 15px;
    top: calc(var(--height-primary-navigation) + 20px);

    a {
      text-decoration: none;
    }

    a.level-1 {
      font-weight: bold;
    }

    a.level-2 {
      padding-left: 2ch;
    }

    a.level-3 {
      padding-left: 4ch;
    }

    a.level-4 {
      padding-left: 6ch;
    }

    a.level-5 {
      padding-left: 8ch;
    }

    a.level-6 {
      padding-left: 10ch;
    }

    a.visible {
      color: var(--color-link-active);
    }

    .heading-permalink {
      display: none;
    }
  }
}
