/* ============================================================
   Homepage equal-height card grid
   Replaces Masonry (dream-grid / dream-column) on the homepage
   with a CSS Grid where every card is the same height and the
   bottom edge lines up.
   ============================================================ */

.dream-grid-equal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 0 0.5rem;
}

.dream-grid-equal-col {
  display: flex;
  min-width: 0;
}

/* Card stretches to fill its grid cell */
.dream-card-equal {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Fixed 16:9 image area */
.dream-card-figure {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

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

/* Body fills remaining height; actions pinned to bottom */
.dream-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dream-card-actions {
  margin-top: auto;
}

/* Clamp title to 2 lines */
.dream-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.35em);
}

/* Clamp description to 3 lines */
.dream-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(3 * 1.5em);
  overflow-wrap: break-word;
}

/* Responsive column counts */
@media (min-width: 640px) {
  .dream-grid-equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .dream-grid-equal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .dream-grid-equal {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
