/* Portfolio Gallery - Clean Grid Layout */

/* Gallery Container */
.gallery-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    padding: 30px !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #fafafa !important;
}

/* Gallery Items - ALL SAME BASE SIZE */
.gallery-item {
    position: relative !important;
    width: 100% !important;
    height: 220px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    display: block !important;
}

.gallery-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-5px) !important;
}

/* Item Size Variations */
.gallery-item.item-small {
    height: 220px !important;
}

.gallery-item.item-medium {
    height: 220px !important;
}

.gallery-item.item-large {
    grid-column: 1 / -1 !important;
    height: 300px !important;
}

/* Links */
.gallery-item a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Images - CRITICAL */
.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    transition: transform 0.3s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.gallery-item:hover img {
    transform: scale(1.1) !important;
}

/* Project Title */
.gallery-item .project-title {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 100%) !important;
    color: #e2e2e2 !important;
    padding: 15px 10px 10px !important;
    text-align: center !important;
    font-size: 13px !important;
    font-weight: bold !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 10 !important;
    margin: 0 !important;
    border: none !important;
}

.gallery-item:hover .project-title {
    transform: translateY(0) !important;
}

/* Fancybox Lightbox */
.fancybox-wrap {
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9) !important;
    border-radius: 4px !important;
}

.fancybox-inner {
    background: #000 !important;
}

.fancybox-image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}

.fancybox-title {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #e2e2e2 !important;
    padding: 10px !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
        padding: 20px !important;
    }
    
    .gallery-item {
        height: 200px !important;
    }
    
    .gallery-item.item-large {
        height: 250px !important;
    }
}

@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 15px !important;
    }
    
    .gallery-item {
        height: 180px !important;
    }
    
    .gallery-item.item-large {
        grid-column: 1 / -1 !important;
        height: 220px !important;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 10px !important;
    }
    
    .gallery-item {
        height: 200px !important;
    }
    
    .gallery-item.item-large {
        height: 200px !important;
    }
}

/* Section 4 Block Styling */
#fbsection4 .block {
    padding: 0 !important;
    background: #fafafa !important;
}

#fbsection4 header {
    color: #8d7e60 !important;
    margin: 0 !important;
    padding: 30px 30px 15px !important;
    border-bottom: 1px solid #ddd !important;
    font-size: 22px !important;
}

/* Ensure all images render */
img {
    max-width: 100% !important;
    height: auto !important;
}

