// Lists
//
// A collection of list types (inline content focussed for manual application by authors)
//
// Markup: lists.twig
//
// Style guide: Lists

// Highlight an item in a list.
ul {
  li {
    transition: background-color 1s;

    &.highlight {
      background-color: $list-bg-colour--highlight;
    }
  }
}

// Large list styles
%list--large {
  list-style-type: none;
  counter-reset: standard-counter;
  padding: 0;
  margin: 0;

  *+& {
    @include AU-space(margin-top, 1.5unit);
  }

  >li {
    vertical-align: top;
    position: relative;
    @include AU-space('margin', 0 0 1unit);
    @include AU-space('padding', 1.5unit);

    background: $list-bg-colour--large;

    &::before {
      content: counter(standard-counter, decimal);
      counter-increment: standard-counter;
      float: left;
      text-align: center;
      font-weight: 700;
      position: absolute;
      left: 14px;
      @include AU-space('top', 1unit);
      padding-top: 0;
      font-size: 24px;
    }

    a {
      font-weight: bold;
      font-size: 1.15rem;
      line-height: 1.2;
    }
  }
}

// Apply default to <ol>
ol.list--large {
  @extend %list--large;

  >li {
    @include AU-space('padding-left', 3unit);
  }
}

// Variant for <ul>
ul.list--large {
  @extend %list--large;
  counter-reset: none;

  >li {
    @include AU-space('padding-left', 3unit);

    &::before {
      content: '■';
      counter-increment: none;

    }
  }
}

// Plain list
ul,
ol {
  &.list--large--plain {
    @extend %list--large;

    >li {
      &:before {
        display: none;
      }
    }
  }
}

// Checklist style
ul {
  &.list--large--checklist {
    @extend %list--large;

    >li {
      @include AU-space('padding-left', 4unit);
      @include AU-space('padding-top', 1unit);
      background: $list-bg-colour--large url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23313131' d='M0,0h32v32H0V0z'/%3E%3Cpath fill='%23fff' d='M2,2h28v28H2V2z'/%3E%3C/svg%3E") no-repeat 13px 13px/30px 30px;

      &::before {
        content: '';
      }

      strong {
        @extend .au-display-md;
      }
    }
  }
}

// Fix aligment of CTA in a list
// Markup <ul><li><a href="#" class="au-cta-link">Link</a></li></ul>
ul:has(.au-cta-link) {
  padding-left: 20px;
}

// CTA link list - apply to <ul>
// Vars:

.au-body {
  .list--cta-links {
    padding-left: 0;
    list-style-type: none;
    border-top: $health-borderize--very-thin;

    &__link {
      position: relative;
      display: block;
      @include AU-space(padding, 0.75unit 1.5unit 0.75unit 0);
      border-bottom: $health-borderize--very-thin;

      &:after {
        content: ' ';
        display: block;
        position: absolute;
        height: 16px;
        width: 14px;
        @include AU-space(bottom, 1unit);
        @include AU-space(right, 0.5unit);
        transition: margin .2s ease;
        transition-property: right;
        background: #000;
        mask-image: AU-svguri('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"/></svg>');
        -webkit-mask-image: AU-svguri('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"/></svg>');
      }

      &:hover,
      &:active,
      &:focus {
        &:after {
          @include AU-space(right, 0);
        }
      }
    }
  }
}

// Handle links inside other elements
// .au-body {
//   .health-card.health-card--colour-primary
// }

// Define defaults
// Define inherited values (reised card and band ones)
// Default
// var(-link-text)
// $health-borderize--very-thin
// var(--icon)

// In band 
// var(--primary-body-text)
// var(--primary-link-text)

// In band X


// In card
// var(--card-text)

// In card X

// var(--card-text--primary)
// var(--card-text--secondary)
// var(--card-clickable-icon--secondary)

// Ned to address
// Dark card link text (broken)


// // Add variant for in content
// $health-borderize--very-thin // var(--card-border);