/* ─── Card ────────────────────────────────────────────────── */
/*
  Card component used in carousels (teaser variant) and category
  listing grids (listing variant). Variants are applied via
  modifier classes on .card__title and .card__excerpt — the base
  card structure is shared.

  Teaser:  step-0 title, excerpt clamped to 3 lines (home / related posts)
  Listing: step-1 title, full excerpt (category listing page)
*/

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  text-decoration: none;
  color: inherit;
}

.card__image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-surface);
}

.card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card__image-wrap img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .card:hover .card__image-wrap img {
    transform: none;
  }
}

.card:hover .card__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Groups title + date as one visual unit */
.card__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-block-start: var(--space-xs);
}

/* Base title — structural styles shared by both variants. font-weight is set
   explicitly now that the element is a <p>, not an <h2> — browsers no longer
   bold it for us by default. */
.card__title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: bold;
  line-height: 1.35;
}

/* Teaser and listing titles share the same size — see DESIGN_decisions.md */
.card__title--teaser,
.card__title--listing {
  font-size: var(--step-1);
}

/* Date */
.card__date {
  font-family: "Geist", system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* Base excerpt */
.card__excerpt {
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

/* Teaser excerpt — clamped to 3 lines */
.card__excerpt--teaser {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
