@import './state';

@mixin Collection {
  padding-right: $collection-padding-right;
  padding-left: $collection-padding-left;
  box-shadow: 0 -1px 0 0 $border-color;
  margin: 0;

  &:only-child {
    border-top: 0;
  }
}

@mixin CollectionItem {
  border-bottom: 1px solid $border-color;
  border-top: 1px solid $border-color;
  padding-bottom: $collection-padding-bottom;
  padding-top: $collection-padding-top;
  position: relative;
  line-height: 1.65;
  transition: 0ms;
  margin-right: 0;
  margin-left: 0;
  display: block;
  color: $black;

  @each $state, $color in $states {
    @include state($state) {
      &::after {
        background-color: $color;
        position: absolute;
        width: 0.125rem;
        content: ' ';
        z-index: 10;
        bottom: 0;
        left: -$collection-padding-left;
        top: -1px;
      }
    }
  }

  @include hover {
    background-color: $gray-100;
    margin-right: -$collection-padding-right;
    margin-left: -$collection-padding-left;
    padding-right: $collection-padding-right;
    padding-left: $collection-padding-left;

    &::after {
      left: 0;
    }
  }

  &[link] {
    cursor: pointer;
  }

  &:first-child {
    border-top: 0;
  }
  &:last-child {
    border-bottom: 0;
  }
  & + & {
    margin-top: -1px;
  }
}
