/* ─── Article card + grid ─────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 32px);

  @media (min-width: 640px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  background: var(--block);
  overflow: hidden;
  transition: transform 0.4s var(--ease);

  &:hover,
  &:focus-within {
    transform: translateY(-4px);
  }
}

.post-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stage-2);
}

.post-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);

  .post-card:hover & {
    transform: scale(1.03);
  }
}

/* Category chip over the photo — its own link, above the stretched title link. */
.post-card__tag {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 14px;
}

.post-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px 24px;
}

.post-card__eyebrow {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-text);

  &:hover {
    color: var(--ink);
  }
}

.post-card__title {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* Whole card is the link. */
.post-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card__link:focus-visible {
  outline: none;

  &::after {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: var(--radius-card);
  }
}

.post-card__excerpt {
  font-size: 15px;
  color: var(--ink-2);
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.post-card__arrow {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-dark);
  transition: background var(--hover-duration) ease-out, transform var(--hover-duration) ease-out;

  .post-card:hover & {
    background: var(--accent);
    transform: translateX(4px);
  }
}
