/* 
   =============================================
   SHREE RAM INTERNATIONAL PRE SCHOOL
   Gallery Premium Design System v1.0
   ============================================= 
*/

/* ─── 0. GALLERY HERO ENHANCEMENT ─── */
/* Using global .ab-hero structure from style.css for consistent premium look */
.ab-hero {
    position: relative;
    z-index: 10;
}

.ab-hero-img-frame {
    background: #fff;
    padding: 12px;
    border-radius: 40px;
    box-shadow: 0 40px 100px rgba(62, 35, 108, 0.12);
    transform: rotate(3deg);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ab-hero-img-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.ab-hero-img-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
}

/* ─── 1. REFINED FILTER BAR ─── */
.gl-filters {
    padding-bottom: 40px;
    position: sticky;
    top: var(--header-height, 72px); /* Matches navbar height for gapless scroll */
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(62, 35, 108, 0.05);
}

.gl-filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0;
}

.gl-filter-btn {
    padding: 10px 22px;
    border-radius: 50px;
    border: 1px solid rgba(62, 35, 108, 0.08);
    background: white;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gl-filter-btn i {
    font-size: 0.85rem;
    opacity: 0.6;
    transition: transform 0.4s ease;
}

.gl-filter-btn:hover {
    background: rgba(62, 35, 108, 0.03);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: translateY(-2px);
}

.gl-filter-btn.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
    box-shadow: 0 8px 20px rgba(108, 93, 211, 0.25);
}

/* ─── 2. PREMIUM MASONRY GRID ─── */
.gl-category {
    padding: 80px 0;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gl-cat-header {
    text-align: center;
    margin-bottom: 50px;
}

.gl-cat-header h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--primary-dark);
}

.gl-masonry {
    display: grid;
    gap: 24px;
}

.gl-masonry-4 { grid-template-columns: repeat(4, 1fr); }
.gl-masonry-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1100px) {
    .gl-masonry-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 850px) {
    .gl-masonry-4, .gl-masonry-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .gl-masonry-4, .gl-masonry-3 { grid-template-columns: 1fr; }
}

.gl-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    cursor: zoom-in;
    aspect-ratio: 4/5;
    box-shadow: 0 10px 30px rgba(62, 35, 108, 0.05);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gl-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 60px rgba(62, 35, 108, 0.15);
    z-index: 10;
}

.gl-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s ease;
}

.gl-item:hover img {
    transform: scale(1.1);
}

.gl-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(62, 35, 108, 0.4), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gl-item:hover::after {
    opacity: 1;
}

/* ─── 3. MODERN LIGHTBOX ─── */
.gl-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(14, 8, 28, 0.98);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.gl-lb-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.gl-lb-content img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 30px 100px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gl-lightbox.active .gl-lb-content img {
    transform: scale(1);
}

.gl-lb-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gl-lb-close:hover {
    background: var(--accent-rose);
    transform: rotate(90deg);
}

.gl-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gl-lb-prev { left: 40px; }
.gl-lb-next { right: 40px; }

.gl-lb-nav:hover {
    background: var(--accent-purple);
    transform: translateY(-50%) scale(1.1);
}

/* ─── 4. VIDEO ITEMS ─── */
.gl-item-video {
    cursor: pointer;
}

.gl-item-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s ease;
}

.gl-item-video:hover video {
    transform: scale(1.1);
}

.gl-video-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.gl-item-video:hover .gl-video-badge {
    background: rgba(124, 77, 255, 0.8);
    border-color: rgba(124, 77, 255, 0.5);
}

.gl-video-badge i {
    font-size: 0.65rem;
}

@media (max-width: 768px) {
    .gl-filters {
        top: 0;
        padding-bottom: 16px;
        position: static;
    }

    .gl-filter-bar {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 14px 0 6px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .gl-filter-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
        padding: 10px 16px;
    }

    .gl-virtual-tour {
        margin: 36px 12px !important;
        padding: 72px 0 !important;
    }

    .gl-virtual-tour .container > div {
        flex-direction: column !important;
        gap: 28px !important;
    }

    .gl-vt-content h2 {
        font-size: clamp(1.9rem, 8vw, 2.4rem) !important;
    }

    .gl-vt-content p {
        font-size: 1rem !important;
        line-height: 1.65 !important;
    }

    .gl-vt-iframe-wrapper {
        border-width: 5px !important;
    }

    .gl-lb-content {
        padding: 84px 16px 104px;
    }

    .gl-lb-content img {
        max-width: 100%;
        max-height: 68vh;
    }

    .gl-lb-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .gl-lb-nav {
        top: auto;
        bottom: 20px;
        transform: none;
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .gl-lb-prev {
        left: calc(50% - 58px);
    }

    .gl-lb-next {
        right: calc(50% - 58px);
    }

    .gl-lb-nav:hover {
        transform: scale(1.05);
    }
}

@media (max-width: 480px) {
    .gl-item {
        border-radius: 16px;
    }

    .gl-video-badge {
        left: 10px;
        bottom: 10px;
        padding: 5px 10px;
        font-size: 0.72rem;
    }
}
