/* Custom Blog Image Styles for Bioreka */

/* Homepage Blog Cards */
.blog-card .box-img img,
.blog-card .global-img img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.blog-card:hover .box-img img {
    transform: scale(1.05);
}

/* Blog Grid Images */
.th-blog .blog-img img,
.single-grid .blog-img img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
}

/* Blog Detail Page Featured Image */
.th-blog.single .blog-img img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Recent Posts Images */
.recent-post .media-img img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

/* Sidebar Widget Images */
.widget .recent-post-img img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blog-card .box-img img,
    .blog-card .global-img img,
    .th-blog .blog-img img,
    .single-grid .blog-img img {
        height: 220px;
    }
    
    .th-blog.single .blog-img img {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .blog-card .box-img img,
    .blog-card .global-img img,
    .th-blog .blog-img img,
    .single-grid .blog-img img {
        height: 200px;
    }
    
    .th-blog.single .blog-img img {
        height: 250px;
    }
    
    .recent-post .media-img img {
        width: 60px;
        height: 60px;
    }
}

/* Loading state for images */
.blog-img img:not([src]),
.box-img img:not([src]) {
    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 hover effects */
.blog-img:hover img,
.box-img:hover img {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Image quality optimization */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* Fix for global-img class */
.global-img {
    overflow: hidden;
    border-radius: 8px;
}

.global-img img {
    display: block;
    width: 100%;
    transition: transform 0.3s ease;
}
