/**
 * Component: List
 */
@include comp('list') {
  position: relative;
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;

  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-start;
  align-content: stretch;
  align-items: stretch;

  padding: 0;
  margin: 0;

  @include elem('item', 'container', 'content', 'left', 'right') {
    position: relative;
    min-width: 0;
  }

  @include elem('item', 'container') {
    flex: none;
    width: 100%;
    max-width: 100%;

    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    align-content: stretch;
    align-items: stretch;

    padding: 0;
    margin: 0;

    color: inherit;

    transition: background-color ease-in-out $button-transition-duration;
  }

  @include elem('content') {
    flex: 1;
  }
  @include elem('left', 'right') {
    flex: none;
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    align-content: stretch;
    align-items: stretch;
  }
  @include elem('left') {
    margin-right: rem($gap-base);
  }
  @include elem('right') {
    margin-left: rem($gap-base);
  }

  // status & properties

  @include when('raise') {
    box-shadow: $raise-base;
  }
  @each $raise, $value in $raise-shadow-map {
    @include prop(
      (
        'raise': $raise,
      )
    ) {
      box-shadow: $value;
    }
  }

  @include when('gap') {
    @include elem('container') {
      padding-left: rem($gap-base);
      padding-right: rem($gap-base);
    }
  }

  @include when('divided') {
    @include elem('content', 'left', 'right') {
      padding-top: rem($gap-base);
      padding-bottom: rem($gap-base);
    }
    @include elem('item') {
      &:not(:first-child) {
        margin-top: rem(-$border-base);
        border-top: rem($border-base);
      }
      &:not(:last-child) {
        @include elem('content', 'left', 'right') {
          border-bottom: rem($border-base) solid transparent;
        }
      }
    }
  }

  @each $theme in $type-theme {
    @include prop(
      (
        'theme': $theme,
      )
    ) {
      color: theme($theme);
      background-color: theme($theme, 'bg');

      @include elem('item') {
        &:hover {
          background-color: theme($theme, 'bg', 'hover');
        }
      }

      @include when('divided') {
        @include elem('item') {
          &:not(:last-child) {
            @include elem('content') {
              border-color: theme($theme, 'bd');
            }
          }
        }
      }
    }
  }
}
