// Markdown

//
// Headings
//

.md h1, .md .h1 {
  @include headings-variant($markdown-h1-font-size, $markdown-h1-line-height, $markdown-h1-margin, $markdown-h1-padding-bottom);
}

.md h2, .md .h2 {
  @include headings-variant($markdown-h2-font-size, $markdown-h2-line-height, $markdown-h2-margin, $markdown-h2-padding-bottom);
}

.md h3, .md .h3 {
  @include headings-variant($markdown-h3-font-size, $markdown-h3-line-height, $markdown-h3-margin);
}

.md h4, .md .h4 {
  @include headings-variant($markdown-h4-font-size, $markdown-h4-line-height, $markdown-h4-margin);
}

.md h5, .md .h5 {
  @include headings-variant(
    $font-size: $markdown-h5-font-size,
    $line-height: $markdown-h5-line-height,
    $margin: $markdown-h5-margin,
    $color: inherit
  );
}

.md h6, .md .h6 {
  @include headings-variant($markdown-h6-font-size, $markdown-h6-line-height, $markdown-h6-margin);
}

.md *:first-child {
  margin-top: 0;
}

.md *:last-child {
  margin-bottom: 0;
}

//
// Paragraphs
//

.md p {
  font-size: $markdown-p-font-size;
  line-height: $markdown-p-line-height;
  margin: $markdown-p-margin;
}

//
// Code
//

code, kbd, pre, samp {
  font-family: $font-family-monospace;
}

.md code {
  display: inline-block;
  color: $markdown-code-color;
  font-size: $markdown-monospace-font-size;
  background-color: $markdown-code-background-color;
  padding: $markdown-code-padding;

  .color-chip {
    display: inline-block;
    vertical-align: middle;
    width: $markdown-color-chip-width;
    height: $markdown-color-chip-height;
    border-radius: $border-radius-base;
    border: $border;
    margin: $markdown-color-chip-margin;
  }
}

//
// Links
//

.md a {

  &.monospace {
    font-size: $markdown-monospace-font-size;
    font-family: $font-family-monospace;
  }

  &.mention {
    display: inline-block;
    background-color: $markdown-mention-link-background;
    border-radius: $border-radius-base;
    padding: $markdown-mention-link-padding;
    transition: $transition-base;

    &:hover {
      background-color: $markdown-mention-link-hover-background;
    }
  }

  code {
    color: inherit;
  }

  &:hover code {
    text-decoration: inherit;
  }
}

//
// Blockquotes
//

.md blockquote {
  background: $markdown-blockquote-background;
  margin: $markdown-blockquote-margin;
  padding: $markdown-blockquote-padding;
  font-size: initial;
  border-left: solid $markdown-blockquote-border-width $border-color;
}

//
// Inline diff
//

.md {

  .addition {
    color: $markdown-inline-diff-addition-color;
    background-color: $markdown-inline-diff-addition-background;
  }

  .deletion {
    color: $markdown-inline-diff-deletion-color;
    background-color: $markdown-inline-diff-deletion-background;
  }

  .addition, .deletion {
    display: inline-block;
    padding: $markdown-inline-diff-padding;
    border-radius: $markdown-inline-diff-radius;
  }
}
