////
/// Global reset
/// Based on normalize.css
////

///
/// Document
html {
  font-family: sans-serif;
  font-size: 62.5%;
  font-display: swap;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  box-sizing: border-box;

  *,
  *::after,
  *::before {
    box-sizing: inherit;
  }
}

html,
button,
input,
optgroup,
select,
textarea {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  line-height: 1;
}

@viewport {
  width: device-width;
}

///
/// Links
a {
  text-decoration: none;
  background: transparent;

  &:hover,
  &:active {
    outline: 0;
  }
}

a:focus,
[tabindex]:focus {
  outline: none,
}

///
/// Typography
h1,
h2,
h3,
h4,
h5,
h6,
li,
ol,
p,
ul {
  margin: 0;
  padding: 0;
  font-weight: 400;
  font-style: normal;
}

strong {
  font-weight: bold;
}

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

blockquote {
  margin: 0;
}

///
/// Lists
ol,
ul {
  list-style: none;

  nav & {
    list-style-image: none;
  }
}

li {
  list-style: none;
}

// Avoid 300ms click delay on touch devices that support 'touch-action'
a,
area,
button,
input,
label,
select,
summary,
textarea,
[role='button'] {
  touch-action: manipulation;
}

///
/// Embedded Content
img {
  max-width: 100%;
  height: auto;
  border: 0;
}

img,
svg {
  display: block;
  vertical-align: middle;
}

///
/// Grouping Content
figure {
  margin: 0;
}

hr {
  box-sizing: content-box;
  height: 0;
}

pre {
  margin-top: 0;
  margin-bottom: 0;
  overflow: auto;
}

code,
pre {
  font-family: monospace;
}

///
/// Forms
button,
input,
optgroup,
select,
textarea {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
}

button {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

button,
[role='button'],
input[type='button'],
input[type='reset'],
input[type='submit'] {
  -webkit-appearance: button; // stylelint-disable-line property-no-vendor-prefix
  cursor: pointer;
}

input[disabled],
button[disabled] {
  cursor: default;
}

input::-moz-focus-inner,
button::-moz-focus-inner {
  padding: 0;
  border: 0;
}

input {
  line-height: normal;
}

input[type='radio'],
input[type='checkbox'] {
  box-sizing: border-box;
  padding: 0;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none; // stylelint-disable-line property-no-vendor-prefix
  margin: 0;
  height: auto;
}

input[type='search'] {
  -webkit-appearance: textfield; // stylelint-disable-line property-no-vendor-prefix
  // box-sizing: content-box;
}

input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none; // stylelint-disable-line property-no-vendor-prefix
}

fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

legend {
  border: 0;
  padding: 0;
}

textarea {
  overflow: auto;
}

optgroup {
  font-weight: bold;
}

select {
  -webkit-appearance: none; // stylelint-disable-line property-no-vendor-prefix
  -moz-appearance: none; // stylelint-disable-line property-no-vendor-prefix
  cursor: pointer;
}

button,
input,
select,
textarea {
  outline: none;
  background: none;
  border: none;
  border-radius: 0;
}

[tabindex='-1']:focus {
  // prevent focus outline on elements that cant be accessed via keyboard
  // remove red border for invalid entries
  outline: none !important; // stylelint-disable-line declaration-no-important
}

select:focus {
  outline: 0;
}

input,
input:focus,
input:invalid,
button:focus {
  box-shadow: none;
}

/* stylelint-disable selector-no-vendor-prefix */
::-webkit-input-placeholder {
  box-shadow: none;
}

::-moz-placeholder {
  box-shadow: none;
  opacity: 1;
}

:-ms-input-placeholder {
  box-shadow: none;
}
/* stylelint-enable selector-no-vendor-prefix */

///
/// Tables
table {
  border-collapse: collapse;
  border-spacing: 0;
}

td,
th {
  padding: 0;
}
