/* =============================================================
   NIRJA VIKAS VARDHINI — gallery.css
   Page-specific styles for gallery.html only.

   Shared:  style.css  → header, footer, cursor, buttons, chips
   Reused:  about.css  → .nvv-page-header + breadcrumb
   This file: filter bar, section heads, image grid, video row,
              lightbox modal, stagger animations
   ============================================================= */

/* ============================================================
   GALLERY PAGE WRAPPER
   ============================================================ */
.nvv-gallery-page {
    padding: 80px 0 100px;
    background: var(--bg);
}

/* ============================================================
   STICKY FILTER BAR
   ============================================================ */
.nvv-gal-filter-bar {
    position: sticky;
    top: calc(72px + 37px);
    /* header height */
    z-index: 400;
    background: rgba(250, 250, 248, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 16px rgba(14, 32, 64, 0.06);
    padding: 0;
    transition: box-shadow 0.3s;
}

.nvv-header.stuck~* .nvv-gal-filter-bar,
.nvv-gal-filter-bar.scrolled {
    top: 72px;
}

.nvv-gal-filter-bar__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nvv-gal-filter-bar__inner::-webkit-scrollbar {
    display: none;
}

.nvv-gal-filter-bar__label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nvv-gal-filter-bar__label i {
    color: var(--orange);
}

.nvv-gal-filter-bar__btns {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.nvv-gal-filter-btn {
    padding: 7px 18px;
    border-radius: 24px;
    border: 1.5px solid var(--line);
    background: white;
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    transition: all 0.22s;
    flex-shrink: 0;
}

.nvv-gal-filter-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--orange-lt);
}

.nvv-gal-filter-btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
    box-shadow: 0 4px 14px rgba(232, 100, 10, 0.3);
}

.nvv-gal-filter-bar__count {
    margin-left: auto;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--bg);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--line);
}

/* ============================================================
   GALLERY SECTION (each themed group)
   ============================================================ */
.nvv-gal-section {
    margin-bottom: 80px;
    padding-top: 16px;
}

.nvv-gal-section:last-child {
    margin-bottom: 0;
}

/* Section heading row */
.nvv-gal-section__head {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
    position: relative;
}

.nvv-gal-section__head::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--gold));
    border-radius: 3px;
}

/* COVID section — orange tinted bg */
.nvv-gal-section__head--covid {
    background: linear-gradient(135deg, var(--orange-lt) 0%, transparent 60%);
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    border-bottom: none;
    margin-bottom: 36px;
}

.nvv-gal-section__head--covid::after {
    display: none;
}

.nvv-gal-section__num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--orange);
    opacity: 0.18;
    flex-shrink: 0;
    min-width: 60px;
    user-select: none;
}

.nvv-gal-section__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--navy);
    margin: 0;
}

.nvv-gal-section__title em {
    color: var(--orange);
    font-style: italic;
}

/* COVID chip variant */
.nvv-chip--covid {
    background: rgba(232, 100, 10, 0.15);
    color: var(--orange);
    border: 1px solid rgba(232, 100, 10, 0.3);
}

.nvv-chip--covid::before {
    background: var(--orange);
}

/* CSR chip variant */
.nvv-chip--csr {
    background: rgba(16, 124, 65, 0.12);
    color: #107c41;
    border: 1px solid rgba(16, 124, 65, 0.28);
}

.nvv-chip--csr::before {
    background: #107c41;
}

/* ============================================================
   IMAGE GRIDS
   ============================================================ */

/* --- 2-column grid --- */
.nvv-gal-grid--2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* --- 3-column grid --- */
.nvv-gal-grid--3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* --- 4-column grid (covid images) --- */
.nvv-gal-grid--4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* --- 1-column grid (CSR single image) --- */
.nvv-gal-grid--1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.nvv-gal-grid--1 .nvv-gal-item {
    height: 380px;
}

/* ============================================================
GALLERY ITEM (image card)
============================================================ */
.nvv-gal-item {
border-radius: var(--radius);
overflow: hidden;
position: relative;
background: var(--line);
box-shadow: var(--shadow);
/* stagger via JS */
opacity: 0;
transform: translateY(24px) scale(0.97);
transition: opacity 0.5s ease, transform 0.5s ease,
box-shadow 0.3s ease;
/* Consistent card dimensions */
height: 240px;
}

