@import "settings";

// Used on a hero block that can hold a background image.
.cover {
  position: relative; // keep hero-footer contained
  text-align: center;
  padding: 0 1rem;
  z-index: 2; // needed for the secondary navbar shadow
}

.cover-img {
  background-size: cover;
  background-position: 50% 0;
  background-repeat: no-repeat;

  .node-unpublished &:before {
    display: block;
    position: absolute;
    content: '';
    background-color: rgba($gray, 0.8);
    width: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
  }

}

.cover-with-canvas {
  padding: 40px;
}

.hero__bgimage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(0,0,0,0.1) 0%,rgba(34,34,34,0.7) 100%);
}

.cover-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
  min-height: 300px;
  align-items: stretch;

  @include for-tablet-portrait-up {
    min-height: 410px;
  }

  &.small {
    @include for-tablet-portrait-up {
      height: 193px;
      min-height: auto;
    }

    .page-title {
      h1 {
        @include for-tablet-portrait-up {
          font-size: 2rem;
          max-height: 70px;
          overflow: hidden;
        }
      }
    }

    > .hero-footer {
      @include for-tablet-portrait-up {
        position: static;
        margin-top: -2.5rem;
      }
    }
  }

  // this excludes the social_landing page hero section
  > .hero-footer {
    @include for-tablet-portrait-up {
      position: absolute;
      bottom: 0;
    }
  }

}

/* IE11 */
@media all and (-ms-high-contrast:none) {
  *::-ms-backdrop, .cover-wrap { min-height: 410px; }

  *::-ms-backdrop, .cover-wrap.small { height: 193px; min-height: auto }

  *::-ms-backdrop, .paragraph--hero .cover-wrap { min-height: 350px; }

  *::-ms-backdrop, .paragraph--hero-small .cover-wrap { min-height: 206px; height: auto }
}

// anon homepage hero
.cover-with-canvas .cover-wrap {
  justify-content: space-between;
}

.node-unpublished .status:before {
  border-top: 1px solid white;
  margin: 5px auto;
  width: 40px;
  height: 0;
  content: '';
  display: block;
}

.cover .page-title {
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  text-align: center;
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 1em;
  width: 80%;

  [dir='rtl'] & {
    text-align: right;
  }

  .path-search & {
    [dir='rtl'] & {
      text-align: center;
    }
  }

  @include for-tablet-portrait-up {
    max-width: 900px;
  }

}

.hero-footer {
  padding: 1rem 0;
  width: 100%;
  @include for-tablet-portrait-up {
    display: flex;
    align-items: center;
  }
}

.hero-footer__text {
  margin-top: 10px;

  @include for-tablet-portrait-up {
    padding-right: 1rem;
    flex: 0 0 50%;
    max-width: 50%;
    margin-left: 25%;
  }

}

.hero-footer__cta {
  display: flex;
  justify-content: flex-end;

  [dir='rtl'] & {
    justify-content: flex-start;
  }

  @include for-tablet-landscape-up {
    padding-left: 1rem;
    flex: 0 0 25%;
    max-width: 25%;

    [dir='rtl'] & {
      padding-left: 0;
      padding-right: 1rem;
    }

  }
}

// Profile

.hero-avatar {
  @include z-depth-1;
  margin: auto;
  width: 128px;
  height: 128px;
}

.block-social-profile {

  header {
    padding-top: 2rem;
    padding-bottom: 1em;
  }

  .page-title {
    padding-top: 1rem;
  }

  .hero-footer {
    justify-content: center;
  }

  .hero-footer__text {
    padding-right: 0;

    @include for-tablet-portrait-up {
      flex: 0 0 auto;
      max-width: unset;
      margin-left: 0;
    }
  }

  .hero-footer__cta {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    padding-left: 1rem;

    @include for-tablet-landscape-up {
      padding: 0;
      position: absolute;
      right: 0;
      flex: 0 0 auto;
      max-width: unset;

    }
  }


}

.hero-footer-icon {
  fill: white;
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-top: -1px; // vertical alignment with text
}


.hero-canvas {
  text-align: left; //overwrite .cover setting
  padding: 2rem;

  @include for-tablet-landscape-up {
    max-width: (100%/1.5);
  }
}


.cover .btn-group {
  margin-top: 10px;
}

.hero-action-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
}


// Hero search

.hero-form {
  padding-bottom: 2rem;

  .form-group {
    position: relative;
    max-width: 400px;
    margin: auto;
  }

  .form-control {
    padding: $padding-base-vertical 38px $padding-base-vertical $padding-base-horizontal;
    max-width: none;
    border: 0;
  }

  .form-submit,
  .search-icon {
    width: 38px;
    height: 38px;
    display: block;
    position: absolute;
    overflow: hidden;
    color: white;
    right: 0;
    top: 0;
    line-height: 38px;
    cursor: pointer;
    text-align: center;

    &:focus-visible,
    &:focus {
      outline: -webkit-focus-ring-color auto 1px;
    }
	}

  .form-submit {
    padding: 0;
    border-bottom-left-radius: 0 !important;
    border-top-left-radius: 0 !important;
    background-color: #fff;
    font-size: 0;

    &:before {
      content: '';
      display: block;
      width: 38px;
      height: 38px;
      mask: url("../images/icons/icon-search.svg");
      -webkit-mask-repeat: no-repeat;
      mask-position: center;
      background-color: var(--primary-color);
      transform: scale(1);
      transition: transform .2s linear;
    }

    &:hover:before {
      transform: scale(1.1);
    }
  }

  .search-icon {
    line-height: 38px;
    speak: none;
    pointer-events: none;
    transition: 0.3s;

    svg {
      width: 24px;
      height: 24px;
      vertical-align: middle;
    }

  }

}
