// Reset
// -----
// Modern CSS reset: https://github.com/hankchizljaw/modern-css-reset

$body-bg:                   var(--body-bg-color) !default;
$body-color:                var(--body-color) !default;

// Element & classes
// Box sizing rules
*,
*::before,
*::after {
  box-sizing: border-box;
}

// Remove default padding, remove list styles on ul, ol elements with a class attribute
ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

// Remove default margin
body,
h1,
h2,
h3,
h4,
p,
ul[class],
ol[class],
figure,
blockquote,
dl,
dd {
  margin: 0;
}

// Set core root defaults
html {
  scroll-behavior: smooth;
}

// Set core body defaults
body {
  min-height: 100vh;
  background: $body-bg;
  color: $body-color;
  font-size: var(--base-font-size);
  font-family: var(--font-primary);
  text-rendering: optimizeSpeed;
  line-height: var(--body-line-height);
}

// A elements that don't have a class get default styles
a:not([class]) {
  text-decoration-skip-ink: auto;
}

// Make images easier to work with
img,
picture {
  max-width: 100%;
  display: block;
}

// Natural flow and rhythm in articles by default
article > * + * {
  margin-top: 1em;
}

// Inherit fonts for inputs and buttons
input,
button,
textarea,
select {
  font: inherit;
}

// Blur images when they have no alt attribute
img:not([alt]) {
  filter: blur(10px);
}

// The Thematic Break (Horizontal Rule) element styles
hr {
  border-top: 1px solid var(--ui-border-02);
  margin: 0;
  border-right-width: 0;
  border-left-width: 0;
  border-bottom-width: 0;
}

// Code elements that don't have a class get default styles
code:not([class]) {
  word-break: break-word;
  hyphens: manual;
  background-color: var(--ui-background-02);
  border-radius: var(--ui-border-radius-01);
  border: 1px solid var(--ui-border-03);
  padding-left: calc(var(--spacing-05) / 2);
  padding-right: calc(var(--spacing-05) / 2);
}

// Remove all animations and transitions for people that prefer not to see them
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
