.layout-selector {
  @include clearfix();

  text-align: right;
  margin: 0 $spacer*1.5 $spacer;
  position: relative;
  top: -0.5rem;

  button {
    background: $input-label-bg;
    color: $text-color-weak;
    box-shadow: $card-shadow;
    border: none;
    padding: 0.5rem;
    line-height: 1;
    font-size: 130%;
    float: right;

    &:focus {
      outline: none;
    }

    &.active {
      background-color: lighten($input-label-bg, 5%);
      color: $link-color;
    }

    &:nth-child(2) {
      border-radius: 3px 0 0 3px;
      border-right: 1px solid $panel-border;
    }

    &:nth-child(1) {
      border-radius: 0 3px 3px 0;
    }
  }
}

.card-section {
  margin-bottom: $spacer*2;
}

.card-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  list-style-type: none;
}

.card-item {
  display: block;
  height: 100%;
  background: $card-background;
  box-shadow: $card-shadow;
  padding: 1rem;
  border-radius: 4px;

  &:hover {
    background: $card-background-hover;
  }

  .label-tag {
    margin-left: 6px;
    font-size: 11px;
    padding: 2px 6px;
  }

  &--alert {
    padding: 0.5rem 1rem;
    .card-item-name a {
      font-size: $font-size-h5;
    }
  }
}

.card-item-body {
  display: flex;
  overflow: hidden;
}

.card-item-details {
  overflow: hidden;
}

.card-item-cog {
  font-size: 130%;
  position: relative;
  top: 1rem;
  color: $text-muted;
}

.card-item-header {
  margin-bottom: $spacer;
}

.card-item-type {
  color: $text-color-weak;
  text-transform: uppercase;
  font-size: $font-size-sm;
  font-weight: bold;
}

.card-item-notice {
  font-size: $font-size-sm;
}

.card-item-name {
  color: $headings-color;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.card-item-sub-name {
  color: $text-color-weak;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.card-item-sub-name--header {
  color: $text-color-weak;
  text-transform: uppercase;
  margin-bottom: $spacer;
  font-size: $font-size-sm;
  font-weight: bold;
}

.card-list-layout-grid {

  .card-item-type {
    display: inline-block;
  }

  .card-item-notice {
    font-size: $font-size-sm;
    display: inline-block;
    margin-left: $spacer;
  }

  .card-item-header-action {
    float: right;
  }

  .card-item-wrapper {
    width: 100%;
    padding: 0 1.5rem 1.5rem 0rem;
  }

  .card-item-wrapper--clickable {
    cursor: pointer;
  }

  .card-item-figure {
    margin: 0 $spacer $spacer 0;
    height: 6rem;

    img {
      width: 6rem;
    }
  }

  .card-item-name {
    font-size: $font-size-h3;
  }

  @include media-breakpoint-up(md) {
    .card-item-wrapper {
      width: 50%;
    }
  }

  @include media-breakpoint-up(lg) {
    .card-item-wrapper {
      width: 33.333333%;
    }
  }

  &.card-list-layout-grid--max-2-col {
    @include media-breakpoint-up(lg) {
      .card-item-wrapper {
        width: 50%;
      }
    }
  }
}

.card-list-layout-list {

  .card-item-wrapper {
    padding: 0;
    width: 100%;
  }

  .card-item-wrapper--clickable {
    cursor: pointer;
  }

  .card-item {
    border-bottom: .2rem solid $page-bg;
    border-radius: 0;
    box-shadow: none;
  }

  .card-item-header {
    float: right;
    text-align: right;
  }

  .card-item-figure {
    margin: 0 $spacer 0 0;
    img {
      width: 3.5rem;
    }
  }

  .card-item-name {
    font-size: $font-size-h4;
  }

  .card-item-sub-name {
    font-size: $font-size-sm;
  }

  .layout-selector {
    margin-right: 0;
  }
}
