/* ==========================================================================
   $CONTENTS
   ========================================================================== */

/**
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 *
 * $HTML5 DISPLAY DEFINITIONS
 * $BASE STYLES: OPINIONATED DEFAULTS
 * $LINKS
 * $TYPOGRAPHY
 * $FORMS
 * $TABLES
 * $HELPER CLASSES
 * $PRINT STYLES
 */

/* ==========================================================================
   $HTML5 DISPLAY DEFINITION
   ========================================================================== */

/**
 * Correct `block` display not defined in IE 8/9.
 */

article, aside,
details,
figcaption, figure, footer,
header, hgroup,
main, nav,
section, summary {
    display: block;
}

/**
 * Address styling not present in IE 8/9.
 */

[hidden] {
    display: none;
}

/* ==========================================================================
   $BASE STYLES: OPINIONATED DEFAULTS
   ========================================================================== */

html,
button,
input,
select,
textarea {
    color: #222;
}

/**
 * 1. Set default font family to sans-serif.
 * 2. Prevent iOS text size adjust after orientation change, without disabling
 *    user zoom.
 */

html {
    font-family: sans-serif; /* 1 */
    overflow-y: scroll;
    -webkit-text-size-adjust: 100%; /* 2 */
}

body {
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
}

/*
 * Remove text-shadow in selection highlight: h5bp.com/i
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

/* ==========================================================================
   $LINKS
   ========================================================================== */

a {
    color: #A90D4B;
    text-decoration: none;
}

/**
 * Address `outline` inconsistency between Chrome and other browsers.
 */

a:focus {
    outline: thin dotted;
}

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

a:active,
a:hover {
    outline: 0;
    text-decoration: underline;
}

/* ==========================================================================
   $TYPOGRAPHY
   ========================================================================== */

/**
 * Address variable `h1` font-size and margin within `section` and `article`
 * contexts in Firefox 4+, Safari 5, and Chrome.
 */

h1 {
    font-size: 22px;
    margin: 10px 0;
}

/**
 * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
 */

b,
strong {
    font-weight: bold;
}

/**
 * Correct font family set oddly in Safari 5 and Chrome.
 */

code,
pre {
    font-family: monospace, serif;
    font-size: 16px;
}

/**
 * Improve readability of pre-formatted text in all browsers.
 */

pre {
    white-space: pre-wrap;
}

/**
 * Set consistent quote types.
 */

q {
    quotes: "\201C" "\201D" "\2018" "\2019";
}

/**
 * Address inconsistent and variable font size in all browsers.
 */

small {
    font-size: 80%;
}

/**
 * A better looking default horizontal rule
 */

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 10px 0;
    padding: 0;
    box-sizing: content-box;
}

/**
 * 1. Remove border when inside `a` element in IE 8/9.
 * 2. Remove the gap between images and the bottom of their containers: h5bp.com/i/440
 */

img {
    border: 0; /* 1 */
    vertical-align: middle; /* 2 */
}

/**
 * Correct overflow displayed oddly in IE 9.
 */

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

/* ==========================================================================
   $FORMS
   ========================================================================== */

/**
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/**
 * 1. Correct `color` not being inherited in IE 8/9.
 * 2. Remove padding so people aren't caught out if they zero out fieldsets.
 */

legend {
    border: 0; /* 1 */
    padding: 0; /* 2 */
}

/**
 * 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 */
}

/**
 * Address Firefox 4+ setting `line-height` on `input` using `!important` in
 * the UA stylesheet.
 */

button, input {
    line-height: normal;
}

/**
 * Address inconsistent `text-transform` inheritance for `button` and `select`.
 * All other form control elements do not inherit `text-transform` values.
 * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
 * Correct `select` style inheritance in Firefox 4+ and Opera.
 */

button, select {
    text-transform: 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"] {
    cursor: pointer; /* 3 */
    -webkit-appearance: button; /* 2 */
    -moz-appearance: button; /* 2 */
}

/**
 * Re-set default cursor for disabled elements.
 */

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

/**
 * 1. Remove excess padding in IE 8/9.
 * 2. Address box sizing set to `content-box` in IE 8/9.
 */

input[type="checkbox"],
input[type="radio"] {
    padding: 0; /* 1 */
    box-sizing: border-box; /* 2 */
}

/**
 * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
 * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
 *    (include `-moz` to future-proof).
 */

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

/**
 * 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;
}

/**
 * Remove inner padding and border in Firefox 4+.
 */

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/**
 * 1. Remove default vertical scrollbar in IE 8/9.
 * 2. Allow only vertical resizing of textareas.
 * 3. Improve readability and alignment in all browsers.
 */

textarea {
    overflow: auto; /* 1 */
    resize: vertical; /* 2 */
    vertical-align: top; /* 3 */
}

/* ==========================================================================
   $TABLES
   ========================================================================== */

/**
 * Remove most spacing between table cells.
 */

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

/* ==========================================================================
   $HELPER CLASSES
   ========================================================================== */

/**
 * Prototyping prompt
 */

.prototyping {
    margin: 10px 0;
    background: #ccc;
    color: #222;
    padding: 5px 0;
}

/**
 * Image replacement
 */

.ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
}

.ir:before {
    content: " ";
    display: block;
    width: 0;
    height: 150%;
}

/**
 * Clearfix: contain floats
 */

.clear:before,
.clear:after {
    content: " ";
    display: table;
}

.clear:after {
    clear: both;
}

/* ==========================================================================
   $PRINT STYLES
   Inlined to avoid required HTTP connection: h5bp.com/r
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: #000 !important; /* Black prints faster: h5bp.com/s */
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /**
     * Don't show links for images, or javascript/internal links
     */
    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* h5bp.com/t */
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: .5cm;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
