/* ===================================================================
 * GALLERY PAGE CSS
 * Mata Dhanpati Devi Charitable Trust
 * Palette: Maroon (#A52A2A) + Saffron (#F28C28) + Gold (#FFD700) + Cream
 * =================================================================== */
:root {
    --primary: #A52A2A;
    --primary-dark: #7B2C2C;
    --primary-deeper: #3A0D0D;
    --secondary: #F28C28;
    --secondary-dark: #E67E22;
    --gold: #FFD700;
    --cream-light: #FFF9E6;
    --cream: #FFF0D1;
    --cream2: #FFF5E1;
    --text-dark: #333333;
    --text-muted: #666666;
    --text-secondary: #555555;
    --white: #FFFFFF;
    --bg-light: #FAF7F2;
}

/* ===== HERO SECTION ===== */
.gallery-hero {
    background: linear-gradient(135deg, var(--cream-light) 0%, var(--cream2) 50%, #F5F5DC 100%);
    min-height: 75vh;
    display: flex;
    align-items: center;
    padding: 100px 0 70px;
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(242, 140, 40, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.gallery-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(165, 42, 42, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-badge {
    background: rgba(242, 140, 40, 0.1);
    color: var(--primary);
    border: 2px solid var(--secondary);
    border-radius: 50px;
    padding: 8px 20px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 18px;
    font-size: 0.85rem;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    display: inline-block;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    line-height: 1.15;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
}

.hero-title .highlight-text {
    background: linear-gradient(120deg, var(--secondary) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 540px;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    min-width: 130px;
}

.hero-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.hero-stat .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    font-family: 'Playfair Display', serif;
    line-height: 1.1;
}

.hero-stat .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero Image Collage */
.hero-collage {
    position: relative;
    height: 460px;
    max-width: 540px;
    margin-left: auto;
}

.hero-collage-img {
    position: absolute;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transition: transform 0.5s ease;
}

.hero-collage-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-collage-img:hover {
    transform: scale(1.04);
    z-index: 5;
}

.hero-collage-img-1 {
    top: 0;
    right: 30px;
    width: 65%;
    height: 60%;
    z-index: 2;
}

.hero-collage-img-2 {
    bottom: 0;
    left: 0;
    width: 55%;
    height: 55%;
    z-index: 3;
}

.hero-collage-img-3 {
    top: 30%;
    right: 0;
    width: 40%;
    height: 40%;
    z-index: 1;
    border: 4px solid white;
}

/* Floating Accent Badge */
.collage-floating-badge {
    position: absolute;
    bottom: 30%;
    left: -10px;
    background: white;
    padding: 12px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--secondary);
    z-index: 10;
}

.collage-floating-badge i {
    font-size: 1.3rem;
    color: var(--secondary);
    background: rgba(242, 140, 40, 0.1);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collage-floating-badge .badge-number {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    line-height: 1;
}

.collage-floating-badge .badge-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 2px;
}

/* ===== FILTER TOOLBAR ===== */
.gallery-toolbar {
    background: var(--white);
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.gallery-toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.gallery-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.gallery-pill {
    padding: 8px 18px;
    border-radius: 50px;
    background: var(--bg-light);
    border: 1px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.gallery-pill i {
    font-size: 0.8rem;
}

.gallery-pill:hover {
    border-color: var(--secondary);
    color: var(--primary);
    background: var(--cream-light);
}

.gallery-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(165, 42, 42, 0.3);
}

.gallery-pill .pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.gallery-pill:not(.active) .pill-count {
    background: rgba(165, 42, 42, 0.08);
    color: var(--primary);
}

.gallery-search {
    min-width: 260px;
    max-width: 320px;
    flex: 1;
}

.gallery-search .form-control {
    border: 2px solid var(--cream);
    border-radius: 50px;
    padding: 10px 18px 10px 44px;
    background-color: var(--bg-light);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.gallery-search .form-control:focus {
    border-color: var(--secondary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(242, 140, 40, 0.12);
    outline: none;
}

.gallery-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.gallery-search .search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    display: none;
}

.gallery-search .search-clear:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.gallery-toolbar-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-toolbar-meta strong {
    color: var(--primary);
    font-weight: 700;
}

/* ===== GALLERY GRID SECTION ===== */
.gallery-section {
    background: var(--bg-light);
    padding: 60px 0;
    position: relative;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    opacity: 0.3;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--gold));
    z-index: 3;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -8px rgba(165, 42, 42, 0.18);
}

.gallery-card:hover::before {
    transform: scaleX(1);
}

.gallery-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--cream-light), var(--cream));
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Image overlay gradient */
.gallery-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-card:hover .gallery-image::after {
    opacity: 1;
}

/* Floating Category Badge on Image */
.gallery-category-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
}

