/* ========================================
   GALLERY / DOKUMENTASI STYLES
   PT. Bina Sukses Lestari
   ======================================== */

/* === Section Padding === */
.section-gallery {
    background-color: var(--light);
}

/* === Filter Buttons === */
.gallery-filter-wrapper {
    margin-bottom: 2.5rem;
}

.gallery-filter-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    margin: 0.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark);
    background: #ffffff;
    border: 2px solid var(--primary);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-filter-btn:hover,
.gallery-filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .gallery-filter-btn {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
        margin: 0.15rem;
    }
}

/* === Gallery Grid === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* === Gallery Card === */
.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.gallery-card.hidden {
    display: none;
}

.gallery-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-card-img {
    transform: scale(1.05);
}

.gallery-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, transparent 100%);
    padding: 2rem 1.25rem 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-card-overlay,
.gallery-card:focus-visible .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.gallery-card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
}

/* Mobile: always show title below image */
@media (max-width: 768px) {
    .gallery-card-overlay {
        display: none;
    }
    
    .gallery-card-info-mobile {
        padding: 0.75rem 1rem;
        background: #ffffff;
    }
    
    .gallery-card-info-mobile .gallery-card-title {
        color: var(--dark);
        font-size: 0.9rem;
    }
    
    .gallery-card-info-mobile .gallery-card-category {
        font-size: 0.7rem;
    }
}

.gallery-card-info-mobile {
    display: none;
}

@media (max-width: 768px) {
    .gallery-card-info-mobile {
        display: block;
    }
}

/* === Lightbox === */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.gallery-lightbox.active {
    display: flex;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2.5rem;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s;
}

.gallery-lightbox-close:hover {
    color: var(--primary);
}

.gallery-lightbox-image-wrapper {
    max-width: 90vw;
    max-height: 65vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-lightbox-image {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.gallery-lightbox-info {
    text-align: center;
    max-width: 700px;
    padding: 1.5rem 2rem;
    color: #ffffff;
}

.gallery-lightbox-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #ffffff;
}

.gallery-lightbox-caption {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 0.75rem;
    line-height: 1.6;
}

.gallery-lightbox-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.gallery-lightbox-category-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
}

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10;
}

.gallery-lightbox-nav:hover {
    background: rgba(37, 99, 235, 0.6);
}

.gallery-lightbox-prev {
    left: 1.5rem;
}

.gallery-lightbox-next {
    right: 1.5rem;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .gallery-lightbox-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
    
    .gallery-lightbox-title {
        font-size: 1.2rem;
    }
    
    .gallery-lightbox-caption {
        font-size: 0.9rem;
    }
    
    .gallery-lightbox-image-wrapper {
        max-width: 95vw;
        max-height: 55vh;
    }
    
    .gallery-lightbox-image {
        max-height: 55vh;
    }
    
    .gallery-lightbox-nav {
        font-size: 1.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .gallery-lightbox-prev {
        left: 0.5rem;
    }
    
    .gallery-lightbox-next {
        right: 0.5rem;
    }
}

/* === Fade-in animation for gallery items === */
.gallery-item-fade {
    animation: galleryFadeIn 0.5s ease forwards;
}

@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
