@import "settings.colors";
@import "settings.fonts";

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

.c-card--promo {
  padding: 0;
  margin: rem(10) 0;
  .c-card__grid {
    @include grid-template-columns(0, 1fr);
    @include grid-template-rows(0, auto 1fr);
  }

  .c-card__content {
    @include grid-row(2, 3);
    @include grid-column(1, 2);
    padding: rem(10);
  }

  .c-card__hed {
    @include font-pratt;
    font-size: rem(26);
    color: $color-red-500;
    letter-spacing: 0;
    line-height: line-height(26, 28);
    .c-card__hed-text--link {
      color: $color-red-500;
      text-decoration: none;
      &:hover,
      &:focus {
        text-decoration: underline;
      }
      &:active {
        color: $color-red-800;
        text-decoration: underline;
      }
    }
  }

  .c-card--promo__subhed {
    margin-top: rem(10);
    margin-bottom: 0;
    color: $color-grey-660;
    letter-spacing: rem(1);
    font-size: rem(12);
    @include font-gm-sans;
    line-height: line-height(12, 15);
    text-transform: uppercase;
  }

  .c-card__dek {
    display: block;
    margin-top: rem(15);
    margin-bottom: rem(15);
    color: $color-grey-900;
    font-size: rem(16);
    line-height: line-height(16, 22);
    padding-top: 0;
  }

  .c-card__media {
    @include grid-row(1, 2);
    @include grid-column(1, 2);
    width: 100%;
    margin-bottom: rem(15);
    .c-image {
      width: 100%;
    }
  }

  .c-card__meta {
    margin-top: 0;
  }

  .c-card--promo__cta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    .c-button {
      flex: 1;
      + .c-button {
        margin-left: rem(10);
      }
    }
  }
}

.c-card--promo--a {
  .c-card__grid {
    height: 100%;
  }
  .c-card__content {
    @include display-grid;
    @include grid-template-rows(0, grid-repeat(3, auto) 1fr);
  }
  .c-card__hed {
    @include grid-row(1, 2);
  }
  .c-card--promo__subhed {
    @include grid-row(2, 3);
  }
  .c-card__dek {
    @include grid-row(3, 4);
  }
  // Only one of the following elements should be visible at any given time
  .c-card--promo__cta,
  .c-card--promo__success,
  .c-card--promo__failure {
    @include grid-row(4, 5);
    @include grid-align-self(end);
  }
  .c-card--promo__cta {
    .c-button {
      padding-left: 0;
      padding-right: 0;
    }
  }
}

.c-card--promo--b-left,
.c-card--promo--b-right {
  padding: rem(10);
  .c-card__grid {
    @include grid-template-columns(rem(10), 1fr auto);
  }

  .c-card__media {
    width: rem(60);
    margin-bottom: 0;
    @include grid-column(1, 2, true);
  }

  .c-card__content {
    @include grid-row(1, 2);
    @include grid-column(2, 3, true);
    padding: 0;
  }

  .c-card__dek {
    font-size: rem(17);
    margin-top: rem(10);
    letter-spacing: 0;
    line-height: line-height(17, 20);
  }

  .c-card--promo__cta {
    display: block;
  }
}

.c-card--promo--b-right {
  .c-card__media {
    @include grid-column(2, 3, true);
  }
  .c-card__content {
    @include grid-column(1, 2, true);
  }
}

.c-card--promo--c {
  height: 100%;
  margin: 0;
  .c-card__hed {
    font-size: rem(19);
    line-height: line-height(19, 21);
  }
  .c-card__content {
    padding-top: rem(15);
  }
  .c-card__link {
    text-decoration: none;
    &:hover {
      text-decoration: none;
      .c-card__hed-text {
        text-decoration: underline;
      }
    }
    &:active {
      text-decoration: none;
      .c-card__hed-text {
        color: $color-red-800;
        text-decoration: underline;
      }
    }
  }
  .c-card__media {
    margin-bottom: 0;
  }
}

.c-card--promo--d {
  padding: 0;
  .c-card__grid {
    height: 100%;
    @include grid-template-rows(0, 1fr);
  }
  .c-card__content {
    @include grid-row(1, 2);
    @include display-grid;
    @include grid-template-rows(0, grid-repeat(2, auto) 1fr);
  }
  .c-card__hed {
    @include grid-row(1, 2);
  }
  .c-card__dek {
    @include grid-row(2, 3);
  }
  .c-card--promo__cta {
    @include grid-row(3, 4);
    @include grid-align-self(end);
  }
}

// Newsletter sign-up success and failure messages
.c-card--promo__success,
.c-card--promo__failure {
  @include font-gm-sans-bold;
  font-size: rem(14);
  letter-spacing: rem(1);
  text-transform: uppercase;
  margin-bottom: rem(5);
  .c-indicator-icon {
    margin-left: 0;
    margin-right: rem(2);
  }
}
.c-card--promo__success {
  color: $color-utility-green-700;
  .c-indicator-icon__art {
    width: rem(23);
    height: rem(18);
    fill: $color-utility-green-700;
  }
  .c-utility-body--secondary__text {
    text-transform: none;
    letter-spacing: normal;
  }
}
.c-card--promo__failure {
  color: $color-red-700;
  .c-indicator-icon__art {
    width: rem(18);
    height: rem(18);
    fill: $color-red-700;
  }
}

// Utility Promo cards
.c-card--utility-promo {
  .c-card__grid {
    @include grid-template-columns(rem(10), auto 1fr);
    &:hover,
    &:focus {
      .c-card__label {
        text-decoration: underline;
      }
    }
    &:active {
      .c-card__label {
        text-decoration: underline;
        color: $color-grey-500;
      }
    }
  }
  .c-card__media {
    @include grid-column(1, 2, true);
    @include grid-row(1, 2);
    width: rem(40);
  }
  .c-card__content {
    @include grid-column(2, 3, true);
    @include grid-row(1, 2);
  }
  .c-card__label {
    @include font-gm-sans;
    background: none;
    color: $color-grey-660;
    padding: 0;
  }
}

.c-card--securedrop {
  background-color: transparent;
  border-width: 0;
  padding: rem(10);
  margin-top: rem(10);
  margin-bottom: rem(10);
  .c-card__grid {
    @include grid-template-columns(rem(10), auto 1fr);
    &:hover,
    &:focus {
      .c-card__hed-text,
      .c-card__author {
        text-decoration: underline;
        color: $color-grey-900;
      }
    }
    &:active {
      .c-card__hed-text,
      .c-card__author {
        text-decoration: underline;
        color: $color-grey-500;
      }
    }
  }
  .c-card__media {
    @include grid-column(1, 2, true);
    @include grid-row(1, 2);
    width: rem(60);
  }
  .c-card__content {
    @include grid-column(2, 3, true);
    @include grid-row(1, 2);
  }
  .c-card__hed {
    @include font-gm-sans;
    font-size: rem(14);
    line-height: line-height(14, 17);
    color: $color-grey-700;
  }
  .c-card__label {
    @include font-gm-sans-bold;
    background: none;
    color: $color-grey-660;
    padding: 0;
  }
  .c-card__meta {
    font-size: rem(12);
    line-height: 1;
    @include font-gm-sans;
    display: flex;
    align-items: center;

    &::before {
      margin-right: rem(2);
      font-size: rem(17);
      color: $color-grey-500;
      content: "\2022";
    }
  }
}
