/**
 * Gallery Lightbox - Beautiful Gallery Layouts
 * 
 * Based on Workik Gallery Designs
 * @see https://workik.com/best-gallery-designs-for-websites-with-html-css-and-javascript
 * 
 * Layouts:
 * 1. Vignette (14 images) - Artistic diamond shapes
 * 2. Lookbook (7 images) - Hero + Side + Bottom
 * 3. Album (12 images) - 3 columns with mixed sizes
 * 4. Photogrid (9 images) - True CSS masonry columns
 * 5. Popup (8 images) - Clean uniform grid with hover
 * 6. Masonry (12 images) - Pinterest-style
 * 7. Grid (12 images) - Equal squares
 * 
 * @version 5.7.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --gallery-columns: 3;
    --gallery-gap: 15px;
    --gallery-border-radius: 8px;
    --gallery-animation-speed: 300ms;
    
    /* Lightbox */
    --lightbox-bg: rgba(0, 0, 0, 0.95);
    --lightbox-text-color: #ffffff;
    --lightbox-accent-color: var(--primary-color, #8CC63F);
    --lightbox-caption-bg: rgba(0, 0, 0, 0.7);
    --lightbox-btn-bg: rgba(255, 255, 255, 0.15);
    --lightbox-btn-hover-bg: rgba(255, 255, 255, 0.25);
}

.lightbox-theme-light {
    --lightbox-bg: rgba(255, 255, 255, 0.98);
    --lightbox-text-color: #1a1a1a;
    --lightbox-caption-bg: rgba(255, 255, 255, 0.9);
    --lightbox-btn-bg: rgba(0, 0, 0, 0.1);
    --lightbox-btn-hover-bg: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   GALLERY PAGE & SECTION STRUCTURE
   ========================================================================== */
.gallery-header-section {
    padding: 60px 0 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.gallery-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.gallery-page-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

.gallery-element-section {
    padding: 50px 0;
    border-bottom: 1px solid #e9ecef;
}

.gallery-element-section:last-of-type {
    border-bottom: none;
}

.gallery-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color, #8CC63F);
}

.gallery-section-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.gallery-image-count {
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* Alternating section backgrounds */
.gallery-element-section:nth-child(even) {
    background: #f8f9fa;
}

.gallery-element-section:nth-child(odd) {
    background: #ffffff;
}

/* ==========================================================================
   1. FLOW GALLERY - 3D Mouse-Tracking Tilt Effect
   Grid layout with customizable columns (2, 3, or 4)
   ========================================================================== */

/* Flow Gallery Variables */
.gallery-flow {
    --flow-height: var(--flow-card-height, 200px);
    --flow-columns: 4;
    --flow-gap: 8px;
    --flow-perspective: 1000px;
    --flow-transition: 0.15s ease-out;
    --flow-grayscale: 1;
    --flow-brightness-base: 0.5;
}

/* Flow Gallery Container - CSS Grid */
.gallery-flow {
    display: grid;
    grid-template-columns: repeat(var(--flow-columns), 1fr);
    gap: var(--flow-gap);
    width: 100%;
    perspective: var(--flow-perspective);
    padding: 20px 0;
}

/* Flow Card - Each image item */
.gallery-flow .flow-card {
    position: relative;
    height: var(--flow-height);
    overflow: visible;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: filter 0.4s ease, transform var(--flow-transition);
    filter: grayscale(var(--flow-grayscale)) brightness(var(--flow-brightness-base));
    border-radius: 4px;
}

/* Flow Card Image Container */
.gallery-flow .flow-card .flow-img {
    position: absolute;
    inset: 0;
    background: var(--flow-bg-image) center/cover no-repeat;
    transform-style: preserve-3d;
    transition: transform var(--flow-transition), box-shadow 0.3s ease;
    will-change: transform;
    border-radius: 4px;
}

/* ===== SCROLL-TRIGGERED ANIMATION ===== */
.gallery-flow .flow-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform var(--flow-transition), filter 0.4s ease;
}

.gallery-flow.flow-visible .flow-card {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for each card - supports up to 12 cards */
.gallery-flow.flow-visible .flow-card:nth-child(1) { transition-delay: 0.05s; }
.gallery-flow.flow-visible .flow-card:nth-child(2) { transition-delay: 0.1s; }
.gallery-flow.flow-visible .flow-card:nth-child(3) { transition-delay: 0.15s; }
.gallery-flow.flow-visible .flow-card:nth-child(4) { transition-delay: 0.2s; }
.gallery-flow.flow-visible .flow-card:nth-child(5) { transition-delay: 0.25s; }
.gallery-flow.flow-visible .flow-card:nth-child(6) { transition-delay: 0.3s; }
.gallery-flow.flow-visible .flow-card:nth-child(7) { transition-delay: 0.35s; }
.gallery-flow.flow-visible .flow-card:nth-child(8) { transition-delay: 0.4s; }
.gallery-flow.flow-visible .flow-card:nth-child(9) { transition-delay: 0.45s; }
.gallery-flow.flow-visible .flow-card:nth-child(10) { transition-delay: 0.5s; }
.gallery-flow.flow-visible .flow-card:nth-child(11) { transition-delay: 0.55s; }
.gallery-flow.flow-visible .flow-card:nth-child(12) { transition-delay: 0.6s; }

/* ===== HOVER STATE - Color reveal ===== */
.gallery-flow .flow-card:hover {
    filter: grayscale(0) brightness(1) saturate(1.1);
    z-index: 10;
}

/* Shadow on hover - applied via JS with transform */
.gallery-flow .flow-card:hover .flow-img {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .gallery-flow {
        --flow-columns: 2 !important;
        gap: 10px;
        padding: 20px;
        perspective: none;
    }
    
    .gallery-flow .flow-card {
        filter: grayscale(0) brightness(1);
        border-radius: var(--gallery-border-radius, 8px);
    }
    
    .gallery-flow .flow-card .flow-img {
        border-radius: var(--gallery-border-radius, 8px);
    }
    
    .gallery-flow .flow-card:hover {
        transform: scale(1.02);
    }
}

@media (max-width: 576px) {
    .gallery-flow {
        --flow-columns: 1 !important;
        --flow-height: 180px;
        padding: 15px;
    }
}

/* ==========================================================================
   2. LOOKBOOK GALLERY (From Workik #4)
   Big hero image with side images + bottom row
   ========================================================================== */
.gallery-lookbook-layout {
    --lookbook-hero-height: 440px;
    --lookbook-side-height: 215px;
    --lookbook-max-width: 1000px;
    
    display: flex;
    flex-direction: column;
    gap: var(--gallery-gap, 10px);
    max-width: var(--lookbook-max-width);
    margin: 0 auto;
}

.gallery-lookbook-layout .lookbook-above {
    display: flex;
    gap: var(--gallery-gap, 10px);
}

.gallery-lookbook-layout .lookbook-bottom {
    display: flex;
    justify-content: space-between;
    gap: var(--gallery-gap, 10px);
}

/* Hero image - large left side */
.gallery-lookbook-layout .gallery-item.lookbook-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--gallery-border-radius, 6px);
    cursor: pointer;
    background: #f5f5f5;
    flex-shrink: 0;
    flex: 2;
    /* Fixed height for the hero container */
    height: var(--lookbook-hero-height);
}

