// This file allows multi-line selectors to make it more readable
// sass-lint:disable single-line-per-selector

/**
 * Adapted from Eric Meyer's reset (http://meyerweb.com/eric/tools/css/reset/, v2.0 | 20110126).
 *
 */

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

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: none;
  vertical-align: baseline;
}

code, pre, kbd, samp {
  font-family: $euiCodeFontFamily;
}

h1, h2, h3, h4, h5, h6, p {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
}

input, textarea, select, button {
  font-family: $euiFontFamily;
}

em {
  font-style: italic;
}

strong {
  font-weight: $euiFontWeightBold;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

html {
  @include euiFont;
  font-size: $euiFontSize;
  color: $euiTextColor;
  height: 100%;
  background-color: $euiPageBackgroundColor;
}

body {
  line-height: $euiBodyLineHeight;
}

*:focus {
  // 👉 Safari and Firefox innately respect only showing the outline with keyboard only
  // 💔 But they don't allow coloring of the 'auto'/default outline, so contrast is no good in dark mode.
  // 👉 For these browsers we use the solid type in order to match with `currentColor`.
  // 😦 Which does means the outline will be square
  outline: $euiFocusRingSize solid currentColor;
  outline-offset: -($euiFocusRingSize / 2);

  // 👀 Chrome respects :focus-visible and allows coloring the `auto` style
  &:focus-visible {
    outline-style: auto;
  }

  //🙅‍♀️ But Chrome also needs to have the outline forcefully removed from regular `:focus` state
  &:not(:focus-visible) {
    outline: none;
  }
}

// Dark mode's highlighted doesn't work well so lets just set it the same as our focus background
::selection {
  background: $euiFocusBackgroundColor;
}

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

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

a:hover, button, [role='button'] {
  cursor: pointer;
}

input {
  margin: 0;
  padding: 0;
}

button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;

  &:hover {
    cursor: pointer;
  }
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none; // sass-lint:disable-line no-duplicate-properties
}

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

hr {
  margin: 0;
}

fieldset {
  min-inline-size: auto;
}
