/* ========================================
   IMAGE GALLERY CSS
   ======================================== */

.image-gallery {
    padding: 4rem 0;
    background-color: #f8f9fa;
    position: relative;
}

.gallery-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin-bottom: 1rem;
}

.gallery-subtitle {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #64748b;
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ========================================
   MASONRY GRID LAYOUT
   ======================================== */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 1rem 0;
    grid-auto-rows: 200px;
}

/* ========================================
   GALLERY ITEM STYLING
   ======================================== */
.gallery-item {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.6s ease-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    display: block;
    opacity: 0;
    transform: scale(0.8) translateY(30px);
}

.gallery-item.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ========================================
   MASONRY EFFECT - ROW SPANS
   ======================================== */
.gallery-item:nth-child(3n+1) {
    grid-row: span 2;
}

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

.gallery-item:nth-child(3n+3) {
    grid-row: span 3;
}

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

.gallery-item:nth-child(6n+2) {
    grid-row: span 2;
}

.gallery-item:nth-child(6n+3) {
    grid-row: span 3;
}

.gallery-item:nth-child(6n+4) {
    grid-row: span 2;
}

.gallery-item:nth-child(6n+5) {
    grid-row: span 1;
}

.gallery-item:nth-child(6n+6) {
    grid-row: span 2;
}

/* ========================================
   HOVER EFFECTS
   ======================================== */
.gallery-item:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: scale(1.02) translateY(0);
}

.gallery-item.visible:hover {
    transform: scale(1.02) translateY(0);
}

/* ========================================
   IMAGE STYLING
   ======================================== */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */
@media (max-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

@media (max-width: 768px) {
    .image-gallery {
        padding: 2rem 0;
    }

    .gallery-title {
        font-size: 2rem;
    }

    .gallery-subtitle {
        font-size: 1rem;
    }

    .masonry-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        grid-auto-rows: 250px;
    }

    .gallery-item {
        grid-row: span 1;
        margin-bottom: 20px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        padding: 1rem 0;
    }

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

/* Section Divider */
.image-gallery::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}