/* Lazy Loading Styles */

/* Placeholder style for images before they load */
img[data-src] {
    background: #f0f0f0;
    filter: blur(5px);
    transition: filter 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Style for elements with background images */
[data-bg] {
    background-color: #f0f0f0;
    transition: opacity 0.3s ease-in-out;
}

/* Animation when image loads */
img.lazy-loaded {
    filter: blur(0);
    animation: fadeIn 0.3s ease-in-out;
}

[data-bg].lazy-loaded {
    animation: fadeIn 0.3s ease-in-out;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0.8;
    }
    to {
        opacity: 1;
    }
}

/* Prevent layout shift */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Loading skeleton for better UX */
.skeleton-loader {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Image aspect ratio containers to prevent layout shift */
.img-container-16-9 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.img-container-4-3 {
    position: relative;
    padding-bottom: 75%; /* 4:3 */
    height: 0;
    overflow: hidden;
}

.img-container-1-1 {
    position: relative;
    padding-bottom: 100%; /* 1:1 */
    height: 0;
    overflow: hidden;
}

.img-container-16-9 img,
.img-container-4-3 img,
.img-container-1-1 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}