/* Grid container */
.dcg-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns,3), 1fr);
  gap: 28px;
  align-items: start;
}

/* Card */
.dcg-card {
  position: relative;
  background: transparent;
  border-radius: 12px;
  overflow: visible; /* allow the floating box to show outside */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Image link wrapper */
.dcg-image-link {
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Actual image */
.dcg-image-link .dcg-thumb,
.dcg-thumb {
  width: 100%;
  height: var(--img-height, 320px);
  object-fit: cover;
  display: block;
}

/* Placeholder (if no featured image) */
.dcg-placeholder {
  background: linear-gradient(180deg,#eee,#ddd);
}

/* Floating white box (centered horizontally, overlapping bottom of image) */
.dcg-box {
  position: relative;
  width: 86%;
  margin-top: -48px; /* pulls the box overlapping below the image */
  background: #fff;
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  z-index: 5;
}

/* Title and excerpt sizing (controlled by inline style variables) */
.dcg-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.05;
  font-size: var(--title-size, 20px);
}

.dcg-title a {
  color: #0a4f78; /* blue like your image */
  text-decoration: none;
}

.dcg-excerpt {
  margin: 8px 0 0 0;
  color: #666;
  font-size: var(--excerpt-size, 14px);
  line-height: 1.4;
  text-align:center;
}

/* Make sure the box content doesn't overflow */
.dcg-box .dcg-excerpt,
.dcg-box .dcg-title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* limit excerpt lines (can be overridden) */
  -webkit-box-orient: vertical;
}

/* Hover lift */
.dcg-card:hover .dcg-image-link {
  transform: translateY(-6px);
  transition: transform .25s ease;
}

/* Responsive */
@media (max-width: 1024px) {
  .dcg-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px) {
  .dcg-grid { grid-template-columns: repeat(1,1fr); }
  .dcg-box { width: 92%; margin-top: -42px; padding: 14px; }
}
