@use "00-base/configure" as *;

.ma__action-step {

  &--accordion {
    border-width: 2px;
    border-style: solid;
  }

  &__icon {
    position: absolute;
      left: 20px;
    text-align: center;
  }

  &:last-child {
    margin-bottom: 0;
  }

  &__header {
    padding: 20px 0 20px 60px;
    position: relative;
    font-weight: $fonts-bold;
  }

  &--accordion &__header {
    border: none;
    display: block;
    padding: 20px 40px 20px 60px;
    text-align: left;
    width: 100%;

    &__toggle {
      display: block;
      font-size: $fonts-5xlarge;
      line-height: .65em;
      border: none;
      overflow: hidden;
      position: absolute;
        right: 17px;
        top: 25px;
      transform-origin: center center;
      transition: transform .2s ease;

      padding-left: 0;
      margin-left: 0;
    }
  }

  &--accordion.is-open &__header__toggle {
    transform: rotate(135deg);
  }

  &__title {

    &-suffix {
      font-size: $fonts-small;
      font-style: italic;
      font-weight: $fonts-light;
      border-left: 1px solid;
      padding-left: 12px;
      margin-left: 12px;
      line-height: 2;

      @media ($bp-x-small-max) {
        display: block;
        border: 0;
        padding: 0;
        margin: 0;
      }
    }
  }

  &__content {
    padding-left: 60px;

    .ma__rich-text {
      margin-bottom: 30px;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  &--accordion &__content {
    padding-bottom: 30px;
    padding-right: 40px;
  }

  .js &--accordion &__content {
    display: none;
  }

  &__downloads {
    margin-bottom: 1em; // for v5.6 and below
  }

  &__more {
    margin-top: 1em;
  }
}

//theme

.ma__action-step {

  &--accordion {
    border-color: var(--mf-c-bd-divider);
  }

  &--accordion:not(.is-open) &__header {
    background-color: var(--mf-c-bg-section);
  }

  &--accordion.is-open &__header {
    background-color: transparent;
  }

  &--accordion &__header__toggle {
    color: var(--mf-c-primary-alt);
  }

  &__icon {

    svg {
      color: var(--mf-c-primary-alt);
    }

    &--input-error {
      color: var(--mf-c-error) !important;
    }
  }

  &__title {

    @include ma-h4;
    font-weight: $fonts-bold;
    margin-bottom: 0;
  }
}
