/* Hero Section */
.hero-section { position: relative; width: 100%; height: 370px; overflow: hidden; }
.hero-section img.hero_image { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-section::after { content: ""; position: absolute; top:0; left:0; width:100%; height:100%; background-color: rgba(0,0,0,0.5); z-index:2; }
.hero-text { position: absolute; top:50%; left:50%; transform: translate(-50%, -50%); color:#fff; font-size:32px; font-weight:bold; text-align:center; z-index:3; }

/* Gallery Container */
.gallery-container {
    margin: 0 auto;
    padding: 30px 100px;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 251px;
    gap: 15px;
    grid-auto-flow: dense;
}

.masonry-item {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.masonry-item:hover img {
    transform: scale(1.03);
}

/* Large items (3rd and 7th) */
.masonry-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

#lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation: fadeIn 0.3s;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    user-select: none;
    transition: 0.3s;
}

.nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .gallery-container {
        padding: 30px 80px;
    }
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-container {
        padding: 30px 40px;
    }
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .masonry-item.large {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 600px) {
    .gallery-container {
        padding: 20px 15px;
    }
    .masonry-grid {
        grid-template-columns: 1fr;
    }
    
    .masonry-item.large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Loading styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    width: 100%;
    height: 100%;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.lazy-img {
    width: 100%;
    height: auto;
    display: block;
}

.prev:hover,
.next:hover {
    background: none !important;
    background-color: transparent !important;
}