// Name:            Base
// Description:     Sets default values for HTML elements
//
// Component:       `wk-h1`, `wk-h2`, `wk-h3`, `wk-h4`, `wk-h5`, `wk-h6`
//                  `wk-link`
//                  `wk-img-preserve`
//
// ========================================================================


// Variables
// ========================================================================

@base-body-background:                          #fff;
@base-body-font-family:                         "Helvetica Neue", Helvetica, Arial, sans-serif;
@base-body-font-weight:                         normal;
@base-body-font-size:                           14px;
@base-body-line-height:                         20px;
@base-body-color:                               #444;

@base-link-color:                               #07D;
@base-link-text-decoration:                     none;
@base-link-hover-color:                         #059;
@base-link-hover-text-decoration:               underline;

@base-code-color:                               #D05;
@base-code-font-size:                           12px;
@base-code-font-family:                         Consolas, monospace, serif;
@base-em-color:                                 #D05;
@base-ins-background:                           #ffa;
@base-ins-color:                                #444;
@base-mark-background:                          #ffa;
@base-mark-color:                               #444;
@base-quote-font-style:                         italic;

@base-margin-vertical:                          15px;

@base-heading-font-family:                      "Helvetica Neue", Helvetica, Arial, sans-serif;
@base-heading-font-weight:                      normal;
@base-heading-color:                            #444;
@base-heading-text-transform:                   none;
@base-heading-margin-top:                       25px;
@base-h1-font-size:                             36px;
@base-h1-line-height:                           42px;
@base-h2-font-size:                             24px;
@base-h2-line-height:                           30px;
@base-h3-font-size:                             18px;
@base-h3-line-height:                           24px;
@base-h4-font-size:                             16px;
@base-h4-line-height:                           22px;
@base-h5-font-size:                             14px;
@base-h5-line-height:                           20px;
@base-h6-font-size:                             12px;
@base-h6-line-height:                           18px;

@base-list-padding-left:                        30px;

@base-hr-margin-vertical:                       @base-margin-vertical;
@base-hr-border:                                #ddd;
@base-hr-border-width:                          1px;

@base-blockquote-padding-left:                  15px;
@base-blockquote-border:                        #ddd;
@base-blockquote-border-width:                  5px;
@base-blockquote-font-size:                     16px;
@base-blockquote-line-height:                   22px;
@base-blockquote-font-style:                    italic;

@base-pre-padding:                              10px;
@base-pre-background:                           #f5f5f5;
@base-pre-color:                                #444;
@base-pre-font-size:                            12px;
@base-pre-line-height:                          18px;
@base-pre-font-family:                          @base-code-font-family;

@base-selection-background:                     #39f;
@base-selection-color:                          #fff;


/* ========================================================================
   Component: Base
 ========================================================================== */

/*
 * 1. Normalize default `font-family` and set `font-size` to support `rem` units
 * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom
 * 3. Style
 */

html {
    /* 1 */
    font: @base-body-font-weight @base-body-font-size e("/") @base-body-line-height @base-body-font-family;
    /* 2 */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* 3 */
    background: @base-body-background;
    color: @base-body-color;
    .hook-base-body;
}

/*
 * Removes default margin.
 */

body { margin: 0; }


/* Links
 ========================================================================== */

/*
 * Remove the gray background color from active links in IE 10.
 */

a { background: transparent; }

/*
 * Improve readability of focused elements when they are also in an active/hover state.
 */

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

/*
 * Style
 */

a,
.wk-link {
    color: @base-link-color;
    text-decoration: @base-link-text-decoration;
    cursor: pointer;
    .hook-base-link;
}

a:hover,
.wk-link:hover {
    color: @base-link-hover-color;
    text-decoration: @base-link-hover-text-decoration;
    .hook-base-link-hover;
}


/* Text-level semantics
 ========================================================================== */

/*
 * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
 */

abbr[title] { border-bottom: 1px dotted; }

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

b,
strong { font-weight: bold; }

/*
 * 1. Address odd `em`-unit font size rendering in all browsers.
 * 2. Consolas has a better baseline in running text compared to `Courier`
 */

:not(pre) > code,
:not(pre) > kbd,
:not(pre) > samp {
    /* 1 */
    font-size: @base-code-font-size;
    /* 2 */
    font-family: @base-code-font-family;
    /* 3 */
    color: @base-code-color;
    white-space: nowrap;
    .hook-base-code;
}

/*
 * Emphasize
 */

em { color: @base-em-color; }

/*
 * Insert
 */

ins {
    background: @base-ins-background;
    color: @base-ins-color;
    text-decoration: none;
}

/*
 * Mark
 * Note: Addresses styling not present in IE 8/9.
 */

mark {
    background: @base-mark-background;
    color: @base-mark-color;
}

/*
 * Quote
 */

q { font-style: @base-quote-font-style; }

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

small { font-size: 80%; }

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


/* Embedded content
 ========================================================================== */

/*
 * Remove the gap between embedded content and the bottom of their containers.
 */

audio,
canvas,
iframe,
img,
svg,
video { vertical-align: middle; }

/*
 * Responsiveness
 * 1. Sets a maximum width relative to the parent and auto scales the height
 * 2. Corrects `max-width` behavior if padding and border are used
 */

audio,
canvas,
img,
svg,
video {
    /* 1 */
    max-width: 100%;
    height: auto;
    /* 2 */
    box-sizing: border-box;
}

