@use "00-base/configure" as *;

.ma__link-list--image-blocks {
  // grid stuff

  .ma__link-list__items {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;

    @media ($bp-x-large-min) {
      justify-content: flex-start;
    }

    .ma__link-list__item {
      flex-basis: 100%;
      padding: 0;
      margin-bottom: 1rem;
      display: none;

      &.toggle-open {
        // Always show all when clicked open so they don't hide on screen resize.
        display: list-item !important;
      }

      // Always show first three on mobile

      &:nth-child(-n+3) {
        display: list-item !important;
      }

      @media ($bp-medium-min) {
        flex-basis: calc(50% - 0.5rem);

        // Always show first 6 on tablet

        &:nth-child(-n+6) {
          display: list-item !important;
        }
      }

      @media ($bp-x-large-min) {
        // Always show all on desktop
        display: list-item;
        flex-basis: calc(33% - 1rem);

        &:nth-child(3n+2) {
          margin: 0 1.8rem 1rem;
        }
      }
    }
  }

  .ma__image-link__image {
    order: 2;
    margin-left: 1rem;
  }

  .ma__image-link__text {
    padding: 0;
  }
}

.ma__link-list--image-links {

  .ma__image-link__text {
    padding: 1rem 1rem 1rem 1.5rem;
  }

  .ma__link-list__item .ma__image-link {
    padding: 10px 0;
  }

  .ma__link-list__toggle {
    margin-top: 20px;
  }
}


.ma__link-list--image-links,
.ma__link-list--image-blocks {

  .ma__link-list__toggle {

    @include ma-button-reset;

    @include ma-link-underline;

    @include ma-chevron;
    font-size: $fonts-medium;
    padding-right: 10px;
    display: none;

    &::after {
      margin-left: 0;
      transform: translateY(-45%) rotate(45deg);
    }

    &.toggle-open::after {
      transform: translateY(-65%) rotate(225deg);
    }

    &.show-toggle {
      display: block;

      @media ($bp-x-large-min) {
        display: none;
      }
    }
  }
}

//theme

.ma__link-list--image-links,
.ma__link-list--image-blocks {

  .ma__link-list__toggle {
    color: $c-font-link;
    font-weight: $fonts-bold;

    &:after {
    border-color: $c-font-link;
    opacity: .5;
    }

    &:hover {
    border-color: rgba($c-font-link,.5);
    }
  }
}

