/* Shared styles for both carousel and grid */
#postCarousel,
#blogGrid {
  margin-bottom: 3rem;
}

#postCarousel .card-equal-height,
#blogGrid .card-equal-height {
  height: 435px;
  display: flex;
  flex-direction: column;
}

#postCarousel .card-title,
#blogGrid .card-title {
  height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

#postCarousel .fixed-height-img,
#blogGrid .fixed-height-img {
  height: 180px;
  object-fit: cover;
}

#postCarousel .excerpt-text,
#blogGrid .excerpt-text {
  max-height: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
}

#postCarousel .card,
#blogGrid .card {
  transition: transform 0.2s;
}

#postCarousel .card:hover,
#blogGrid .card:hover {
  transform: translateY(-5px);
}

/* Carousel-specific styles */
#postCarousel .carousel-indicators {
  bottom: -18px;
}

#postCarousel .carousel-control-prev,
#postCarousel .carousel-control-next {
  bottom: -18px;
}

#postCarousel .carousel-control-next-icon {
  color: #bbb;
}

/* Category badge (standalone - not carousel specific) */
.category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #a0fcdd;
  color: #212529;
  padding: 4px 10px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 1;
}

/* Responsive styles */
@media (min-width: 576px) and (max-width: 991px) {
  #postCarousel .slide-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: hidden;
    margin-right: -15px;
    margin-left: -15px;
  }

  #postCarousel .slide-row > div {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }

  #postCarousel .card-equal-height {
    height: 400px;
  }

  #postCarousel .excerpt-text {
    max-height: 80px;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
}

@media (max-width: 767.98px) {
  #blogGrid .card-equal-height {
    height: auto;
    min-height: 400px;
  }

  #blogGrid .card-title {
    height: auto;
    min-height: 40px;
  }

  #blogGrid .excerpt-text {
    max-height: 80px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

@media (max-width: 575.98px) {
  #postCarousel .slide-row > div {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #blogGrid .card-equal-height {
    height: auto;
    min-height: 350px;
  }

  #blogGrid .fixed-height-img {
    height: 150px;
  }
}
