/*
 * The press and news card (card 32), shared by the Press page, the News page, an article's Keep
 * reading and the About page's Latest news (moved unchanged from about.css): picture, outlet and
 * type, title, summary, date, links. In a .cards grid, every card's rows line up with its
 * neighbours' (subgrid), so summaries, dates and links align whatever the title's length.
 * Every value from tokens.css.
 */

.article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
}

.article__photo {
  position: relative;
  width: 100%;
}

/* Card 45b: the picture opens the card's first link (an empty link over it, hidden from
   keyboards and screen readers); pointing at it shows that link's own hover. */
.article__photo-link {
  position: absolute;
  inset: 0;
  border-radius: var(--space-16);
}

@media (hover: hover) {
  .article:has(.article__photo-link:hover) .article__link:first-child {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.article__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 384 / 240;
  border-radius: var(--space-16);
  object-fit: cover;
}

.article__category {
  color: var(--color-teal-700);
  font-size: var(--text-eyebrow-size);
  line-height: var(--text-eyebrow-line);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--text-eyebrow-tracking);
  text-transform: uppercase;
}

.article__headline {
  color: var(--color-petrol-900);
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line);
  font-weight: var(--weight-semibold);
}

.article__excerpt,
.article__date {
  color: var(--color-slate-500);
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-line);
}

.article__link {
  padding-left: 0;
}

/* The links: side by side as drawn from 768 px (Equans: article and video), one under the other
   on a phone, each a 44 px tall touch target. */
.article__links {
  display: flex;
  flex-direction: column;
}

.news__all {
  margin-top: var(--space-40);
  padding-left: 0;
}

/* --- The grid of the Press and News pages, and Keep reading ------------------------------- */

.cards {
  display: grid;
  gap: var(--space-40);
}

@media (min-width: 768px) {
  .article__links {
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: var(--space-24);
  }

  /* Each card's six rows are rows of the grid (subgrid): 16 px apart inside a card, and 56 px
     between two rows of cards (16 and the 40 under each card's links). */
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-24);
    row-gap: var(--space-16);
    margin-bottom: calc(-1 * var(--space-40));
  }

  .cards > .article {
    display: grid;
    grid-row: span 6;
    grid-template-rows: subgrid;
    align-items: start;
  }

  .cards > .article .article__links {
    margin-bottom: var(--space-40);
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  /* Desktop: the links as drawn (20 px), a pointer needs no 44 px touch area (About's cards keep
     theirs, as before card 32). */
  .cards .article__link {
    min-height: 0;
    padding-block: 2px;
  }

  .article__headline {
    min-height: 90px;
  }

  .article__excerpt {
    min-height: 100px;
  }

  .cards {
    grid-template-columns: repeat(3, 384px);
  }
}
