$col4-header-line-height: 20;
$col4-header-font-size: 14;

.ds-card-grid {
  display: grid;
  grid-gap: 24px;
  margin: 16px 0;

  .ds-card {
    @include dark-theme-only {
      background: none;
    }

    background: $white;
    border-radius: 4px;
  }

  .ds-card-link:focus {
    @include ds-fade-in;
  }

  &.ds-card-grid-border {
    .ds-card:not(.placeholder) {
      @include dark-theme-only {
        box-shadow: 0 1px 4px $shadow-10;
        background: $grey-70;
      }

      box-shadow: 0 1px 4px 0 $grey-90-10;

      .img-wrapper .img img {
        border-radius: 4px 4px 0 0;
      }
    }
  }

  &.ds-card-grid-no-border {
    .ds-card {
      background: none;

      .meta {
        padding: 12px 0;
      }
    }
  }

  // "2/3 width layout"
  .ds-column-5 &,
  .ds-column-6 &,
  .ds-column-7 &,
  .ds-column-8 & {
    grid-template-columns: repeat(2, 1fr);
  }

  // "Full width layout"
  .ds-column-9 &,
  .ds-column-10 &,
  .ds-column-11 &,
  .ds-column-12 & {
    grid-template-columns: repeat(4, 1fr);

    &.ds-card-grid-divisible-by-3 {
      grid-template-columns: repeat(3, 1fr);

      .title {
        font-size: 17px;
        line-height: 24px;
      }

      .excerpt {
        @include limit-visibile-lines(3, 24, 15);
      }
    }

    &.ds-card-grid-divisible-by-4 .title {
      @include limit-visibile-lines(3, 20, 15);
    }
  }

  &.empty {
    grid-template-columns: auto;
  }
}
