@import "settings.colors";
@import "settings.breakpoints";

@import "mixins/settings.fonts";
@import "mixins/tools.mixins";

.c-article-list-row__heading {
  @include font-pratt;
  font-size: rem(26);
  line-height: line-height(26, 28);
  color: $color-grey-900;
  margin: 0;
  padding-bottom: rem(5);
  border-bottom: 1px solid $color-stone-300;
}

.c-article-list-row__content {
  .c-card:not(.c-card--adv) {
    border-width: 0 0 1px 0;
    background-color: transparent;
  }

  .c-card {
    padding-right: 0;
    padding-left: 0;
  }

  .c-card:first-child {
    padding-left: 0;
  }

  .c-card:last-child {
    border-bottom: none;
  }

  .c-card:not(.c-card--adv) .c-card__hed-text {
    @include font-pratt;
    font-size: rem(17);
    line-height: line-height(17, 20);
  }

  .c-card__media {
    width: rem(90);
  }

  .c-card--adv {
    margin-right: rem(-20);
    margin-left: rem(-20);
    padding-right: rem(20);
    padding-left: rem(20);
    border-width: 0;
    width: auto;

    .c-card__label--muted {
      font-weight: normal;
      font-size: rem(11);
      line-height: line-height(11, 12);
      margin-bottom: rem(5);
    }

    .c-card__hed-text {
      font-size: rem(15);
      line-height: line-height(15, 18);
      color: $color-grey-900;
    }
  }
}


@include mq($from: tablet) {
  .c-article-list-row__heading {
    font-size: rem(30);
    line-height: line-height(30, 32);
  }

  .c-article-list-row__content {
    @include display-grid;
    @include grid-template-columns(rem(20), grid-repeat(2, 1fr));
    @include grid-template-rows(0, grid-repeat(3, auto));

    //column position
    .c-card:nth-child(odd) {
      @include grid-column(1, 2, true);
    }

    .c-card:nth-child(even) {
      @include grid-column(2, 3, true);
    }

    //row position
    .c-card:nth-child(1), .c-card:nth-child(2) {
      @include grid-row(1, 2);
    }

    .c-card:nth-child(3), .c-card:nth-child(4) {
      @include grid-row(2, 3);
    }

    .c-card:nth-child(5), .c-card:nth-child(6) {
      @include grid-row(3, 4);
    }

    .c-card:nth-child(5) {
      border-bottom: none;
    }

    .c-card__media {
      width: rem(100);
    }

    .c-card {
      padding-right: rem(10);
    }

    .c-card--adv {
      margin-left: 0;
      margin-right: 0;
      padding-right: rem(-10);
      padding-left: rem(5);
    }
  }
}

@include mq($from: tabletMedium) {
  .c-article-list-row__heading {
    margin-right: rem(20);
  }

  .c-article-list-row__content {
    @include grid-template-columns(0, grid-repeat(6, 1fr));
    @include grid-template-rows(0, auto);

    .c-card {
      padding-right: rem(20);
      height: auto;
      border-bottom: 0;

      .c-card__grid {
        @include display-grid;
        @include grid-template-columns(0, auto);
        @include grid-template-rows(rem(10), grid-repeat(2, auto));
      }

      .c-card__content {
        @include grid-row(2, 3, true);
      }

      .c-card__media {
        @include grid-column(1, 2);
        @include grid-row(1, 2, true);

        max-width: rem(192);
        width: 100%;
        display: block;
      }
    }

    .c-card:not(.c-card--adv) .c-card__hed-text {
      font-size: rem(16);
      line-height: line-height(16, 19);
    }

    //card position - put them in a row
    .c-card:nth-child(odd), .c-card:nth-child(even) {
      @include grid-row(1, 2);

      $elements-count: 7;
      @for $i from 1 to $elements-count {

        &:nth-child(#{$i}) {
          @include grid-column($i, $i + 1);
        }
      }
    }

    .c-card--adv {
      height: auto;
      padding: 0;
      margin-top: rem(10);
      margin-right: rem(20);
      border-width: 0;

      .c-card__content {
        padding: 0 rem(5);
      }
    }
  }
}

@include  mq($from: desktop) {
  .c-article-list-row__content {
    .c-card:not(.c-card--adv) .c-card__hed-text {
      font-size: rem(17);
      line-height: line-height(17, 20);
    }

    .c-card--adv .c-card__content {
      padding: 0 rem(10);
    }
  }
}

