@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

/* Gallery Section Background */
.gallery-section {
    position: relative;
    height: 120vh;
    width: 100%;
    overflow: hidden;
}

.parallax-container-gallery {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip: rect(0, auto, auto, 0);
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
}

.parallax-background-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('../img/gallery-bg-new.jpeg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* Gallery Heading */
.gallery-section h2 {
    font-family: "Audiowide", system-ui;
    font-size: 36px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    margin-top: 80px;
}

/* Gallery Item */
.gallery-item {
    overflow: hidden;
    position: relative;
    cursor: pointer;
    height: 230px; /* Reduced height from 250px to 220px */
    width: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 10px 10px 10px;
    border-radius: 25px;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    margin-left: 80px;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: cover;
    border-radius: 25px;
    transition: all 0.5s ease;
    border: 5px solid #fff;
    margin: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s ease-in-out, width 0.5s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 40%;
    max-height: 40%;
}

.modal-content-landscape {
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 80%;
    max-height: 70vh;
    width: auto;
    height: auto;
}

.modal-content-landscape img {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    z-index: 999999999;
}

.modal-content img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.close,
.prev,
.next {
    position: absolute;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    z-index: 1000;
}

.close {
    top: 10px;
    right: 25px;
}

.prev {
    top: 50%;
    left: 25px;
    transform: translateY(-50%);
}

.next {
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
}

/* Mobile-Specific Adjustments */
@media (max-width: 768px) {
    .parallax-background-gallery {
        position: fixed;
        background-image: url('../img/gallery-mobile-bg.jpeg');
        height: 100vh;
        background-position: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateY(-5%);
        -webkit-transform: translateY(-5%);
        padding: 0;
    }

    .gallery-heading {
        font-size: 1.2em;
        color: #fff;
        margin-bottom: 20px;
    }

    .gallery-item {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 180px;
        width: 85%;
        margin: 10px auto;
    }

    .gallery-item img {
        border-radius: 15px;
        height: 100%;
        width: auto;
        margin: 0;
    }
}

/* Desktop Adjustments for Second Row Images */
@media (min-width: 992px) {
    /* Move the second row upward */
    #galleryCarouselSecondRow {
        margin-top: -70px; /* Increased negative margin to move images up */
    }

    /* Reduce vertical padding on all columns */
    #galleryCarousel .col-lg-4,
    #galleryCarouselSecondRow .col-lg-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    /* Adjust left side images */
    #galleryCarousel .col-lg-4:first-child .gallery-item,
    #galleryCarouselSecondRow .col-lg-4:first-child .gallery-item {
        position: relative;
        right: -60px; /* Move right */
    }
    
    /* Adjust right side images */
    #galleryCarousel .col-lg-4:last-child .gallery-item,
    #galleryCarouselSecondRow .col-lg-4:last-child .gallery-item {
        position: relative;
        left: -60px; /* Move left */
    }
}

/* Styles for 1920px screen size */
@media (max-width: 1024px) {
    .gallery-section h2 {
        font-size: 42px;
        margin-top: 70px;
    }

    .gallery-item {
        height: 390px; /* Reduced height from 320px to 280px */
        margin-left: -10px !important;
    }

    .gallery-item img {
        border-radius: 28px;
        border: 5px solid #fff;
    }

    /* Adjust the margin-top for larger screens */
    #galleryCarouselSecondRow {
        margin-top: -90px; /* Increased negative margin */
    }
}

/* Styles for 1920px screen size */
@media (min-width: 1920px) and (max-width: 2559px) {
    .gallery-section h2 {
        font-size: 42px;
        margin-top: 70px;
    }

    .gallery-item {
        height: 380px; /* Reduced height from 320px to 280px */
        width: 370px;
        margin-left: 90px !important;
    }

    .gallery-item img {
        border-radius: 28px;
        border: 5px solid #fff;
    }

    /* Adjust the margin-top for larger screens */
    #galleryCarouselSecondRow {
        margin-top: -50px; /* Increased negative margin */
    }
    /* Adjust left side images */
    #galleryCarousel .col-lg-4:first-child .gallery-item,
    #galleryCarouselSecondRow .col-lg-4:first-child .gallery-item {
        position: relative;
        right: -90px; /* Move right */
    }
    
    /* Adjust right side images */
    #galleryCarousel .col-lg-4:last-child .gallery-item,
    #galleryCarouselSecondRow .col-lg-4:last-child .gallery-item {
        position: relative;
        left: -90px; /* Move left */
    }
}

/* Safari-specific fix for consistent parallax */
@media not all and (min-resolution: 0.001dpcm) {
    @supports (-webkit-touch-callout: none) {
        .gallery-section {
            background-attachment: fixed;
        }
    }
}

/* iPhone-specific adjustments */
@media screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2) {
    .gallery-section {
        background-attachment: fixed;
    }

    .gallery-item {
        height: 180px;
    }

    .gallery-item img {
        height: 100%;
    }
}
