//
// Base
//

// Common
* {
  box-sizing: border-box;
  list-style: none;
  user-select: unset;

  &:disabled {
    cursor: not-allowed !important;
  }

  &:focus {
    outline: $border-weight solid transparent;
  }

  &::selection {
    background-color: $selection;
  }
}


// Body
body {
  color: $primary;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  word-wrap: break-word;
}


// Heading
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 $space-01;
  padding: 0;
}

label, legend {
  margin: 0;
  padding: 0;
}


// Paragraph
p {
  margin: 0 0 $space-03;
  padding: 0;
}


// Strong
b, strong {
  font-weight: map-get($font-weight, bold);
}


// Link
a {
  color: $primary;
  text-decoration: none;
  background-color: transparent;
  pointer-events: auto;
}


// List
dl, dd, ul, ol, li, form, fieldset {
  background-color: transparent;
  border: none;
  margin: 0;
  padding: 0;
  outline: 0;
}


// Subscript, Superscript
sub, sup {
  position: relative;
}

sub {
  vertical-align: sub;
}

sup {
  vertical-align: super;
}


// Code
code, pre {
  direction: ltr;
  text-align: left;
  vertical-align: baseline;
  border: 0;
  white-space: pre;
  word-break: normal;
  word-spacing: normal;
  tab-size: 4;
  margin: 0;
  padding: 0;
}


//
// Table
//

table {
  border: none;
	border-collapse: collapse;
	border-spacing: 0;
  table-layout: auto;
  width: 100%;
  margin: $space-03 auto $space-05;

  tr:first-child {
    background-color: $background-table;
  }

  tr:first-child td {
    font-weight: map-get($font-weight, regular);
    border: none;
  }

  td {
    border-bottom: $border-weight solid $border-01;
    padding: $space-02 $space-02 $space-04;
    vertical-align: middle;
  }
}

//
// Form
//

input, button, optgroup, select, textarea {
  border-radius: 0;
  margin: 0;
}

select {
  appearance: none;
  outline: $border-weight-bold solid transparent;
  outline-offset: -$border-weight-bold;
}

button, input, [type="button"], [type="reset"], [type="search"], [type="submit"] {
  appearance: button;
  background-color: transparent;
  border: none;
}


// Search
[type="search"] {
  outline-offset: -$border-weight-bold;

  &::-webkit-search-cancel-button, &::-webkit-search-decoration {
    appearance: none;
  }
}


//
// Media
//

audio, embed, img, object, video {
  display: block;
  border-style: none;
  vertical-align: middle;
  height: auto;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

svg:not(:root) {
  overflow: hidden;
}

iframe {
  border-style: none;
}
