/**
 * Base Styles
 */
html {
  font-size: 112.5%;
}

body {
  background-color: $color-body-bg;
  color: $color-body-text;
  line-height: 1.66667;
  text-rendering: optimizeLegibility;
  @include font-smooth();
}

@each $style in map-keys($theme-styles) {
  $style-suffix: "#{$style}";
  $fonts: map-deep-get($theme-styles, $style, "fonts");
  @each $font, $stack in $fonts {
    $font-suffix: "#{$font}";
    .style-#{$style-suffix} {
      &.font-#{$font-suffix} {
        font-family: $stack;
      }
    }
  }
}

a {
  color: inherit;
  text-decoration: underline;

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin: 1.25em 0 0.5em;

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

  a {
    color: inherit;
    text-decoration: none;
  }
}

h1 {
  font-size: 2.66667em;
}

h2 {
  font-size: 2.22222em;
}

h3 {
  font-size: 1.66667em;
}

h4 {
  font-size: 1.33333em;
}

h5 {
  font-size: 1.11111em;
}

h6 {
  font-size: 1em;
}

mark,
ins {
  background-color: $color-highlight-bg;
  color: $color-highlight-text;
  padding: 0.125em 0.25em;
  text-decoration: none;
}

blockquote {
  margin: 0 0 1em;
  padding: 0 0 0 2.22222em;
  position: relative;

  &:before {
    color: currentColor;
    content: "\201C";
    font-size: 2.66667em;
    left: 0;
    line-height: 1;
    position: absolute;
    top: 0;
  }
}

pre {
  border: 1px solid $color-code-border;
  font-size: 0.88889em;
  line-height: 1.5;
  margin: 0 0 1em;
  overflow: auto;
  padding: 1.5em;
  white-space: pre;
}

.style-classic {
  pre {
    background-color: $color-code-bg;
    border-radius: 6px;
  }
}

.style-bold {
  pre {
    background-color: $color-bold-code-bg;
    border-width: 2px;
  }
}

p,
ul,
ol {
  margin: 0 0 1em;
}

ul,
ol {
  padding: 0 0 0 1.5em;
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

li > ul,
li > ol {
  margin-bottom: 0;
}

dt {
  font-weight: 700;
}
dd {
  margin-left: 0;
}

hr {
  background-color: $color-hr-border;
  border: 0;
  color: inherit;
  height: 1px;
  margin: 1.11111em 0;

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

.style-bold {
  hr {
    height: 2px;
  }
}

/* Media */
embed,
iframe,
object,
video {
  max-width: 100%;
}

img {
  height: auto;
  max-width: 100%;
}

.style-classic {
  .site-content {
    img {
      border-radius: 6px;
    }
  }
}

figure {
  margin: 0 0 1em;
}

figcaption {
  color: $color-meta;
  font-size: 0.88889em;
  text-align: left;
}

@include media-breakpoint-down(sm) {
  h1 {
    font-size: 2.22222em;
  }

  h2 {
    font-size: 1.88889em;
  }

  h3 {
    font-size: 1.55556em;
  }

  html {
    font-size: 100%;
  }
}
