@mixin heading-spacing($x) {
  line-height: rem($x);
  margin-bottom: rem($x / 2);
}

@mixin font-sans-serif() {
  font-family: $font-sans-serif;
}

@mixin font-serif() {
  font-family: $font-serif;
}

@mixin base-font-size() {
  font-size: $font-size-base;

  @include on("sm") {
    font-size: 14.8px;
  }
}

@mixin heading() {
  @include font-sans-serif();
  font-weight: bold;
  margin-top: 0;
}





// Base sizing
// ===========

// (1) A random number that has been found to
//     result in more pixel perfect down-sizing


html, .html {
  @include base-font-size();
}

// Base styling
// ============

.wf-active body, .body {

}

body, .body {
  @include base-font-size();
  @include font-sans-serif();
  line-height: 1.5;
  color: #{map-get($palette, 'text')};
  font-smooth: always;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

article, .article {
  margin-bottom: $md;
  &:last-child {
    margin-bottom: 0;
  }
}

.font-sans-serif {
  @include font-sans-serif();
}

.font-serif {
  @include font-serif();
}



// Links
// =====

a, .a {
  text-decoration: none;
  color: #{map-get($palette, 'text-link')};
  cursor: pointer;
  &:hover {
    text-decoration: underline;
  }
}

// Paragraphs
// ==========

p, .p {
  @include font-serif();
  font-size: rem(20);
  height: 1.5;
  margin-top: 0;
  margin-bottom: $md;

  &:last-child {
    margin-bottom: 0;
  }
  
  &.small {
    font-size: rem(16);
  }
}

.font-sans-serif>p, .font-sans-serif>.p {
  @include font-sans-serif();
} 



// Headings
// ========

h1, .h1 {
  @include heading();
  @include heading-spacing(60);
  font-size: rem(66);
  &.huge {
    @include heading-spacing(66);
    font-size: rem(60);
  }
  @include on("sm") {
    font-size: rem(36);
    line-height: rem(40);
  }
}

h2, .h2 {
  @include heading();
  @include heading-spacing(53);
  font-size: rem(48);
  @include on("md") {
    font-size: rem(30);
    line-height: rem(33);
  }
}

h3, .h3 {
  @include heading();
  @include heading-spacing(40);
  font-size: rem(36);
}

h4, .h4 {
  @include heading();
  @include heading-spacing(33);
  font-size: rem(30);
}

h5, .h5 {
  @include heading();
  @include heading-spacing(26);
  font-size: rem(24);
}

h6, .h6 {
  @include heading();
  @include heading-spacing(22);
  font-size: rem(20);
}



// Editorial list styles

.p-li {
  margin-bottom: $md;
  &:last-child {
    margin-bottom: 0;
  }
}

.strong {
  font-weight: bold;
}

.weight-normal {
  font-weight: normal;
}

em, .italic {
  font-style: italic;
}

.strikethrough {
  text-decoration: line-through;
}

// Align icons in text

.icon {
  vertical-align: top;
}


// Sizes
// =======

.text-xxl {
  font-size: rem(65);
}

.text-xl {
  font-size: rem(50);
}

.text-lg {
  font-size: rem(40);
}

.text-md {
  font-size: rem(26);
}

.text-sm {
  font-size: rem(20);
}

.text-xs {
  font-size: rem(16);
}

// Text Transform
// =======

.lowercase {
  text-transform: lowercase;
}

.capitalize {
  text-transform: capitalize;
}

.uppercase {
  text-transform: uppercase;
}

// Line height
// =======

.line-height-0-5 {
  line-height: 0.5;
}

.line-height-0-75 {
  line-height: 0.75;
}

.line-height-1 {
  line-height: 1;
}

.line-height-1-25 {
  line-height: 1.25;
}

.line-height-1-5 {
  line-height: 1.5;
}

.line-height-1-75 {
  line-height: 1.75;
}

.line-height-2 {
  line-height: 2;
}

// Custom headings
// ===============

.heading-dashed {
  margin-bottom: rem(32);
  padding-bottom: rem(24);
  text-align: center;
  border-style: dashed;
  border-width: 0px 0px 2px 0px;
  border-color: #{map-get($palette, 'white-pointer')};
  color: #{map-get($palette, 'vermilion')};
  p + & {
    margin-top: $lg;
  }
}

.heading-brushed {
  @include heading-spacing(26);
  @include font-serif();
  margin-bottom: rem(38);
  padding-bottom: rem(16);
  text-align: center;
  background-image: image-url("dashed-line-133x2.svg");
  background-repeat: no-repeat;
  border: none;
  background-position: bottom;
  background-size: 130px 2px;
  font-size: rem(24);
  font-weight: normal;
  color: #{map-get($palette, 'text-disabled')};
  p + & {
    margin-top: $lg
  }
}

// Sub heading
// ===============

.subheading {
  @include font-sans-serif();
  font-size: rem(20);
  height: 1.5;
  margin-top: 0;
  margin-bottom: $md;
}

// Quotations
// ========

blockquote, .blockquote {
  @include font-serif();
  font-style: italic;
  font-size: rem(30);
  line-height: rem(38);
  margin: rem(20) 0;
  text-align: center;
}



// Captions (below images etc.)
// ========

figure, .figure {
  margin: 0;
  text-align: center;
}

.figcaption {
  margin: $sm 0 $md;
  font-size: rem(14);
  color: #{map-get($palette, 'text-light')};
  text-align: center;
}

// Formatted text blocks
// =====================

pre, .pre {
  @include font-sans-serif; 
  display: block;
  width: 100%;
  white-space: pre-wrap;
  font-style: italic;
}


// Dropcap
// =====================


.dropcap {
  @include heading();
  @include heading-spacing(60);
  font-size: rem(66);
  float: left;
  margin-right: 10px;
  margin-bottom: 0;
  line-height: 0.9;
}



// Other custom stuff
// ==================

.text-indented {
  display: block;
  padding-left: $md + rem(5);
  margin-bottom: $md;
}

.text-indented-orange {
  border-left: rem(5) solid map-get($palette, 'international-orange');
}

.text-indented-yellow {
  border-left: rem(5) solid map-get($palette, 'sunglow');
}


