/* ===== Image Gallery Section ===== */
.image-gallery-section {
    padding: 60px 0;
    background: #f5f5f5;
}

.image-gallery-section .section-header {
    margin-bottom: 50px;
}

.image-gallery-section .section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.image-gallery-section .section-header p {
    font-size: 1rem;
    color: #999;
    margin: 0;
}

/* ===== Image Gallery Grid (Masonry Layout) ===== */
.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    grid-auto-rows: 200px;
    margin: 0 -12px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #e8e8e8;
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
}

.gallery-item:nth-child(1) { 
    animation-delay: 0.1s;
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item:nth-child(2) { 
    animation-delay: 0.2s;
    grid-column: span 1;
    grid-row: span 2;
}

.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }
.gallery-item:nth-child(10) { animation-delay: 1s; }
.gallery-item:nth-child(11) { animation-delay: 1.1s; }
.gallery-item:nth-child(12) { animation-delay: 1.2s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Gallery Image Wrapper ===== */
.gallery-img-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

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

/* ===== Gallery Overlay ===== */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* ===== Gallery Link Button ===== */
.gallery-link {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gallery-link:hover {
    background: #3498db;
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

/* ===== View All Button ===== */
.image-gallery-section .btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.image-gallery-section .btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    color: #fff;
}

.image-gallery-section .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

/* ===== Responsive Design ===== */
/* Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    .image-gallery-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
        grid-auto-rows: 200px;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item:nth-child(2) {
        grid-column: span 1;
        grid-row: span 2;
    }
}

/* Desktop (1024px to 1399px) */
@media (max-width: 1399px) {
    .image-gallery-section {
        padding: 50px 0;
    }

    .image-gallery-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
        grid-auto-rows: 180px;
    }

    .image-gallery-section .section-header h2 {
        font-size: 2.2rem;
    }

    .gallery-link {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* Tablet (768px to 1023px) */
@media (max-width: 1023px) {
    .image-gallery-section {
        padding: 45px 0;
    }

    .image-gallery-section .section-header {
        margin-bottom: 40px;
    }

    .image-gallery-section .section-header h2 {
        font-size: 2rem;
    }

    .image-gallery-section .section-header p {
        font-size: 0.95rem;
    }

    .image-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        grid-auto-rows: 160px;
        margin: 0 -8px;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 1;
    }

    .gallery-item:nth-child(2) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-link {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
}

/* Mobile Tablet (600px to 767px) */
@media (max-width: 767px) {
    .image-gallery-section {
        padding: 40px 0;
    }

    .image-gallery-section .section-header {
        margin-bottom: 30px;
    }

    .image-gallery-section .section-header h2 {
        font-size: 1.8rem;
    }

    .image-gallery-section .section-header p {
        font-size: 0.9rem;
    }

    .image-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        grid-auto-rows: 140px;
        margin: 0 -6px;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-item:nth-child(2) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-link {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .image-gallery-section .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Mobile (below 600px) */
@media (max-width: 599px) {
    .image-gallery-section {
        padding: 30px 0;
    }

    .image-gallery-section .section-header {
        margin-bottom: 25px;
    }

    .image-gallery-section .section-header h2 {
        font-size: 1.5rem;
    }

    .image-gallery-section .section-header p {
        font-size: 0.85rem;
    }

    .image-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        grid-auto-rows: 120px;
        margin: 0 -4px;
    }

    .gallery-item {
        border-radius: 8px;
    }

    .gallery-link {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }

    .image-gallery-section .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Extra Small (below 480px) */
@media (max-width: 479px) {
    .image-gallery-section {
        padding: 25px 0;
    }

    .image-gallery-section .section-header h2 {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .image-gallery-section .section-header p {
        font-size: 0.8rem;
    }

    .image-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        grid-auto-rows: 100px;
        margin: 0;
    }

    .gallery-item {
        border-radius: 6px;
    }

    .gallery-link {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .image-gallery-section .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ===== Lightbox Styling ===== */
.lightbox {
    outline: none;
}

.lb-data {
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
}

.lb-details {
    padding: 10px 20px !important;
}

.lb-caption {
    color: #ccc !important;
    font-size: 0.9rem !important;
}

.lb-close {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
}

.lb-close:hover {
    background-color: rgba(255, 0, 0, 0.5) !important;
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
    background-color: rgba(52, 152, 219, 0.8) !important;
}
