.Article {
  font-size: 1rem;
  color: map-get($color-aliases, "text-body");

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

  p {
    letter-spacing: -0.01em;
    font-size: 1rem;
    margin-block: 1em;
  }

  blockquote,
  pre,
  table {
    margin: 1rem 0;
  }

  li {
    margin-block: 0.66em;
    p {
      margin-block: 0.33em;
    }
    li {
      margin-block: 0.33em;
    }
  }

  ol {
    list-style: decimal;
    padding-left: 30px;

    ol {
      list-style: lower-alpha;

      ol {
        list-style: lower-roman;

        ol {
          list-style: decimal;

          ol {
            list-style: lower-alpha;

            ol {
              list-style: lower-roman;
            }
          }
        }
      }
    }
  }

  ul {
    list-style: disc;
    padding-left: 30px;

    ul {
      list-style: circle;

      ul {
        list-style: square;

        ul {
          list-style: disc;

          ul {
            list-style: circle;

            ul {
              list-style: square;
            }
          }
        }
      }
    }
  }

  .two-column-list {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: repeat(2, 1fr);
    width: max-content;
    > li {
      margin: 0 1em 0 1em;
    }

    @media (max-width: 500px) {
      display: block;
      > li {
        margin: 0 0 0.5em 1em;
      }
    }
  }

  .three-column-list {
    @extend .two-column-list;
    grid-template-columns: repeat(3, 1fr);
  }

  a {
    @include style-text-link;
  }

  code {
    font-family: "SFMono-Regular", Monaco, Menlo, Consolas, "Liberation Mono",
      Courier, monospace;
    font-size: map-get($font-size-aliases, "code");
    overflow-wrap: anywhere;

    a {
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  a {
    &:not([class]) {
      > code {
        @include code-bg;
      }
    }
  }

  p,
  li,
  dt,
  td,
  th {
    > code {
      @include code-bg;
    }
  }

  th code,
  td:first-child code {
    @media (min-width: $screen-lg) {
      white-space: nowrap;
    }
  }

  em {
    font-style: italic;
  }
  strong {
    font-weight: 600;
  }

  .highlight {
    font-size: 1rem;
  }

  pre {
    word-break: break-all;
    word-wrap: break-word;
    border: 1px solid #ddd;
    padding: 0.8em 1em;
    border-radius: 8px;
    line-height: map-get($line-heights, "code");
    min-width: 0;
    white-space: pre-wrap;

    &.overflow-scroll {
      overflow: auto;
      word-break: normal;
      word-wrap: normal;
    }

    code {
      line-height: map-get($line-heights, "code");
      font-size: map-get($font-sizes, "sm");
    }
  }
  iframe {
    border: 1px solid #ddd;
  }
  table {
    font-size: 0.875rem;
    word-wrap: break-word;
    border-radius: 8px;
    box-shadow: 0 0 0 1px #28205020, 0 1px 3px #28205033;
    margin: 2em 0;
    min-width: 100%;

    p {
      font-size: 0.875rem;
    }
  }

  thead {
    border-bottom: 1px solid $navy-200;
  }

  table,
  tbody,
  tr,
  th,
  td {
    color: currentColor;
  }

  tbody tr {
    border-top: 1px solid $navy-100;
    border-bottom: 1px solid $navy-100;
  }

  tbody tr:first-child {
    border-top: 0 none;
  }

  tbody tr:last-child {
    border-bottom: 0 none;
  }

  th code,
  td code {
    border: none;
    font-size: map-get($font-sizes, "xs");
  }

  th,
  td {
    padding: 0.5rem;

    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p {
      &:first-child {
        margin-top: 0;
      }

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  th {
    font-weight: inherit;
    color: currentColor;
    text-align: left;
    font-weight: 700;
  }
  th code {
    font-weight: normal;
  }
  table.two-column {
    td {
      border: none;
    }

    th:first-of-type,
    td:first-of-type {
      border-right: 1px solid #ddd;
    }
  }

  table.no-formatting {
    th,
    td {
      border: none;
    }
  }

  table.table--no-wrap {
    th,
    td {
      white-space: nowrap;
      &:last-child {
        white-space: initial;
      }
    }
  }

  blockquote {
    padding-left: 1em;
    border-left: 5px solid #8e8e8e;
  }

  .no-margin-top {
    margin-top: 0;
  }
  .no-margin-bottom {
    margin-top: 0;
  }

  details {
    background-color: map-get($color-aliases, "panel-background");
    display: inline-block;
    padding: 10px 15px;

    &[open] {
      display: block;
    }

    summary {
      cursor: pointer;

      + table {
        margin-top: 0;

        tbody {
          tr:first-child {
            border-top: 0;
          }
        }
      }

      ~ table {
        &:last-child {
          margin-bottom: 0;
        }

        tbody {
          tr:last-child {
            border-bottom: 0;
          }
        }
      }
    }
  }

  .is-small {
    font-size: 0.8888rem;
  }

  /* Some styles from Bass that our Markdown render outputs */
  .rounded {
    border-radius: map-get($color-aliases, "border")-rounded;
  }
  .dark-gray {
    color: $charcoal-300;
  }
  .border {
    border: 1px solid;
  }
  .border-gray {
    border-color: map-get($color-aliases, "border");
  }

  .highlight-figure {
    figcaption {
      border: 1px solid #ddd;
      padding: 0.8em 1em;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
      border-bottom: none;
      font-size: 14px;
      color: map-get($color-aliases, "text-lightest");
    }
    pre {
      margin-top: 0;
      border-top-left-radius: 0;
      border-top-right-radius: 0;
    }
  }

  img.emoji {
    padding: 0;
    border: none;
  }
  hr + h2 {
    margin-top: 0;
  }
  th {
    font-weight: 600;
  }
  thead th {
    font-weight: 600;
  }

  img {
    max-width: 100%;
  }

  li .responsive-image-container {
    margin: 0.5rem 0 0 0;
  }

  table.fixed-width {
    // In general, the width of our tables within articles depends on the size of their content. This works great except
    // when we have text such as a HTTP response snippet that includes a long unbroken string. When that happens, the
    // table overflows outside of its bounding box and doesn't wrap or scroll nicely, causing text cropping. Use this
    // "fixed-width" class for a table that won't overflow it's bounding box horizontally and forces text wrapping.

    table-layout: fixed;
    width: 100%;
    th {
      width: 25%;
    }
    tr {
      width: 75%;
    }
  }
}
