// Name:            Base
// Description:     Sets default values for HTML elements
//
// Component:       `uk-h1`, `uk-h2`, `uk-h3`, `uk-h4`, `uk-h5`, `uk-h6`
//                  `uk-link`
//                  `uk-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-em-color:                                 #D05;
@base-ins-background:                           #ffa;
@base-ins-color:                                #444;
@base-mark-background:                          #ffa;
@base-mark-color:                               #444;
@base-selection-background:                     #39f;
@base-selection-color:                          #fff;

@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-border:                                #ddd;
@base-hr-border-width:                          1px;

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

@base-code-color:                               #D05;
@base-code-font-size:                           12px;
@base-code-font-family:                         Consolas, monospace, serif;

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


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

/* Body
 ========================================================================== */

/*
 * `font-size` is set in `html` element to support the `rem` unit for font-sizes
 */

html { font-size: @base-body-font-size; }

body {
    background: @base-body-background;
    font-family:  @base-body-font-family;
    font-weight:  @base-body-font-weight;
    line-height: @base-body-line-height;
    color: @base-body-color;
    .hook-base-body;
}

/* Phone landscape and smaller */
@media (max-width: @breakpoint-small-max) {

    /*
     * Break strings if their length exceeds the width of their container
     */

    body {
        word-wrap: break-word;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
        -moz-hyphens: auto;
        hyphens: auto;
    }

}


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

/*
 * Links
 */

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

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

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

/*
 * Selection highlight
 */

::-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;
}

/*
 * Abbreviation and definition
 */

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

dfn[title] {
    border-bottom: 1px dotted;
    font-style: normal;
}


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

/*
 * 1. Corrects max-width behavior (2.) if padding and border are used
 * 2. Responsiveness: Sets a maximum width relative to the parent and auto scales the height
 * 3. Remove the gap between images and the bottom of their containers
 */

img {
    /* 1 */
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    /* 2 */
    max-width: 100%;
    height: auto;
    /* 3 */
    vertical-align: middle;
}

/*
 * Preserve original image dimensions
 * 1. Fix Google maps automatically via URL detection
 */

.uk-img-preserve,
.uk-img-preserve img,
img[src*="maps.gstatic.com"], // 1
img[src*="googleapis.com"] { max-width: none; }


/* Spacing for block elements
 ========================================================================== */

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

/*
 * Don't worry about the universal selector.
 * There is no mentionable performance impact.
 */

* + p,
* + hr,
* + 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;
}

/*
 * Don't worry about the universal selector.
 * There is no mentionable performance impact.
 */

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

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

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

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

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

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

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


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

/*
 * Ordered and unordered 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 rule
 ========================================================================== */

hr {
    display: block;
    padding: 0;
    border: 0;
    border-top: @base-hr-border-width solid @base-hr-border;
}


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

address { font-style: normal; }


/* Quotes
 ========================================================================== */

q,
blockquote { font-style: italic; }

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

/* Small print for identifying the source */
blockquote small {
    display: block;
    color: @base-blockquote-small-color;
    font-style: normal;
}

/* Smaller margin if `small` follows */
blockquote p:last-of-type { margin-bottom: 5px; }


/* Code and preformatted text
 ========================================================================== */

code {
    color: @base-code-color;
    font-size: @base-code-font-size;
    white-space: nowrap;
    .hook-base-code;
}

/* Reset code elements if parent of pre elements */
pre code {
    color: inherit;
    white-space: pre-wrap;
    .hook-base-code-reset;
}

pre {
    padding: @base-pre-padding;
    background: @base-pre-background;
    color: @base-pre-color;
    font-size: @base-pre-font-size;
    line-height: @base-pre-line-height;
    -moz-tab-size: 4;
    tab-size: 4;
    .hook-base-pre;
}


/* Forms
 ========================================================================== */

/*
 * Vertical alignment
 * Exclude `radio` and `checkbox` elements because the default `baseline` value aligns better with text
 */

button,
input:not([type="radio"]):not([type="checkbox"]),
select { vertical-align: middle; }


/* 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-code() {}
.hook-base-code-reset() {}
.hook-base-pre() {}
.hook-base-misc() {}