/**
 * Image Optimization Styles
 */

/* Common styling for lazy-loaded images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy:not([data-src]) {
    opacity: 1;
}

/* Add loading animation for placeholder */
.wegreen-featured-image img.lazy,
.wegreen-special-image img.lazy {
    background-color: #f1f1f1;
    background-image: linear-gradient(
        90deg,
        #f1f1f1 0px,
        #e0e0e0 40%,
        #f1f1f1 80%
    );
    background-size: 200% 100%;
    animation: image-placeholder 1.5s ease-in-out infinite;
}

/* Loading animation keyframes */
@keyframes image-placeholder {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Set aspect ratio for featured story images */
.wegreen-featured-stories .wegreen-featured-image {
    position: relative;
    overflow: hidden;
    padding-top: 75%; /* 4:3 aspect ratio */
    display: block;
}

.wegreen-featured-stories .wegreen-featured-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Add image compression visual hint in admin */
.wp-admin .attachment-info .file-size:after {
    content: " - Consider using image optimization plugins for better performance";
    color: #d63638;
    font-style: italic;
    display: block;
    margin-top: 5px;
} 