@import 'variables';

#content, #sidebar {
  margin-top: 1rem;
}

#content, #sidebar, #drawer {
  h1, h2, h3, h4, h5, h6 {
    margin: 0;
    margin-top: $h-margin-top;
    margin-bottom: $h-margin-bottom;
    line-height: 1.4em;
    small {
      font-size: 0.6em;
      color: $color-grey;
      margin-left: 0.2em;
    }
  }
  h2 {
    font-size: 1.8em;
  }
  h3 {
    font-size: 1.5em;
  }
  h4 {
    font-size: 1.3em;
  }
  h5 {
    font-size: 1.2em;
  }
  h6 {
    font-size: 1em;
  }
  @media (max-width: 960px) { // <= md
    h1 {
      font-size: 2em;
    }
    h2 {
      font-size: 1.7em;
    }
    h3 {
      font-size: 1.4em;
    }
  }

  h1:first-child {
    margin-top: 0;
  }

  p, ul, ol, table {
    margin: $base-margin-y 0;
    ul, ol {
      margin: 0;
    }
  }

  img {
    max-width: 100%;
    max-height: 40vh;
  }

  blockquote {
    border-left: 3px solid $color-grey-light;
    color: $color-grey;
    padding-left: 1em;
  }

  h1, h2, h3, h4, h5, h6, p, a, td, th, li, strong, em {
    > code {
      background-color: $color-grey-light;
      padding: 0.1rem 0.2rem;
      margin: 0;
      font-size: 0.85em;
      font-family: $font-family-monospace;
    }
  }

  table {
    width: 100%;
    display: block;
    overflow: scroll;
    border-collapse: collapse;
    td, th {
      border: 1px solid $color-grey-light;
      padding: 0.5em 1em;
    }
    @media (max-width: 960px) { // <= md
      & {
        word-break: keep-all;
      }
    }
  }

  a {
    color: $color-link;
    text-decoration: none;
    &:hover {
      text-decoration: underline;
    }

    &.unstyled {
      @include unstyled-link;
    }

    &.disabled {
      pointer-events: none;
    }
  }

  hr {
    height: 1px;
    border: none;
    border-top: 1px solid $color-grey-light;
    margin: $base-margin-y 0;
  }
}
