@import "../_variables";

:root {
  scroll-behavior: smooth;
}

html,
body,
#app {
  height: 100%;
}

html,
body {
  padding: 0;
  margin: 0;
  background-color: var(--c-bg);
  transition: background-color var(--t-color);
}

html.dark {
  color-scheme: dark;
}

html {
  font-size: 16px;
}

html.fixed {
  overflow: hidden !important;
}

body {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 1.15rem;
  color: var(--c-text);
}

a {
  color: var(--c-text-accent);
  text-decoration: none;
}

p a code {
  font-weight: 400;
  color: var(--c-text-accent);
}

kbd {
  font-family: var(--font-family-code);
  color: var(--c-text);
  background: var(--c-bg-lighter);
  border: solid 0.15rem var(--c-border-sub);
  border-bottom: solid 0.25rem var(--c-border-sub);
  border-radius: 0.15rem;
  padding: 0 0.15em;
}

code {
  font-family: var(--font-family-code);
  color: var(--inline-code-color);
  padding: 0.25rem 0.5rem;
  margin: 0;
  font-size: 0.85em;
  background-color: transparent;
  border-radius: 3px;
  overflow-wrap: break-word;
  transition: background-color var(--t-color);
}

blockquote {
  font-size: 1rem;
  color: var(--c-text-sub);
  border-left: 0.2rem solid var(--c-border-sub);
  margin: 1rem 0;
  padding: 0.25rem 0 0.25rem 1rem;

  & > p {
    margin: 0;
  }
}

ul,
ol {
  padding-left: 40px;
}

strong {
  font-weight: 600;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.25;

  &:focus-visible {
    outline: none;
  }

  &:hover .header-anchor {
    opacity: 1;
  }
}

h1 {
  font-size: 2.2rem;
  font-weight: bold;
}

h2 {
  font-size: 1.65rem;
  padding-bottom: 0.3rem;
  transition: border-color var(--t-color);
}

h3 {
  font-size: 1.35rem;
}

h4 {
  font-size: 1.15rem;
}

h5 {
  font-size: 1.05rem;
}

h6 {
  font-size: 1rem;
}

a.header-anchor {
  font-size: inherit;
  float: left;
  margin-left: -0.87em;
  padding-right: 0.23em;
  opacity: 0;
  user-select: none;

  &:hover {
    text-decoration: none;
  }

  &:focus-visible {
    opacity: 1;
  }
}

p,
ul,
ol {
  line-height: 1.7;
}

hr {
  border: 0;
  border-top: 1px solid var(--c-border);
}

table {
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
  transition: border-color var(--t-color);
}

tr {
  border-top: 1px solid var(--c-border-sub);
  transition: border-color var(--t-color);

  &:nth-child(2n) {
    background-color: var(--c-bg-light);
    transition: background-color var(--t-color);
  }
}

th,
td {
  padding: 0.6em 1em;
  border: 1px solid var(--c-border-sub);
  transition: border-color var(--t-color);
}

@media (max-width: $MQMobile) {
  ul,
  ol {
    padding-left: 30px;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    outline: none;
  }
}

@media (max-width: $MQMobileNarrow) {
  ul,
  ol {
    padding-left: 20px;
  }

  a.header-anchor {
    display: none;
  }
}
