/* ==========================================================================
   1. VARIABLES (Required for Gallery Effects)
   ========================================================================== */
:root {
    --shadow: 0 10px 20px rgba(0,0,0,0.1);
    --transition: 0.3s ease;
}

/* ==========================================================================
   3. HEADER SECTION
   ========================================================================== */
.header-section {

    background: linear-gradient(rgba(10, 61, 98, 0.8), rgba(10, 61, 98, 0.8)), 
                url('https://images.unsplash.com/photo-1492684223066-81342ee5ff30?q=80&w=1470');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.header-section h1 {
    font-size: 2.8rem;
    margin: 0;
    letter-spacing: 1px;
}

.underline {
    width: 80px;
    height: 4px;
    background: var(--accent-gold);
    margin: 15px auto;
}

/* ==========================================================================
   4. GALLERY GRID & FILTER
   ========================================================================== */
main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.filter-buttons {
    text-align: center;
    margin-bottom: 30px;
}

.filter-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, 
.filter-btn.active {
    background: var(--accent-gold);
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.gallery-item {
    position: relative;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.4s ease, opacity 0.3s ease;
    animation: fadeIn 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-10px);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Overlay */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.overlay h4 { margin: 0; font-size: 1.1rem; }
.overlay p { margin: 5px 0 0; font-size: 0.85rem; color: #ddd; }

/* ==========================================================================
   5. LIGHTBOX CUSTOMIZATION (Desktop & Global)
   ========================================================================== */
.lightboxOverlay {
    background-color: rgba(0,0,0,0.9) !important;
}

/* ==========================================================================
   LIGHTBOX CAPTION & CLOSE BUTTON FINAL FIX
   ========================================================================== */

/* १. कॅप्शन कंटेनर - जो इमेजच्या खाली माहिती दाखवतो */
.lb-dataContainer {
    position: relative !important; /* हे 'absolute' वरून 'relative' केल्यामुळे कॅप्शन पुन्हा इमेजच्या खाली येईल */
    margin-top: 10px !important;
    padding: 10px !important;
    width: 100% !important;
    background: transparent !important;
}

/* २. क्लोज बटण - हे स्वतंत्रपणे कोपऱ्यातच राहील */
.lb-data .lb-close {
    position: fixed !important; 
    top: 20px !important; 
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
    background-color: var(--accent-gold) !important;
    background-image: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    opacity: 1 !important;
    z-index: 100000 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    transition: transform 0.3s ease;
    touch-action: manipulation;
}
.lb-outerContainer {
    position: relative !important;
}

.lb-data .lb-close:hover {
    transform: scale(1.1); 
}

.lb-data .lb-close::after {
    content: '\2715';
    font-size: 26px;
    color: white;
    font-weight: bold;
}

/* ३. कॅप्शन मजकूर (Title) स्टाईल - हा आता इमेजच्या खाली डावीकडून सुरू होईल */
.lb-data .lb-caption {
    font-family: 'Poppins', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #fff !important;
    text-align: left !important; /* डावीकडून सुरू होईल */
    display: block !important;
    letter-spacing: 0.5px;
    border-left: 3px solid var(--accent-gold); /* डाव्या बाजूला छोटी गोल्ड लाईन */
    padding-left: 10px;
}

/* ४. इमेज नंबर (उदा. Image 1 of 4) स्टाईल */
.lb-data .lb-number {
    display: block !important;
    text-align: left !important;
    color: var(--accent-gold) !important;
    font-size: 0.8rem !important;
    margin-top: 5px !important;
    font-style: italic;
}

/* ५. इमेज आणि स्क्रीन मधील अंतर (मोबाईलसाठी) */
@media (max-width: 768px) {
    .lb-outerContainer {
    position: relative !important;
}
    .lb-data .lb-caption {
        font-size: 0.9rem !important;
    }
}


@media (max-width: 480px) {
    .lb-data .lb-close::after {
        font-size: 28px;
    }
}

/* ==========================================================================
   6. ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gallery Container Fix */
.gallery-container {
    display: grid !important;
    /* खालील लाईनमुळे ३-३ फोटो दिसतील. किमान ३००px जागा नसल्यास २ होतील */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 20px;
    padding: 20px 0;
    width: 100%;
}

/* Gallery Item Fix */
.gallery-item {
    width: 100%; /* फोटो आपल्या ग्रिड सेलच्या बाहेर जाणार नाही */
    height: auto;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%;
    height: 250px; /* सर्व फोटोची उंची समान ठेवण्यासाठी */
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* मोबाईलसाठी (१ किंवा २ फोटो एका रांगेत) */
@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}