@use '../../00-settings/settings' as *;
@use '../../00-mixins/mixins' as *;

////
/// Default markup for the most common HTML elements, based on the settings file.
////

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

:root,
html {
  @include theme('background', 'color-none');

  display: grid;
  box-sizing: border-box;
  height: 100%;
  font: $default-font-weight $default-font-size $default-font-family;
  line-height: $default-line-height;
}

body {
  @include large-text;

  position: relative;
  min-height: 100%;

  // Since the `cs--` class is set on the body element, the styles should be applied directly to the element.
  @each $theme, $colors in $themes {
    &.cs--#{$theme} {
      color: set-themified-property($colors, 'color-zero', 'default-text-color');
    }
  }
}

::selection {
  @include theme('background-color', 'color-primary', 'text-selection-background');
  @include theme('color', 'color-secondary', 'text-selection-color');
}

th > * {
  margin: 0;
}

hr {
  margin: 0 auto 1.4rem;
  clear: both;
  border: solid coloring('gray-light');
  border-width: 1px 0 0;
}

//
// Fix a > img problem
//
img {
  border: 0;
  vertical-align: top;
}

p,
ol,
ul,
dl,
table,
address,
pre {
  margin-bottom: 10px;
  font-size: inherit;
  line-height: inherit;
}

address {
  font-style: normal;
}

p,
span,
input,
label,
textarea,
button,
select,
dd,
q {
  max-width: 40rem;
}

strong {
  @include bold-text;
}

input[type="button"],
button {
  font: $default-font-weight $default-font-size $default-font-family;
}

a[href],
area[href],
input:not([disabled]),
select:not([disabled]),
textarea:not([disabled]),
button:not([disabled]),
object,
embed,
iframe,
*[tabindex]:not([tabindex="-1"]),
*[contenteditable] {
  @include focus-style;
}

table {
  hyphens: auto;
}