.gallery-lookbook-layout .gallery-item.lookbook-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

/* Side column - stacked images */
.gallery-lookbook-layout .lookbook-side {
    display: flex;
    flex-direction: column;
    gap: var(--gallery-gap, 10px);
    flex: 1;
}

/* Regular gallery items */
.gallery-lookbook-layout .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--gallery-border-radius, 6px);
    cursor: pointer;
    background: #f5f5f5;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-lookbook-layout .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Side items - stacked to match hero height */
.gallery-lookbook-layout .lookbook-side .gallery-item {
    flex: 1;
    /* Each side item takes half the hero height minus gap */
    height: calc((var(--lookbook-hero-height) - var(--gallery-gap, 10px)) / 2);
}

.gallery-lookbook-layout .lookbook-side .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Bottom items - equal width */
.gallery-lookbook-layout .lookbook-bottom .gallery-item {
    flex: 1;
    height: var(--lookbook-side-height);
}

.gallery-lookbook-layout .lookbook-bottom .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* View button overlay */
.gallery-lookbook-layout .gallery-item .lookbook-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--primary-color, #8CC63F);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
}

.gallery-lookbook-layout .gallery-item:hover .lookbook-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gallery-lookbook-layout .gallery-item .lookbook-btn:hover {
    background: var(--primary-color-dark, #7ab52f);
}

/* Hover effects */
.gallery-lookbook-layout .gallery-item:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery-lookbook-layout .gallery-item:hover img {
    transform: scale(1.02);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .gallery-lookbook-layout .gallery-item.lookbook-hero img {
        min-height: 340px;
    }
    
    .gallery-lookbook-layout .lookbook-side .gallery-item img {
        min-height: 165px;
    }
    
    .gallery-lookbook-layout .lookbook-bottom .gallery-item img {
        height: 165px;
    }
}

/* Responsive - Small Tablet */
@media (max-width: 768px) {
    .gallery-lookbook-layout .lookbook-above {
        flex-direction: column;
    }
    
    .gallery-lookbook-layout .gallery-item.lookbook-hero {
        width: 100%;
    }
    
    .gallery-lookbook-layout .gallery-item.lookbook-hero img {
        min-height: 280px;
        height: 280px;
    }
    
    .gallery-lookbook-layout .lookbook-side {
        flex-direction: row;
        width: 100%;
    }
    
    .gallery-lookbook-layout .lookbook-side .gallery-item {
        flex: 1;
    }
    
    .gallery-lookbook-layout .lookbook-side .gallery-item img {
        min-height: 180px;
        height: 180px;
    }
    
    .gallery-lookbook-layout .lookbook-bottom {
        flex-wrap: wrap;
    }
    
    .gallery-lookbook-layout .lookbook-bottom .gallery-item {
        flex: 0 0 calc(50% - 5px);
    }
    
    .gallery-lookbook-layout .lookbook-bottom .gallery-item img {
        height: 180px;
    }
}

/* Responsive - Mobile */
@media (max-width: 500px) {
    .gallery-lookbook-layout .gallery-item.lookbook-hero img {
        min-height: 200px;
        height: 200px;
    }
    
    .gallery-lookbook-layout .lookbook-side .gallery-item img {
        min-height: 110px;
        height: 110px;
    }
    
    .gallery-lookbook-layout .lookbook-bottom .gallery-item img {
        height: 110px;
    }
    
    .gallery-lookbook-layout .gallery-item .lookbook-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   3. PHOTOGRID GALLERY - Beautiful Asymmetric Layout
   6 images in an artistic grid with overlay lightbox
   ========================================================================== */

/* Main Container */
.photogrid-gallery {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 10px 30px;
    background: transparent;
}

.photogrid-gallery * {
    box-sizing: border-box;
}

.photogrid-container {
    max-width: 1320px;
    margin: 0 auto;
    min-height: 720px;
    height: 720px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* Base Project Styles */
.photogrid-project {
    position: absolute;
    padding: 0;
    overflow: hidden;
    border-radius: var(--gallery-border-radius, 8px);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photogrid-project:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Images */
.photogrid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--gallery-border-radius, 8px);
    transition: transform 0.4s ease;
}

.photogrid-project:hover .photogrid-image {
    transform: scale(1.05);
}

/* Project Positions - Desktop (Asymmetric Grid) */
.photogrid-project-1 {
    width: 39.8%;
    height: 66.67%;
    top: 0;
    left: 0;
}

.photogrid-project-2 {
    width: 59.75%;
    height: 32.6%;
    bottom: 0;
    left: 0;
    top: auto;
}

.photogrid-project-3 {
    width: 19.4%;
    height: 32.98%;
    left: 40.2%;
    top: 0;
}

.photogrid-project-4 {
    width: 19.5%;
    height: 32.98%;
    left: 40.2%;
    top: 33.7%;
}

.photogrid-project-5 {
    width: 39.8%;
    height: 32.6%;
    right: 0;
    left: auto;
    top: 0;
}

.photogrid-project-6 {
    width: 39.8%;
    height: 66.67%;
    right: 0;
    left: auto;
    bottom: 0;
    top: auto;
}

/* View Button */
.photogrid-btn-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 5;
}

.photogrid-project:hover .photogrid-btn-box {
    display: block;
}

.photogrid-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color, #8CC63F);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.photogrid-btn:hover {
    background: var(--primary-color-dark, #7ab62e);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.photogrid-btn svg {
    fill: currentColor;
}

/* ==========================================================================
   PHOTOGRID CAROUSEL LIGHTBOX
   Full-screen lightbox with navigation arrows
   ========================================================================== */

.photogrid-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photogrid-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.photogrid-lightbox.visible {
    opacity: 1;
}

.photogrid-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.photogrid-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

/* Close Button */
.photogrid-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.photogrid-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.photogrid-lightbox-close .lightbox-icon {
    font-size: 24px;
    font-weight: bold;
    color: white;
    line-height: 1;
}

/* Navigation Arrows */
.photogrid-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.photogrid-lightbox-nav:hover {
    background: var(--primary-color, #8CC63F);
    border-color: var(--primary-color, #8CC63F);
    transform: translateY(-50%) scale(1.1);
}

.photogrid-lightbox-nav .lightbox-icon {
    font-size: 28px;
    font-weight: bold;
    color: white;
    line-height: 1;
}

.photogrid-lightbox-prev {
    left: 20px;
}

.photogrid-lightbox-next {
    right: 20px;
}

/* Image Container */
.photogrid-lightbox-image-wrap {
    max-width: 90%;
    max-height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photogrid-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.photogrid-lightbox-image.loaded {
    opacity: 1;
    transform: scale(1);
}

.photogrid-lightbox-caption {
    margin: 20px 0 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    text-align: center;
    line-height: 1.5;
    max-width: 600px;
}

/* Counter */
.photogrid-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
}

/* Loading State */
.photogrid-lightbox-image-wrap::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color, #8CC63F);
    border-radius: 50%;
    animation: photogrid-spin 0.8s linear infinite;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.photogrid-lightbox-image.loaded ~ .photogrid-lightbox-image-wrap::before,
.photogrid-lightbox-image-wrap:has(.photogrid-lightbox-image.loaded)::before {
    opacity: 0;
}

@keyframes photogrid-spin {
    to { transform: rotate(360deg); }
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .photogrid-container {
        height: 600px;
    }
    
    .photogrid-lightbox-content {
        padding: 60px 60px;
    }
    
    .photogrid-lightbox-nav {
        width: 50px;
        height: 50px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .photogrid-gallery {
        padding: 10px 20px;
    }
    
    .photogrid-container {
        height: 930px;
    }
    
    .photogrid-project-1 {
        width: 64%;
        height: 300px;
        top: 0;
        left: 0;
    }
    
    .photogrid-project-3 {
        left: auto;
        width: 35%;
        height: 145px;
        right: 0;
        top: 0;
    }
    
    .photogrid-project-4 {
        left: auto;
        width: 35%;
        height: 145px;
        top: 155px;
        right: 0;
    }
    
    .photogrid-project-2 {
        width: 100%;
        top: 310px;
        height: 200px;
        bottom: auto;
    }
    
    .photogrid-project-5 {
        top: 520px;
        width: 100%;
        left: 0;
        right: auto;
        height: 200px;
    }
    
    .photogrid-project-6 {
        width: 100%;
        height: 200px;
        top: 730px;
        bottom: auto;
        left: 0;
        right: auto;
    }
    
    .photogrid-lightbox-content {
        padding: 60px 15px;
    }
    
    .photogrid-lightbox-nav {
        width: 45px;
        height: 45px;
    }
    
    .photogrid-lightbox-prev {
        left: 10px;
    }
    
    .photogrid-lightbox-next {
        right: 10px;
    }
    
    .photogrid-lightbox-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* Small Mobile */
@media (max-width: 500px) {
    .photogrid-container {
        height: 890px;
    }
    
    .photogrid-project-1 {
        height: 250px;
    }
    
    .photogrid-project-3 {
        height: 123px;
    }
    
    .photogrid-project-4 {
        height: 123px;
        top: 127px;
    }
    
    .photogrid-project-2 {
        top: 260px;
    }
    
    .photogrid-project-5 {
        top: 470px;
    }
    
    .photogrid-project-6 {
        top: 680px;
    }
    
    .photogrid-lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .photogrid-lightbox-nav svg {
        width: 24px;
        height: 24px;
    }
}

/* ==========================================================================
   4. POP-UP GALLERY - Scroll-Animated Asymmetric Grid
   Creative grid that scales and rotates on scroll
   ========================================================================== */

/* Wrapper */
.popup-gallery-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    z-index: 1;
    margin-top: var(--popup-spacing, 400px);
    margin-bottom: 50px;
    timeline-scope: --popup-timeline;
}

/* Scroll Container - Creates the scroll height for animation */
.popup-gallery-scroll-container {
    height: var(--popup-scroll-height, 150vh);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: visible;
    view-timeline: --popup-timeline block;
}

/* The Grid */
.popup-gallery-grid {
    --big-tile-size: var(--popup-tile-size, 50vmin);
    --scale: var(--popup-start-scale, 0.4);
    --rotation: var(--popup-rotation, 270deg);
    --tile-size: calc(var(--big-tile-size) / 3);
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1vmin;
    grid-template: repeat(9, var(--tile-size)) / repeat(9, var(--tile-size));
    position: sticky;
    top: 50vh;
    transform: translateY(-50%) scale(var(--scale));
    transform-origin: center center;
    animation: popup-scale-up both linear;
    animation-timeline: --popup-timeline;
    animation-range: entry -10% cover 75%;
    z-index: 2;
}

@keyframes popup-scale-up {
    0% {
        transform: translateY(-50%) scale(var(--scale)) rotate(0deg);
    }
    100% {
        transform: translateY(-50%) scale(1) rotate(var(--rotation));
    }
}

/* Grid Items */
.popup-gallery-item {
    padding: 0;
    position: relative;
    background: hsl(0 0% 75% / 0.2);
    grid-column: var(--x1, auto) / var(--x2, auto);
    grid-row: var(--y1, auto) / var(--y2, auto);
    border-radius: var(--gallery-border-radius, 8px);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
    z-index: 3;
}

.popup-gallery-item:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Images - counter-rotate to stay upright */
.popup-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: popup-img-counter-rotate both linear;
    animation-timeline: --popup-timeline;
    animation-range: entry -10% cover 75%;
    transition: transform 0.3s ease;
}

@keyframes popup-img-counter-rotate {
    0% {
        transform: scale(1.5) rotate(0deg);
    }
    100% {
        transform: scale(1.5) rotate(calc(var(--popup-rotation, 270deg) * -1));
    }
}

.popup-gallery-item:hover img {
    transform: scale(1.6) rotate(calc(var(--popup-rotation, 270deg) * -1));
}

/* View overlay on hover - counter-rotates to stay horizontal */
.popup-gallery-item::after {
    content: 'View';
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--primary-color, #8CC63F);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    animation: popup-btn-rotate both linear;
    animation-timeline: --popup-timeline;
    animation-range: entry -10% cover 75%;
}

@keyframes popup-btn-rotate {
    0% {
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8) rotate(calc(var(--popup-rotation, 270deg) * -1));
    }
}

.popup-gallery-item:hover::after {
    opacity: 1;
}

/* ==========================================================================
   POPUP GALLERY LIGHTBOX (Same as Photogrid)
   ========================================================================== */
.popup-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-lightbox.visible {
    opacity: 1;
}

.popup-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.popup-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

/* Close Button */
.popup-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.popup-lightbox-close .lightbox-icon {
    font-size: 24px;
    font-weight: bold;
    color: white;
    line-height: 1;
}

/* Navigation Arrows */
.popup-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-lightbox-nav:hover {
    background: var(--primary-color, #8CC63F);
    border-color: var(--primary-color, #8CC63F);
    transform: translateY(-50%) scale(1.1);
}

.popup-lightbox-nav .lightbox-icon {
    font-size: 28px;
    font-weight: bold;
    color: white;
    line-height: 1;
}

.popup-lightbox-prev {
    left: 20px;
}

.popup-lightbox-next {
    right: 20px;
}

/* Image Container */
.popup-lightbox-image-wrap {
    max-width: 90%;
    max-height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.popup-lightbox-image.loaded {
    opacity: 1;
    transform: scale(1);
}

.popup-lightbox-caption {
    margin: 20px 0 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    text-align: center;
    line-height: 1.5;
    max-width: 600px;
}

/* Counter */
.popup-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .popup-gallery-grid {
        --big-tile-size: 60vmin;
    }
    
    .popup-gallery-scroll-container {
        height: 200vh;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .popup-gallery-grid {
        --big-tile-size: 80vmin;
        --scale: 0.5;
    }
    
    .popup-gallery-scroll-container {
        height: 180vh;
    }
    
    .popup-lightbox-content {
        padding: 60px 15px;
    }
    
    .popup-lightbox-nav {
        width: 45px;
        height: 45px;
    }
    
    .popup-lightbox-prev {
        left: 10px;
    }
    
    .popup-lightbox-next {
        right: 10px;
    }
}

/* Fallback for browsers without scroll-timeline support */
@supports not (animation-timeline: scroll()) {
    .popup-gallery-scroll-container {
        height: auto;
        min-height: 80vh;
        padding: 60px 0;
    }
    
    .popup-gallery-grid {
        position: relative;
        top: auto;
        transform: scale(0.8) rotate(45deg);
    }
    
    .popup-gallery-item img {
        transform: scale(1.2) rotate(-45deg);
    }
    
    .popup-gallery-item::after {
        transform: translate(-50%, -50%) scale(0.8) rotate(-45deg);
    }
    
    .popup-gallery-item:hover::after {
        transform: translate(-50%, -50%) scale(1) rotate(-45deg);
    }
}

/* ==========================================================================
   5. GRID GALLERY (Equal Squares - Legacy)
   ========================================================================== */
.gallery-layout-grid {
    display: grid;
    grid-template-columns: repeat(var(--gallery-columns, 3), 1fr);
    gap: var(--gallery-gap, 15px);
}

.gallery-layout-grid .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--gallery-border-radius, 8px);
    cursor: pointer;
    background: #f5f5f5;
    aspect-ratio: 1;
    transition: transform var(--gallery-animation-speed) ease,
                box-shadow var(--gallery-animation-speed) ease;
}

.gallery-layout-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--gallery-animation-speed) ease;
}

.gallery-layout-grid .gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery-layout-grid .gallery-item:hover img {
    transform: scale(1.1);
}

/* Grid responsive */
@media (max-width: 768px) {
    .gallery-layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .gallery-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-layout-grid .gallery-item {
        aspect-ratio: 4/3;
    }
}

/* ==========================================================================
   6. MASONRY GALLERY (Pinterest Style - CSS Columns)
   Beautiful flowing masonry with CSS columns for natural stacking
   ========================================================================== */
.gallery-masonry {
    column-count: 3;
    column-gap: var(--gallery-gap, 15px);
    padding: 10px;
}

.gallery-masonry .gallery-item {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: var(--gallery-gap, 15px);
    break-inside: avoid;
    overflow: hidden;
    border-radius: var(--gallery-border-radius, 12px);
    cursor: pointer;
    background: transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    line-height: 0;
    font-size: 0;
    /* Override generic .gallery-item styles */
    aspect-ratio: unset !important;
    min-height: unset !important;
    height: auto !important;
}

.gallery-masonry .gallery-item * {
    font-size: 1rem;
}

.gallery-masonry .gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    border-radius: var(--gallery-border-radius, 12px);
    pointer-events: none;
}

