// ============================================================
// FILE : normalize.sass
// DESCRIPTION: Used as a Reset 
// ------------------------------------------------------------*/

+route(style,base)
  h1, h2, h3, h4, h5, h6, p, blockquote, pre, dl, dd, ol, ul, form, fieldset, legend, table, th, td, caption, hr
    margin: 0
    padding: 0
    // ---- Activate Antialias ----
    @if $activate-antialias == true
      -webkit-font-smoothing: antialiased

  @if $activate-box-sizing == true
    *
      &,&:before,&:after
        +box-sizing(border-box)
      @if $comp-borderbox == true
        *behavior: url('#{$comp-polyfill-path}/boxsizing.htc')

+route(style,theme,child)
  html, button, input, select, textarea
    font-family: nth($font-style-text,1)

html,body
  +route(style,theme,child)
    color: $tc-text
  +route(style,base)
    @if nth($font-style-text,2) != false
      font-weight: nth($font-style-text,2)
  +route(style,theme,child)
    .soft
      color: $tc-text-soft

+route(style,base)
  html 
    -webkit-text-size-adjust: 100% 
    -ms-text-size-adjust: 100% 
    height: 100%

    @if $comp-css3pie != false
      -pie-load-path: #{$comp-polyfill-path}

    $slice-amount: length($slicer-breakpoints)

    @if $mobile-first == true
      font-size: nth($res-fontsize, 1) + 0%
      @if nth($layout-fluid-behavior,2) != false 
        @if $responsive-fonts == true   
          @for $i from 2 through ($slice-amount)
            $fsize : nth($res-fontsize,($i)) 
            @if $fsize > 0
              +from($i) 
                font-size: $fsize + 0%
    @else
      font-size: nth($res-fontsize, $slice-amount) + 0%
      @if nth($layout-fluid-behavior,2) != false 
        @if $responsive-fonts == true   
          @for $i from (0 - ($slice-amount - 1)) through -1
            $fsize : nth($res-fontsize,(abs($i - 1)))
            @if $fsize > 0
              +to(abs($i)) 
                font-size: $fsize + 0%

body
  +route(style,base)
    margin: 0 
    min-height: 100%
    height: 100%
    position: relative
  +route(style,theme,child)
    background-color: $c-body

+route(style,base)
  article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary 
    display: block

  audio,canvas,video 
    display: inline-block
    @if $comp-ie7 == true
      .ie7 &
        display: inline
        zoom: 1

  audio:not([controls]) 
    display: none
    height: 0

  [hidden]
    display: none

// ============================================================
//          TYPOGRAPHY                                  
// ------------------------------------------------------------
#{headings(all)}
  +route(style,base)
    text-rendering: optimizeLegibility
    margin-top: 0
    small
      font-size: 60%
      line-height: 0
  +route(style,theme,child)
    @if $font-heading-family != false OR $tc-heading != false
      @if $font-heading-family != false
        font-family: $font-heading-family
      @if $tc-heading != false
        color: $tc-heading
      @if $tc-heading-sub != false
        &.subheader
          color: $tc-heading-sub

// ---- Headings ----
h1, .h1
  +route(style,base)
    +fontsize(nth($font-h1-style,1))
    +lineheight(nth($font-h1-style,2))
    +marginbottom(nth($font-h1-style,3))
  @if nth($font-heading-weight,1) != false
    +route(style,theme,child)
      font-weight: nth($font-heading-weight,1) 

h2, .h2
  +route(style,base)
    +fontsize(nth($font-h2-style,1))
    +lineheight(nth($font-h2-style,2))
    +marginbottom(nth($font-h2-style,3))
  @if nth($font-heading-weight,2) != false
    +route(style,theme,child)
      font-weight: nth($font-heading-weight,2) 

h3, .h3
  +route(style,base)
    +fontsize(nth($font-h3-style,1))
    +lineheight(nth($font-h3-style,2))
    +marginbottom(nth($font-h3-style,3))
  @if nth($font-heading-weight,3) != false
    +route(style,theme,child)
      font-weight: nth($font-heading-weight,3) 

