/* ===============================================================
   GALLERY.CSS - Clean, uniform gallery with zoom-only overlay
   Optimized for mobile and desktop
================================================================ */

/* ========== GALLERY HERO ========== */
.gallery-hero {
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.95), rgba(0, 51, 153, 0.90)),
                url('https://images.unsplash.com/photo-1600880292089-90a7e086ee0c?w=1600&q=80') center/cover no-repeat;
    color: var(--white);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
    z-index: 0;
}

.gallery-hero-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease forwards;
}

.gallery-hero h1 {
    font-size: 48px;
    margin-bottom: 16px;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

.gallery-hero p {
    font-size: 18px;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

/* ========== GALLERY SECTION ========== */
.gallery-section {
    padding: 80px 0;
    background: var(--primary-blue);
}

/* ========== UNIFORM GALLERY GRID ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-flow: dense;  
    gap: 20px;
    margin-bottom: 50px;
}

/* Gallery Item - Uniform Size */
.gallery-item {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animation delays */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }
.gallery-item:nth-child(9) { animation-delay: 0.5s; }
.gallery-item:nth-child(n+10) { animation-delay: 0.55s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item.hidden {
    display: none;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}

/* Uniform Image Sizing */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ========== ZOOM ICON OVERLAY (CLEAN & SIMPLE) ========== */
.gallery-zoom {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 31, 84, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.gallery-item:hover .gallery-zoom {
    opacity: 1;
}

.gallery-zoom i {
    color: var(--white);
    font-size: 48px;
    transform: scale(0.5);
    transition: all 0.4s ease;
}

.gallery-item:hover .gallery-zoom i {
    transform: scale(1);
}

/* ========== LOAD MORE BUTTON ========== */
.gallery-load-more {
    text-align: center;
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
}

.gallery-load-more .btn {
    padding: 16px 40px;
    font-size: 16px;
}

/* ========== LIGHTBOX MODAL ========== */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    object-fit: contain;
}

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: var(--white);
    color: var(--primary-blue);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent-green);
    color: var(--white);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
}

/* ========== GALLERY CTA ========== */
.gallery-cta {
    background: linear-gradient(135deg, rgba(0, 31, 84, 0.95), rgba(0, 51, 153, 0.92)),
                url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1600&q=80') center/cover;
    color: var(--white);
    padding: 70px 0;
    text-align: center;
    position: relative;
}

.gallery-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
    z-index: 0;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.gallery-cta h2 {
    font-size: 38px;
    margin-bottom: 16px;
}

.gallery-cta p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* ========== TABLET LANDSCAPE (992px - 1200px) ========== */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    
    .gallery-item {
        height: 260px;
    }
}

/* ========== TABLET PORTRAIT (768px - 992px) ========== */
@media (max-width: 992px) {
    .gallery-hero {
        padding: 60px 0 40px;
    }
    
    .gallery-hero h1 {
        font-size: 40px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-item {
        height: 240px;
    }
    
    .gallery-zoom i {
        font-size: 42px;
    }
    
    .gallery-section {
        padding: 60px 0;
    }
}

/* ========== MOBILE LARGE (576px - 768px) ========== */
@media (max-width: 768px) {
    .gallery-hero {
        padding: 50px 0 30px;
    }
    
    .gallery-hero h1 {
        font-size: 32px;
    }
    
    .gallery-hero p {
        font-size: 16px;
    }
    
    .gallery-section {
        padding: 50px 0;
    }
    
    .gallery-grid {
        gap: 12px;
    }
    
    .gallery-item {
        height: 220px;
    }
    
    .gallery-zoom i {
        font-size: 38px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .lightbox-close {
        width: 45px;
        height: 45px;
        font-size: 22px;
        top: 15px;
        right: 15px;
    }
    
    .gallery-cta h2 {
        font-size: 28px;
    }
    
    .gallery-cta p {
        font-size: 16px;
    }
}

/* ========== MOBILE MEDIUM (480px - 576px) ========== */
@media (max-width: 576px) {
    .gallery-hero {
        padding: 40px 0 25px;
    }
    
    .gallery-hero h1 {
        font-size: 28px;
    }
    
    .gallery-hero p {
        font-size: 15px;
    }
    
    .gallery-section {
        padding: 40px 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item {
        height: 280px;
    }
    
    .gallery-zoom i {
        font-size: 40px;
    }
    
    .lightbox-content {
        max-height: 85vh;
    }
    
    .lightbox-content img {
        max-height: 80vh;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
    
    .gallery-cta {
        padding: 50px 0;
    }
    
    .gallery-cta h2 {
        font-size: 24px;
    }
    
    .gallery-cta p {
        font-size: 14px;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
}

/* ========== MOBILE SMALL (360px - 480px) ========== */
@media (max-width: 480px) {
    .gallery-item {
        height: 260px;
    }
    
    .gallery-zoom i {
        font-size: 36px;
    }
}

/* ========== MOBILE EXTRA SMALL (< 360px) ========== */
@media (max-width: 360px) {
    .gallery-hero h1 {
        font-size: 24px;
    }
    
    .gallery-item {
        height: 240px;
    }
    
    .gallery-zoom i {
        font-size: 32px;
    }
}

/* ========== LANDSCAPE MODE FIXES ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .lightbox-content img {
        max-height: 75vh;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* ========== HIGH DPI SCREENS ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery-item img {
        image-rendering: -webkit-optimize-contrast;
    }
}