.markdown {

  @mixin code-in-headers {
    letter-spacing: normal;
  }

  h1 {
    font-size: 2rem;
    line-height: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;

    & code {
      @include code-in-headers;
    }
  }

  h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: $font-weight-semi-bold;
    padding-bottom: 0.5rem;
    letter-spacing: -0.04em;

    & code {
      @include code-in-headers;
    }
  }

  h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: $font-weight-semi-bold;
    padding-bottom: 0.3em;
    letter-spacing: -0.04em;

    & code {
      @include code-in-headers;
    }
  }

  h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: $font-weight-semi-bold;
    padding-bottom: 0.3em;
    letter-spacing: -0.04em;

    & code {
      @include code-in-headers;
    }
  }

  p {
    color: $gray-dark;
    margin-bottom: 1rem;
    word-wrap: break-word;

    img {
      border-radius: 0.25rem;
      border: 1px solid $gray-lighter;
      margin: 1rem 0;
    }
  }

  blockquote {
    padding: 0 1em;
    border-left: 0.25rem solid $brand-primary;
    background-color: transparentize($brand-primary, 0.95);
    p {
      padding: 0.75rem;
    }
  }

  pre {
    padding: 1rem 1.25rem;
    overflow: auto;
    font-size: $font-size-sm;
    line-height: 1.45;
    border-radius: $border-radius;
    background-color: #272822;
    margin: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    white-space: pre-wrap;
    &.chroma {
      background-color: #272822;
    }
  }

  strong {
    font-weight: 600;
  }

  ul,
  ol {
    padding-left: 2rem;
    line-height: $line-height-pub-site;

    li {
      margin-bottom: 0.5 * $spacer-y;
      line-height: 26px;
    }
  }

  img {
    max-width: 100%;

    &.markdown-responsive-img {
      width: 100%;
      height: auto;
    }
  }

  video {
    max-width: 100%;
    border-radius: 4px;
  }

  code {
    color: $gray-dark;
    font-size: 80%;
    padding: 0.15rem 0.4rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  }

  pre {
    code {
      border: none;
      color: white;
      font-size: 100%;
      padding: 0;
      box-shadow: none;
    }
  }

  kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
    color: $gray-dark;
    vertical-align: middle;
    background-color: $gray-lightest;
    border: solid 1px $gray-lighter;
    border-bottom-color: $gray-light;
    border-radius: 3px;
    box-shadow: inset 0 -1px 0 $gray;
  }

  nav#TableOfContents {
    ul {
      list-style-type: none;
      padding-left: 0;
      margin-bottom: 0;
      li {
        ul {
          list-style-type: disc;
          padding-left: 1rem;
          li {
            ul {
              display: none;
            }
          }
        }
      }
    }
  }

  table {
    width: 100%;
    margin-bottom: $spacer-y;
    thead {
      tr {
        th {
          padding: 0.5rem;
          border-bottom: 1px solid $gray-light;
          color: $gray-dark;
          text-transform: uppercase;
          font-size: $font-size-xs;
          font-family: "fakt-soft", sans-serif;
        }
      }
    }
    tbody {
      tr {
        td {
          padding: 0.5rem;
          border-bottom: 1px solid $gray-light;
          //code {
          //  padding: 0;
          //  background: none;
          //  border: none;
          //  color: $gray-dark !important;
          //}
        }
      }
    }
  }

  .badge {
    font-family: "fakt-soft", sans-serif;
  }

  .markdown-tabs {
    margin-top: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;

    label {
      display: inline-block;
      padding: 0.75em 1.5em;
      border-bottom: 2px transparent;
      cursor: pointer;
      margin-bottom: 0;
      text-transform: uppercase;
      font-size: 0.75rem;
      color: $gray;
      font-weight: 600;
      line-height: 24px;
      letter-spacing: 0.04rem;
    }

    .markdown-tabs-content {
      order: 999; //Move content blocks to the end
      width: 100%;
      outline: 3px solid $gray-lighter;
      display: none;
      position: relative;
    }

    input[type="radio"]:checked + label {
      border-bottom: 3px solid $brand-primary;
      color: $brand-primary;
      z-index: 999;
    }
    input[type="radio"]:checked + label + .markdown-tabs-content {
      padding-top: 1rem;
      display: block;
    }
    input[type="radio"]:focus + label {
      //@include outline
    }

    input.toggle {
      height: 0;
      width: 0;
      overflow: hidden;
      opacity: 0;
      position: absolute;
    }
  }
}