h4, .h4
  +route(style,base)
    +fontsize(nth($font-h4-style,1))
    +lineheight(nth($font-h4-style,2))
    +marginbottom(nth($font-h4-style,3))
  @if nth($font-heading-weight,4) != false
    +route(style,theme,child)
      font-weight: nth($font-heading-weight,4) 

h5, .h5
  +route(style,base)
    +fontsize(nth($font-h5-style,1))
    +lineheight(nth($font-h5-style,2))
    +marginbottom(nth($font-h5-style,3))
  @if nth($font-heading-weight,5) != false
    +route(style,theme,child)
      font-weight: nth($font-heading-weight,5) 

h6, .h6
  +route(style,base)
    +fontsize(nth($font-h6-style,1))
    +lineheight(nth($font-h6-style,2)) 
    +marginbottom(nth($font-h6-style,3))
  @if nth($font-heading-weight,6) != false
    +route(style,theme,child)
      font-weight: nth($font-heading-weight,6) 

+route(style,base)
  // ---- Header Stack ----
  .header--stack
    #{headings(all)}
      margin-bottom: 0
    
  // ---- Brandlogo ----
  .brand
    font-size: inherit !important
    line-height: 1 !important
    margin-bottom: 0 !important
    a
      display: block
      text-decoration: none !important
      &:hover
        text-decoration: none !important

  .brand_logo
    @extend .brand
    a
      +ct
  
  // ---- Paragraph ----
  p
    +marginbottom(nth($font-p-style,3))

  p, .container
    @if nth($font-p-style,1) != false
      +fontsize(nth($font-p-style,1))
    @if nth($font-p-style,2) != false
      +lineheight(nth($font-p-style,2))

  // ---- Leading Paragraph ----

  .lead
    @if nth($font-p-style,1) != false
      +fontsize(nth($font-p-style,1) * 1.19)
    @else
      +fontsize($body-font-size * 1.19)

  // ---- Smaller Paragraph ----
  .small 
    @if nth($font-p-style,1) != false
      +fontsize(nth($font-p-style,1) * 0.9)
    @else
      +fontsize($body-font-size * 0.9)
      
+route(style,theme,child) 
  .weight-100
    font-weight: 100 !important

  .weight-200
    font-weight: 200 !important

  .weight-300
    font-weight: 300 !important

  .weight-600
    font-weight: 600 !important

  .weigth-900
    font-weight: 900 !important

// ---- Links ----
a
  +route(style,base)
    line-height: inherit
    outline: 0
    cursor: pointer
  +route(style,theme,child) 
    color: nth($tc-link,1)
    @if nth($tc-decoration,1) == true
      text-decoration: underline 
    @else
      text-decoration: none

    &:hover
      color: nth($tc-link,2)
      @if nth($tc-decoration,2) == true
        text-decoration: underline
      @else
        text-decoration: none
        
    &:active
      color: nth($tc-link,3)
  +route(style,base)
    &:hover,&:active
      outline: 0

+route(style,theme,child) 
  abbr[title] 
    border-bottom: 1px dotted

  b, strong
    font-weight: nth($font-style-bold,2)
    @if nth($font-style-bold,1) != false
      font-family: nth($font-style-bold,1)

  em, i, dfn
    font-style: nth($font-style-italic,2)
    @if nth($font-style-italic,1) != false
      font-family: nth($font-style-italic,1)

  mark, .hightlight
    background: nth($tc-highlight,1)
    color: nth($tc-highlight,2)

+route(style,base)
  // ---- Lists ----
  ul, ol, dd
    +marginbottom(nth($font-ul-style,3))
    list-style: none
    li
      @if nth($font-ul-style,1) != false
        +fontsize(nth($font-ul-style,1))

      @if nth($font-ul-style,2) != false
        +lineheight(nth($font-ul-style,2))

  .list-disc, .list-square, .list-circle, .list-numbered
    margin-left: nth($font-ul-style,1) + 3px

  .list-disc
    list-style-type: disc

  .list-square
    list-style-type: square

  .list-circle
    list-style-type: circle

  .list-none
    list-style-type: none
    padding-left: 0

  // ---- Remove vertical spacing from nested lists ----
  li     
    > ul, > ol
      margin-bottom: 0

  // ---- Overwrite the UL Behavior ----
  .list-numbered
    list-style-type: decimal

  // Address differences between Firefox and other browsers.
  hr 
    +box-sizing(content-box)
    height: 0
    border-top: 0
    border-right: 0
    border-left: 0
    border-bottom: $hr-style +0px
    @if nth($hr-style,1) != false 
      +marginbottom(nth($hr-style,1))

