﻿/* These are the styles for the gallery.

    There are three pages:
    - Gallery Index Page - GalleryHome.cshtml
    - Gallery Desktop View - _GalleryDesktopView.cshtml
    - Gallery Mobile View - _GalleryMobileView.cshtml  
*/


/*
    Gallery Index Page
*/

.gallery-thumbnail-image {
    transition: 0.5s;
}

    .gallery-thumbnail-image:hover {
        opacity: 0.6;
        cursor: pointer;
    }

/*
    Gallery Desktop View
*/

#desktop-gallery {
    display: none;
    position: relative; /* Needed for positioning the new controls */
}

#container {
    padding-top: 0;
}

.product-slider #carousel {
    margin: 0;
}

.product-slider #thumbcarousel {
    margin: 12px 0 0;
    padding: 0 45px;
}

    .product-slider #thumbcarousel .item {
        text-align: center;
    }

        .product-slider #thumbcarousel .item .thumb {
            border: 4px solid #cecece;
            width: 20%;
            margin: 0 2%;
            display: inline-block;
            vertical-align: middle;
            cursor: pointer;
            max-width: 98px;
        }

            .product-slider #thumbcarousel .item .thumb:hover {
                border-color: #1089c0;
            }

.product-slider .item img {
    height: auto;
}

#carousel .carousel-inner {
    max-height: 650px;
    margin: auto;
}

#carousel .carousel-control-prev, #carousel .carousel-control-next {
    background-color: rgba(0, 0, 0, 1);
    width: 45px;
    height: 45px;
    border-radius: 0;
    top: 50%;
    transform: translateY(-50%);
}

#carousel .carousel-control-prev {
    margin-left: 15px; /* Pushes the left arrow in from the left edge */
}

#carousel .carousel-control-next {
    margin-right: 15px; /* Pushes the right arrow in from the right edge */
}

#thumbcarousel .carousel-control-prev, #thumbcarousel .carousel-control-next {
    color: #fff;
    width: 30px;
    background-color: #000;
}

    #thumbcarousel .carousel-control-prev:hover, #thumbcarousel .carousel-control-next:hover {
        color: #fff;
    }


/* Fixes error where next image pushes everything down the page */
.carousel-item.active, .carousel-item-next, .carousel-item-prev {
    height: 100% !important;
}

#thumbcarousel img {
    transition: 0.5s;
}

    #thumbcarousel img:hover {
        cursor: pointer;
        opacity: 0.6;
    }

.carousel-accessibility-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 8px;
    color: white;
}

#slide-indicator {
    font-size: 0.9rem;
    font-weight: bold;
}


/*
    Gallery Mobile View
*/

#mobile-gallery {
    display: none;
}

.gallery-image {
    max-width: 100%;
    cursor: pointer;
}

.gallery-lightbox {
    width: 100%;
    height: 100%;
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    left: 0;
    top: 0;
    z-index: 100;
    display: none;
}

.gallery-lightbox-image {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 80vh;
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}

    .close-lightbox:hover,
    .close-lightbox:focus {
        color: #bbb;
        text-decoration: none;
        cursor: pointer;
    }

.lightbox-caption-class {
    text-align: center;
    color: #ccc;
    padding: 10px 20px;
    position: absolute;
    bottom: 20px;
    width: 100%;
    left: 0;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
}

.animation-toggle-container {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* A robust way to hide an element while keeping it keyboard-accessible */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* This rule adds a prominent white glow when you tab to the switch */
.switch input.visually-hidden:focus + .slider {
    box-shadow: 0 0 2px 3px rgba(255, 255, 255, 0.7);
}

#play-pause-btn:focus-visible {
    box-shadow: 0 0 2px 3px rgba(255, 255, 255, 0.7) !important;
    /* Removes the default browser outline to avoid a double border */
    outline: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e2e2;
    transition: .4s;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: .4s;
    }

input:checked + .slider {
    background-color: #7c7c7c
}

input:focus + .slider {
    box-shadow: 0 0 1px #1089c0;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

    .slider.round:before {
        border-radius: 50%;
    }

/* Class to disable animations */
.animations-disabled .carousel-item {
    transition: transform .001s ease-in-out !important; /* Effectively turns off the slide */
}

/* Rule to enforce desktop slide animation */
/* This helps prevent other CSS rules from stopping the slide effect. */
#desktop-gallery:not(.animations-disabled) .carousel-item {
    transition: transform 0.6s ease-in-out;
}


/*
    Gallery Mobile View
*/

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.6);
    color: #000;
    border: none;
    font-size: 30px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 102;
    transition: background-color 0.3s;
}

    .lightbox-nav:hover {
        background-color: rgba(255,255,255,0.9);
    }

    .lightbox-nav.prev {
        left: 10px;
    }

    .lightbox-nav.next {
        right: 10px;
    }

/* Make space for caption */
.gallery-lightbox-image {
    max-height: 75vh;
}

/* Mobile Lightbox Animations */
@keyframes slideInFromRight {
    from {
        transform: translate(-50%, -50%) translateX(100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translate(-50%, -50%) translateX(0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -50%) translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translate(-50%, -50%) translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translate(-50%, -50%) translateX(0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -50%) translateX(100%);
        opacity: 0;
    }
}

.slide-next-enter {
    animation: slideInFromRight 0.5s forwards;
}

.slide-next-exit {
    animation: slideOutToLeft 0.5s forwards;
}

.slide-prev-enter {
    animation: slideInFromLeft 0.5s forwards;
}

.slide-prev-exit {
    animation: slideOutToRight 0.5s forwards;
}