.nvv-gal-item.visible {
opacity: 1;
transform: translateY(0) scale(1);
}

.nvv-gal-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px) scale(1.02);
    z-index: 2;
}

/* Hide/show on filter */
.nvv-gal-item.hidden {
    display: none;
}

/* Image */
.nvv-gal-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.nvv-gal-item img {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
    /* Fallback for browsers that don't support object-fit */
    font-family: 'object-fit: cover; object-position: center;';
    /* Alternative: ensure minimum coverage */
    min-width: 100%;
    min-height: 100%;
}

.nvv-gal-grid--4 .nvv-gal-item {
    height: 190px;
}

.nvv-gal-grid--4 .nvv-gal-item img {
    height: 90px;
    /* object-fit: cover; */
    object-position: center;
}


.nvv-gal-item:hover img {
    transform: scale(1.07);
}

/* Overlay */
.nvv-gal-item__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(14, 32, 64, 0.72) 0%,
            rgba(14, 32, 64, 0.1) 60%,
            transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nvv-gal-item:hover .nvv-gal-item__overlay {
    opacity: 1;
}

.nvv-gal-item__overlay i {
    font-size: 1.8rem;
    color: white;
    background: rgba(232, 100, 10, 0.85);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.nvv-gal-item:hover .nvv-gal-item__overlay i {
    transform: scale(1);
}

.nvv-gal-item__overlay span {
    font-size: 0.76rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(14, 32, 64, 0.5);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ============================================================
   VIDEO ROW (covid videos)
   ============================================================ */
.nvv-gal-videos-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* 2-column variant — for sections with only 2 videos */
[data-section="csr-event"] .nvv-gal-videos-row {
    grid-template-columns: repeat(2, 1fr);
}

.nvv-gal-video-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--navy);
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 10;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s;
}

.nvv-gal-video-wrap.visible {
    opacity: 1;
    transform: translateY(0);
}

.nvv-gal-video-wrap:hover {
    box-shadow: 0 20px 60px rgba(14, 32, 64, 0.2);
    transform: translateY(-4px);
}

.nvv-gal-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nvv-gal-video__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(232, 100, 10, 0.9);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
}

/* ============================================================
   CUSTOM LIGHTBOX MODAL
   ============================================================ */
.nvv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.nvv-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.nvv-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 24, 0.94);
    backdrop-filter: blur(6px);
}

.nvv-lightbox__stage {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nvv-lightbox__img {
    max-width: 90vw;
    max-height: 82vh;
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    display: block;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    object-fit: contain;
}

.nvv-lightbox.open .nvv-lightbox__img {
    transform: scale(1);
}

/* Lightbox controls */
.nvv-lightbox__close,
.nvv-lightbox__prev,
.nvv-lightbox__next {
    position: fixed;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s, transform 0.22s;
    backdrop-filter: blur(4px);
}

.nvv-lightbox__close {
    top: 20px;
    right: 24px;
    width: 46px;
    height: 46px;
    font-size: 1rem;
}

.nvv-lightbox__prev,
.nvv-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
}

.nvv-lightbox__prev {
    left: 20px;
}

.nvv-lightbox__next {
    right: 20px;
}

.nvv-lightbox__close:hover {
    background: var(--orange);
    border-color: var(--orange);
    transform: rotate(90deg);
}

.nvv-lightbox__prev:hover {
    background: var(--orange);
    border-color: var(--orange);
    transform: translateY(-50%) translateX(-3px);
}

.nvv-lightbox__next:hover {
    background: var(--orange);
    border-color: var(--orange);
    transform: translateY(-50%) translateX(3px);
}

