#carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    max-width: 1080px;
    margin: 0 auto;
}

#carousel {
    display: flex;
    transition: transform 0.3s ease-in-out;
}

.gallery-slide {
    position: relative;
    flex: 0 0 calc(25% - 20px);
    box-sizing: border-box;
    margin-right: 10px;
}

.gallery-slide:first-child {
    margin-left: 10px;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
    cursor: pointer;
}

#previous-icon,
#next-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

#previous-icon:hover,
#next-icon:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

#previous-icon {
    left: 10px;
}

#next-icon {
    right: 10px;
}

@media (max-width: 768px) {
    .gallery-slide {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .gallery-slide {
        flex: 0 0 calc(100% - 20px);
    }

    .gallery-slide:first-child {
        margin-left: 10px;
    }
}


/* Main Gallery CSS*/
.showcase-dynamic-gallery-container {
    display: grid;
    /*grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); Old Grid */ /* Adjusted to fit grid */
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Adjusted to fit grid */
    gap: 5px; /* Space between images */
    /*max-width: 1000px; Old Width*/
    max-width: 1080px;
    margin: 0 auto;
}

.showcase-gallery-item {
    position: relative;
    overflow: hidden;
}

.showcase-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    aspect-ratio: 1/1; /* Ensure all images have a 1:1 aspect ratio */
}

.normal {
    grid-column: span 2; /* Normal images take up 2 columns */
    grid-row: span 2; /* Normal images take up 2 rows */
}

.featured {
    grid-column: span 4; /* Featured images take up 4 columns */
    grid-row: span 4; /* Featured images take up 4 rows, double the size of normal images */
}

@media (max-width: 768px) {
    .showcase-dynamic-gallery-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Adjust grid for smaller screens */
    }

    .featured {
        grid-column: span 4; /* Adjust featured image size */
        grid-row: span 4;
    }

    .normal {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 480px) {
    .showcase-dynamic-gallery-container {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); /* Adjust grid for mobile screens */
    }

    .featured {
        grid-column: span 4; /* Full-width for featured image on mobile */
        grid-row: span 4;
    }

    .normal {
        grid-column: span 2;
        grid-row: span 2;
    }
}


/*Main Gallery Overlay CSS*/

#gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#gallery-overlay-content {
    position: relative;
}

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

#overlay-image {
    max-width: 80%;
    max-height: 80%;
}


/* Alternate Overlay Styles */
#gallery-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
}

#gallery-overlay button {
    position: absolute;
    bottom: 20px;
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    background-color: #4CAF50; /* Shrek green */
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#gallery-overlay button:hover {
    background-color: #3E8E41; /* Darker Shrek green */
}

.gallery-overlay-button {
    width: 40px;
    height: 40px;
    background-color: white;
    color: black;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    position: absolute;
}

.gallery-overlay-button.prev {
    left: 10px;
}

.gallery-overlay-button.next {
    right: 10px;
}

@media (max-width: 768px) {
    .gallery-slide {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .gallery-slide {
        flex: 0 0 calc(100% - 20px);
    }

    .gallery-slide:first-child {
        margin-left: 10px;
    }
}

/* Example placeholder styling (optional) */
.lazyload {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazyloaded {
    opacity: 1;
}
