﻿/* Carousel base */
.carousel-wrapper {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  animation: scroll 30s linear infinite;
  width: max-content;
}

.carousel-wrapper:hover .carousel-track {
  animation-play-state: paused;
}

.carousel-itempost {
 padding: 10px;
  box-sizing: border-box;
  width: 25vw; /* Chiều rộng căn theo màn hình */
  height: calc(25vw * 3 / 4); /* Tính chiều cao theo tỷ lệ 4:3 */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Ẩn phần ảnh thừa nếu chiều cao vượt quá */
}

.carousel-itempost img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Đảm bảo ảnh sẽ cover hết khung mà không bị méo */
  border-radius: 12px;
  display: block;
}
/* Responsive */
@media (max-width: 1024px) {
 .carousel-item {
    width: 33.3333vw;
    height: calc(33.3333vw * 3 / 4); /* Giữ tỷ lệ 4:3 */
  }
}
@media (max-width: 768px) {
  .carousel-item {
    width: 50vw;
    height: calc(50vw * 3 / 4); /* Giữ tỷ lệ 4:3 */
  }
}

/* Animation */
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Zoom Modal */
.zoom-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}
.zoom-modal.active {
  display: flex; /* Chỉ hiện flex khi có class active */
}

.zoom-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
  object-fit: contain;
}


.zoom-modal .close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  color: white;
  cursor: pointer;
  z-index: 1001;
}
/* Optional fade animation */
/*@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}*/