.cards > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.cards > ul > li {
  border: 1px solid var(--border-color);
  background-color: var(--background-color);
}

.cards .cards-card-body {
  margin: 16px;
}

.cards .cards-card-image {
  line-height: 0;
}

.cards > ul > li img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* card typography — titles and teaser copy */
.cards .cards-card-body h3 {
  margin: 0 0 8px;
  font-size: var(--heading-font-size-m);
  line-height: 1.2;
}

.cards .cards-card-body h2 a:any-link,
.cards .cards-card-body h3 a:any-link {
  color: var(--text-color);
  font-weight: 900;
}

.cards .cards-card-body p {
  margin: 0;
  color: var(--text-muted-color);
  font-size: var(--body-font-size-s);
}

.cards .cards-empty {
  color: var(--text-muted-color);
}

/* mobile-first base is a single column; grids layer on at tablet/desktop (R7/R13) */
@media (width >= 768px) {
  .cards > ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width >= 1024px) {
  .cards > ul {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- variant: news (compact horizontal list rows, source-style) ---
   news-dynamic (Cards (news-dynamic)) shares this exact styling — it's the
   same visual card, just fed from a central sheet instead of authored rows. */
.cards.news > ul,
.cards.news-dynamic > ul {
  grid-template-columns: 1fr;
  gap: 0;
}

.cards.news > ul > li,
.cards.news-dynamic > ul > li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  border: 0;
  background-color: transparent;
  padding: 16px 0;
}

.cards.news > ul > li {
  border-bottom: 1px solid var(--border-color);
}

.cards.news > ul > li:first-child,
.cards.news-dynamic > ul > li:first-child {
  padding-top: 0;
}

.cards.news > ul > li img,
.cards.news-dynamic > ul > li img {
  aspect-ratio: 16 / 9;
}

.cards.news .cards-card-body,
.cards.news-dynamic .cards-card-body {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cards.news .cards-card-body h3,
.cards.news-dynamic .cards-card-body h3 {
  order: 2;
  margin: 0;
  font-size: var(--heading-font-size-s);
}

.cards.news .cards-card-body p,
.cards.news-dynamic .cards-card-body p {
  margin: 0;
}

/* timestamp: the <p> immediately before the title, wherever it sits */
.cards.news .cards-card-body p:has(+ h3),
.cards.news-dynamic .cards-card-body p:has(+ h3) {
  order: 1;
  color: var(--text-muted-color);
  font-size: var(--body-font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cards.news .cards-card-body h3 + p,
.cards.news-dynamic .cards-card-body h3 + p {
  order: 3;
}

/* category tag: the first of two consecutive plain <p>s (excludes the CTA, which
   is its own labelled .cards-cta paragraph, not a category tag) */
.cards.news .cards-card-body p:has(+ p:not(.cards-cta)),
.cards.news-dynamic .cards-card-body p:has(+ p:not(.cards-cta)) {
  order: 4;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: var(--body-font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* CTA: red, uppercase, same size/family as the teaser copy, below the description */
.cards.news .cards-cta,
.cards.news-dynamic .cards-cta {
  order: 5;
}

.cards.news .cards-cta a:any-link,
.cards.news-dynamic .cards-cta a:any-link {
  color: var(--brand-primary);
  text-transform: uppercase;
}

@media (width >= 768px) {
  .cards.news > ul > li,
  .cards.news-dynamic > ul > li {
    grid-template-columns: 220px 1fr;
    gap: 24px;
  }
}

/* --- variant: list (3-column grid of card tiles, image on top) --- */
.cards.list > ul {
  grid-template-columns: 1fr;
  gap: 24px;
}

/* stylelint-disable-next-line no-descending-specificity */
.cards.list > ul > li {
  border: 0;
  background-color: transparent;
}

.cards.list .cards-card-body h3 {
  font-size: var(--heading-font-size-s);
}

.cards.list > ul > li img {
  aspect-ratio: 16 / 9;
}

@media (width >= 768px) {
  .cards.list > ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width >= 1024px) {
  .cards.list > ul {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- variant: featured-news (single hero lead teaser, source hero_feed_category_primary) --- */
.cards.featured-news > ul {
  grid-template-columns: 1fr;
}

/* stylelint-disable-next-line no-descending-specificity */
.cards.featured-news > ul > li {
  display: grid;
  grid-template-columns: 1fr;
  border: 0;
  background-color: transparent;
}

/* image stacks first on mobile, text second; order is flipped to place text first at desktop */
.cards.featured-news .cards-card-image {
  order: 1;
}

.cards.featured-news .cards-card-body {
  order: 2;
  margin: 0 0 24px;
}

.cards.featured-news > ul > li img {
  aspect-ratio: 16 / 9;
}

/* stylelint-disable-next-line no-descending-specificity */
.cards.featured-news .cards-card-body p:first-child {
  margin: 0 0 8px;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: var(--body-font-size-s);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cards.featured-news .cards-card-body p:first-child a:any-link {
  color: inherit;
}

.cards.featured-news .cards-card-body h2 {
  margin: 0 0 16px;
  padding-bottom: 16px;
  font-size: var(--heading-font-size-xxl);
  line-height: 1.05;
  text-transform: uppercase;
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--brand-accent) 0, var(--brand-primary) 51.04%, var(--link-color) 100%) 1;
}

/* stylelint-disable-next-line no-descending-specificity */
.cards.featured-news .cards-card-body h2 + p {
  font-size: var(--body-font-size-m);
}

@media (width >= 1024px) {
  .cards.featured-news > ul > li {
    grid-template-columns: minmax(300px, 1fr) 1.8fr;
    column-gap: 48px;
    align-items: start;
  }

  .cards.featured-news .cards-card-body {
    order: 1;
    margin: 0;
  }

  .cards.featured-news .cards-card-image {
    order: 2;
  }

  .cards.featured-news > ul > li img {
    aspect-ratio: 2 / 1;
  }
}