.gallery-category-badge .badge {
    padding: 5px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(165, 42, 42, 0.1);
}

/* Year badge (right side of image) */
.gallery-year-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

/* Hover overlay (centered action) */
.gallery-hover-action {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-card:hover .gallery-hover-action {
    opacity: 1;
}

.gallery-hover-action .action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    transform: scale(0.5);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-card:hover .gallery-hover-action .action-btn {
    transform: scale(1);
}

.gallery-hover-action .action-btn:hover {
    background: var(--secondary);
    color: white;
}

/* Card Body */
.gallery-body {
    padding: 1.25rem 1.4rem 1.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-album {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.85rem;
    flex: 1;
}

.gallery-album i {
    color: var(--secondary);
    font-size: 0.8rem;
}

.gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.gallery-view-link {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.gallery-view-link:hover {
    color: var(--primary);
    gap: 10px;
}

.gallery-views {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Hidden state for filtering */
.gallery-item-hidden {
    display: none !important;
}

/* ===== EMPTY STATE ===== */
.gallery-empty {
    background: white;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.gallery-empty .empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cream-light), var(--cream));
    border: 2px dashed var(--secondary);
    color: var(--secondary);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.gallery-empty h4 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.gallery-empty p {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.cta-section .cta-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: white;
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.8rem;
}

.cta-section .cta-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto 1.8rem;
}

.cta-section .btn-cta-light {
    background: white;
    color: var(--primary);
    border: none;
    padding: 13px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cta-section .btn-cta-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    color: var(--primary);
}

.cta-section .btn-cta-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.7);
    padding: 13px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cta-section .btn-cta-outline:hover {
    background: white;
    color: var(--primary);
    border-color: white;
    transform: translateY(-3px);
}

/* ===== LIGHTBOX MODAL ===== */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 8, 8, 0.95);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-lightbox.is-open {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    transition: opacity 0.25s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-50%) scale(1.1);
}

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

.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}

.lightbox-info-text {
    flex: 1;
}

.lightbox-info-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    font-family: 'Playfair Display', serif;
}

.lightbox-info-meta {
    font-size: 0.85rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lightbox-info-meta i {
    color: var(--secondary);
    margin-right: 4px;
}

.lightbox-counter {
    background: rgba(242, 140, 40, 0.2);
    color: var(--gold);
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(242, 140, 40, 0.4);
    white-space: nowrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .gallery-hero {
        padding: 80px 0 50px;
        text-align: center;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-collage {
        margin: 2rem auto 0;
        height: 380px;
        max-width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-stat {
        min-width: 110px;
        padding: 0.85rem 1.1rem;
    }

    .hero-stat .stat-number {
        font-size: 1.5rem;
    }

    .hero-collage {
        height: 320px;
    }

    .gallery-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-pill {
        flex-shrink: 0;
    }

    .gallery-search {
        max-width: none;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
    }

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

    .lightbox-info {
        padding: 16px 20px;
    }

    .lightbox-info-title {
        font-size: 1rem;
    }

    .cta-section .cta-title {
        font-size: 1.7rem;
    }
}
