/* SLIDER gutters */
.custom-posts.wrapper.layout-waste.is-slider.cols-4,
.custom-posts.wrapper.layout-waste.is-slider.column-4 {
  --slider-gutter: 4px;
}
.custom-posts.wrapper.layout-waste.is-slider.cols-3,
.custom-posts.wrapper.layout-waste.is-slider.column-3 {
  --slider-gutter: 8px;
}

/* Wrapper */
.layout-waste {
  transition: opacity 0.4s ease;
}
.layout-waste.loaded {
  opacity: 1;
  visibility: visible;
}

/* Card / slide */
.layout-waste article.waste-card.slick-slide {
  position: relative;
  overflow: hidden;
  margin: 0 var(--slider-gutter, 4px) !important;
}

/* Make the overlay link cover the whole card */
.layout-waste article.waste-card .cp-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Image link area */
.layout-waste article.waste-card a.entry-featured-image-url {
  position: relative;
  display: block;
  overflow: hidden;
}

/* Before / after swap */
.layout-waste article.waste-card img.acf-image.before {
  opacity: 1;
}
.layout-waste article.waste-card img.acf-image.after {
  opacity: 0;
  position: absolute;
  inset: 0;
}

/* Content panel */
.layout-waste article.waste-card .cp-content {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 16px;
  background: rgba(54, 67, 75, 0.8);
  backdrop-filter: blur(6px);
  color: #fff;
  z-index: 4; /* below overlay link */
}

/* Title */
.layout-waste article.waste-card .cp-title {
  margin: 0;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0;
}
.layout-waste article.waste-card .cp-title a {
  color: #fff !important;
  text-decoration: none;
  font-family: 'Montserrat', Helvetica, Arial, Lucida, sans-serif !important;
  font-weight: 600 !important;
}

/* Excerpt hidden by default */
.layout-waste article.waste-card .cp-excerpt {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    max-height 0.6s ease;
}

/* Hover effects */
.layout-waste article.waste-card:hover img.acf-image {
  transform: scale(1.05);
  filter: brightness(0.9);
}
.layout-waste article.waste-card:hover img.acf-image.before {
  opacity: 0;
}
.layout-waste article.waste-card:hover img.acf-image.after {
  opacity: 1;
}
.layout-waste article.waste-card:hover .cp-excerpt {
  opacity: 1;
  max-height: 200px;
  transform: translateY(0);
}

/* Desktop default */
.layout-waste article.waste-card img.acf-image {
  display: block;
  width: 100%;
  height: 390px; /* desktop */
  object-fit: cover;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    filter 0.4s ease;
}

/* Tablet / mobile */
@media (max-width: 768px) {
  .layout-waste article.waste-card img.acf-image {
    height: 230px;
  }
}

/* Touch devices: don't rely on hover */
@media (hover: none) {
  .layout-waste article.waste-card .cp-excerpt {
    opacity: 1;
    max-height: 200px;
    transform: none;
  }
}
