$breakpoint: 460px;
$image-height: 60%;
$title-height: 40%;

:host {
  position: relative;
}

/deep/ {
  .mat-card-header-text {
    width: 100%;
  }
}

md-card.hover-card {
  overflow: hidden;
  padding: 0;
  margin-bottom: 0;

  md-card-title,
  md-card-subtitle {
    margin: 0 80px 0 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  md-card-subtitle {
    font-size: 12px;
    margin-top: 4px;
  }
}

.hover-area {
  position: relative;
  cursor: pointer;

  @media screen and (min-width: $breakpoint) {
    padding-top: 55%;

    &:hover {
      .description {
        top: 0;
      }

      .enabled-indicator {
        span {
          width: 70px;
        }
      }
    }
  }
}

.hover-banner {
  max-height: 133px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;

  img {
    max-width: 100%;
  }

  @media screen and (min-width: $breakpoint) {
    max-height: none;
    position: absolute;
    top: 0;
  }
}

.description {
  box-sizing: border-box;
  padding: 10px 16px 0;
  overflow: hidden;
  background: #fff;
  transition: 0.3s ease all;

  &:after {
    content: '';
    display: block;
    width: 100%;
    height: 40%;
    position: absolute;
    bottom: 0;
    left: 0;
    background: linear-gradient(rgba(#fff,0) 40%, rgba(#fff,1) 70%);
  }

  @media screen and (min-width: $breakpoint) {
    position: absolute;
    top: $image-height;
    width: 100%;
    height: 100%;

    &:after {
      height: 70%;
    }
  }
}

md-card-header {
  box-sizing: border-box;
  padding-bottom: 16px;
  margin: 0;
  height: $title-height;
  display: flex;
  align-items: center;
}

md-card-content {
  min-height: 40px;
  max-height: 80px;
  padding: 16px;
  margin: 0 -16px;
  border-top: 1px solid #e5e5e5;
  font-size: 12px;

  @media screen and (min-width: $breakpoint) {
    min-height: 0;
    max-height: none;
  }
}

.enabled-indicator {
  position: absolute;
  right: 8px;
  bottom: 8px;

  span {
    display: inline-block;
    width: 70px;
    overflow: hidden;
    transition: 0.3s ease all;
  }

  @media screen and (min-width: $breakpoint) {
    span {
      width: 0;
    }
  }
}

button[md-button] {
  padding: 0 8px;
  min-width: 0;
}

md-card-actions {
  position: relative;
  padding: 8px !important;
  margin: 0 !important;
  text-align: right;
  border-top: 1px solid #e5e5e5;
  background-color: #fff;
}

.status {
  font-size: 14px;
}
