
// .promo-header--feature   - Body copy overlap bg image
// .promo-header--no-image   - Body copy overlap bg image

.promo-header {
  position: relative;
  clear: both;
  overflow: hidden;
  @include breakpoint($screen-md-max) {
    min-height: 600px;
  }
  &.promo-header--no-image {
    min-height: auto; // fallback IE
    min-height: initial;
  }
  &.promo-header--small {
    @include breakpoint($screen-md-max) {
      min-height: 400px;
    }
  }
}
.promo-header {
  &.promo-header--feature {
    width: 100%;
    min-height: initial;
    background: transparent;
    display: flex;
    flex-direction: column;

    .bg_video {
      position: relative !important;
      height: 400px;
    }

    .promo-header__content {
      order: 2;
    }

    .promo-header__bg-image {
      // Reorder markup to show image first on this feature variant
      order: 1;
      display: block;
    }
  }
}
.promo-header--default {
  .promo-header__bg-image {
    img {
      @include no-objectfit;

      object-fit: cover;
      object-position: top;
    }
  }
}
.promo-header--video {
  min-height: 200px;
  @include breakpoint($screen-md) {
    min-height: 300px;
  }
  @include breakpoint($screen-lg) {
    min-height: 600px;
  }
  //override styling set by vide library
  .bg_video {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
  }
  .video {
    position: relative !important;
    height: 100%;

    video {
      visibility: visible !important;
    }
  }
  &.promo-header--small {
    height: 400px;
  }
}
.bg--none {
  .bg_video {
    opacity: 1;
  }
}
.promo-header__bg-image {
  width: 100%;
  margin-bottom: -7px;
  @include breakpoint($screen-md-max) {
    position: absolute;
    width: 100%;
    height: 100%;
    margin-top: 0;
    margin-right: auto;
    margin-left: auto;
  }
  .promo-header--feature & {
    position: relative;
    float: none;
  }
  img {
    @include breakpoint($screen-md-max) {
      display: block;
      width: 100%;
      height: 100%;
    }
  }
}
.promo-header__content {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: auto;
  @include breakpoint($screen-md-max) {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
  }
  .promo-header--feature & {
    position: relative;
    top: 0;
    margin: -50px auto 0;
    padding: 1px 0;
    background: $colour-white;
    transform: translateY(0);
    @include breakpoint-gutters;
  }
  .promo-header--no-image & {
    position: relative;
    top: 0;
    transform: translateY(0);
  }
  .promo-header__content-inner {
    width: 100%;
    margin: 25px auto 15px;
    padding: 15px;
    text-align: center;
    word-break: break-word;
    @include breakpoint($screen-md) {
      width: span(10);
      margin: 50px auto 40px;
      padding: 0;
    }
    @include breakpoint($screen-md-max) {
      width: 50%;
      text-align: left;
      .promo-header--feature & {
        width: 100%;
        max-width: span(8);
        margin: 55px auto 45px;
        text-align: center;
      }
    }
    &--centre {
      @include breakpoint($screen-md-max) {
        margin-right: auto;
        margin-left: auto;
        text-align: center;
        .promo-header--no-image & {
          width: 100%;
          max-width: span(8);
          margin: 55px auto 45px;
        }
        .promo-header--small & {
          width: 100%;
          max-width: span(8);
        }
      }
    }
    &--left {
      @include breakpoint($screen-md-max) {
        margin-left: gutter();
      }
    }
    &--right {
      @include breakpoint($screen-md-max) {
        margin-right: gutter();
      }
    }
    .promo-header--feature & {
      @include breakpoint($screen-md-max) {
        max-width: span(8);
      }
    }
  }
  p {
    .promo-header--feature & {
      color: $colour-black;
    }
  }
  img {
    width: 100%;
    height: auto;
    margin: 0 0 40px;
  }
}
.promo-header__svg-title {
  svg {
    width: 100%;
    .promo-header--feature & {
      path {
        fill: $colour-black;
      }
    }
  }
}
.promo-header__link {
  a {
    display: inline-block;
    height: 50px;
    padding: 14px 35px;
    text-align: center;
    text-decoration: none;
    color: #1e1e1e;
    background-color: #fff;
    font-size: 16px;
    line-height: 22px;
    @include border-radius(30px);
    transition: background-color 300ms;
    &:hover {
      background-color: rgba(255,255,255,0.8);
    }
  }
}

// Offset content to make sure copy doesn't overlap transaprent nav at top of screen
header[role=banner].sticky-nav__header ~ main .promo-header__content .promo-header__content-inner {
  padding-top: 30px;

  @include breakpoint($screen-md) {
    margin-top: 60px;
  }

  @include breakpoint($screen-lg) {
    margin-top: 50px;
  }
}
