@import "settings.colors";

@import "mixins/tools.mixins";
@import "mixins/objects.homepage-cards";
@import "mixins/objects.package-within-group";

// Hide decks for all cards except for the lead card,
// for all "package within group" type packages
.o-package--within-group {
  // All cards
  .o-card__dek {
    display: none;
  }
  // Lead card
  .o-package__stories > .u-wrapper:first-of-type .o-card,
  .o-package__col:first-of-type .o-card:first-of-type {
    .o-card__dek {
      display: block;
    }
  }
}

.o-package--within-group {
  margin-bottom: rem(20);
  background-color: $color-white;
  border-width: 1px;
  @include flex-display;
  flex: 100%;
  align-content: flex-start;
  justify-content: flex-start;
  .o-package__label {
    font-size: rem(12);
    line-height: line-height(12, 12);
    color: $color-grey-660;
    border-width: 0;
  }
  .o-package__label,
  .o-package__col,
  .u-wrapper {
    flex: 100%;
  }
  .u-wrapper {
    border-style: solid;
    border-color: $color-stone-200;
    border-width:  0 0 1px 0;
    .o-card__hed {
      @include font17b;
    }
    &:first-of-type {
      .o-card__col:nth-of-type(n+2) {
        display: block;
      }

      .o-card__col:nth-of-type(n+2) > .c-image {
        display: none;
      }

      .o-card__col:nth-of-type(n+2) .c-image-container {
        display: block;
      }
    }
    &:last-of-type {
      border-bottom: 0;
    }
    .o-card__col:nth-of-type(n+2) {
      display: none;
    }
    &:nth-of-type(n+2) {
      .o-card--package-opinion,
      .o-card--package-column {
        .o-card__col:nth-of-type(n+2) {
          display: block;
        }
      }
    }
  }
  .o-card {
    margin-bottom: 0;
    margin-top: 0;
    border: none;
    background-color: transparent;
  }

  .o-card--package-opinion,
  .o-card--package-column {
    .o-card__col:nth-of-type(n+2) .c-image-container {
      display: none;
    }
  }

  &.o-package--within-group--display {
    .u-wrapper:first-of-type {
      .o-card__col:nth-of-type(n+2),
      .o-card__col:nth-of-type(n+2) .c-image-container {
        display: block;
      }
      .o-card__col:nth-of-type(n+2) > .c-image {
        display: none;
      }
    }
  }

  // Lead card
  .o-package__stories > .u-wrapper:first-of-type .o-card,
  .o-package__col:first-of-type .o-card:first-of-type {
    padding: 0;
    .o-card__content {
      flex-wrap: wrap;
    }
    @include o-package--within-group--card-col-order(2, 1);
    .o-card__col {
      flex: 100%;
      &:first-of-type {
        flex: 100%;
        margin-right: 0;
        padding: rem(10);
      }
    }
    .o-card__hed {
      @include font19b;
    }
    .o-card__dek {
      @include font15r;
    }
  }
}

.o-package--within-group--g1 {
  .o-package__col {
    &:first-of-type {
      .u-wrapper:last-of-type {
        border-bottom: 1px solid $color-stone-200;
      }
    }
    &:last-of-type {
      .u-wrapper .o-card__dek {
        display: none;
      }
    }
  }
}
