%card-title {
  margin: 0 0 20px;
  font-size: 1.5rem;
  font-weight: 700;
}

.card {
  width: 100%;
  min-height: 450px;
  background-color: $white;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  position: relative;
  box-shadow: $box-shadow;

  &--media-list {
    min-height: 87px;
    flex-direction: row;
    padding: 10px;
    border-bottom: 1px solid $grey-light;
    box-shadow: none;
    position: relative;

    &:first-of-type {
      border-top: 1px solid $grey-light;
    }

    &--selected {
      border: 2px solid $light-blue;
      margin-bottom: 4px;
      border-radius: 3px;
      cursor: pointer;

      &:first-of-type {
        border-top: 2px solid $light-blue;
      }
    }

    &:hover {
      cursor: pointer;
    }
  }

  &--media-grid {
    flex: 0 0 49%;
    margin: .5%;
    padding: 0;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    @include mq($from: phablet) {
      flex: 1 1 auto;
      margin: 5px;
      max-width: 160px;
    }
    @include mq($from: desktop) {
      max-width: 180px;
    }
    @include mq($from: wide) {
      max-width: 240px;
    }
  }

  &--prompt {
    width: calc(100% - 20px);
    margin: 10px;
    max-width: 800px;
    box-shadow: none;
    background-color: $primary-color;
    flex: 1 1 auto;
    @include mq($from: tablet) {
      max-height: 600px;
      flex: 0 0 auto;
      margin: auto;
    }
  }

  &--element {
    min-height: auto;
    box-shadow: none;
    padding-bottom: 100%;
    position: relative;
    transition: $animate-default;
    cursor: pointer;

    &:hover {
      transform: scale(1.08);
      z-index: 10;
      box-shadow: $box-shadow;

      & .card__select {
        background: rgba($white, 0.8);
        text-decoration: none;

        & i {
          color: $green;
        }
      }

      & .card__image {
        background: rgba($black, 0.2);

        & i {
          color: $white;
        }
      }
    }

    &.selected {
      & .card__select {
        background: $white;

        & i {
          color: $green;
        }
      }

      & .card__image {
        background: rgba($black, 0.2);

        & i {
          color: rgba($white, 0.9);
        }
      }
    }
  }

  &__content {
    padding: 20px;
    text-align: left;
    @include mq($from: tablet) {
      padding: 20px 30px 30px;
    }

    & p {
      line-height: 1.5em;
      margin: 0 0 30px;

      &:last-of-type {
        margin: 0;
      }

      & a {
        color: $primary-color;

        &:hover {
          border-color: $primary-color;
        }
      }
    }

    &--prompt {
      text-align: center;
      color: $white;
      @include mq($from: tablet) {
        padding: 30px;
      }

      & p {
        font-weight: 600;
      }

      & .button {
        margin: 25px auto 0;
      }
    }
  }

  &__title {
    @extend %card-title;

    &--media-list {
      margin: 3px 0;
      font-weight: $font-semi-bold;

      & h2 {
        margin: 0;
        font-size: .875rem;
        font-weight: $font-semi-bold;
        word-break: break-all;
      }
    }

    &--media-grid {
      flex: 1;
      min-width: 0;
      margin-bottom: 5px;

      & h2 {
        margin: 0;
        font-size: .875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

    &--header {
      margin: 0;
    }

    &--with-badge {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    & a {
      color: $nearly-black;

      &:hover {
        border-color: $grey-dark;
      }
    }
  }

  &__image {
    line-height: 0;
    background: $pink;
    height: 213px;
    display: flex;
    justify-content: center;
    align-items: center;

    &--media-list {
      display: inherit;
      flex: 0 0 100px;
      height: 67px;
      overflow: hidden;

      & img {
        object-fit: cover;
        height: 100%;
        width: 100%;
      }

      &-document {
        flex: 0 0 100px;
        height: 67px;
        overflow: hidden;
        background: none;
        padding: 20px;
      }
    }

    &--media-grid {
      height: 200px;
      @include mq($from: phablet) {
        height: 160px;
      }
      @include mq($from: desktop) {
        height: 180px;
      }
      @include mq($from: wide) {
        height: 240px;
      }

      & img {
        object-fit: cover;
        height: 100%;
        width: 100%;
      }
    }

    &--with-badge {
      position: relative;
    }

    &--text {
      font-size: 3rem;
      font-weight: 900;
      color: rgba($white, 0.8);
    }

    &--element {
      width: 100%;
      height: 75%;
      position: absolute;
      bottom: 0;
      left: 0;
      display: flex;
      justify-content: center;
      align-content: center;
      background: rgba($black, 0.1);

      & i {
        transition: $animate-default;
        font-size: 500%;
        color: rgba($white, 0.6);
        @include mq($from: tablet) {
          font-size: 400%;
        }
        @include mq($from: tablet) {
          font-size: 250%;
        }
      }
    }

    & a {
      border: 0;
    }
  }

  &__footer {
    margin-top: auto;
    padding: 5px 10px;
    text-align: left;
    background-color: $grey-100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: .813rem;
    color: $grey-dark;
    text-transform: uppercase;
    @include mq($from: tablet) {
      padding: 5px 20px;
      min-height: 70px;
    }

    & .button {
      margin: 10px;
    }

    & p {
      margin: 10px;
      font-weight: $font-bold;
      letter-spacing: $x-small-space;
    }

    &--media-list {
      text-transform: none;
      background: none;
      padding: 0 0 0 20px;
      margin-top: 0;
      flex: 1 1 auto;
      display: flex;
      flex-wrap: nowrap;
      justify-content: space-between;
      align-items: center;
      @include mq($from: tablet) {
        min-height: 20px;
      }

      & p {
        margin: 0;
        font-weight: $font-regular;
      }

      & .icon-button--clear {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
      }
    }

    &--media-grid {
      display: inherit;
      text-transform: none;
      color: $white;
      background-color: $primary-color;
      padding: 10px 40px 10px 10px;
      position: absolute;
      left: 0;
      bottom: 0;
      right: 0;
      z-index: 1;
      @include mq($from: tablet) {
        padding: 10px 40px 10px 10px;
        min-height: 20px;
      }

      & p {
        margin: 0;
        font-weight: $font-regular;
      }
    }

    &--element {
      height: 25%;
      min-height: 1px;
      width: 100%;
      position: absolute;
      left: 0;
      top: 0;
      background: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: $white;
      padding: 5px 20px;
      @include mq($from: tablet) {
        padding: 5px 10px;
      }

      & p {
        margin: 0;
        font-size: 1rem;
        @include mq($from: tablet) {
          font-size: .688rem;
          white-space: nowrap;
          max-width: 100px;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }
    }
  }

  &__select {
    height: 26px;
    width: 26px;
    border-radius: 13px;
    border: 0;
    background: rgba($white, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: $animate-default;
    margin-right: -5px;

    & i {
      color: rgba($white, 0.8);
    }
  }

  &__header {
    padding: 20px;
    text-align: left;
    background-color: $grey-lightest;
    display: flex;

    &--with-badge {
      justify-content: space-between;
      align-items: center;
    }
  }

  &__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 11;

    & i {
      font-size: .75rem;
    }
  }

  &__alert {
    font-size: .875rem;
    font-weight: $font-semi-bold;
    color: $warning;
    margin-top: auto;
    text-align: left;
    padding: 10px 20px;
    @include mq($from: tablet) {
      padding: 15px 30px;
    }
  }

  &__details {
    text-align: left;
    width: 100%;
    overflow: hidden;

    & p {
      font-size: .75rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    & span {
      margin-right: 10px;

      &:last-of-type {
        margin-right: 0;
      }
    }
  }

  &__menu {
    &--list {
      flex: 0 0 30px;

      & .icon-button--round {
        background: none;
        color: $nearly-black;
        box-shadow: none;

        &:hover {
          box-shadow: none;
          transform: none;
        }
      }
    }

    &--grid {
      position: absolute;
      right: 5px;
      top: 50%;
      transform: translateY(-50%);

      & .icon-button--round {
        box-shadow: none;

        &:hover {
          box-shadow: none;
          transform: none;
        }
      }
    }
  }
}

.card__image + .card__content {
  /*If there is an image before content*/
  @include mq($from: tablet) {
    padding-top: 20px;
  }

  &--prompt {
    @include mq($from: tablet) {
      padding-top: 30px;
    }
  }
}

.card__title + .author {
  /*If author comes after title*/
  margin-top: -15px;
}

.author--card + .date {
  /*If date comes after author*/
  margin-top: -15px;
}

.box {
  width: 100%;
  padding: 30px;
  background-color: $warning;
}
