/* Container grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Switch to 2 columns */
@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Switch to 1 column on mobile */
@media (max-width: 580px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Base card styling */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  color: #000;
}

/* Hover effect over entire card */
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Image wrapper - locks image to 16:9 */
.card-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hide image on mobile */
@media (max-width: 580px) {
  .card-image-wrapper {
    display: none;
  }
}

/* Title */
.card h3 {
  margin: 16px;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Description with line clamp */
.card .description {
  margin: 0 16px 16px 16px;
  font-size: 0.95rem;
  line-height: 1.4em;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 5.6em;
}