// # Reset

// ## Box-sizing
// Reset all elements to use the border-box model.

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

// General resets.

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
dl,
dd,
ol,
ul,
form,
fieldset,
legend,
table,
th,
td,
caption,
hr {
  margin: 0;
  padding: 0;
}

// Remove default list-style.

ol,
ul {
  list-style: none;
}

// Normalize headings to one weight.

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
}

// Set tables to collapse.

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

// Give a help cursor to elements that give extra info on `:hover`.

abbr[title],
dfn[title] {
  cursor: help;
}

// Remove underlines from potentially troublesome elements.

u,
ins {
  text-decoration: none;
}

// Apply faux underline via `border-bottom`.

ins {
  border-bottom: 1px solid;
}

// So that `alt` text is visually offset if images don't load.
// Set to display block by default.

img {
  font-style: italic;
}

// Give form elements some cursor interactions...

button,
select,
option,
input[type="checkbox"] + label,
input[type="radio"] + label {
  cursor: pointer;
}

[type=text]:active,
[type=text]:focus,
[type=password]:active,
[type=password]:focus,
[type=email]:active,
[type=email]:focus,
textarea:active,
textarea:focus {
  cursor: text;
  outline: none;
}

// ## Links

a {
  text-decoration: none;
}

// Improve readability when focused and also mouse hovered in all browsers.

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

// ## Typography

// Prevent `sub` and `sup` affecting `line-height` in all browsers.

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

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

em {
  font-style: italic;
}

b,
strong {
  font-weight: 600;
}

// ## Forms
// Remove border from fieldset.

fieldset {
  border: 0;
}

// Improve readability and alignment in all browsers.

textarea {
  vertical-align: top;
}

// 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
// 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome

// <!---->

input[type="search"] {
  -webkit-appearance: textfield; // 1
  -webkit-box-sizing: content-box; // 2
  box-sizing: content-box;
}

// Re-set default cursor for disabled elements.

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

// Address inconsistent `text-transform` inheritance for `button` and `select`.
// All other form control elements do not inherit `text-transform` values.
// Correct `button` style inheritance.

button,
select {
  text-transform: none;
}

// 1. Correct font family not being inherited in all browsers.
// 2. Correct font size not being inherited in all browsers.
// 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.

// <!---->

button,
input,
select,
textarea {
  font-family: inherit; // 1
  font-size: 100%; // 2
  margin: 0; // 3
}

// Remove inner padding and search cancel button in Safari 5 and Chrome
// on OS X.

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
//    and `video` controls.
// 2. Correct inability to style clickable `input` types in iOS.
// 3. Improve usability and consistency of cursor style between image-type
//    `input` and others.

// <!---->

button,
html input[type="button"], // 1
input[type="reset"],
input[type="submit"] {
  -webkit-appearance: button; // 2
  cursor: pointer; // 3
}
