/* ============================================
   GALLERY PAGE — Styles
   ============================================ */

/* ---- Gallery Hero ---- */
.gallery-hero {
    padding: 140px 0 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    text-align: center;
    color: #fff;
}

.gallery-hero .section-tag {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

.gallery-hero .section-title {
    color: #fff;
}

.gallery-hero .section-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

/* ---- Gallery Section ---- */
.gallery-section {
    padding: 60px 0 100px;
    background: var(--bg-light);
}

/* ---- Filter Buttons ---- */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 24px;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    background: var(--bg-white);
    color: var(--text-medium);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---- Gallery Grid ---- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder for items without images yet */
.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-cream) 100%);
    color: var(--text-light);
    gap: 8px;
}

.gallery-placeholder span {
    font-size: 2.5rem;
}

.gallery-placeholder p {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Hover overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    padding: 40px 16px 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: all var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-overlay h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.gallery-overlay p {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ---- Empty State ---- */
.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 1rem;
}

/* ---- Lightbox ---- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox-img-wrapper {
    position: relative;
}

.lightbox-img-wrapper img {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.lightbox-caption {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    margin-top: 12px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 2.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .gallery-hero {
        padding: 100px 0 32px;
    }

    .gallery-hero h1 {
        font-size: clamp(1.5rem, 5vw, 2.2rem);
    }

    .gallery-filters {
        gap: 8px;
        padding: 0 16px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
        padding: 0 16px;
    }

    .lightbox-content {
        max-width: 95vw;
    }

    .lightbox-img-wrapper img {
        max-width: 92vw;
        max-height: 70vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 1.8rem;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-hero {
        padding: 90px 0 24px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 0 12px;
    }

    .gallery-filters {
        gap: 6px;
        padding: 0 12px;
    }

    .filter-btn {
        padding: 7px 14px;
        font-size: 0.75rem;
    }

    .gallery-overlay h4 {
        font-size: 0.75rem;
    }

    .gallery-overlay p {
        display: none;
    }
}
