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

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

.o-card {
  border: 1px solid $color-stone-200;
  padding: rem(10);
  background-color: $color-white;
  margin-top: rem(10);
  margin-bottom: rem(10);
}

.o-card--special {
  background-color: $color-stone-150;
}

.o-card--adv {
  background-color: $color-blue-steel;
  position: relative;
}

.o-card--ad-native {
  border: 1px solid $color-blue-steel;
  background-color: $color-blue-steel;
  position: relative;
}

.o-card--author {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  background-color: transparent;
  &:first-of-type {
    padding-top: 0;
  }
}

.o-card--image-left {
  .o-card__content {
    .o-card__col {
      flex: 1;
      order: 1;
      margin-right: rem(10);
      &:first-of-type {
        flex: 4;
        order: 2;
        margin-right: 0;
      }
    }
  }
}

.o-card--securedrop {
  .o-card__content {
    .o-card__col {
      &:first-of-type {
        @include mq($from: desktop) {
          flex: 5;
        }
      }
    }
  }
  .o-card__label--muted {
    margin-bottom: 0;
    .o-card__label-text {
      @include font-gm-sans-bold;
    }
  }

  .o-card__hed .o-card__hed-text {
    @include font-gm-sans;
    font-size: rem(14);
    line-height: line-height(14, 17);
    color: $color-grey-700;
  }

  .o-card__meta {
    margin-top: rem(5);
    &::before {
      margin-right: 0;
      font-size: rem(17);
      color: $color-grey-500;
      content: "\2022";
    }
  }
}

.o-card__content-group {
  display: block;
  margin-bottom: rem(2);
}

.o-card__content-text {
  font-size: rem(17);
  color: $color-grey-900;
  + .c-indicator-icon {
    margin-left: 0;
  }
}

.o-card__link {
  text-decoration: none;
  display: block;
  &:visited {
    .o-card__content-text {
      color: $color-grey-660;
      text-decoration: underline;
    }
    .o-video-time {
      text-decoration: none;
    }
  }
  &:hover,
  &:focus {
    // Prevent underline from appearing below icon
    text-decoration: none;
    .o-card__content-text {
      text-decoration: underline;
    }
    .o-video-time {
      text-decoration: none;
    }

    .o-card--image-left & {
      .o-card__label-text {
        text-decoration: underline;
      }
    }
    .o-card--securedrop & {
      .o-card__label-text {
        text-decoration: none;
      }
      .o-card__hed .o-card__hed-text {
        color: $color-grey-900;
      }
      .o-card__meta-author {
        text-decoration: underline;
        color: $color-grey-900;
      }
    }
  }
  &:active {
    .o-card__content-text {
      color: $color-grey-500;
      text-decoration: underline;
    }
    .o-video-time {
      text-decoration: none;
    }

    .o-card--image-left & {
      .o-card__label-text {
        text-decoration: underline;
        color: $color-grey-500;
      }
    }

    .o-card--securedrop & {
      .o-card__label-text {
        text-decoration: none;
      }
      .o-card__hed .o-card__hed-text {
        color: $color-grey-500;
      }
      .o-card__meta-author {
        text-decoration: underline;
        color: $color-grey-500;
      }
    }
  }
}

.o-card__content {
  display: flex;
  justify-content: space-between;
  .o-card__col {
    flex: 1;
    &:first-of-type {
      flex: 2;
      margin-right: rem(10);
    }
  }
}

.o-card--story,
.o-card--special {
  .o-card__content-text {
    @include font-pratt-bold;
  }
}

.o-card--section {
  .o-card__link {
    color: $color-grey-900;

    &:visited {
      color: $color-grey-660;
      text-decoration: none;
    }

    &:hover,
    &:focus {
      color: $color-grey-900;
      text-decoration: underline;
    }

    &:active {
      color: $color-grey-500;
      text-decoration: underline;
    }
  }

  .o-card__content-text {
    @include font-pratt;
    font-size: rem(24);
    line-height: line-height(24, 26);
    letter-spacing: 0;
    text-transform: none;
    color: inherit;

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

.o-card--ad-native {
  .o-card__content-text {
    font-family: $font-sans-stack;
    font-weight: bold;
    font-style: normal;
    font-size: rem(15);
  }
}

///////////////////////////
// Card Meta
///////////////////////////
.o-card__meta {
  @include font-gm-sans;
  text-transform: uppercase;
  font-size: rem(12);
  letter-spacing: rem(1);
  line-height: line-height(12, 15);
  color: $color-grey-600;
  margin-top: rem(10);
  display: block;

  .o-card__meta-authors,
  .o-card__meta-time {
    margin-right: rem(15);
  }
  .o-card__meta-author,
  .o-card__meta-time {
    display: inline-block;
  }
  .o-card__meta-time--salmon {
    color: $color-graphics-salmon;
  }
  &.o-card__meta--single-md {
    color: $color-white;
  }
}

///////////////////////////
// Video Indicator Icons
///////////////////////////
.o-video-time {
  white-space: nowrap;
  display: inline-block;
}
.o-card__hed__duration {
  @include font-gm-sans;
  text-transform: uppercase;
  font-size: rem(12);
  letter-spacing: rem(1);
  line-height: line-height(12, 13);
  color: $color-grey-600;
}
