/**
 * @file
 * Events 3 Up Feature
 *
 * Contains styles for Events 3 Up content object.
 */

.events3up {

  // slide animation
  &__item {
    &.scroll-animate {
      @include slide-fade-in;
    }
  }

  &__item {
    text-align: center;
    display: flex;
    flex-direction: row;
    color: $color-white;
    margin-bottom: .5rem;

    // sets the background colors
    &:nth-of-type(odd) {
      .events3up__date {
        background-color: $color-blue-dark;
      }
      .events3up__data {
        background-color: $color-purple;
      }
    }

    &:nth-of-type(even) {
      .events3up__date {
        background-color: $color-green-dark;
      }
      .events3up__data {
        background-color: $color-green;
      }
      h3 a {
        color: $color-green-light;
        span:after {
          background-image: url("data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.2468 0.439453L15 5.46326L10.2468 10.4395H8.09713L11.9904 6.34421H0V4.5585H11.9904L8.09713 0.439453H10.2468Z' fill='#{str-replace(#{$color-green-light}, '#', '%23')}'/%3E%3C/svg%3E");
        }
        &:hover {
          color: $color-white;
          span:after {
            background-image: url("data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.2468 0.439453L15 5.46326L10.2468 10.4395H8.09713L11.9904 6.34421H0V4.5585H11.9904L8.09713 0.439453H10.2468Z' fill='#{str-replace(#{$color-white}, '#', '%23')}'/%3E%3C/svg%3E");
          }
        }
      }
    }
  }

  &__date {
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    margin: 0 auto;
    width: 36%;
    padding: 1.875rem 0;
    border-radius: 8px 0 0 8px;
  }

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

  &__month {
    font-family: $font-acumen;
    font-weight: 700;
    @include fontsize(16px);
    line-height: 1.5;
  }

  &__data {
    width: 64%;
    border-radius: 0 8px 8px 0;
    padding: 1.625rem 0.5rem 1.5rem 1rem;
    text-align: left;
  }

  &__time {
    display: inline;
    margin-right: 10px;
    position: relative;
    line-height: 1.52;
    &:after {
      content: '';
      position: absolute;
      width: 2px;
      height: 17px;
      background-color: $color-white;
      right: -3px;
      bottom: 0;
    }
  }

  &__location {
    display: inline;
    line-height: 1.52;
  }

  h3 {
    a {
      color: $color-white;

      &:hover {
        color: $color-blue-light;

        span.last-word:after {
          background-image: url("data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.2468 0.439453L15 5.46326L10.2468 10.4395H8.09713L11.9904 6.34421H0V4.5585H11.9904L8.09713 0.439453H10.2468Z' fill='#{str-replace(#{$color-blue-light}, '#', '%23')}'/%3E%3C/svg%3E");
        }
      }

      @include focus-light;
    }
    width: fit-content;
    font-family: $font-acumen;
    font-weight: 600;
    @include fontsize(14px);
    line-height: 1.3;
    margin: 0 1.375rem .5rem 0;
    span {
      position: relative;
      &.last-word {
        padding-right: 0;
      }
      &:after {
        content: '';
        position: absolute;
        background: url("../assets/icons/arrow_right.svg"), center, no-repeat;
        background-size: cover;
        width: 15px;
        height: 11px;
        right: -20px;
        bottom: 3px;
      }
    }
  }
  &__section-cta {
    text-align: left;
    text-transform: capitalize;
    margin-top: 1.5rem;
    a.cta--button-arrow {
      @include cta-arrow($color-blue-dark, $color-blue-dark, $color-white, $color-blue-light, $color-blue-light, $color-blue-dark);
      padding-right: 2.5rem;
    }
  }

  // column overides for medium screens
  @media (min-width: $break-medium) {
    .column--three {
      flex-direction: column;
      gap: 0.688rem;
    }

    &__item {
      margin-bottom: 0;
    }

    &__date {
      width: 27%;
      padding: 0;
      border-radius: 8px 0 0 8px;
    }
    &__data {
      width: 73%;
      padding: 1.875rem 2.5rem;
      word-break: break-word;
    }

    &__day {
      @include fontsize(48px);
      line-height: 1.2;
    }

    &__month {
      @include fontsize(18px);
      line-height: 1.6;
    }

    h3 {
      @include fontsize(18px);
      line-height: 1.3;
      margin-bottom: 0.625rem;
      span:after {
        width: 19px;
        height: 14px;
        right: -30px;
        bottom: 3px;
      }
    }

    &__time {
      line-height: 1.6;
    }

    &__location {
      line-height: 1.6;
    }
  }

  @media (min-width: $break-large) {
    .column--three {
      flex-direction: row;
      gap: 1.25rem;
    }

    &__item {
     flex-direction: column;
    }

    &__date {
      width: 100%;
      border-radius: 8px 8px 0 0;
      padding: 1.25rem 1rem;
    }

    &__day {
      @include fontsize(54px);
      line-height: 1;
    }

    &__month {
      line-height: 1.3;
    }

    &__data {
      width: 100%;
      border-radius: 0 0 8px 8px;
      padding: 1.625rem 1.5rem 1.875rem;
    }

    h3 {
      @include fontsize(24px);
      line-height: 1.3;
      margin-bottom: 0.5rem;
      span:after {
        bottom: 8px;
      }
    }

    &__time {
      @include fontsize(18px);
    }

    &__location {
      @include fontsize(18px);
    }

    .scroll-animate.js-active + .scroll-animate.js-active {
      transition-delay: 100ms;

      & + .scroll-animate.js-active {
        transition-delay: 200ms;
      }
    }
  }
}