/* Home project covers: always crop from the center */
.projects-grid .project-card img {
  object-position: center center !important;
}

/* Keep every project card contained inside its own grid cell. */
.projects-grid {
  align-items: stretch;
  grid-auto-rows: auto;
}

.projects-grid .project-card {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.projects-grid .project-card img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

/* Narrow desktop / tablet: keep cards stable without changing mobile. */
@media (min-width: 651px) and (max-width: 1100px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid .project-card {
    aspect-ratio: 4 / 3;
  }
}
