/**
 * @file
 * Hero
 *
 * Contains styles for hero object.
 */

.hero {
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
  position: relative;
  width: calc(100vw - var(--scrollbar-width));
  background-size: cover;
  z-index: 0;
  background-color: $color-green-dark;

  &.no-image {
    position: unset;
    h1 {
      padding: 22px 16px 30px;
      @media (min-width: $break-medium) {
        padding: 22px 50px 34px;
      }
      @media (min-width: $break-large) {
        padding: 230px 80px 50px;
      }
    }

    img.no-bg-image {
      position: absolute;
      left: 0;
      top: 0;
      margin-top: -65px;
      width: 100%;
      height: calc(100% + 65px);
      object-fit: cover;
      object-position: top;
      z-index: 0;

      @media (min-width: $break-medium) {
        margin-top: -86px;
        height: calc(100% + 86px);
      }

      @media (min-width: $break-large) {
        margin-top: 0;
        height: 100%;
        margin-left: auto;
        width: 100vw;
        left: 50%;
        transform: translateX(-50%);
        max-width: 100vw;
      }
    }

    @media (min-width: $break-medium) {
      min-height: unset;
    }

    @media (min-width: $break-large) {
      transform: none;
      min-height: 360px;
    }
  }

  &.has-image {
    position: relative;
    min-height: 303px; // temporary till we get nav put in.
    padding-top: 210px;
    transition: padding-top 300ms 400ms;

    @media (min-width: $break-medium) {
      padding-top: 100px;
      min-height: 220px;
    }

    @media (min-width: $break-large) {
      padding-top: 350px;
    }

    &.expanded .section-nav {
      position: relative;
      transition: top 300ms 300ms;
      top: -210px;

      @media (min-width: $break-medium) {
        top: -100px;
      }
     
      .section-nav__list {
         margin-bottom: -200px;

         @media (min-width: $break-medium) {
          margin-bottom: -80px;
         }
      }

      &+picture {
        img,
        &:before,
        &:after {
          opacity: 0;
          transition: all 300ms;
        }
      }

      .section-nav__toggle {
        padding: 1.125rem 1rem;
        background: $color-green-dark;
        border-color: $color-white;
        transition: all 300ms 300ms, outline 0ms;

        @media (min-width: $break-medium) {
          padding: 1.125rem 50px;
        }
      }
    }

    picture {
      width: 100%;
      top: -65px;
      bottom: 0;
      position: absolute;
      max-width: calc(100vw - var(--scrollbar-width));
      background-image: url("../assets/img/banner-image.jpg");

      &:before {
        content: "";
        position: absolute;
        height: 65px;
        width: 100%;
        top: 0;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 27.69%, rgba(0, 0, 0, 0) 75.6%);
        mix-blend-mode: multiply;
        z-index: 1;
        transition: all 300ms 900ms;
      }

      &:after {
        content: "";
        position: absolute;
        height: 271px;
        width: 100%;
        min-height: 100%;
        bottom: 0;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0) 46.56%, rgba(0, 0, 0, 0.65) 86.44%);
        mix-blend-mode: multiply;
        transition: all 300ms 900ms;
      }

      img {
        position: absolute;
        height: 100%;
        width: 100%;
        top: 0;
        object-fit: cover;
        transition: opacity 300ms 900ms;
      }

      @media (min-width: $break-medium) {
        top: -86px;
      }

      @media (min-width: $break-large) {
        min-height: 500px;

        &:before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 100vw;
          height: 300px;
          background: linear-gradient(179.76deg, rgba(0, 0, 0, 0.7) 0.21%, rgba(0, 0, 0, 0) 99.79%);
        }
      }
    }

    .section-nav {
      position: relative;
      top: 0;
      transition: all 300ms 400ms;

      @media (min-width: $break-medium) {
        top: 15px
      }

      .section-nav__toggle {
        @include fontsize(16px);
        line-height: 1.3;
        margin: 0;
        text-transform: uppercase;
        border-color: transparent;
        background-color: transparent;
        transition: all 300ms 600ms, outline 0ms;


        @media (forced-colors: active) and (prefers-color-scheme: 'light') {
          background-color: $color-white !important;
        }

        @media (min-width: $break-medium) {
          @include fontsize(20px);
        }
      }
    }
  }

  &__inner {
    position: relative;
    &:before {
      content: '';
      position: absolute;
      background-image: url("../assets/img/banner-image.jpg");
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      width: 100vw;
      height: calc(100% + 65px + 16px);
      top: calc(-65px - 16px);
      left: 50%;
      transform: translateX(-50%);
      z-index: -1;

      @media (min-width: $break-medium) {
        height: calc(100% + 86px + 16px);
        top: calc(-86px - 16px);
      }
    }

    h1 {
      padding: .5rem 0 1.5rem;
      color: $color-white;
      margin: 0;
    }

    @media (min-width: $break-large) {
      padding: 240px 0 32px;

      h1 {
        padding: 0;
      }
    }
  }

  h1, h2 {
    position: relative;
    z-index: 1;
    color: $color-white;
    align-self: baseline;
  }

  h1 {
    padding: 0 16px 24px;
    margin: 0;
  }

  h2 {
    @include fontsize(16px);
    line-height: 1.3;
    margin: 0;
    padding: 0 16px 22px;
    text-transform: uppercase;
  }

  //&__title {
  //  margin: 0 -15px;
  //  padding: 0 0 0 15px;
  //  line-height: 300px;
  //
  //  @media (min-width: $break-medium) {
  //    margin: 0 -20px;
  //    padding: 0 0 0 20px;
  //  }
  //}

  @media (min-width: $break-medium) {
    min-height: 300px;
    &.has-image {
      margin-bottom: 32px;
    }
    h1 {
      padding: 0 50px 30px;
    }
    h2 {
      @include fontsize(20px);
      line-height: 1;
      padding: 0 50px 20px;
    }
  }

  @media (min-width: $break-large) {
    min-height: 360px;
    margin-bottom: 50px;
    &.has-image {
      min-height: 500px;
      margin-bottom: 50px;
      h1 {
        padding: 0 80px 44px;
        margin: 0 auto
      }
    }
    @include full-width();
    h1,h2 {
      max-width: 1800px;
      width: 100%;
      text-align: left;
    }
    h1 {
      padding: 0 80px 30px;
    }
    h2 {
      padding: 0 80px 44px;
      // To-do: Add css for subheading on large screens. Missing from comp.
    }
  }
}