/* Resources page: news grid. Colors only via tokens.css. */

.news {
  background-color: var(--white);
}

/* 1 column on phones, 2 from 768px, 3 from 1025px. A lone post keeps its column width. */
.news-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

@media (width >= 768px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (width >= 1025px) {
  .news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: none;
  overflow: hidden;
  border-radius: var(--radius-card);
  background-color: var(--stone);
}

/* Charcoal 16:9 panel with the logo centered at 60% of its width. */
.news-card__media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background-color: var(--charcoal);
}

.news-card__media img {
  width: 60%;
  height: auto;
}

.news-card__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--space-2);
  padding: var(--space-3);
}

/* The link line sits at the bottom so links line up across a row. */
.news-card__more {
  margin-top: auto;
}

/* Stretches the link over the whole card. */
.news-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
}

.news-card__link:focus-visible {
  outline: none;
}

/* overflow: hidden would clip an outer ring, so the ring is drawn just inside the card edge. */
.news-card__link:focus-visible::after {
  outline: 2px solid var(--charcoal);
  outline-offset: -2px;
}

.news-card:hover .news-card__link {
  text-decoration-thickness: 2px;
}
