/* ─── Post card + card grid — the one card everywhere (blog listings,
   related posts, the homepage blog section). Loaded on blog views and on
   the front page when the blog section is on (includes/assets.php). */

.posts-grid {
  display: grid;
  gap: 22px;

  @media (min-width: 640px) {
    grid-template-columns: 1fr 1fr;
  }

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

/* Card: arch-topped photo, cream pill category tag, serif title */
.news-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  background: var(--cream);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;

  &:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
  }

  /* On a cream band the card turns sand (and its arrow cream). */
  .prose-band + .posts-band &,
  .tone-cream & {
    background: var(--sand);

    & .news-card__arrow {
      background: var(--cream);
    }
  }
}

.news-card__media {
  aspect-ratio: 4 / 3;
  margin: 10px 10px 0;
  border-radius: 180px 180px var(--r-md) var(--r-md);

  & > a:not(.news-card__tag) {
    display: block;
    height: 100%;
  }
}

.news-card__tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 6px 13px;
  border-radius: var(--pill);
  background: var(--cream);
  color: var(--cocoa);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;

  &:hover {
    background: var(--clay);
    color: var(--white);
  }
}

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

.news-card__eyebrow {
  margin-bottom: 12px;
}

.news-card__title {
  font-size: 1.6rem;
  line-height: 1.1;

  & a {
    text-decoration: none;
  }

  & a:hover {
    color: var(--clay);
  }
}

.news-card__excerpt {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.93rem;
}

.news-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.news-card__arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--cocoa);
  display: grid;
  place-items: center;
  transition: background-color 0.25s, color 0.25s;

  .news-card:hover & {
    background: var(--clay);
    color: var(--white);
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-card,
  .news-card:hover {
    transition: none;
    transform: none;
  }
}

@media (min-width: 640px) {
  .news-card--list {
    flex-direction: row;

    & .news-card__media {
      flex: 0 0 40%;
      aspect-ratio: auto;
      margin: 10px 0 10px 10px;
    }
  }
}

/* Featured lead card — photo left, big serif title (from 768px) */
.news-card--featured {
  & .news-card__title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.02;
  }

  & .news-card__excerpt {
    font-size: 1rem;
    max-width: 52ch;
  }

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

@media (min-width: 768px) {
  .news-card--featured {
    flex-direction: row;
    align-items: stretch;

    & .news-card__media {
      flex: 0 0 55%;
      aspect-ratio: 4 / 3;
      margin: 12px 0 12px 12px;
      border-radius: 240px 240px var(--r-md) var(--r-md);
    }

    & .news-card__body {
      justify-content: center;
      padding: 40px 44px;
    }

    & .news-card__meta {
      margin-top: 0;
      padding-top: 26px;
    }
  }
}
