/* Portfolio Image Display Fix */

.folioThumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
    display: block !important;
    background: #f8f9fa !important;
}

/* Fallback for broken images */
.folioThumb img[src=""],
.folioThumb img[src*="undefined"],
.folioThumb img:not([src]) {
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #e9ecef;
}

/* Image loading state */
.folioThumb {
    background: #f8f9fa;
    position: relative;
}

.folioThumb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #4CAF50;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: portfolioSpin 1s linear infinite;
    opacity: 0;
    z-index: 1;
}

.folioThumb img[src=""]::after,
.folioThumb img[loading]::after {
    opacity: 1;
}

@keyframes portfolioSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Force image dimensions */
.singleFolio .folioThumb {
    height: 250px !important;
    overflow: hidden !important;
    background-color: #f8f9fa !important;
}

/* Debug: Show image sources in development */
.folioThumb img:not([src]),
.folioThumb img[src=""] {
    position: relative;
}

.folioThumb img:not([src])::after,
.folioThumb img[src=""]::after {
    content: "Image not found";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
    text-align: center;
    width: 100%;
}

/* Ensure images are visible on mobile */
@media (max-width: 767px) {
    .folioThumb {
        height: 200px !important;
    }
    
    .folioThumb img {
        min-height: 200px !important;
    }
}
