.article-card-grid {
  --article-grid-width: min(1160px, calc(100vw - 40px));
  width: var(--article-grid-width);
  margin-inline: calc((100% - var(--article-grid-width)) / 2);
}

.article-card-grid--recent {
  margin-block-start: clamp(2rem, 5vw, 3.5rem);
}

.article-card-grid > h2 {
  margin: 0 0 24px;
}

.article-card-grid .article-card-grid__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 35px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-card-grid--recent .article-card-grid__list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card-grid .post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 1px 12px rgba(22, 57, 37, .16);
  transition: box-shadow .2s ease;
}

.post-card:hover,
.post-card:focus-within {
  box-shadow: 0 4px 22px rgba(22, 57, 37, .22);
}

.post-card__media {
  position: relative;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  background: var(--soft);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 45%, rgba(14, 36, 24, .35));
  content: "";
  opacity: 0;
  transition: opacity .2s ease;
}

.post-card:is(:hover, :focus-within) .post-card__media::after {
  opacity: 1;
}

.post-card__category {
  position: absolute;
  z-index: 1;
  inset-block-start: 14px;
  inset-inline-start: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--green);
  color: var(--paper);
  font-size: .8em;
  font-weight: 700;
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 19px 14px;
  overflow-wrap: anywhere;
}

.post-card .post-card__title {
  margin: 0;
  color: var(--ink);
  font-size: 1.15em;
  line-height: 1.35;
}

.post-card .post-card__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: .93em;
  line-height: 1.55;
}

.post-card__link {
  align-self: flex-start;
  margin-block-start: auto;
  font-size: .9em;
  font-weight: 700;
}

.post-card__link::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: 4px;
  content: "";
}

.post-card__link:focus-visible::after {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.post-card__date {
  display: block;
  padding: 8px 19px;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: .82em;
}

@media (max-width: 1024px) {
  .article-card-grid .article-card-grid__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .article-card-grid .article-card-grid__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card-grid .post-card,
  .post-card__media::after {
    transition: none;
  }
}
