/******************************************************************
Site Name:
Author:

Stylesheet: Typography

******************************************************************/

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/sourcesanspro-it-webfont.eot');
    src: url('../fonts/sourcesanspro-it-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/sourcesanspro-it-webfont.woff2') format('woff2'),
         url('../fonts/sourcesanspro-it-webfont.woff') format('woff'),
         url('../fonts/sourcesanspro-it-webfont.ttf') format('truetype'),
         url('../fonts/sourcesanspro-it-webfont.svg#source_sans_proitalic') format('svg');
    font-weight: normal;
    font-style: italic;

}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/sourcesanspro-regular-webfont.eot');
    src: url('../fonts/sourcesanspro-regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/sourcesanspro-regular-webfont.woff2') format('woff2'),
         url('../fonts/sourcesanspro-regular-webfont.woff') format('woff'),
         url('../fonts/sourcesanspro-regular-webfont.ttf') format('truetype'),
         url('../fonts/sourcesanspro-regular-webfont.svg#source_sans_proregular') format('svg');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/sourcesanspro-boldit-webfont.eot');
    src: url('../fonts/sourcesanspro-boldit-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/sourcesanspro-boldit-webfont.woff2') format('woff2'),
         url('../fonts/sourcesanspro-boldit-webfont.woff') format('woff'),
         url('../fonts/sourcesanspro-boldit-webfont.ttf') format('truetype'),
         url('../fonts/sourcesanspro-boldit-webfont.svg#source_sans_probold_italic') format('svg');
    font-weight: bold;
    font-style: italic;

}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/sourcesanspro-bold-webfont.eot');
    src: url('../fonts/sourcesanspro-bold-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/sourcesanspro-bold-webfont.woff2') format('woff2'),
         url('../fonts/sourcesanspro-bold-webfont.woff') format('woff'),
         url('../fonts/sourcesanspro-bold-webfont.ttf') format('truetype'),
         url('../fonts/sourcesanspro-bold-webfont.svg#source_sans_probold') format('svg');
    font-weight: bold;
    font-style: normal;

}





// Fonts
$sans-serif: "Source Sans Pro", 'Helvetica Neue', Helvetica, Arial, sans-serif;
$serif: "Amaranth", Arial, sans-serif;

$base-font-family: $sans-serif;
$header-font-family: $serif;
// $header-font-family: $sans-serif;
$scale-ratio: 1.3;
$base-font-size: 1rem / 1.5;
$base-line-height: 1rem;
$base-cap-height: .51; // this value may vary for each font (unitless value relative to 1em, offsets fonts to align to baseline)
$header-cap-height: .65; 




// mixin used to generate a font size, line height, and offset value for a given power of the global scale factor. 
// 0 returns the base font size

@mixin baseline($scale-factor: 0, $cap-height: $base-cap-height) {

  $scale: pow($scale-ratio, $scale-factor);

  // font size
  $font-size: $base-font-size * $scale;
 
  // rhythm unit
  $rhythm: 1rem;
 
 
  // calculate the new line-height
  $line-height: ceil($base-line-height * $scale * 2) / 2;

  // calculate the offset
  $baseline-distance: ( ( $line-height / $font-size ) - $cap-height) / 2 * $font-size;

  

  // use the results
  font-size: $font-size;
  line-height: $line-height;
  padding-top: $baseline-distance;
  margin-top: 0;
  margin-bottom: ceil($line-height - 1) / 2 + 1 - $baseline-distance;

  & img{
    position: relative;
    top: $baseline-distance;
  }
}



p {
  -ms-word-break: break-all;
  -ms-word-wrap: break-all;
      word-break: break-word;
     word-break: break-word;
  // cleaning up the ragged lines and breaks
  -webkit-hyphens: auto;
     -moz-hyphens: auto;
          hyphens: auto;
  // sets a minimum number of characters before and after the break
  -webkit-hyphenate-before: 2;
   -webkit-hyphenate-after: 3;
           hyphenate-lines: 3;
  // enabling fancy ligatures when available
  -webkit-font-feature-settings: "liga", "dlig";
   -moz-font-feature-settings: "liga=1, dlig=1";
      -ms-font-feature-settings: "liga", "dlig";
       -o-font-feature-settings: "liga", "dlig";
          font-feature-settings: "liga", "dlig";
}


body {
  font-family: $base-font-family;
  font-size: $base-font-size;
  line-height: $base-line-height;
  word-wrap: normal;
  margin:0; padding:0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.deck{ font-style:italic;}


/**
 *
 * =======================================================================
   Word Wrap
 * =======================================================================
 */

.breakword {
  word-wrap: break-word;
}

.normal-wrap {
  word-wrap: normal;
}

.inherit-wrap {
  word-wrap: auto;
}

.no-wrap {
  white-space: nowrap;
}




/**
 *
 * =======================================================================
   Alignment
 * =======================================================================
 */
  .text-left    { text-align: left !important; }
  .text-right   { text-align: right !important; }
  .text-center  { text-align: center !important; }
  .text-justify { text-align: justify !important; }



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

h1, h2, h3, h4, h5, h6,
.tera, .giga, .mega, .alpha, .beta, .gamma, .delta, .epsilon, .zeta {
  line-height: 1;
  margin-top: 0;
  text-rendering: optimizeLegibility; /*  voodoo to enable ligatures and kerning | https://developer.mozilla.org/en-US/docs/CSS/text-rendering */
  font-weight: normal;
  font-family: $header-font-family;
}


p, ul, ol, pre, table, blockquote, .normal {
  @include baseline();
}
.large, .deck   {  @include baseline(1); }
small, .small {  @include baseline(-1); }


.tera       {  @include baseline(7, $header-cap-height); }
.giga       {  @include baseline(6, $header-cap-height); }
.mega       {  @include baseline(5, $header-cap-height); }
h1,.alpha   {  @include baseline(4, $header-cap-height); }
h2,.beta    {  @include baseline(3, $header-cap-height); }
h3,.gamma   {  @include baseline(2, $header-cap-height); }
h4,.delta   {  @include baseline(1, $header-cap-height); }
h5,.epsilon {  @include baseline(0, $header-cap-height); }
h6,.zeta    {  @include baseline(-1, $header-cap-height); }







/**
 *
 * =======================================================================
   Hyphens
 * =======================================================================
 */

abbr, acronym, blockquote, code, dir, kbd, listing, plaintext, q, samp, tt, var, xmp {
  -webkit-hyphens: none; /* Safari 5.1 thru 6, iOS 4.2 thru 6 */
  -moz-hyphens: none; /* Firefox 16 thru 20 */
  -ms-hyphens: none; /* IE10 */
  -o-hyphens: none; /* PRESTO...haha LOL */
  hyphens: none;   /* W3C standard */
}



ol, ul {
    padding-left: 2em;
    list-style-type: disc;
}


/**
 *
 * =======================================================================
   Code Blocks
 * =======================================================================
 */

pre code {
  word-wrap: normal;
  white-space: -moz-pre-wrap;
  white-space: pre-wrap; /* http://css-tricks.com/almanac/properties/w/whitespace */
}

pre {
  white-space: pre;
}

code {
  white-space: pre;
  font-family: monospace;
}


/**
 *
 * =======================================================================
 * Abbreviations Markup
 * =======================================================================
 */

abbr {
  font-variant: small-caps; /* https://developer.mozilla.org/en-US/docs/CSS/font-variant */
  font-weight: 600;
  text-transform: lowercase;
  color: #808080;
}

abbr[title]:hover {
  cursor: help; /* cursor changed to a question mark when it has a title */
}
