// The foundation of Skeleton which includes all base styles
// that come bundled by default.
// See skeleton/core/_config.scss for default variable values.
// See _vars.scss for theme-scoped default values.

/* Normalize
 * ------------------------------------------------ */
@include normalize();

/* BASIC STYLES
 * ------------------------------------------------ */
html {
  font-size: percentage(strip-units($base-font-size) / 16);
}

@if ($use-global-border-box) {
  *,
  *:before,
  *:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }
}

body {
  background: $background-color;
  font: {
    family: $font-family;
    weight: $font-weight;
    style: normal;
  }
  @include font-size($font-size);
  line-height: 1.6;
  color: $font-color;
}

/* TYPOGRAPHY
 * ------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  color: $heading-color;
  font: {
    family: $heading-family;
    weight: $heading-weight;
  }
  margin-top: 0;
  margin-bottom: relative(20px);
}

h1 {
  font-size: relative(30px);
  line-height: 1.2;
  letter-spacing: relative(-1px);
}

h2 {
  font-size: relative(27px);
  line-height: 1.25;
  letter-spacing: -0.1rem;
}

h3 {
  font-size: relative(24px);
  line-height: 1.3;
  letter-spacing: -0.1rem;
}

h4 {
  font-size: relative(21px);
  line-height: 1.35;
  letter-spacing: -0.08rem;
}

h5 {
  font-size: relative(18px);
  line-height: 1.5;
  letter-spacing: -0.05rem;
}

h6 {
  font-size: relative(15px);
  line-height: 1.6;
  letter-spacing: 0;
}

/* Larger than phablet */
@media (min-width: 550px) {
  h1 {
    font-size: relative(40px);
  }
  h2 {
    font-size: relative(37px);
  }
  h3 {
    font-size: relative(34px);
  }
  h4 {
    font-size: relative(31px);
  }
  h5 {
    font-size: relative(24px);
  }
  h6 {
    font-size: relative(15px);
  }
}

p {
  margin-top: 0;
}

/* LINKS
 * ------------------------------------------------ */
a, a:visited {
  color: $link-color;
  text-decoration: $link-decoration;
}

a:hover, a:focus, a:active {
  color: $link-hover;
}

button > a,
button > a:visited,
button > a:hover,
button > a:focus,
button > a:active {
  color: inherit;
  text-decoration: none;
}

/* LISTS
 * ------------------------------------------------ */
ul {
  list-style: circle inside;
}

ol {
  list-style: decimal inside;
}

ol, ul {
  padding-left: 0;
  margin-top: 0;
}

ul ul,
ul ol,
ol ol,
ol ul {
  margin: relative(15px) 0 relative(15px) relative(30px);
  font-size: 90%;
}

li {
  margin-bottom: relative(10px);
}

/* CODE
 * ------------------------------------------------ */
code {
  padding: relative(2px) relative(5px);
  margin: 0 relative(2px);
  font-size: 90%;
  white-space: nowrap;
  background: #F1F1F1;
  border: 1px solid #E1E1E1;
  border-radius: 4px;
}

pre > code {
  display: block;
  padding: relative(10px) relative(15px);
  white-space: pre;
}

/* TABLES
 * ------------------------------------------------ */
th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #E1E1E1;
  &:first-child {
    padding-left: 0;
  }
  &:last-child {
    padding-right: 0;
  }
}

/* UTILITIES
 * ------------------------------------------------ */
.u-full-width {
  width: 100%;
  box-sizing: border-box;
}

.u-max-full-width {
  max-width: 100%;
  box-sizing: border-box;
}

.u-pull-right {
  float: right;
}

.u-pull-left {
  float: left;
}

/* IMAGES
 * ------------------------------------------------ */
img.scale-with-grid {
  max-width: 100%;
  height: auto;
}

/* BUTTONS
 * ------------------------------------------------ */
.button,
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
  display: inline-block;
  height: 38px;
  padding: 0 relative(30px);
  color: $button-color;
  text-align: center;
  font-size: relative(13px);
  font-weight: $button-weight;
  line-height: 38px;
  letter-spacing: 0.1rem;
  text-transform: if($button-font-uppercase, uppercase, none);
  text-decoration: none;
  white-space: nowrap;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid $button-border-color;
  cursor: pointer;
  box-sizing: border-box;
  &:hover,
  &:focus {
    color: #333;
    border-color: #888;
    outline: 0;
  }
  &.button-primary {
    color: #FFF;
    background-color: $orange;
    border-color: $orange-dark;
    &:hover,
    &:focus {
      color: #FFF;
      background-color: $orange;
      border-color: $orange-dark;
    }
  }
}

.button:visited {
  color: $button-color;
}

/* Fix for odd Mozilla border & padding issues */
button,
input {
  &::-moz-focus-inner {
    border: 0;
    padding: 0;
  }
}

/* FORMS
 * ------------------------------------------------ */
input[type="email"],
input[type="number"],
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea,
select {
  height: 38px;
  padding: 6px 10px; /* The 6px vertically centers text on FF, ignored by Webkit */
  background-color: #fff;
  border: 1px solid #D1D1D1;
  border-radius: 4px;
  box-shadow: none;
  box-sizing: border-box;
}

/* Removes awkward default styles on some inputs for iOS */
input[type="email"],
input[type="number"],
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

textarea {
  min-height: 65px;
  padding-top: 6px;
  padding-bottom: 6px;
}

input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border: 1px solid $orange;
  outline: 0;
}

label,
legend {
  display: block;
  margin-bottom: relative(5px);
  font-weight: 600;
}

fieldset {
  padding: 0;
  border-width: 0;
}

input[type="checkbox"],
input[type="radio"] {
  display: inline;
}

label > .label-body {
  display: inline-block;
  margin-left: relative(5px);
  font-weight: normal;
}

/* SPACING
 * ------------------------------------------------ */
button,
.button {
  margin-bottom: relative(10px);
}

input,
textarea,
select,
fieldset {
  margin-bottom: relative(15px);
}

pre,
blockquote,
dl,
figure,
table,
p,
ul,
ol,
form {
  margin-bottom: relative(25px);
}

/* MISC
 * ------------------------------------------------ */
hr {
  margin-top: relative(30px);
  margin-bottom: relative(35px);
  border-width: 0;
  border-top: 1px solid #E1E1E1;
}
