/**
 * Gallery Block Styles
 * Modern gallery layouts with animations
 */

/* ==========================================================================
   Accordion Gallery (Expanding Panels)
   ========================================================================== */

.peak-gallery-accordion {
    width: 100%;
    overflow: hidden;
}

.peak-accordion-panel {
    min-width: 60px;
    cursor: pointer;
    position: relative;
}

.peak-accordion-panel:hover {
    -webkit-box-flex: 3 !important;
    -ms-flex: 3 !important;
    flex: 3 !important;
}

/* Mobile: Always show titles */
@media (max-width: 1023px) {
    .peak-accordion-panel h3 {
        opacity: 1 !important;
        font-size: 1rem;
    }

    .peak-accordion-panel {
        min-width: 80px;
    }
}

/* ==========================================================================
   Grid Gallery
   ========================================================================== */

.peak-gallery-grid {
    width: 100%;
}

.peak-gallery-item {
    position: relative;
}

/* Hover Effects */
.peak-gallery-item.hover-zoom img {
    -webkit-transition: -webkit-transform 0.5s ease;
    transition: -webkit-transform 0.5s ease;
    -o-transition: transform 0.5s ease;
    transition: transform 0.5s ease;
    transition: transform 0.5s ease, -webkit-transform 0.5s ease;
}

.peak-gallery-item.hover-zoom:hover img {
    -webkit-transform: scale(1.1);
    -ms-transform: scale(1.1);
    transform: scale(1.1);
}

.peak-gallery-item.hover-slide {
    overflow: hidden;
}

.peak-gallery-item.hover-slide img {
    -webkit-transition: -webkit-transform 0.5s ease;
    transition: -webkit-transform 0.5s ease;
    -o-transition: transform 0.5s ease;
    transition: transform 0.5s ease;
    transition: transform 0.5s ease, -webkit-transform 0.5s ease;
}

.peak-gallery-item.hover-slide:hover img {
    -webkit-transform: translateY(-10px);
    -ms-transform: translateY(-10px);
    transform: translateY(-10px);
}

.peak-gallery-item.hover-fade img {
    -webkit-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

.peak-gallery-item.hover-fade:hover img {
    opacity: 0.8;
}

/* ==========================================================================
   Masonry Gallery
   ========================================================================== */

.peak-gallery-masonry {
    width: 100%;
}

.masonry-grid {
    column-gap: 1rem;
}

.masonry-grid .peak-gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Carousel Gallery
   ========================================================================== */

.peak-gallery-carousel {
    width: 100%;
}

.carousel-container {
    position: relative;
    background: #f3f4f6;
}

.carousel-track {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-transition: -webkit-transform 0.5s ease-in-out;
    transition: -webkit-transform 0.5s ease-in-out;
    -o-transition: transform 0.5s ease-in-out;
    transition: transform 0.5s ease-in-out;
    transition: transform 0.5s ease-in-out, -webkit-transform 0.5s ease-in-out;
}

.carousel-slide {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 100%;
    flex: 0 0 100%;
    width: 100%;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* Carousel Controls */
.carousel-prev,
.carousel-next {
    z-index: 10;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.carousel-prev:hover,
.carousel-next:hover {
    -webkit-transform: translateY(-50%) scale(1.1);
    -ms-transform: translateY(-50%) scale(1.1);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev:active,
.carousel-next:active {
    -webkit-transform: translateY(-50%) scale(0.95);
    -ms-transform: translateY(-50%) scale(0.95);
    transform: translateY(-50%) scale(0.95);
}

/* Carousel Indicators */
.carousel-indicators {
    z-index: 10;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border: none;
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    width: 24px;
    background: white !important;
}

.carousel-indicator:hover {
    -webkit-transform: scale(1.2);
    -ms-transform: scale(1.2);
    transform: scale(1.2);
}

/* ==========================================================================
   Lightbox Styles (Enhanced with Counter & Caption)
   ========================================================================== */

.peak-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    opacity: 0;
    -webkit-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

.peak-lightbox.active {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    opacity: 1;
}

/* Top Bar with Counter and Close */
.peak-lightbox-top-bar {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 20px 30px;
    position: relative;
    z-index: 10;
}

.peak-lightbox-counter {
    color: white;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Content Area with Image and Navigation */
.peak-lightbox-content-area {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    position: relative;
}

.peak-lightbox-image-container {
    max-width: 90vw;
    max-height: 80vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.peak-lightbox-image-container img {
    max-width: 100%;
    max-height: 80vh;
    -o-object-fit: contain;
    object-fit: contain;
    -webkit-box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    -webkit-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
    opacity: 1;
}

/* Caption Area */
.peak-lightbox-caption {
    padding: 20px 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
}

/* Close Button */
.peak-lightbox-close {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: white;
}

.peak-lightbox-close svg {
    width: 24px;
    height: 24px;
}

.peak-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    -webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
    transform: scale(1.05);
}

/* Navigation Buttons */
.peak-lightbox-prev,
.peak-lightbox-next {
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: white;
    z-index: 10;
}

.peak-lightbox-prev svg,
.peak-lightbox-next svg {
    width: 24px;
    height: 24px;
}

.peak-lightbox-prev {
    left: 30px;
}

.peak-lightbox-next {
    right: 30px;
}

.peak-lightbox-prev:hover,
.peak-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    -webkit-transform: translateY(-50%) scale(1.1);
    -ms-transform: translateY(-50%) scale(1.1);
    transform: translateY(-50%) scale(1.1);
}

/* Lightbox Animation */
@-webkit-keyframes lightboxZoomIn {
    from {
        opacity: 0;
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}
@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .peak-gallery-accordion {
        height: 400px !important;
    }

    .carousel-prev,
    .carousel-next {
        width: 40px;
        height: 40px;
    }

    .carousel-prev {
        left: 8px;
    }

    .carousel-next {
        right: 8px;
    }

    .peak-lightbox-top-bar {
        padding: 15px 20px;
    }

    .peak-lightbox-counter {
        font-size: 14px;
    }

    .peak-lightbox-close {
        width: 40px;
        height: 40px;
    }

    .peak-lightbox-close svg {
        width: 20px;
        height: 20px;
    }

    .peak-lightbox-prev,
    .peak-lightbox-next {
        width: 44px;
        height: 44px;
    }

    .peak-lightbox-prev {
        left: 10px;
    }

    .peak-lightbox-next {
        right: 10px;
    }

    .peak-lightbox-caption {
        padding: 15px 20px;
        font-size: 13px;
    }

    /* Project gallery adjustments */
    .peak-gallery-project {
        padding-top: 100px;
    }
}

/* ==========================================================================
   Project Gallery Grid - Consistent Heights
   ========================================================================== */

.peak-gallery-project #image-gallery-grid {
    grid-auto-rows: 200px;
}

.peak-gallery-project #image-gallery-grid > div {
    position: relative;
    overflow: hidden;
}

.peak-gallery-project #image-gallery-grid > div a {
    display: block;
    width: 100%;
    height: 100%;
}

.peak-gallery-project #image-gallery-grid img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    display: block;
}

/* Large featured image - spans 3 columns and 2 rows */
.peak-gallery-project #image-gallery-grid > div.lg\:col-span-3.lg\:row-span-2 {
    grid-row: span 2;
}

@media (max-width: 1023px) {
    .peak-gallery-project #image-gallery-grid {
        grid-auto-rows: 250px;
    }
}

@media (max-width: 767px) {
    .peak-gallery-project #image-gallery-grid {
        grid-auto-rows: 300px;
    }
}
