/* Blog Image Styles - James SEO Strategy Implementation */

/* Blog Image Containers */
.blog-image-container {
    margin: 2rem 0;
    text-align: center;
    padding: 1rem 0;
}

.blog-featured-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
    background-color: #f8f9fa;
}

.blog-featured-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.image-caption {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.75rem;
    font-style: italic;
    font-weight: 400;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Blog Images */
@media (max-width: 768px) {
    .blog-image-container {
        margin: 1.5rem 0;
        padding: 0.5rem;
    }
    
    .blog-featured-image {
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .image-caption {
        font-size: 0.85rem;
        margin-top: 0.5rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .blog-image-container {
        margin: 1rem 0;
    }
    
    .blog-featured-image {
        border-radius: 6px;
    }
}

/* Image Loading States */
.blog-featured-image[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-featured-image[loading="lazy"].loaded {
    opacity: 1;
}

/* WebP Support Detection */
.no-webp .blog-featured-image[src$=".webp"] {
    display: none;
}

/* Blog Post Image Grid (for multiple images) */
.blog-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.blog-image-grid .blog-image-container {
    margin: 0;
}

@media (max-width: 768px) {
    .blog-image-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* SEO-Optimized Figure Elements */
figure.blog-image-figure {
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
}

figure.blog-image-figure img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

figure.blog-image-figure figcaption {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.75rem;
    font-style: italic;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

/* Performance Optimization */
.blog-featured-image {
    will-change: transform;
}

/* Accessibility Improvements */
.blog-featured-image:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .blog-image-container {
        break-inside: avoid;
        margin: 1rem 0;
    }
    
    .blog-featured-image {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .image-caption {
        color: #333;
        font-style: normal;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .blog-featured-image {
        background-color: #2d3238;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }
    
    .image-caption {
        color: #adb5bd;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .blog-featured-image {
        border: 2px solid #000;
        box-shadow: none;
    }
    
    .image-caption {
        color: #000;
        font-weight: 500;
    }
}

/* Animation for Image Loading */
@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-featured-image.animate-in {
    animation: fadeInImage 0.6s ease-out forwards;
}
