/* ============================================
   GALLERY SECTION
   ============================================ */

.gallery-section {
    height: 100vh;
    background: transparent;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 0;
    margin: 0;
    border: 0;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.gallery-section .container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    margin-bottom: -1.5rem;
    font-size: 3rem;
    color: #333;
    width: 100%;
    z-index: 999;
}

.section-subtitle {
    text-align: center;
    font-weight: 100;
    letter-spacing: 2rem;
    font-size: 2.5rem;
    margin-top: -3rem;
    margin-bottom: 2rem;
    color: rgba(0, 0, 0, 0.5);
    width: 100%;
    z-index: 998;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 1.5rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    padding: 0 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    align-content: start;
    justify-content: center;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

/* Custom scrollbar for gallery grids */
.gallery-grid::-webkit-scrollbar {
    width: 8px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    aspect-ratio: 16/9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 16/9;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.overlay h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.overlay p {
    font-size: 0.8rem;
    margin-top: 0rem;
    opacity: 0.9;
}

/* Gallery Responsive Design - Desktop */
@media (min-width: 769px) {
    .gallery-item {
        aspect-ratio: 16/9;
    }
    
    .gallery-item img {
        aspect-ratio: 16/9;
    }
}

/* Gallery Responsive Design - Tablet */
@media (min-width: 769px) and (max-width: 1399px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1000px;
    }
}

/* Gallery Navigator Button */
.gallery-navigator {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 0.875rem 1.5rem;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.gallery-navigator:hover {
    background: #1a1a1a;
    transform: translateY(8px);
}

.gallery-navigator.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gallery-navigator svg {
    transition: transform 0.2s ease;
}

.gallery-navigator:hover svg {
    transform: translateX(4px);
}

/* Gallery Responsive Design - Mobile */
@media (max-width: 768px) {
    .gallery-section .container {
        padding: 1.5rem 1rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-top: -4rem;
        margin-bottom: 1rem;
        letter-spacing: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
        gap: 1rem;
        max-height: calc(80vh - 80px);
        padding: 0 0.5rem;
        align-content: start;
        max-width: 100%;
    }
    
    .gallery-item {
        aspect-ratio: 4/3;
    }
    
    .gallery-item img {
        aspect-ratio: 4/3;
    }
    
    .overlay {
        padding: 1.5rem 1rem 1rem;
    }
    
    .overlay h3 {
        font-size: 1rem;
    }
    
    .overlay p {
        font-size: 0.8rem;
    }
}

/* Gallery for small height screens */
@media (min-width: 769px) and (max-height: 800px) {
    .section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .gallery-grid {
        gap: 1rem;
        max-height: calc(70vh - 80px);
    }
}

/* ============================================
   LIGHTBOX STYLES
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    display: block;
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.lightbox-content.loading {
    opacity: 0;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 45px;
    font-size: 40px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.close-lightbox:hover {
    color: #ccc;
}

/* Lightbox Navigation arrows */
.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-next {
    right: 20px;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Lightbox Mobile responsive */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .close-lightbox {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 10px;
    }
}
