/* Gallery-specific styles */
body {
    background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e0 50%, #f0f0e8 100%);
    min-height: 100vh;
}

.gallery-hero {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 100px 20px 40px;
    border-radius: 20px;
    padding: 60px 0;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.gallery-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gallery-description {
    font-size: 1.1rem;
    color: rgba(60, 60, 60, 0.9);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.gallery-section {
    padding: 110px 0 80px; /* Added top padding to account for fixed nav (70px) + extra space */
    background: rgba(255, 255, 255, 0.2);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
    
    /* Ensure auto-fit creates flexible columns that can accommodate horizontal spanning */
    grid-auto-flow: row dense;
}

/* Responsive grid adjustments */
@media (min-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Horizontal images take up two columns */
.gallery-item.horizontal {
    grid-column: span 2;
}

/* Ensure vertical images maintain their aspect ratio */
.gallery-item.vertical {
    grid-column: span 1;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: all 0.4s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: white;
    padding: 25px 20px 20px;
    transform: translateY(100%);
    transition: all 0.4s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.gallery-item-caption {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 6px;
    line-height: 1.3;
}

.gallery-item-date {
    font-size: 0.8rem;
    opacity: 0.7;
    font-style: italic;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    transition: opacity 0.3s ease;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 120px;
}

.lightbox-image {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    z-index: 1001;
    min-width: 60px;
    text-align: center;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.slideshow-hidden {
    opacity: 0;
    pointer-events: none;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    padding: 20px 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
    max-width: 80%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.lightbox-caption.slideshow-hidden {
    opacity: 0;
}

.lightbox-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.lightbox-description {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

.lightbox-date {
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

/* Loading animation */
.gallery-item.loading {
    background: rgba(255, 255, 255, 0.1);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Responsive design */
@media (max-width: 768px) {
    .gallery-title {
        font-size: 2.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        padding: 0 15px;
    }
    
    .gallery-item.horizontal {
        grid-column: span 1; /* Single column on mobile */
    }
    
    .lightbox-nav {
        padding: 10px 15px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .gallery-hero {
        margin: 80px 15px 30px;
        padding: 40px 20px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-caption {
        bottom: 20px;
        padding: 15px 20px;
        max-width: 90%;
    }
}

/* Slideshow Button Styling */
.slideshow-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slideshow-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.slideshow-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-title {
        font-size: 2rem;
    }
    
    .gallery-description {
        font-size: 1rem;
    }
}