// Type sizes
$header-font-size: 17;
$header-line-height: 24;
$excerpt-font-size: 14;
$excerpt-line-height: 20;

.ds-card {
  display: flex;
  flex-direction: column;
  position: relative;

  &.placeholder {
    background: transparent;
    box-shadow: inset $inner-box-shadow;
    border-radius: 4px;

    .ds-card-link {
      cursor: default;
    }

    .img-wrapper {
      opacity: 0;
    }
  }


  .img-wrapper {
    width: 100%;
  }

  .img {
    height: 0;
    padding-top: 50%; // 2:1 aspect ratio

    img {
      border-radius: 4px;
      box-shadow: inset 0 0 0 0.5px $black-15;
    }
  }

  .ds-card-link {
    height: 100%;

    &:focus {
      @include ds-fade-in;

      @include dark-theme-only {
        @include ds-fade-in($blue-40-40);
      }
    }

    &:hover {
      @include ds-fade-in($grey-30);

      @include dark-theme-only {
        @include ds-fade-in($grey-60);
      }
    }

    &:focus,
    &:hover {
      header {
        @include dark-theme-only {
          color: $blue-40;
        }

        color: $blue-60;
      }
    }

    &:active {
      header {
        @include dark-theme-only {
          color: $blue-50;
        }

        color: $blue-70;
      }
    }
  }

  .meta {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;

    .info-wrap {
      flex-grow: 1;
      margin: 0 0 12px;
    }

    .title {
      // show only 3 lines of copy
      @include limit-visibile-lines(3, $header-line-height, $header-font-size);
      font-weight: 600;
    }

    .excerpt {
      // show only 3 lines of copy
      @include limit-visibile-lines(3, $excerpt-line-height, $excerpt-font-size);
    }

    .source {
      -webkit-line-clamp: 1;
      margin-bottom: 2px;
    }

    .context,
    .source {
      @include dark-theme-only {
        color: $grey-40;
      }

      font-size: 13px;
      color: $grey-50;
    }
  }

  header {
    @include dark-theme-only {
      color: $grey-10;
    }

    line-height: $header-line-height * 1px;
    font-size: $header-font-size * 1px;
    color: $grey-90;
  }

  p {
    @include dark-theme-only {
      color: $grey-10;
    }

    font-size: $excerpt-font-size * 1px;
    line-height: $excerpt-line-height * 1px;
    color: $grey-90;
    margin: 0;
  }
}
