@import "common/var";

:root {
  --font-color: #{$--color-text-primary};
}

html.dark {
  --font-color: #eee;
}

body {
  font-family: Lato, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-weight: $--font-weight-primary;
  font-size: $--font-size-base;
  color: var(--font-color);
  margin: 0px;
}

::selection {
  color: #fff;
  background: $--color-dark;
}

::placeholder {
  font-weight: $--font-weight-primary;
}
::-webkit-input-placeholder {
  font-weight: $--font-weight-primary;
}

a {
  color: $--color-primary;
  text-decoration: none;

  &:hover,
  &:focus {
    color: mix($--color-white, $--color-primary, $--button-hover-tint-percent);
  }

  &:active {
    color: mix(
      $--color-black,
      $--color-primary,
      $--button-active-shade-percent
    );
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--font-color);
  font-weight: inherit;
}

h1 {
  font-size: $--head-font-size-base + 5 * $--head-font-size-step;
  font-weight: 300;
}

h2 {
  font-size: $--head-font-size-base + 4 * $--head-font-size-step;
  font-weight: 300;
}

h3 {
  font-size: $--head-font-size-base + 3 * $--head-font-size-step;
  font-weight: 300;
}

h4 {
  font-size: $--head-font-size-base + 2 * $--head-font-size-step;
  font-weight: 300;
}

h5 {
  font-size: $--head-font-size-base + $--head-font-size-step;
  font-weight: 300;
}

h6 {
  font-size: $--head-font-size-base;
}

p {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.8;

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

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

sup,
sub {
  font-size: #{$--font-size-base - 1px};
}

small {
  font-size: #{$--font-size-base - 2px};
}

hr {
  margin-top: 20px;
  margin-bottom: 20px;
  border: 0;
  border-top: 1px solid #ccc;
}

textarea {
  font-family: inherit;
}
