.markdown {
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  ul,
  ol,
  img {
    margin-top: 0.8em;
    margin-bottom: 0.8em;
  }

  li {
    margin-bottom: 0.3em;
    margin-left: 20px;
  }

  p {
    &.text > a > .icon {
      display: none;
    }
  }

  iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;

    &:not(:last-child) {
      margin-bottom: 20px;
    }
  }

  table {
    border-collapse: collapse;
    margin-bottom: 1.2em;

    th,
    td {
      text-align: left;
      padding: 0.2em 0.8em;
      border: 1px solid rgba(0, 0, 0, 0.1);

      &:first-child {
        border-left: 0;
      }
      &:last-child {
        border-right: 0;
      }
    }
    thead tr:first-child th {
      border-top: 0;
    }
    tbody tr:last-child td {
      border-bottom: 0;
    }
  }

  :not(img) {
    &:first-child {
      margin-top: 0;
    }

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

  .atomic a {
    display: block;
  }

  img {
    display: block;
    max-width: 100%;
  }

  a {
    text-decoration: underline;
    color: #4d659e;
  }

  hr {
    height: 2px;
  }

  .math-inline {
    display: inline-block;
    max-width: 100%;
    overflow: auto;
  }
}

// Nocturnal styles

.nocturnal-theme {
  .markdown-body {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      .octicon-link {
        color: rgba(255, 255, 255, 0.8);
      }

      &:hover .anchor .octicon-link:before {
        color: rgba(255, 255, 255, 0.9);
      }
    }

    a {
      color: saturate(lighten(#0366d6, 15), 10);
    }

    hr {
      border-bottom-color: rgba(255, 255, 255, 0.2); //#dfe2e5
    }

    .border {
      border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }

    .border-bottom {
      border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    }

    hr {
      background-color: rgba(255, 255, 255, 0.2) !important;
    }

    .blockquote {
      border-left-color: rgba(255, 255, 255, 0.2);
    }

    h1,
    h2 {
      border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    }

    h6 {
      color: rgba(255, 255, 255, 0.6);
    }

    table {
      td,
      th {
        border: 1px solid rgba(255, 255, 255, 0.2);
      }

      th {
        background: #322b25;
      }

      tr {
        background: #29231f;
        border: 1px solid rgba(255, 255, 255, 0.2);
      }
      tr:nth-child(2n) {
        background: mix(#322b25, #29231f, 50);
      }
    }
  }
}
