/* ============================================
   Gallery Page Styles — Responsive Masonry & Lightbox
   ============================================ */

.gallery-section {
    padding: var(--space-section) 0;
}

.gallery-filter {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-3xl);
    flex-wrap: wrap;
}

.gallery-filter-btn {
    padding: 10px 24px;
    font-size: var(--font-size-sm);
    font-weight: var(--fw-medium);
    color: var(--color-gray);
    background: var(--color-white);
    border: 2px solid var(--color-gray-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-filter-btn:hover,
.gallery-filter-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 112, 33, 0.3);
}

/* Responsive Grid for Gallery Images */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

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

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

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    background: var(--color-gray-light, #f8f9fa);
    aspect-ratio: 4 / 3;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.gallery-item:hover {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item.portrait img {
    aspect-ratio: 3 / 4;
}

.gallery-item.landscape img {
    aspect-ratio: 4 / 3;
}

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

/* Hover overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-base);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-lg);
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h4 {
    color: var(--color-white);
    font-size: var(--font-size-md);
    margin-bottom: var(--space-xs);
    transform: translateY(10px);
    transition: transform var(--transition-base);
}

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

.gallery-overlay p {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
    transform: translateY(10px);
    transition: transform var(--transition-base) 0.05s;
}

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

/* Zoom icon */
.gallery-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: rgba(243, 112, 33, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
    pointer-events: none;
}

.gallery-item:hover .gallery-zoom {
    transform: translate(-50%, -50%) scale(1);
}

.gallery-zoom svg {
    width: 22px;
    height: 22px;
    fill: var(--color-white);
}

/* ---- Lightbox Modal ---- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-modal, 9999);
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.lightbox.active {
    display: flex;
    animation: zoomIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90vw;
    max-height: 76vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

.lightbox-caption {
    margin-top: 14px;
    text-align: center;
    color: var(--color-white);
}

.lightbox-caption h4 {
    color: var(--color-white);
    font-size: var(--font-size-md, 1.15rem);
    margin-bottom: 2px;
    font-weight: var(--fw-semibold, 600);
}

.lightbox-caption p {
    color: var(--color-primary, #f37021);
    font-size: var(--font-size-sm, 0.85rem);
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: var(--fw-medium, 500);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    z-index: 10001;
}

.lightbox-close:hover {
    background: var(--color-primary);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    fill: var(--color-white);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: var(--color-primary);
    transform: translateY(-50%) scale(1.12);
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    fill: var(--color-white);
}

.lightbox-prev {
    left: 28px;
}

.lightbox-next {
    right: 28px;
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: 12px;
    }
    .lightbox-next {
        right: 12px;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    .lightbox-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
    .lightbox img {
        max-height: 70vh;
    }
}

