// Header
//
// Main page header region, including page title and an optional subtitle.
//
// .-sponsored - Makes space for sponsor module within header.
// .-centered  - Center text in the header (generally used for non-content pages).
// .-hero      - Hero image header banner styling.
//
//
// Markup:
//   <header role="banner" class="header {{modifier_class}}">
//     <div class="wrapper">
//       <h1 class="header__title">Title</h1>
//       <p class="header__subtitle">Subtitle.</p>
//     </div>
//   </header>
//
// Styleguide Header

.header {
  position: relative;
  background: $purple no-repeat center center;
  background-size: cover;
  overflow: hidden;
  padding: 144px ($base-spacing / 2) $base-spacing;

  @include media($tablet) {
    padding-left: 0;
    padding-right: 0;
  }

  > .wrapper {
    position: relative;
    text-align: center;
    width: 100%;
    z-index: 10;

    @include clearfix();

    @include media($tablet) {
      text-align: left;

      @include span(12);
      @include push(2);
    }
  }

  .header__title {
    color: $white;
    font-size: $font-larger;
    margin: 0;

    @include media($tablet) {
      font-size: $font-hero;
    }
  }

  .header__subtitle {
    color: $white;
    font-size: $font-regular;

    @include media($tablet) {
      font-size: $font-medium;
    }
  }

  .header__title,
  .header__subtitle,
  .header__date {
    text-shadow: $text-shadow;
  }

  video {
    display: none;

    @include media($tablet) {
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      min-width: 100%;
      min-height: 100%;
      width: auto;
      height: auto;
      overflow: hidden;
    }
  }

  // Makes space for sponsor module inside header.
  // @TODO: There's a better solution for this, but need a quick solution for now (2014.05.22).
  &.-sponsored {
    .header__subtitle {
      @include media($tablet) {
        width: 75%;
      }
    }
  }

  // Center text in the header (generally used for non-content pages).
  &.-centered {
    min-height: 365px;
    padding: 216px 0;

    @include media($tablet) {
      height: 520px;
    }

    > .wrapper {
      position: absolute;
      top: 50%;
      padding: 18px;
      text-align: center;
      transform: translateY(-50%);

      @include media($tablet) {
        @include span(8);
        @include push(4);
      }
    }

    .header__title {
      font-size: $font-larger;
    }

    .header__subtitle {
      font-size: $font-regular;
      margin-bottom: 0;

      span {
        opacity: 0.8;
      }
    }
  }

  // Hero image header banner styling.
  &.-hero {
    display: table;
    width: 100%;
    min-height: 465px;

    @include media($tablet) {
      height: 620px;
    }

    &:before {
      position: absolute;
      content: "";
      width: 100%;
      height: 100%;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 5;
      background: linear-gradient(rgba(#000, 0) 10%, rgba(#000, 0.2) 65%, rgba(#000, 0.5) 87%, rgba(#000, 0.85) 100%);

      @include media($tablet) {
        background: linear-gradient(rgba(#000, 0) 40%, rgba(#000, 0.2) 70%, rgba(#000, 0.5) 87%, rgba(#000, 0.85) 100%);
      }

      .modernizr-no-cssgradients & {
        background: transparent neue-asset-url("images/fallbacks/black-gradient.png") 0 bottom repeat-x;
      }
    }

    > .wrapper {
      display: table-cell;
      vertical-align: bottom;

      @include media($tablet) {
        position: absolute;
        bottom: $base-spacing;
      }
    }

    .header__subtitle {
      @include media($tablet) {
        width: 80%;
      }
    }

    .header__date {
      color: #fff;
      font-size: $font-small;
      margin-top: 0;
      margin-bottom: 9px;

      @include media($tablet) {
        font-size: $font-regular;
        float: left;
        margin-bottom: 27px;
      }
    }

    .header__signup {
      margin-top: $base-spacing;

      @include media($tablet) {
        clear: left;
        float: left;
        position: relative;
        width: 50%;
      }
    }
  }
}
