/* ===================================================
   Gallery Page Styles — Tiyasa Foundation
   =================================================== */


/* ── Gallery Hero ── */

.gallery-hero {
    background: var(--clr-primary);
    padding: calc(80px + var(--space-xl)) 0 var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    border-radius: 50%;
}

.gallery-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    border-radius: 50%;
}

.gallery-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--fs-small);
    font-weight: 500;
    margin-bottom: var(--space-lg);
    transition: color var(--transition-fast);
}

.gallery-back:hover {
    color: var(--clr-white);
}

.gallery-back i {
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.gallery-back:hover i {
    transform: translateX(-3px);
}

.gallery-hero-content {
    position: relative;
    z-index: 1;
}

.gallery-hero-content .section-label {
    color: rgba(255, 255, 255, 0.6);
}

.gallery-hero-content h1 {
    font-size: var(--fs-display);
    font-weight: 700;
    color: var(--clr-white);
    margin-bottom: var(--space-sm);
}

.gallery-hero-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    max-width: 560px;
    line-height: 1.8;
}


/* ── Gallery Main ── */

.gallery-main {
    padding: var(--space-2xl) 0 var(--space-3xl);
    background: var(--clr-bg);
}


/* ── Event Section ── */

.gallery-event {
    margin-bottom: var(--space-2xl);
}

.gallery-event:last-child {
    margin-bottom: 0;
}

.event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--clr-border);
}

.event-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.event-icon {
    width: 46px;
    height: 46px;
    background: var(--clr-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--clr-white);
    flex-shrink: 0;
}

.event-title-group h2 {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--clr-dark);
    margin-bottom: 2px;
}

.event-count {
    font-size: var(--fs-xs);
    color: var(--clr-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ── Image Grid ── */

.event-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: var(--clr-border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

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

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.35s ease;
}

.gallery-item-overlay i {
    font-size: 1.6rem;
    color: var(--clr-white);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s var(--ease-out);
}

.gallery-item:hover .gallery-item-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .gallery-item-overlay i {
    opacity: 1;
    transform: scale(1);
}


/* ── Lightbox ── */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
    backdrop-filter: blur(8px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--clr-white);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-image-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-wrap img {
    max-width: 80vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.35s var(--ease-out);
}

.lightbox-overlay.active .lightbox-image-wrap img {
    opacity: 1;
    transform: scale(1);
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--fs-small);
    margin-top: var(--space-sm);
    text-align: center;
    font-weight: 500;
}

.lightbox-nav {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: var(--clr-white);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
}

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--fs-small);
    font-weight: 500;
}


/* ── Reveal (reuse from main) ── */

.gallery-main .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s var(--ease-out);
}

.gallery-main .reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ── Responsive ── */

@media (max-width: 900px) {
    .event-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        padding: calc(70px + var(--space-lg)) 0 var(--space-xl);
    }

    .gallery-hero-content h1 {
        font-size: var(--fs-h1);
    }

    .event-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .event-title-group h2 {
        font-size: 1.1rem;
    }

    .lightbox-content {
        max-width: 95vw;
    }

    .lightbox-image-wrap img {
        max-width: 90vw;
    }

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

    /* Mobile nav support */
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: var(--clr-primary);
        flex-direction: column;
        padding: 80px var(--space-lg) var(--space-lg);
        transition: right var(--transition-normal);
        z-index: 999;
        gap: var(--space-sm);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: var(--fs-body);
        padding: var(--space-xs) 0;
    }
}

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

    .gallery-main {
        padding: var(--space-xl) 0 var(--space-2xl);
    }

    .lightbox-nav {
        display: none;
    }
}