.gallery-masonry .gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid var(--primary-color, #8CC63F);
    border-radius: var(--gallery-border-radius, 12px);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-masonry .gallery-item img {
    width: 100%;
    height: auto !important;
    display: block;
    border-radius: var(--gallery-border-radius, 12px);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.4s ease;
    vertical-align: bottom;
    object-fit: cover;
}

/* Hover effects */
.gallery-masonry .gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2),
                0 10px 20px rgba(140, 198, 63, 0.1);
    z-index: 10;
}

.gallery-masonry .gallery-item:hover::before {
    opacity: 1;
}

.gallery-masonry .gallery-item:hover::after {
    opacity: 1;
    transform: scale(1);
}

.gallery-masonry .gallery-item:hover img {
    transform: scale(1.08);
}

/* Caption overlay on hover */
.gallery-masonry .gallery-item .gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px 15px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.gallery-masonry .gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Zoom icon indicator */
.gallery-masonry .gallery-item .zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    z-index: 4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gallery-masonry .gallery-item .zoom-icon::before {
    content: '+';
    font-size: 28px;
    font-weight: 300;
    color: var(--primary-color, #8CC63F);
    line-height: 1;
}

.gallery-masonry .gallery-item:hover .zoom-icon {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Staggered animation on load */
.gallery-masonry .gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-masonry .gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-masonry .gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-masonry .gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-masonry .gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-masonry .gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-masonry .gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-masonry .gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-masonry .gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-masonry .gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-masonry .gallery-item:nth-child(11) { animation-delay: 0.55s; }
.gallery-masonry .gallery-item:nth-child(12) { animation-delay: 0.6s; }

@keyframes masonryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-masonry.animate-items .gallery-item {
    animation: masonryFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

/* Masonry responsive - Tablet (2 columns) */
@media (max-width: 992px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 12px;
    }
    
    .gallery-masonry .gallery-item {
        margin-bottom: 12px;
    }
}

/* Masonry responsive - Mobile */
@media (max-width: 576px) {
    .gallery-masonry {
        column-count: 1;
        column-gap: 10px;
        padding: 5px;
    }
    
    .gallery-masonry .gallery-item {
        margin-bottom: 15px;
        border-radius: 10px;
    }
    
    .gallery-masonry .gallery-item img {
        border-radius: 10px;
    }
    
    .gallery-masonry .gallery-item::after {
        border-radius: 10px;
    }
    
    .gallery-masonry .gallery-item:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

/* ==========================================================================
   7. VIGNETTE GALLERY (Artistic Diamond Shapes)
   Unique clip-path effect with hover reveal - 14 images max
   ========================================================================== */
.gallery-vignette {
    --img-size: calc(120px - 0.5rem / 2);
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(6, var(--img-size));
    grid-template-rows: repeat(5, var(--img-size));
    justify-content: center;
    padding: 40px 20px;
    background: #000814;
    border-radius: var(--gallery-border-radius, 12px);
}

.gallery-vignette .gallery-item {
    position: relative;
    overflow: visible;
    cursor: pointer;
    grid-column: span 2;
    border-radius: 0.5rem;
    transition: filter 500ms, clip-path 500ms, z-index 0ms;
}

.gallery-vignette .gallery-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.5rem;
    clip-path: path(
        "M 80 20 C 100 0 100 0 120 20 C 140 40 160 60 180 80 C 200 100 200 100 180 120 C 160 140 140 160 120 180 C 100 200 100 200 80 180 C 60 160 40 140 20 120 C 0 100 0 100 20 80 Z"
    );
    transition: filter 500ms, clip-path 500ms;
}

/* Offset pattern for images 4 and 9 */
.gallery-vignette .gallery-item:nth-child(4),
.gallery-vignette .gallery-item:nth-child(9) {
    grid-column: 2 / span 2;
}

/* Hover - expand to full square */
.gallery-vignette .gallery-item:hover {
    z-index: 100;
}

.gallery-vignette .gallery-item:hover img {
    clip-path: path(
        "M 0 0 C 100 0 100 0 200 0 C 200 50 200 50 200 80 C 200 100 200 100 200 120 C 200 150 200 150 200 200 C 100 200 100 200 0 200 C 0 150 0 150 0 120 C 0 100 0 100 0 80 Z"
    );
}

.gallery-vignette .gallery-item:not(:hover) img {
    animation: vignetteZIndexFix 500ms;
}

/* Dim non-hovered images */
.gallery-vignette:hover > .gallery-item img {
    filter: brightness(0.5) saturate(0.5);
}

.gallery-vignette > .gallery-item:hover img {
    filter: brightness(1) saturate(1.5);
}

@keyframes vignetteZIndexFix {
    0%, 100% {
        z-index: 10;
    }
}

/* Hide overlay and zoom icon for vignette */
.gallery-vignette .gallery-item-overlay,
.gallery-vignette .gallery-zoom-icon {
    display: none;
}

/* Vignette responsive - Tablet */
@media (max-width: 992px) {
    .gallery-vignette {
        --img-size: calc(100px - 0.5rem / 2);
        grid-template-columns: repeat(4, var(--img-size));
        grid-template-rows: auto;
    }
    
    .gallery-vignette .gallery-item {
        grid-column: span 2;
    }
    
    .gallery-vignette .gallery-item:nth-child(4),
    .gallery-vignette .gallery-item:nth-child(9) {
        grid-column: span 2;
    }
}

/* Vignette responsive - Mobile */
@media (max-width: 500px) {
    .gallery-vignette {
        --img-size: calc(140px - 0.5rem / 2);
        grid-template-columns: repeat(2, var(--img-size));
    }
    
    .gallery-vignette .gallery-item,
    .gallery-vignette .gallery-item:nth-child(4),
    .gallery-vignette .gallery-item:nth-child(9) {
        grid-column: span 1;
    }
}

/* ==========================================================================
   Gallery Item Overlay (Captions)
   ========================================================================== */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        transparent 70%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--gallery-animation-speed) ease;
    border-radius: var(--gallery-border-radius, 8px);
    z-index: 3;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px;
    transform: translateY(10px);
    transition: transform var(--gallery-animation-speed) ease;
}

