/* === Tổng thể === */
.news-community {
  width: 100%;
  color: var(--white-color);
  background-color: var(--primary-color);
  background-image: url("../../../assets/img/bt-tin-tuc-cong-dong.png");
  background-size: cover;
  background-position: center;
  padding: 40px 20px;
}

.is-desktop {
  display: none;
}

.news-community h2 {
  margin-bottom: 24px;
}

.is-mobile {
  display: block;
  text-align: center;
}

.news-community .content {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.news-community .content .left .list .items .detail {
  display: none;
}

.news-community .content .left .list {
  display: flex;
  flex-direction: column;
}

.news-community .content .left .list .items {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
}

.news-community .content .left .list .items:not(:last-child) {
  border-bottom: 1px solid rgba(216, 216, 217, 1);
}

.news-community .content .left .list .items .detail .icon-detail {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
  min-width: 91px;
}

.news-community .content .left .list .items .detail a {
  color: rgba(255, 194, 81, 1);
  width: 100%;
  flex-shrink: 0;
  min-width: 0;
  display: block;
}

.news-community .content .left .list .items .content {
  margin: 0;
  gap: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: start;
}

.news-community .content .left .list .items .content h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  max-width: 456px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* Giới hạn 2 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  color: #fff;
}

.news-community .carousel-item img {
  width: 100%;
  height: 235px;
  object-fit: cover;
}

.news-community .content .left .list .items .content .date {
  color: rgba(216, 216, 217, 1);
  font-size: 12px;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .news-community {
    padding: 68px 20px;
  }

  .news-community .carousel-item img {
    height: 446px;
  }

  .news-community .content {
    flex-direction: row;
    align-items: center;
    max-width: 1276px;
    margin: 0 auto;
    gap: 40px;
  }

  .is-desktop {
    display: block;
  }

  .is-mobile {
    display: none;
  }
}

/* === Cột trái / phải chia theo % === */
@media (min-width: 992px) {
  .news-community {
    background-size: cover;
    background-position: center;
  }

  .news-community .content .left .list .items .content h2 {
    font-size: 20px;
  }

  .news-community .content .left .list .items .detail {
    display: block;
  }

  .news-community .left {
    width: 50%;
  }

  .news-community .right {
    width: 50%;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 446px;
  }

  .news-community .carousel-caption {
    padding: 32px;
  }
}

/* === Mobile: full width === */
@media (max-width: 991.98px) {

  .news-community .left,
  .news-community .right {
    width: 100%;
  }
}

.news-community .carousel-item {
  height: 100%;
  position: relative;
  transition: opacity 0.6s ease-in-out;
}

.news-community .carousel-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

/* === Overlay tối === */

/* === Caption === */
.news-community .carousel-caption {
  z-index: 3;
  bottom: 0;
  text-align: left;
}

.news-community .carousel-caption h5 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-community .carousel-caption p {
  font-size: 14px;
  color: #f0f0f0;
  display: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.carousel-caption .detail {
  display: none;
}

/* === Nút điều hướng === */
.news-community .carousel-control-prev,
.news-community .carousel-control-next {
  background: #ffffff4d;
  z-index: 99;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 24px;
  height: 24px;
}

/* === Tiêu đề và bài viết === */
.news-community .left h2 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
}

.news-community .border-bottom {
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* === Overlay tối === */
.news-community .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
  /* Overlay nằm dưới caption và nút điều hướng */
}

/* === Caption luôn trên overlay === */
.news-community .carousel-caption {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  padding: 20px;
}

.news-community .carousel-caption a {
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
}

.news-community .carousel-caption .date {
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #d8d8d9;
  margin-top: 10px;
}

/* === Nút điều hướng nổi lên trên overlay === */
.news-community .carousel-control-prev,
.news-community .carousel-control-next {
  z-index: 99;
  /* cao hơn overlay và caption */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* Giúp nút hiển thị bên ngoài vùng overflow */
.news-community .right {
  position: relative;
  overflow: visible;
  /* Cho phép nút hiển thị đè lên cả ngoài khung nếu cần */
}

/* Đảm bảo toàn bộ carousel là relative để z-index hoạt động đúng */
.news-community .carousel {
  position: relative;
  z-index: 2;
}