.nvv-lightbox__caption {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(14, 32, 64, 0.6);
    padding: 6px 20px;
    border-radius: 24px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.nvv-lightbox__counter {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 2;
    font-size: 0.76rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   SECTION HIDDEN STATE (when filtered out)
   ============================================================ */
.nvv-gal-section.section-hidden {
    display: none;
}

/* ============================================================
   STAGGER ANIMATION — applied via JS with delay
   ============================================================ */
.nvv-gal-item:nth-child(1) {
    transition-delay: 0.05s;
}

.nvv-gal-item:nth-child(2) {
    transition-delay: 0.10s;
}

.nvv-gal-item:nth-child(3) {
    transition-delay: 0.15s;
}

.nvv-gal-item:nth-child(4) {
    transition-delay: 0.20s;
}

.nvv-gal-item:nth-child(5) {
    transition-delay: 0.25s;
}

.nvv-gal-item:nth-child(6) {
    transition-delay: 0.30s;
}

.nvv-gal-item:nth-child(7) {
    transition-delay: 0.35s;
}

.nvv-gal-item:nth-child(8) {
    transition-delay: 0.40s;
}

.nvv-gal-item:nth-child(9) {
    transition-delay: 0.10s;
}

.nvv-gal-item:nth-child(10) {
    transition-delay: 0.15s;
}

.nvv-gal-item:nth-child(11) {
    transition-delay: 0.20s;
}

.nvv-gal-item:nth-child(12) {
    transition-delay: 0.10s;
}

.nvv-gal-video-wrap:nth-child(1) {
    transition-delay: 0.05s;
}

.nvv-gal-video-wrap:nth-child(2) {
    transition-delay: 0.15s;
}

.nvv-gal-video-wrap:nth-child(3) {
    transition-delay: 0.25s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .nvv-gal-grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .nvv-gal-filter-bar {
        top: 72px;
    }

    .nvv-gal-filter-bar__inner {
        gap: 8px;
    }

    .nvv-gal-filter-bar__count {
        display: none;
    }

    .nvv-gal-grid--1 .nvv-gal-item {
        height: 280px;
    }

    .nvv-gal-grid--2,
    .nvv-gal-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .nvv-gal-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .nvv-gal-videos-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nvv-gal-section__head {
        flex-direction: column;
        gap: 12px;
    }

    .nvv-gal-section__num {
        font-size: 3rem;
    }

    .nvv-lightbox__prev {
        left: 8px;
    }

    .nvv-lightbox__next {
        right: 8px;
    }

    .nvv-gallery-page {
        padding: 60px 0 72px;
    }
}

@media (max-width: 576px) {

    .nvv-gal-grid--1 {
        max-width: 100%;
    }

    .nvv-gal-grid--1 .nvv-gal-item {
        height: 220px;
    }

    .nvv-gal-grid--2,
    .nvv-gal-grid--3,
    .nvv-gal-grid--4 {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .nvv-gal-item img,
    .nvv-gal-grid--4 .nvv-gal-item img {
        height: 150px;
    }

    .nvv-gal-filter-bar__btns {
        gap: 6px;
    }

    .nvv-gal-filter-btn {
        padding: 6px 12px;
        font-size: 0.72rem;
    }
}

/* ── CSR Sub-Filter Bar ── */
.nvv-gal-sub-filter-bar {
    background: linear-gradient(to right, #fff9f5, #fff5ee, #fff9f5);
    border-top: 2px solid rgba(232, 100, 10, 0.12);
    border-bottom: 2px solid rgba(232, 100, 10, 0.12);
    padding: 12px 0;
    animation: subFilterSlide 0.3s ease;
}

@keyframes subFilterSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nvv-gal-sub-filter-bar .csr-bar-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.nvv-gal-sub-filter-bar .csr-bar-label i {
    color: var(--orange);
    font-size: 0.9rem;
}

/* Sub-Filter Buttons */
.nvv-gal-sub-filter-btn {
    padding: 7px 20px;
    border-radius: 30px;
    border: 1.5px solid rgba(14, 32, 64, 0.15);
    background: white;
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.22s ease;
    box-shadow: 0 2px 6px rgba(14, 32, 64, 0.06);
    outline: none;
    position: relative;
    overflow: hidden;
}

.nvv-gal-sub-filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--orange);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
}

.nvv-gal-sub-filter-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: #fff5ee;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 100, 10, 0.15);
}

.nvv-gal-sub-filter-btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
    box-shadow: 0 4px 14px rgba(232, 100, 10, 0.35);
    transform: translateY(-1px);
}