/**
 * @file
 * Statistic: 3 up feature
 *
 * Styles for Statistick: 3 up feature object.
 */

.stat3up {

  .column--three {
    @media (min-width: $break-medium) {
      gap: 0;
      margin: 0 2px;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
    }
  }

  @media (min-width: $break-large) {
    margin: 0 4px;
  }

  .scroll-animate .stat3up__number, 
  .scroll-animate .stat3up__caption {
    opacity: 0;
    transform: translateY(30px);
    transition: transform .3s ease, opacity .3s ease;
  }

  .js-active .stat3up__number,
  .js-active .stat3up__caption {
    opacity: 1;
    transform: translateY(0);
  }

  &__image {
    img {
      aspect-ratio: 288/173;
      object-fit: cover;

      @media (min-width: $break-medium) {
        img {
          aspect-ratio: 200/121;
        }
      }

      @media (min-width: $break-large) {
        aspect-ratio: 342/172;
      }
    }
  }

  &__item {
    text-align: center;
    border: 2px solid $color-blue-dark;
    border-radius: 8px;
    overflow: hidden;
    gap: 0;

    @media (min-width: $break-medium) {
      flex: 1;
      display: flex;
      flex-direction: column;
      margin: 0 -1px;

      &:first-of-type {
        border-radius: 8px 0 0 8px;
      }
      &:nth-of-type(2) {
        border-radius: 0 0 0 0;
      }
      &:nth-of-type(3) {
        border-radius: 0 8px 8px 0;
      }
    }

    @media (min-width: $break-large) {
      border: 3px solid $color-blue-dark;
      margin: 0 -2px;

      &:nth-of-type(2) {
        margin-left: -1px;
      }

      &:nth-of-type(3) {
        margin-left: -1px;
      }
    }
  }

  &__content {
    padding: 24px 16px;
    display: flex;
    gap: 18px;
    align-items: center;
    color: $color-blue-dark;

    @media (min-width: $break-medium) {
      flex-direction: column;
      text-align: left;
      padding: 18px;
      gap: 0;
    }

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

  &__number {
    font-family: $font-acumen-cond;
    @include fontsize(42px);
    font-weight: 800;
    line-height: 1;

    @media (min-width: $break-medium) {
      margin-right: auto;
      @include fontsize(48px);
      font-size: 48px;
      line-height: 1.2;
    }

    @media (min-width: $break-large) {
      margin-bottom: 16px;
      @include fontsize(72px);
      line-height: 1.1;
    }
  }

  &__caption {
    margin: 0;
    font-family: $font-acumen;
    font-weight: 400;
    @include fontsize(16px);
    line-height: 1.52;

    @media (min-width: $break-medium) {
      font-family: $font-acumen-cond;
      font-style: italic;
      font-weight: 800;
      @include fontsize(21px);
      line-height: 1.4;
      width: 100%;
    }

    @media (min-width: $break-large) {
      @include fontsize(32px);
      line-height: 1.4;
    }
  }

  &__cta {
    margin-top: auto;

    @media (max-width: $break-medium - 1) {
      min-height: inherit !important;
    }
  }

  &__cta a {
    text-align: left;
    color: $color-blue-light;
    position: relative;
    transition: all .3s ease;
    padding: 18px 16px 16px;
    background-color: $color-blue-dark;
    margin: auto 0 0;
    display: block;
    height: 100%;
    span.last-word {
      position: relative;
      margin-right: 35px;
      padding-right: 0;
      &:after {
        content: '';
        position: absolute;
        width: 20px;
        height: 12px;
        right: -30px;
        top: 0.45em;
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='12' viewBox='0 0 20 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.6624 0L20 6.02857L13.6624 12H10.7962L15.9873 7.08571H0L0 4.94286H15.9873L10.7962 0L13.6624 0Z' fill='%23CBE2FF'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        transition: all .3s ease;

        @media (min-width: $break-large) {
          top: 0.6em;
        }
      }
    }
    &:before {
      display: none;
    }
    &:focus {
      @include focus-light();
      outline-offset: -4px;
    }
    &:hover {
      color: $color-blue-dark;
      background-color: $color-blue-light;
      span.last-word:after {
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='12' viewBox='0 0 20 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.6624 0L20 6.02857L13.6624 12H10.7962L15.9873 7.08571H0L0 4.94286H15.9873L10.7962 0L13.6624 0Z' fill='#{str-replace(#{$color-blue-dark}, '#', '%23')}'/%3E%3C/svg%3E");
      }
    }

    @media (min-width: $break-medium) {
      padding: 27px 18px 23px;
      margin-top: auto;
    }

    @media (min-width: $break-large) {
      padding: 24px 32px;
      @include fontsize(24px);
      line-height: 1.3;
    }
  }
}

.homepage-hero__ctas + .container > section.stat3up {
  margin-top: -65px;
  .stat3up__intro,
  .stat3up__header {
    display: none;
  }

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

  @media (min-width: 1600px) {
    max-width: 1640px;
    margin-left: auto;
    margin-right: auto;
  }
}