/* ==========================================
   IMAGE OPTIMIZATION STYLES
   WebP Support with JPG Fallback
   ========================================== */

/* Lazy Loading Placeholder */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[data-src].loaded {
    opacity: 1;
}

/* Progressive Image Loading */
.progressive-image {
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
}

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

/* Blur effect while loading */
.progressive-image img.blur {
    filter: blur(10px);
    transition: filter 0.3s ease-in;
}

.progressive-image img.loaded {
    filter: blur(0);
}

/* Picture element styling */
picture {
    display: block;
}

picture img {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive images */
.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Image loading spinner */
.image-loading {
    position: relative;
    min-height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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