/*

Base

The base stylesheet requires `core.css` and uses it to set all html elements
to adhere to the Baseline Grid and gives them default styles.

Markup:
<div>
  <h1>Headline 1</h1>
  <p>
    Paragraph
  </p>
  <h2>Headline 2</h2>
  <ul>
    <li>Unordered item</li>
    <li>Unordered item</li>
  </ul>
  <h3>Headline 3</h3>
  <ol>
    <li>Ordered item</li>
    <li>Ordered item</li>
  </ol>
  <h4>Headline 4</h4>
<pre>
  Preformatted
</pre>
  <h5>Headline 5</h5>
  <blockquote>
    Blockquote
  </blockquote>
  <h6>Headline 6</h6>
  <table>
    <tr>
      <th>Table Header</th>
      <th>Table Header</th>
    </tr>
    <tr>
      <td>Table Cell</td>
      <td>Table Cell</td>
    </tr>
  </table>
</div>

Styleguide 2.0

*/

* {
    border: 0;
    font: inherit;
    margin: 0;
    padding: 0;
    text-rendering: geometricPrecision;
}

:focus {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

html {
    overflow-x: hidden;
}

html,
body {
    box-sizing: border-box;
    min-height: 100%;
}

body {
    background-color: var(--color-neutral-tint4);
    color: var(--color-neutral-shade4);
    font-family: var(--font-body);
    position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-size: var(--font-size);
    line-height: var(--line-height);
    margin: var(--rhythm) 0;
}

h1 {
    --line-height-ratio: 1.1;
    --sub-rhythm: var(--rhythm-triple);

    font-weight: 700;
    margin-bottom: var(--rhythm-double);
}

h2 {
    --line-height-ratio: 1.2;
    --sub-rhythm: var(--rhythm-triple);
}

h3 {
    --line-height-ratio: 1.3;
    --sub-rhythm: var(--rhythm-double);

    font-weight: 700;
}

h4 {
    --sub-rhythm: var(--rhythm-double);
}

h5 {
    font-weight: 700;
}

p {
    margin-bottom: var(--rhythm);
}

form {
    margin: var(--rhythm) 0;
}

pre,
code,
samp,
kbd {
    background-color: var(--color-neutral-tint3);
    font-size: var(--font-size);
    color: var(--color-primary-shade1);
    font-family: var(--font-mono);
    line-height: 1;
}

code,
samp,
kbd {
    border-radius: var(--border-radius);
    overflow-y: hidden;
    overflow-x: auto;
    padding: var(--rhythm-sixth);
}

pre {
    border-radius: var(--border-radius);
    line-height: var(--line-height);
    overflow-y: hidden;
    overflow-x: auto;
    padding: var(--rhythm-half);
    margin: 0 0 var(--rhythm);
}

pre code,
pre samp,
pre kbd {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

a:link {
    color: var(--color-link);
}

a:visited {
    color: var(--color-link-visited);
}

a:hover,
a:focus {
    color: var(--color-link-hover);
}

a:active {
    color: var(--color-link-active);
}

img,
video {
    max-width: 100%;
    vertical-align: top;
}

hr {
    height: var(--rhythm-double);
    margin-bottom: var(--rhythm);
    position: relative;
}

hr::before {
    background-color: var(--color-neutral-tint1);
    content: '';
    height: 1px;
    left: 0;
    position: absolute;
    top: 50%;
    width: 100%;
}

ol,
ul {
    margin: 0 0 var(--rhythm) var(--rhythm);
}

ol {
    list-style-type: decimal;
}

ol ol {
    margin-bottom: 0;
}

ul {
    list-style-type: disc;
}

ul ul {
    margin-bottom: 0;
}

dt {
    font-style: italic;
}

dd {
    margin-left: var(--rhythm);
}

blockquote {
    margin: 0 0 var(--rhythm) var(--rhythm-half);
    border-left: var(--rhythm-eighth) solid var(--color-neutral-tint1);
    padding: var(--rhythm) var(--rhythm-half);
}

blockquote p:last-child {
    margin-bottom: 0;
}

figure {
    margin: 0 auto var(--rhythm);
}

small,
sub,
sup,
caption,
figcaption {
    font-size: calc(2 * var(--rhythm-third));
    vertical-align: top;
}

sub,
sup {
    position: relative;
}

sub {
    top: var(--rhythm-third);
}

sup {
    bottom: var(--rhythm-third);
}

caption,
figcaption {
    font-style: italic;
    text-align: center;
}

em,
cite,
i {
    font-style: italic;
}

strong,
var,
b {
    font-weight: bold;
}

q::before {
    content: "'";
}

q::after {
    content: "'";
}

q > q {
    font-style: italic;
}

dfn,
abbr {
    border-bottom: var(--rhythm-sixteenth) dotted var(--color-neutral-shade2);
    cursor: default;
}

table {
    border-radius: var(--border-radius);
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: var(--rhythm);
    width: 100%;
}

table th {
    text-align: left;
}

table th,
table td {
    padding: 0 var(--rhythm-fourth);
}

input,
label,
select,
button,
textarea {
    color: var(--color-neutral-shade4);
    display: block;
    padding: var(--rhythm-half);
    resize: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Firefox detection for keeping exact rhythm */
@-moz-document url-prefix() {
    select {
        line-height: calc(var(--rhythm) - 2px);
    }
}

label {
    color: var(--color-neutral-shade1);
    padding: 0;
}
