.cards-block-highlight {
  position: relative;
  margin: 75px 0;

  &.cards-block-highlight--white-grid {
    padding: 48px 0;

    &.cards-block-highlight--bg-blue {
      background-color: $medium-color;

      h2 {
        color: $white !important;
      }
    }

    &.cards-block-highlight--bg-orange {
      background-color: $orange;
    }

    &.cards-block-highlight--bg-yellow {
      background-color: $yellow;
    }

    &.cards-block-highlight--bg-green {
      background-color: $green;
    }

    &.cards-block-highlight--bg-primary {
      background-color: $primary-color;

      h2 {
        color: $white !important;
      }
    }

    &.cards-block-highlight--bg-secondary {
      background-color: $secondary-color;

      h2 {
        color: $primary-color !important;
      }
    }
  }

  @include sm {
    margin: 50px 0;
  }

  .title-block {
    margin-top: 0;
    margin-bottom: 64px;

    h2 {
      font-weight: 600;
    }

    h1 {
      margin: 0 0 24px;
    }

    @include sm {
      margin-bottom: 32px;

      h1 {
        margin-bottom: 16px;
      }

      h4 {
        font-size: 1.6rem;
        line-height: 2.3rem;
        margin-bottom: 0;
      }

      &__cta {
        display: none;
      }
    }
  }

  &__wrapper {
    width: 100%;
    max-width: $max-width;
    margin: 0 auto;
  }

  &__cards {
    display: flex;
    justify-content: center;
    padding: 0 $gutter;

    @include sm {
      flex-direction: column;
      padding: 0 8px;
    }
  }

  &__card {
    text-align: center;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    min-height: 300px;
    pointer-events: none;

    .cards-block-highlight__cards--4 & {
      width: calc(100% / 4);
      padding: 50px 24px;

      &:nth-child(odd) {
        margin-top: 24px;
      }

      &:nth-child(even) {
        margin-bottom: 24px;
      }
    }

    .cards-block-highlight__cards--3 & {
      width: calc(100% / 3);

      &:nth-child(odd) {
        margin-top: 40px;
      }

      &:nth-child(even) {
        margin-bottom: 40px;

        .cards-block-highlight--colored-grid & {
          .cards-block-highlight__card-icon {
            @include sm {
              height: 48px;
            }
          }
        }
      }
    }

    .cards-block-highlight__cards--2 & {
      width: 50%;
    }

    .cards-block-highlight__cards--1 & {
      width: 100%;
    }

    @include sm {
      text-align: left;
      pointer-events: all;
      align-items: flex-start;
      max-width: 100%;
      padding: 0 !important;
      min-height: 110px;

      .cards-block-highlight__cards--4 &,
      .cards-block-highlight__cards--3 &,
      .cards-block-highlight__cards--2 & {
        width: 100%;
      }

      &:nth-child(odd),
      &:nth-child(even) {
        margin: 0 !important;
      }
    }

    .cards-block-highlight--white-grid & {
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      background-color: transparent;
      // border-right: 1px solid $gray-bluish;
      color: $primary-color;
      padding: 0 24px;
      min-height: 160px;

      &:last-child {
        border-right: 0;
      }

      @include sm {
        border-right: 0;
        min-height: 110px;
        padding: 0;
        border-bottom: 1px solid $gray-bluish;

        &:last-child {
          border-bottom: 0;
        }
      }
    }
  }

  &__card-header {
    display: flex;
    flex-direction: column;
    align-items: center;

    @include sm {
      flex-direction: row;
      justify-content: flex-start;
      padding: 24px 16px;
      width: 100%;
    }
  }

  &__card-icon {
    width: 80px;
    height: 80px;
    text-align: center;
    margin-bottom: 24px;

    .cards-block-highlight__cards--4 & {
      width: 64px;
      height: 64px;

      @include sm {
        width: 48px;
        height: 48px;
      }
    }

    .cards-block-highlight__cards--3 & {
      .cards-block-highlight--white-grid & {
        width: 64px;
        height: 64px;

        @include sm {
          width: 48px;
          height: 48px;
        }
      }
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-blue & {
      color: $white !important;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-green & {
      color: $primary-color !important;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-primary & {
      color: $white !important;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-secondary & {
      color: $primary-color !important;
    }

    @include sm {
      width: 48px;
      height: 48px;
      margin-right: 15px;
      margin-bottom: 0;
      flex-shrink: 0;
    }

    svg {
      width: 100%;
      height: 100%;

      path {
        fill: currentColor;

        .cards-block-highlight--luumo & {
          fill: none;
        }
      }
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .cards-block-highlight--white-grid & {
      color: $secondary-color;
    }
  }

  &__card-content-box {
    margin-top: 16px;
    width: 100%;
    overflow: hidden;

    @include sm {
      padding: 0 16px 0;
      margin-top: 0;
      height: 0;
      transition: height 0.25s ease-out;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-blue & {
      color: $white !important;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-green & {
      color: $primary-color !important;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-primary & {
      color: $white !important;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-secondary & {
      color: $primary-color !important;
    }
  }

  &__card-content {
    @include sm {
      padding-bottom: 30px;
      opacity: 0;
      transition: opacity 0.25s ease-out;

      .js-open & {
        opacity: 1;
        transition-delay: 0.15s;
      }
    }
  }

  .rich-content {
    color: inherit;

    p {
      letter-spacing: 0.23px;
    }

    h2, h3, h4 {
      color: inherit;
    }

    & > *:first-child {
      margin-top: 0;
    }

    & > *:last-child {
      margin-bottom: 0;
    }
  }

  &__card-title {
    font-family: var(--font-heading);;
    font-size: 3.8rem;
    font-weight: 600;
    line-height: 4.5rem;

    .cards-block-highlight__cards--4 & {
      font-size: 2.6rem;
      line-height: 3.2rem;
    }

    .cards-block-highlight__cards--3 & {
      .cards-block-highlight--white-grid & {
        font-size: 2.6rem;
        line-height: 3.2rem;
      }
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-blue & {
      color: $white !important;
    }

    .cards-block-highlight--white-grid.cards-block-highlight--bg-primary & {
      color: $white !important;
    }

    @include sm {
      width: 100%;
      font-size: 2.6rem;
      line-height: 3rem;
    }
  }

  &__card-toggle {
    flex-shrink: 0;
    padding-left: 16px;
    display: none;

    @include sm {
      display: block;
    }

    span {
      display: block;
      pointer-events: none;

      &:first-child {
        .js-open & {
          display: none;
        }
      }

      &:last-child {
        display: none;

        .js-open & {
          display: inline;
        }
      }
    }

    svg {
      display: block;
      width: 18px;
      height: 18px;

      g, path {
        fill: $white;

        .cards-block-highlight--white-grid & {
          fill: $secondary-color;
        }
      }
    }
  }

  &__cta {
    margin-top: 48px;
    padding: 0 24px;
    text-align: center;
    display: none;

    .cards-block-highlight--white-grid & {
      display: block;

      .std-button {
        width: auto;
      }
    }

    @include sm {
      display: block;

      .std-button {
        width: 100%;
        max-width: 400px;
      }
    }
  }

  &--white-grid {
    .title-block__cta {
      display: none;
    }
  }
}
