.card {
  border: 1px solid $panel-default-border;
  border-radius: $border-radius-base;
  margin-bottom: $line-height-computed;
  position: relative;

  &-block {
    padding: $panel-body-padding;
  }

  &-blockquote {
    border-left: 0;
    margin-bottom: 0;
    padding: 0;
  }

  &-footer {
    background-color: $panel-footer-bg;
    border-top: 1px solid $panel-default-border;
    padding: $panel-footer-padding;

    &:last-child {
      border-radius: 0 0 ($panel-border-radius - 1) ($panel-border-radius - 1);
    }
  }

  &-header {
    background-color: $panel-default-heading-bg;
    border-bottom: 1px solid $panel-default-border;
    padding: $panel-heading-padding;

    &:first-child {
      border-radius: ($border-radius-base - 1) ($border-radius-base - 1) 0 0;
    }
  }

  &-link {
    text-decoration: none;

    + .card-link {
      margin-left: ($grid-gutter-width / 2);
    }
  }

  //todo fix errors
  > .list-group:first-child .list-group-item:first-child {
    border-radius: $border-radius-base $border-radius-base 0 0;
  }

  > .list-group:last-child .list-group-item:last-child {
    border-radius: 0 0 $border-radius-base $border-radius-base;
  }

  &-subtitle {
    margin-bottom: 0;
    margin-top: 0;
  }

  &-title {
    margin-bottom: .5em;
    margin-top: 0;
  }

  &-text:last-child {
    margin-bottom: 0;
  }
}

.card-primary {
  background-color: $brand-primary;
  border-color: $brand-primary;
}

.card-success {
  background-color: $brand-success;
  border-color: $brand-success;
}

.card-info {
  background-color: $brand-info;
  border-color: $brand-info;
}

.card-warning {
  background-color: $brand-warning;
  border-color: $brand-warning;
}

.card-danger {
  background-color: $brand-danger;
  border-color: $brand-danger;
}

.card-inverse {

  .card-header,
  .card-footer {
    border-bottom: 1px solid $wk-primary-white;
    opacity: .2;
  }

  .card-header,
  .card-footer,
  .card-title,
  .card-blockquote {
    color: $wk-primary-white;
  }

  .card-link,
  .card-text,
  .card-blockquote > footer {
    color: $wk-primary-white;
    opacity: .65;
  }

  .card-link {

    &:hover,
    &:focus {
      color: $wk-primary-white;
    }
  }
}

// Card image
.card-img {
  border-radius: $panel-border-radius;
}

.card-img-overlay {
  bottom: 0;
  left: 0;
  padding: $panel-body-padding;
  position: absolute;
  right: 0;
  top: 0;
}

// Card image caps
.card-img-top {
  border-radius: $panel-border-radius $panel-border-radius 0 0;
}

.card-img-bottom {
  border-radius: 0 0 $panel-border-radius $panel-border-radius;
}

//
// Card set
//

.card-deck {
  border-spacing: ($grid-gutter-width / 2) 0;
  display: table;
  table-layout: fixed;

  .card {
    display: table-cell;
    vertical-align: top;
    width: 1%;
  }
}

.card-deck-wrapper {
  margin-left: -($grid-gutter-width / 2);
  margin-right: -($grid-gutter-width / 2);
}

//
// Card groups
//

.card-group {
  display: table;
  table-layout: fixed;
  width: 100%;

  .card {
    display: table-cell;
    vertical-align: top;

    + .card {
      border-left: 0;
      margin-left: 0;
    }

    // Handle rounded corners
    &:first-child {

      .card-img-top {
        border-top-right-radius: 0;
      }

      .card-img-bottom {
        border-bottom-right-radius: 0;
      }
    }

    &:last-child {

      .card-img-top {
        border-top-left-radius: 0;
      }

      .card-img-bottom {
        border-bottom-left-radius: 0;
      }
    }

    &:not(:first-child):not(:last-child) {
      border-radius: 0;

      .card-img-top,
      .card-img-bottom {
        border-radius: 0;
      }
    }
  }
}

//
// Card
//
.card-columns {
  column-count: 3;
  column-gap: ($grid-gutter-width / 2);

  .card {
    display: inline-block;
    width: 100%; // Don't let them exceed the column width
  }
}
