/**
 * Copyright (c) Forward Email LLC
 * SPDX-License-Identifier: BUSL-1.1
 */

// stylelint-disable no-invalid-position-at-import-rule

@import 'node_modules/github-markdown-css/github-markdown-light';
@import 'node_modules/markdown-it-github-alerts/styles/github-colors-light';
@import 'node_modules/markdown-it-github-alerts/styles/github-colors-dark-media';
@import 'node_modules/markdown-it-github-alerts/styles/github-base';

.markdown-body {
  background-color: transparent !important;

  // override since font weight is a little off due to our fonts used
  // (e.g. we don't have a semibold)
  // <https://github.com/sindresorhus/github-markdown-css/blob/bedb4b771f5fa1ae117df597c79993fd1eb4dff0/github-markdown-light.css#L1051-L1056>
  .markdown-alert {
    .markdown-alert-title {
      font-weight: 700 !important;
    }
  }

  img {
    background-color: transparent !important;
  }

  // margin-left: 20px;
  // margin-right: 20px;
  font-family: $font-family-sans-serif !important;

  h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: $headings-font-family !important;
    font-weight: 400 !important;
  }

  @for $index from 1 through 6 {
    h#{$index} {
      .anchor {
        float: left;
        padding-right: 5px;
        margin-left: -20px;
      }
      a {
        font-size: 80%;
      }
    }
  }

  code, kbd, pre, .commit-tease-sha, .blob-num, .blob-code-inner, {
    font-family: $font-family-monospace !important;
  }

  code {
    // font-size: 100%;
  }

  pre {
    > code {
      white-space: pre-wrap !important;
      display: block !important;
    }
  }

  pre, .highlight pre {
    // font-size: 100%;
    padding: 1rem !important;
  }

  hr {
    margin: 0;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    height: 0;
  }
}

td {
  .markdown-body {
    background-color: transparent !important;
  }
}

@media (prefers-color-scheme: light) {
  code {
    color: $dark;
  }
  .markdown-body {
    code {
      color: $dark;
    }
  }
}
