@use '_helper' as *;

.homepage-goals {
  position: relative;
  padding: 50px 0 0;
  margin-top: 0;

  @media screen and (max-width: $break-medium - 1) {
    margin-bottom: calc($spacing-vertical-sm * 1.35);
  }

  @media screen and (min-width: $break-medium) {
    padding: 82px 0 0;
  }

  @media screen and (min-width: $break-large) {
    padding: 130px 0 0;
  }

  a {
    @include focus-light
  }

  &:before {
    content: "";
    @include full-width();
    position: absolute;
    height: 100%;
    top: 0;
    z-index: -3;
    background-color: $color-blue-dark;
    color: $color-white;
  }

  h2 {
    margin-top: 0;
    color: $color-white;

    @media screen and (min-width: $break-medium) and (max-width: $break-large - 1) {
      font-size: 56px;
      margin-bottom: 6px;
    }

    @media screen and (min-width: $break-large) {
      margin-bottom: 10px;
    }
  }

  &__cta {
    padding-bottom: 100px;

    @media screen and (min-width: $break-medium) {
      padding-bottom: 180px;
    }

    @media screen and (min-width: $break-large) {
      margin-bottom: 200px;
    }

    a {
      @include ctaButton($darkBG: true)
    }
  }

  &__intro {
    color: $color-white;
    @include body-large($isExtraLarge: true);
    margin-bottom: 20px;

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

    @media screen and (min-width: $break-large) {
      max-width: 867px;
    }
  }

  &__white {
    @include full-width();
    @include swipe($type: "white", $vertPosOffset: -190px);
    margin-top: -60px !important;

    @media screen and (min-width: $break-medium) {
      @include swipe($type: "white", $vertPosOffset: -240px);
      margin-top: -180px !important;
    }

    @media screen and (min-width: $break-large) {
      @include swipe($type: "white", $vertPosOffset: -320px);
      margin-top: -242px !important;
    }
  }

  &__goals {
    @media screen and (min-width: $break-medium) {
      display: flex;
      flex-wrap: wrap;
      gap: 30px;
      margin-top: 60px;
    }

    @media screen and (min-width: $break-large) {
      gap: 38px;
      display: grid;
      grid-template-rows: auto auto auto auto;
      grid-template-columns: 1fr 1fr;
      max-width: calc($content-max - 58px * 2);
      margin: 0 auto;
    }

  }

  &__goal {
    position: relative;
    border-radius: 15px;
    padding: 20px;
    overflow: hidden;
    min-height: 97vw;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column-reverse;
    @include cardArrowCornerHover;

    @media screen and (min-width: $break-medium) {
      min-height: 39.5vw;
      width: calc(43% - 15px);
      margin-bottom: 0;

      &:nth-child(2) {
        align-self: end;

        @media screen and (min-width: $break-large) {
          align-self: start;
          margin-top: -10vw;
        }

        @media screen and (min-width: $content-max) {
          margin-top: -110px;
        }
      }

      &:nth-child(3) {
        align-self: start;

        @media screen and (min-width: $break-large) {
          max-width: 32vw;
        }
      }
    }

    @media screen and (min-width: $break-large) {
      max-width: 35vw;
      width: 100%;
      min-height: 37.5vw;
      padding: 40px 35px;

      @media screen and (min-width: $content-max) {
        min-height: 600px;
      }

      &:nth-child(1) {
        grid-row-start: 1;
        grid-row-end: 3;

        @media screen and (min-width: $content-max) {
          margin-top: 50px;
        }
      }

      &:nth-child(4) {
        grid-row-start: 2;
        grid-row-end: 4;
      }

      &:nth-child(3) {
        grid-row-end: 5;
        grid-row-start: 3;
        width: 100%;
        min-height: 36vw;
        margin-left: auto;

        @media screen and (min-width: $content-max) {
          min-height: 576px;
        }

      }
    }

    @media screen and (min-width: $content-max) {
      max-width: 660px;
    }

    &.big-card {
      @media screen and (min-width: $break-medium) {
        min-height: 56.5vw;
        width: calc(57% - 15px);
      }

      @media screen and (min-width: $break-large) {
        width: 100%;
        max-width: 100%;
        min-height: 48vw;
      }

      @media screen and (min-width: $content-max) {
        min-height: 843px;
      }
    }

    h3 {
      margin: 0;
      padding-right: 70px;
      line-height: 115%;
      font-family: $font-roboto-slab;
      font-size: rem(20px);

      @media screen and (min-width: $break-large) {
        font-size: rem(30px);
      }
    }

    h3 a {
      font: inherit;
      font-weight: 500;
      color: $color-white;
      text-decoration: none;

      &:before {
        content: "";
        width: calc(100% + 1px);
        height: calc(100% + 1px);
        inset: 0;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
      }
    }

    .background-wrapper--img:after {
      content: "";
      position: absolute;
      inset: 0;
      background-color: $color-blue;
      mix-blend-mode: multiply;
      opacity: 0;
      transition: .2s all;
    }

    .background-wrapper--img img {
      transition: all ease .2s;
      top: -2%;
      left: -2%;
      width: 104%;
      height: 104%;
      max-width: inherit;
    }

    &:hover {
      .background-wrapper--img img {
        transform: scale(1.05);
      }
    }

    &.js-active {
      .homepage-goals__overlay {
        opacity: 1;
        visibility: visible;
      }

      .background-wrapper--img:after {
        opacity: 1;
      }

      .background-wrapper--img img {
        filter: blur(7.5px);
      }
    }
  }

  &__overlay {
    color: $color-white;
    visibility: hidden;
    opacity: 0;
    transition: all .1s;
    margin-bottom: auto;
  }

  &__quote {
    font-family: $font-roboto-slab;
    font-size: rem(20px);
    font-weight: 300;
    margin: 0;
    padding: 0;
    text-indent: -0.25em;

    @media screen and (min-width: $break-medium) {
      font-size: rem(28px);
      line-height: normal;
    }

    @media screen and (min-width: $break-large) {
      font-size: rem(44px);
    }
  }

  &__name {
    font-weight: 900;
    margin-top: 10px;

    @media screen and (min-width: $break-medium) {
      font-size: rem(20px);
    }

    @media screen and (min-width: $break-large) {
      font-size: rem(25px);
    }
  }

  &__quote__stat {
    margin-top: 10px;
    font-size: rem(30px);
    font-weight: 700;
    line-height: normal;

    @media screen and (min-width: $break-medium) {
      margin-top: 20px;
    }

    @media screen and (min-width: $break-large) {
      font-size: rem(50px);
      margin-top: 40px;
    }

    &-desc {
      margin-bottom: 13px;
      padding-bottom: 13px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.50);

      @media screen and (min-width: $break-medium) {
        padding-bottom: 34px;
        margin-bottom: 29px;
      }

      @media screen and (min-width: $break-large) {
        padding-bottom: 40px;
        margin-bottom: 30px;
      }
    }
  }

  &__links {
    @media screen and (min-width: $break-large) {
      max-width: calc($content-max - 58px * 2);
      margin: 0 auto;
    }

    h3 {
      @include h5;
      margin: 40px 0 0;
      color: $color-black;
    }

    a {
      @include focus-dark
    }

    ul {
      padding: 0;

      @media screen and (min-width: $break-medium) {
        margin-top: 20px;
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
      }

      @media screen and (min-width: $break-large) {
        margin-top: 30px;
        gap: 20px;
      }
    }

    li {
      list-style: none;

      @media screen and (min-width: $break-medium) {
        margin: 0;
      }

      &::before {
        content: none;
      }
    }
  }
}