/* components/featured-1-2-5.css — layout for
   partials/sections/featured-1-2-5.hbs: lead, two stacked stories and a
   list, stacking below --bp-lg. Card shapes are in post-card.css. */

.featured-1-2-5 {
  display: grid;
  gap: var(--space-10);
  margin-block: var(--space-10);
}

/* Phones: the header and .site-main's margin already space the masthead,
   so no extra gap when this section opens the page. */
@media (width < 48rem) {
  .post-list > .featured-1-2-5:first-child {
    margin-block-start: 0;
  }
}

@media (width >= 64rem) {
  .featured-1-2-5 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  /* Column rules, desktop grid only. */
  .featured-1-2-5__mid,
  .featured-1-2-5__list {
    padding-inline-start: var(--space-8);
    border-inline-start: var(--border-width) solid var(--color-border-soft);
  }
}

/* The first Latest story (compact-lead) takes the shape its width allows:
   its own floated thumbnail on phones, text | image across the single
   column from --bp-md (below), stacked in the narrow desktop column, and
   the float again from 75rem (1200px; off the token scale — the first
   width where the column fits a title beside it). Keep image_sizes in
   sections/featured-1-2-5.hbs in step. */
@media (width >= 64rem) and (width < 75rem) {
  .featured-1-2-5__list .post-card[data-variant="compact-lead"] .post-card__media {
    --card-media-ratio: var(--media-ratio-stacked);

    float: none;
    width: auto;
    margin-inline-start: 0;
    margin-block-end: var(--space-3);
  }
}

/* The middle stories and the first Latest story go back on the default
   card's grid (post-card.css): text | image. */
@media (width >= 48rem) and (width < 64rem) {
  .featured-1-2-5__mid .post-card,
  .featured-1-2-5__list .post-card[data-variant="compact-lead"] {
    --card-media-ratio: var(--media-ratio-beside);

    display: grid;
    column-gap: var(--space-6);
  }

  .featured-1-2-5__mid .post-card__media,
  .featured-1-2-5__list .post-card[data-variant="compact-lead"] .post-card__media {
    float: none;
    width: auto;
    margin: 0;
  }
}

/* The lead's image is 3 / 2 at every width (the --media-ratio-lead exception). */
.featured-1-2-5__lead .post-card {
  --card-media-ratio: var(--media-ratio-lead);
}

/* Section-specific: trending-features uses the same lead variant with the
   default dek. */
.featured-1-2-5__lead .post-card__excerpt {
  font-size: var(--text-lg);
  padding-inline: var(--space-4);
}

.featured-1-2-5__mid {
  display: flex;
  flex-direction: column;
  /* No gap: spacing comes from the cards' padding below. */
}

/* Rule between the two stacked stories (vertical cards have no border). */
.featured-1-2-5__mid .post-card {
  padding-block-end: var(--space-8);
  border-block-end: var(--border-width) solid var(--color-border-soft);
}

.featured-1-2-5__mid .post-card:last-child {
  padding-block-end: 0;
  border-block-end: none;
}

/* The rule lives on each card; cancel the last one. */
.featured-1-2-5__list {
  display: flex;
  flex-direction: column;
}

.featured-1-2-5__list .post-card {
  padding-block: var(--space-4);
  border-block-end: var(--border-width) solid var(--color-border-soft);
}

/* No padding at the column's edges, so the first title lines up with the
   other columns' tops. */
.featured-1-2-5__list .post-card:first-child {
  padding-block-start: 0;
}

.featured-1-2-5__list .post-card:last-child {
  padding-block-end: 0;
  border-block-end: none;
}