code,kbd,pre,samp
  +route(style,base)
    @if nth($font-code-style,1) != false
      +fontsize(nth($font-code-style,1))
    @if nth($font-code-style,2) != false
      +lineheight(nth($font-code-style,2))
  +route(style,theme,child)
    @if nth($font-style-code,2) != false
      font-weight: nth($font-style-code,2)
    @if nth($font-style-code,1) != false
      font-family: nth($font-style-code,1)
    @else
      font-family: monospace, serif 
      _font-family: 'courier new', monospace

+route(style,base)
  pre
    white-space: pre
    white-space: pre-wrap
    word-wrap: break-word
    +marginbottom(nth($font-code-style,3))

  q 
    quotes: none

    &:before, &:after
      content: ''
      content: none

  small 
    font-size : 80%

  sub,sup 
    font-size: 75%
    line-height: 0
    position: relative
    vertical-align: baseline

  sup 
    top: -0.5em

  sub 
    bottom: -0.25em

  // ---- Embed Media ----
  img 
    border : 0
    -ms-interpolation-mode: bicubic

  svg:not(:root) 
    overflow: hidden

// ---- Blockquote ----*/
+route(style,base)
  blockquote
    & p
      @if nth($font-blockquote-style,1) != false
        +fontsize(nth($font-blockquote-style,1))
      @if nth($font-blockquote-style,2) != false
        +lineheight(nth($font-blockquote-style,2))
    p:last-child 
      margin-bottom: 0
    +marginbottom(nth($font-blockquote-style,3))
    cite
      @if nth($font-cite-style,1) != false
        +fontsize(nth($font-cite-style,1))
      @if nth($font-cite-style,2) != false
        +lineheight(nth($font-cite-style,2))

+route(style,theme,child)
  blockquote, q, cite
    @if nth($font-style-quote,1) != false
      font-family: nth($font-style-quote,1)
    @if nth($font-style-quote,2) != false
      font-weight: nth($font-style-quote,2)
    @if nth($font-style-quote,3) != false
      font-style: nth($font-style-quote,3)
    @if $tc-blockquote != false
      color: $tc-blockquote

  cite
    font-style: normal
    &:before
      content : '\2014 \0020'

+route(style,base)
  // ---- Figures ----
  figure 
    margin: 0

// ---- Forms ----
fieldset 
  +route(style,theme,child)
    border: 1px solid #c0c0c0
  +route(style,base)
    margin: 0 2px
    padding: 0.35em 0.625em 0.75em

+route(style,base)
  legend 
    border: 0  
    padding: 0
    white-space: normal
    @if $comp-ie7 == true
      margin-left: -7px

  button,input,select,textarea 
    font-size: 100%
    margin: 0
    vertical-align: baseline
    @if $comp-ie7 == true
      .ie7 &
        vertical-align: middle

  button,input 
    line-height: normal

  button,select 
    text-transform: none

  button, html input[type="button"],input[type="reset"],input[type="submit"]
    -webkit-appearance: button
    cursor: pointer 
    @if $comp-ie7 == true
      .ie7 &
        overflow: visible

  button[disabled],html input[disabled] 
    cursor: default

  input[type="checkbox"],input[type="radio"] 
    box-sizing: border-box
    cursor: pointer
    padding: 0
    @if $comp-ie7 == true
      .ie7 &
        height: 13px
        width: 13px

  input[type="search"]
    -webkit-appearance: textfield
    +box-sizing(content-box)

  input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration 
    -webkit-appearance: none

  button::-moz-focus-inner,input::-moz-focus-inner 
    border: 0
    padding: 0

  textarea 
    overflow: auto
    vertical-align: top

  // ---- Tables ----
  table 
    border-collapse: collapse
    border-spacing: 0
    width: 100%

  .mobilenav
    display: none
