/* ============================================================
   GALLERY PAGE — gallery.css
   Extends the Mystical Islamic Art theme from style.css
   ============================================================ */

/* ================= GALLERY HERO ================= */

.gallery-hero {
    text-align: center;
    padding: 70px 20px 30px;
    background: linear-gradient(135deg, var(--midnight) 0%, var(--royal-blue) 60%, #1a3a6b 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.gallery-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent);
}

.gallery-hero .ornament {
    color: var(--gold);
    opacity: 0.8;
    margin-bottom: 6px;
}

.gallery-hero h2 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.2rem;
    color: var(--gold-light);
    text-shadow: 0 2px 20px rgba(201,168,76,0.4);
    margin-bottom: 14px;
}

.gallery-hero p {
    max-width: 680px;
    margin: 0 auto;
    color: rgba(255,255,255,0.85);
    font-size: 1.02rem;
    line-height: 1.85;
}

/* ================= FILTER BUTTONS ================= */

.gallery-filter-section {
    padding: 30px 20px 0;
    text-align: center;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--royal-blue);
    background: var(--white);
    border: var(--border-gold);
    padding: 9px 22px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: rgba(201,168,76,0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--midnight);
    border-color: transparent;
    box-shadow: var(--shadow-gold);
}

/* ================= GALLERY GRID ================= */

.gallery-section {
    padding: 40px 30px 70px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: var(--border-gold);
    box-shadow: var(--shadow-deep);
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--midnight);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 0 4px rgba(201,168,76,0.25), var(--shadow-deep);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

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

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

/* OVERLAY ICON */
.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(5,14,31,0) 40%, rgba(5,14,31,0.75) 100%);
    opacity: 0;
    transition: var(--transition);
}

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

.gallery-overlay i {
    color: var(--gold-light);
    font-size: 1.6rem;
    border: 1px solid rgba(201,168,76,0.5);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5,14,31,0.6);
}

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

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5,14,31,0.94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 900px;
    max-height: 88vh;
    text-align: center;
    animation: fadeSlideIn 0.35s ease both;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 72vh;
    border-radius: var(--radius-md);
    border: 2px solid rgba(201,168,76,0.4);
    box-shadow: 0 0 0 6px rgba(201,168,76,0.1), var(--shadow-deep);
}

.lightbox-content p {
    margin-top: 18px;
    color: var(--gold-pale);
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.7;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 30px;
    background: none;
    border: 1px solid rgba(201,168,76,0.5);
    color: var(--gold-light);
    font-size: 1.8rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(201,168,76,0.15);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.4);
    color: var(--gold-light);
    font-size: 1.3rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: rgba(201,168,76,0.25);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
    .gallery-hero h2 {
        font-size: 1.6rem;
    }

    .gallery-section {
        padding: 30px 16px 50px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 14px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }

    .lightbox-close {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
}

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

    .gallery-filters {
        gap: 8px;
    }

    .filter-btn {
        font-size: 0.72rem;
        padding: 7px 16px;
    }
}
