 /*Carousel*/
.ad-carousel {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 30px; /* Add horizontal space */
    box-sizing: border-box;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 20px;
}

.carousel-item {
    flex: 0 0 auto;
    width: 300px;
    height: 394px; /* scaled-down height keeping aspect ratio */
    border-radius: 10px;
    overflow: hidden;
    opacity: 0.5;
    filter: blur(3px);
    transition: all 0.5s ease-in-out;
}


.carousel-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 681 / 894; /* maintain original aspect ratio */
    object-fit: cover;       /* crop edges if needed */
    border-radius: 10px;
}

.carousel-item.active {
    transform: scale(1.2);
    opacity: 1;
    filter: blur(0);
    z-index: 2;
}

/* The Modal (background overlay) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.8); 
    overflow: auto;
    padding-top: 60px;
    justify-content: center;
    align-items: center;
    display: flex;
}

/* Modal Content (Image) */
#modalImage {
    margin: auto;
    display: block;
    max-width: 90%; /* Adjust to 90% width */
    max-height: 80vh; /* Set a maximum height relative to viewport */
    object-fit: contain; /* Make sure the image fits well */
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1500; /* Ensure the close button is above the modal */
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal img {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    margin: 5% auto;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
}

@media (max-width: 768px) {
  .ad-carousel {
    padding: 0 10px; /* Reduce horizontal padding */
    margin: 20px auto; /* Less margin */
  }

  .carousel-item {
    width: 220px;  /* Smaller width for smaller screens */
    height: 300px; /* Adjusted height */
    filter: blur(2px);
    opacity: 0.5;
  }

  .carousel-item.active {
    transform: scale(1.1);
    opacity: 1;
    filter: blur(0);
  }

  #modalImage {
    max-width: 80%;
    max-height: 70vh;
  }

  
}