/*
 * Preserve original dimensions
 */

.wk-img-preserve,
.wk-img-preserve audio,
.wk-img-preserve canvas,
.wk-img-preserve img,
.wk-img-preserve svg,
.wk-img-preserve video { max-width: none; }

/*
 * Remove border when inside `a` element in IE 8/9/10.
 */

img { border: 0; }

/*
 * Correct overflow not hidden in IE 9/10/11.
 */

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


/* Block elements
 ========================================================================== */

/*
 * Reset margin
 */

blockquote,
figure { margin: 0; }

/*
 * Margins
 */

p,
ul,
ol,
dl,
blockquote,
pre,
address,
fieldset,
figure { margin: 0 0 @base-margin-vertical 0; }

* + p,
* + ul,
* + ol,
* + dl,
* + blockquote,
* + pre,
* + address,
* + fieldset,
* + figure { margin-top: @base-margin-vertical; }


/* Headings
 ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 @base-margin-vertical 0;
    font-family:  @base-heading-font-family;
    font-weight: @base-heading-font-weight;
    color: @base-heading-color;
    text-transform: @base-heading-text-transform;
    .hook-base-h;
}

/*
 * Margins
 */

* + h1,
* + h2,
* + h3,
* + h4,
* + h5,
* + h6 { margin-top: @base-heading-margin-top; }

/*
 * Sizes
 */

h1, .wk-h1 {
    font-size: @base-h1-font-size;
    line-height: @base-h1-line-height;
    .hook-base-h1;
}

h2, .wk-h2 {
    font-size: @base-h2-font-size;
    line-height: @base-h2-line-height;
    .hook-base-h2;
}

h3, .wk-h3 {
    font-size: @base-h3-font-size;
    line-height: @base-h3-line-height;
    .hook-base-h3;
}

h4, .wk-h4 {
    font-size: @base-h4-font-size;
    line-height: @base-h4-line-height;
    .hook-base-h4;
}

h5, .wk-h5 {
    font-size: @base-h5-font-size;
    line-height: @base-h5-line-height;
    .hook-base-h5;
}

h6, .wk-h6 {
    font-size: @base-h6-font-size;
    line-height: @base-h6-line-height;
    .hook-base-h6;
}


/* Lists
 ========================================================================== */

ul,
ol { padding-left: @base-list-padding-left; }

/*
 * Reset margin for nested lists
 */

ul > li > ul,
ul > li > ol,
ol > li > ol,
ol > li > ul { margin: 0; }


/* Description lists
 ========================================================================== */

dt { font-weight: bold; }
dd { margin-left: 0; }


/* Horizontal rules
 ========================================================================== */

/*
 * 1. Address differences between Firefox and other browsers.
 * 2. Style
 */

hr {
    /* 1 */
    box-sizing: content-box;
    height: 0;
    /* 2 */
    margin: @base-hr-margin-vertical 0;
    border: 0;
    border-top: @base-hr-border-width solid @base-hr-border;
    .hook-base-hr;
}


/* Address
 ========================================================================== */

address { font-style: normal; }


/* Blockquotes
 ========================================================================== */

blockquote {
    padding-left: @base-blockquote-padding-left;
    border-left: @base-blockquote-border-width solid @base-blockquote-border;
    font-size: @base-blockquote-font-size;
    line-height: @base-blockquote-line-height;
    font-style: @base-blockquote-font-style;
    .hook-base-blockquote;
}


/* Preformatted text
 ========================================================================== */

/*
 * 1. Contain overflow in all browsers.
 */

pre {
    padding: @base-pre-padding;
    background: @base-pre-background;
    font: @base-pre-font-size e("/") @base-pre-line-height @base-pre-font-family;
    color: @base-pre-color;
    -moz-tab-size: 4;
    tab-size: 4;
    /* 1 */
    overflow: auto;
    .hook-base-pre;
}


/* Selection pseudo-element
 ========================================================================== */

::-moz-selection {
    background: @base-selection-background;
    color: @base-selection-color;
    text-shadow: none;
}

::selection {
    background: @base-selection-background;
    color: @base-selection-color;
    text-shadow: none;
}


/* HTML5 elements
 ========================================================================== */

/*
 * Correct `block` display not defined for any HTML5 element in IE 8/9.
 * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.
 * Correct `block` display not defined for `main` in IE 11.
 */

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

/*
 * Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
 */

progress { vertical-align: baseline; }

/*
 * Prevent displaying `audio` without controls in Chrome, Safari and Opera
 */

audio:not([controls]) { display: none; }

/*
 * Address `[hidden]` styling not present in IE 8/9/10.
 * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
 */

[hidden],
template { display: none; }


/* Iframe
 ========================================================================== */

iframe { border: 0; }


/* Fix viewport for IE10 snap mode
 ========================================================================== */

@media screen and (max-width: 400px) {
    @-ms-viewport{
        width: device-width;
    }
}


// Hooks
// ========================================================================

.hook-base-misc;

.hook-base-body() {}
.hook-base-link() {}
.hook-base-link-hover() {}
.hook-base-code() {}
.hook-base-h() {}
.hook-base-h1() {}
.hook-base-h2() {}
.hook-base-h3() {}
.hook-base-h4() {}
.hook-base-h5() {}
.hook-base-h6() {}
.hook-base-hr() {}
.hook-base-blockquote() {}
.hook-base-pre() {}
.hook-base-misc() {}