.gallery-item-caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
    transform: translateY(10px);
    transition: transform var(--gallery-animation-speed) ease 0.05s;
}

.gallery-item:hover .gallery-item-title,
.gallery-item:hover .gallery-item-caption {
    transform: translateY(0);
}

/* Zoom Icon */
.gallery-zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--gallery-animation-speed) ease;
    z-index: 4;
}

.gallery-zoom-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.gallery-item:hover .gallery-zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.sports-lightbox {
    position: fixed;
    inset: 0;
    background: var(--lightbox-bg);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sports-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.sports-lightbox.active .lightbox-image-container {
    transform: scale(1);
}

/* Lightbox Header */
.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.lightbox-counter {
    color: var(--lightbox-text-color);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    background: var(--lightbox-btn-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.lightbox-actions {
    display: flex;
    gap: 10px;
}

.lightbox-btn {
    width: 44px;
    height: 44px;
    background: var(--lightbox-btn-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    color: var(--lightbox-text-color);
}

.lightbox-btn svg {
    width: 20px;
    height: 20px;
}

.lightbox-btn svg path,
.lightbox-btn svg polygon {
    fill: #ffffff;
}

.lightbox-btn svg line,
.lightbox-btn svg polyline {
    stroke: #ffffff;
    fill: none;
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
}

.lightbox-nav svg polyline {
    stroke: #ffffff;
    fill: none;
}

.lightbox-btn:hover {
    background: var(--lightbox-btn-hover-bg);
    transform: scale(1.1);
}

.lightbox-btn:active {
    transform: scale(0.95);
}

.lightbox-btn.active {
    background: var(--lightbox-accent-color);
}

/* Image Container */
.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 80px 140px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-image.loaded {
    opacity: 1;
}

/* Loading Spinner */
.lightbox-loading {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid var(--lightbox-btn-bg);
    border-top-color: var(--lightbox-accent-color);
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
    to { transform: rotate(360deg); }
}

/* Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: var(--lightbox-btn-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    color: var(--lightbox-text-color);
}

.lightbox-nav:hover {
    background: var(--lightbox-btn-hover-bg);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Caption */
.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 30px;
    background: var(--lightbox-caption-bg);
    backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sports-lightbox.active .lightbox-caption {
    transform: translateY(0);
}

.lightbox-title {
    color: var(--lightbox-text-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.lightbox-description {
    color: var(--lightbox-text-color);
    opacity: 0.8;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    max-width: 800px;
}

/* Thumbnails - Top Bar */
.lightbox-thumbnails {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    backdrop-filter: blur(15px);
    max-width: calc(100% - 200px);
    overflow-x: auto;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    z-index: 15;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.lightbox-thumbnails.visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.25s ease;
    flex-shrink: 0;
    border: 2px solid transparent;
    transform: scale(0.9);
}

.lightbox-thumb:hover {
    opacity: 0.85;
    transform: scale(1);
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--primary-color, #8CC63F);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(140, 198, 63, 0.5);
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox-thumb:hover { opacity: 0.8; }
.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--lightbox-accent-color);
}

/* Progress */
.lightbox-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--lightbox-accent-color);
    width: 0;
}

.lightbox-progress.active {
    animation: lightbox-progress 5s linear forwards;
}

@keyframes lightbox-progress {
    from { width: 0; }
    to { width: 100%; }
}

/* Zoom Mode */
.sports-lightbox.zoomed .lightbox-image-container {
    cursor: grab;
    overflow: auto;
}

.sports-lightbox.zoomed .lightbox-image {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

/* Lightbox responsive */
@media (max-width: 768px) {
    .lightbox-image-container {
        padding: 60px 20px 140px;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    
    .lightbox-caption { padding: 20px; }
    .lightbox-title { font-size: 1.1rem; }
    .lightbox-description { font-size: 0.9rem; }
    
    .lightbox-thumbnails {
        top: 60px;
        max-width: calc(100% - 20px);
        gap: 5px;
        padding: 6px 8px;
    }
    
    .lightbox-thumb {
        width: 40px;
        height: 40px;
        border-radius: 4px;
    }
}

@media (max-width: 500px) {
    .lightbox-header { padding: 10px 15px; }
    .lightbox-btn { width: 40px; height: 40px; }
    .lightbox-counter { font-size: 0.85rem; padding: 6px 12px; }
    
    .lightbox-thumbnails {
        top: 55px;
    }
    
    .lightbox-thumb {
        width: 35px;
        height: 35px;
    }
}

/* Hide toggle thumbnails button since they're always visible */
.lightbox-btn-thumbnails {
    display: none;
}

/* Hide zoom button */
.lightbox-btn-zoom {
    display: none;
}

/* ==========================================================================
   Hover Effect Variations
   ========================================================================== */
.gallery-hover-zoom .gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.gallery-hover-zoom .gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-hover-fade .gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(140, 198, 63, 0.7) 0%, rgba(140, 198, 63, 0.3) 100%);
    opacity: 0;
    transition: opacity var(--gallery-animation-speed) ease;
    border-radius: inherit;
    z-index: 1;
}

.gallery-hover-fade .gallery-item:hover::after {
    opacity: 1;
}

.gallery-hover-slide .gallery-item-overlay {
    transform: translateY(100%);
    opacity: 1;
}

.gallery-hover-slide .gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-hover-none .gallery-item:hover {
    transform: none;
    box-shadow: none;
}

.gallery-hover-none .gallery-item:hover img {
    transform: none;
}

/* ==========================================================================
   Print & Reduced Motion
   ========================================================================== */
@media print {
    .sports-lightbox { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-item img,
    .lightbox-image,
    .lightbox-nav,
    .lightbox-btn {
        transition: none;
    }
    
    .lightbox-loading { animation: none; }
}
