/* Project grid: rows of two cards, 7 + 5 then 5 + 7 columns, equal
   image height per row. Name left, object type right under the image. */

.project-grid {
  row-gap: clamp(1.25rem, 2.083vw, 2rem);
}

.project-card {
  grid-column: span 7;
}

.project-card:nth-child(4n + 2),
.project-card:nth-child(4n + 3) {
  grid-column: span 5;
}

/* After filtering, the rhythm follows the visible cards (set in JS). */
.project-grid.is-filtered .project-card {
  grid-column: span var(--theme-project-span, 6);
}

.project-card[hidden] {
  display: none;
}

.project-card__link {
  display: block;
}

.project-card__media {
  height: max(31.6vw, 14rem);
}

.project-card__media img {
  transition: scale 1.2s var(--theme-ease-signature);
}

.project-card__link:hover .project-card__media img {
  scale: 1.03;
}

.project-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-block-start: 0.9em;
  font-size: clamp(0.875rem, 1.111vw, 1rem);
  line-height: 1.2;
}

.project-card__title {
  font-size: inherit;
  line-height: 1.19;
  letter-spacing: -0.01em;
}

.project-card__type {
  color: var(--theme-color-text-muted);
}

.project-grid__empty {
  grid-column: 1 / -1;
  padding-block: var(--theme-space-md);
  font-size: var(--theme-fs-lg);
}

@media (width <= 768px) {
  .project-card,
  .project-card:nth-child(4n + 2),
  .project-card:nth-child(4n + 3),
  .project-grid.is-filtered .project-card {
    grid-column: 1 / -1;
  }

  .project-card__media {
    height: auto;
    aspect-ratio: 4 / 3;
  }
}
