
.markdown, .trix-content {

  h1, h2, h3, h4, h5, h6 {
    margin-bottom: $spacing-sm;
    font-weight: $headings-font-weight;
    line-height: 1;
  }

  h1 {
    font-size: $font-size-h2;
  }

  h2 {
    font-size: $font-size-h3;
  }

  h3 {
    font-size: $font-size-h4;
  }

  h4 {
    font-size: $font-size-h5;
  }

  h5 {
    font-size: $font-size-base;
    text-transform: uppercase;
    font-weight: 600;
  }

  h6 {
    font-size: $font-size-base;
    text-transform: uppercase;
    font-weight: 600;
  }

  p {
    margin-bottom: $spacing-xs;
  }

  em {
    font-style: normal;
    padding: 0 $spacing-xxs;
    color: white;
    background-color: $info;
    border-radius: $border-radius;
  }

  em a, a em {
    font-style: normal;
    padding: 0 $spacing-xxs;
    color: white;
    background-color: $info;
    border-radius: $border-radius;

    &:hover, &:focus {
      background-color: $link-hover-color;
    }
  }

  a:hover em, a:focus em {
    background-color: $link-hover-color;
  }

  code {
    padding: $spacing-xxs;
    margin-bottom: $spacing-xs;
    font-size: $font-size-label;
    white-space: break-spaces;
    background-color: $gray-lightest;
    border-radius: $border-radius;
    color: $black;
    font-family: $font-family-mono;
  }

  pre {
    padding: $spacing-xxs $spacing-sm;
    overflow: auto;
    color: $black;
    background-color: $gray-lightest;
    border-radius: $border-radius;
    font-family: $font-family-mono;
    white-space: pre-wrap;
    width: auto;
  }

  pre > code {
    padding: 0;
    margin: 0;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
  }

  pre code {
    display: inline;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
  }

  blockquote {
    margin: 0;
    padding: 0 1em;
    color: $gray-darker;
    border-left: .25em solid $gray-lighter;
  }

  figure {
    display: block;
    margin: 1em 40px;
  }


  em strong,
  strong em {
    font-family: sans-serif;
  }

  table {
    border-spacing: 0;
    border-collapse: collapse;
    display: block;
    width: max-content;
    max-width: 100%;
    overflow: auto;
    margin-bottom: $spacing-sm;
  }

  th {
    background-color: $gray-lighter;
    border: $border-width solid $white;
    padding: $spacing-xxs $spacing-xs;
    text-align: left;
    font-size: $font-size-label;
    font-weight: 600;
  }

  td {
    background-color: $gray-lightest;
    border: $border-width solid $white;
    padding: $spacing-xs;
    text-align: left;
  }

  td > code {
    background-color: $gray-lighter;
  }
}

/*/// List styles with combinations ///*/


.markdown, .trix-content {
  ul, ol {
  counter-reset: list-counter;
  list-style: none;
  overflow: visible;
  display: block;
  position: relative;
  margin-top: $spacing-xs;
  margin-bottom: $spacing-md;
  padding-inline-start: 0;
  padding-inline-end: 0;
}

  ul li {
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
  }

  ul ul > li {
    padding-left: $spacing-sm;
  }

  ul ul ul > li {
    margin-bottom: 5px;
    padding-left: 12px;
  }

  ul ul > li::before {
    top: 1px;
    font-size: 12px;
  }

  ul ul ul > li::before {
    top: 3px;
    font-size: 8px;
  }

  ul > li, ol > li {
    display: block;
    position: relative;
    line-height: 1;
  }

  ol {
    margin-top: $spacing-md;
    margin-bottom: $spacing;
  }

  ol > li {
    counter-increment: list-counter;
    position: relative;
    margin-bottom: 26px;
    padding-left: 40px;
  }

  ol > li::before {
    content: counter(list-counter);
    position: absolute;
    display: block;
    overflow: visible;
    margin-right: $spacing-xs;
    left: 0;
    top: -8px;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 1;
    padding-top: 5px;
    text-align: center;

    background-color: $gray-lighter;
    border-radius: 50%;
  }

  ul > li::before {
    position: absolute;
    display: inline;
    top: -4px;
    left: 0;
    width: auto;
    height: auto;
    padding-top: 0;
    content: "●";
    font-size: 20px;
    text-align: left;
    background-color: transparent;
    border-radius: 0;
  }

  ul > li.task-list-item::before {
    content: none;
  }

  ol ol, ol ul, ul ol {
    margin-top: $spacing-sm;
    margin-left: 0;
  }

  ul ul {
    margin-top: $spacing-xs;
    margin-left: 0;
  }

  ol ol > li, ul ol > li {
    margin-bottom: 12px;
    padding-left: 30px;
  }

  ol ol > li::before, ul ol > li::before {
    top: -3px;
    width: 20px;
    height: 18px;
    padding-top: 2px;
    font-size: 14px;
    line-height: 1.2;
  }

  ol ol ol > li, ul ul ul > li, ul ol ol > li {
    margin-bottom: 5px;
    padding-left: 20px;
  }

   ol ol ol > li::before, ul ol ol > li::before  {
    content: counter(list-counter) ".";
    text-align: left;
    background-color: transparent;
  }

  ol li code {
    line-height: 2.4;
  }

  ul li code {
    line-height: 1.7;
  }
}

// markdown styles

.markdown-meta-sidebar{
  h1 { font-size: $h4-font-size; }
  h2 { font-size: $h5-font-size; }
  h3 { font-size: $h6-font-size; }
  h4 { font-size: $h6-font-size; }
  h5 { font-size: $h6-font-size; }
  h6 { font-size: $h6-font-size; }
  img {
    max-width: 100%;
  }
  ol {
    counter-reset: section;
    list-style-type: none;
    margin-bottom: $spacing-sm;
     li:before {
      color: $white;
      counter-increment: section;
      content: counter(section);
      margin-right: $spacing-icon-x;
      position: absolute;
      left: 0;
      top: 0;
    }
    li {
      position: relative;
      padding-left: $spacing-md;
    }
  }
}

.markdown-button {
  position: absolute;
  right: 0;
  top: -32px;
  padding: 5px $spacing-xs;
  border-radius: 5px 5px 0 0;
  background-color: $gray-lighter;
  color: $gray-dark;
  cursor: pointer;

  &.markdown-button-clicked {
    background-color: $white;
    border: 1px solid $gray-lighter;
    border-bottom: none;
    color: $black;
    padding-bottom: 6px;
  }
}

.markdown-preview-no-border {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
