.apidocs,
.guide {
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 250px 1fr;
  @media only screen and (max-width: $mobile) {
    display: flex;
    flex-direction: column;
    & > div.doc {
      padding: 1rem;
      grid-column: 1;
      grid-row: 1;
    }
  }
  @media (min-width: 1500px) {
    grid-template-columns: 1fr 1000px 1fr;
  }
  & > nav,
  & > .doc {
    grid-row: 1;
    padding: 1rem;
  }
  & > nav {
    display: flex;
    flex-direction: column;
    background-color: $gray2;
    padding: 0;
    grid-column: 1;
    header {
      font-weight: bold;
      padding: 0.6rem 0.9rem;
      border-bottom: 1px solid $gray4;
      margin-top: 0.5rem;
    }
    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
      li {
        display: flex;
        align-items: stretch;
        justify-content: stretch;
        transition: all 100ms;
        font-size: 14px;
        &.active {
          pointer-events: none;
          background-color: $gray5;
          a {
            color: $teal11;
          }
        }
        &:hover {
          background-color: rgba(255, 255, 255, 0.05);
        }
        a {
          flex: 1;
          padding: 0.6rem 1rem;
          color: $teal12;
          text-decoration: none;
          &:first-of-type {
            padding-top: 0.8rem;
          }
        }
        a:hover {
          color: $teal11;
        }
      }
    }
  }
  & > .doc {
    grid-column: 2;
    padding: 1rem 2rem;
  }
  .monotitle,
  code {
    font-family: "Iosevka Web", monospace;
  }
  .reference {
    .api {
      padding-bottom: 15px;
      .tag {
        background-color: #5699e1;
        color: rgb(239, 245, 249);
        font-size: 12px;
        text-transform: uppercase;
        display: inline-block;
        padding: 3px 5px;
        border-radius: 8px;
        &.rpc {
          background-color: #8e56e1;
        }
        &.event {
          background-color: #018937;
        }
        &.history {
          background-color: #037f88;
        }
      }
    }
  }
}

select {
  background-color: $gray2;
  color: $gray12;
  border-radius: 4px;
}

#api-version {
  margin: 1rem;
  margin-bottom: 0;
}

.schema {
  margin-top: 1rem;
  code > ul:first-of-type > li > blockquote {
    padding-top: 0;
  }
  blockquote {
    margin: 0;
    padding: 0;
    padding-top: 0.5rem;
    color: $gray9;
    &::before {
      content: "// ";
    }
  }
  .nameblock {
    display: none;
  }
  .kind.array,
  .kind.object,
  .kind.dictionary {
    color: $grass12;
  }
  li {
    list-style-type: none;
    & > code > .nameblock {
      display: inline-flex;
      padding-right: 0.5rem;
      & > .name {
        &::before,
        &::after {
          content: '"';
        }
      }
    }
  }
  .dict {
    display: inline;
    .key {
      display: inline;
    }
    .element {
      display: inline;
    }
  }
  ul {
    padding: 0;
    margin: 0;
    margin-left: 2rem;
  }
  .name {
    color: $yellow11;
  }
  .kind {
    color: $grass10;
  }
}

.doc {
  h2 {
    border-bottom: 1px solid $gray5;
    padding-bottom: 0.4rem;
    margin-top: 2rem;
  }
  h3 {
    padding-bottom: 0.4rem;
    margin-top: 2rem;
    font-size: 20px;
  }

  img {
    max-width: 100%;
    border: 2px solid $gray4;
    border-radius: 3px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  }
  .noborder img {
    border: none;
    box-shadow: none;
  }
  &.flashbang {
    img {
      filter: brightness(80%) contrast(80%);
    }
  }
}

.toc {
  @media only screen and (max-width: 1500px) {
    display: none;
  }
  padding: 0;
  position: fixed;
  right: 0;
  top: 60px;
  header {
    font-weight: bold;
    padding: 0.6rem 0.9rem;
    margin-top: 0.5rem;
  }
  #TableOfContents > ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    li {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: stretch;
      transition: all 100ms;
      font-size: 14px;
      ul {
        margin: 0;
        padding: 0;
      }
      &.active > a {
        border-left-color: $teal8;
        color: $teal11;
      }
      &:hover {
        background-color: rgba(255, 255, 255, 0.05);
      }
      a {
        border-left: 5px solid $gray3;
        flex: 1;
        padding: 0.6rem 1rem;
        color: $teal12;
        text-decoration: none;
        &:first-of-type {
          padding-top: 0.8rem;
        }
      }
      a:hover {
        color: $teal11;
      }
    }
  }
}

.copy {
  ul li {
    line-height: 1.4;
  }

  dl {
    dt {
      font-weight: bold;
      margin-bottom: 0.3em;
    }
    dd {
      margin-left: 1em;
      margin-bottom: 0.8em;
    }
  }

  table {
    border-collapse: collapse;
    margin-bottom: 1em;
    th,
    td {
      padding: 5px 8px;
    }
    th {
      background-color: $gray4;
      border: 1px solid $gray2;
      color: $teal11;
    }
    td {
      background-color: $gray2;
      border: 1px solid $gray1;
    }
  }
}
