/**
 * Image SEO Styles
 * Responsive ve SEO-optimized görsel stilleri
 *
 * @package HaberPro
 */

/* Tüm görseller için responsive base styles */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Sidebar görselleri için genel kuralları override et */
.widget-other-news-img {
    height: 100% !important;
    max-width: none !important;
}

/* Slider görselleri için özel kurallar - Tüm genel kuralları override et */
.new3slide img {
    width: 100% !important;
    height: auto !important;
    min-width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    object-fit: cover !important;
    object-position: center !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Web Stories görselleri için özel kurallar - Tüm genel kuralları override et */
.web-story-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    object-fit: cover !important;
    object-position: center !important;
    position: absolute !important;
    z-index: 1 !important;
}

/* Sidebar görselleri için özel kurallar - Tüm genel kuralları override et */
.widget-other-news-img {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    object-fit: cover !important;
    object-position: center !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Aspect ratio korunması için container */
.image-seo-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.image-seo-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Common aspect ratios */
.image-seo-wrapper[data-aspect="16:9"] {
    padding-bottom: 56.25%;
}

.image-seo-wrapper[data-aspect="4:3"] {
    padding-bottom: 75%;
}

.image-seo-wrapper[data-aspect="1:1"] {
    padding-bottom: 100%;
}

.image-seo-wrapper[data-aspect="3:2"] {
    padding-bottom: 66.67%;
}

/* Viewport-based responsive images */
@media (max-width: 768px) {
    img {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Image loading states - Sadece genel görseller için opacity 0 (özel görseller override edecek) */
img[loading="lazy"]:not(.widget-other-news-img):not(.new3slide img):not(.web-story-thumbnail img):not(.post-card-thumbnail img):not(.post-thumbnail-img):not(.category-news-section img):not(.news-item img):not(.img-wrapper img):not(.haberpro-popular-post-image img):not(.haberpro-most-read-image img):not(.haberpro-trending-post-image img):not(.haberpro-category-post-image img):not(.haberpro-recent-post-image img):not(.haberpro-popular-post-image img):not(.haberpro-most-read-image img) {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Sidebar görselleri için lazy loading override */
.widget-other-news-img[loading="lazy"] {
    opacity: 1 !important;
}

/* Widget görselleri için lazy loading override - Tüm widget görselleri */
.haberpro-popular-post-image img[loading="lazy"],
.haberpro-most-read-image img[loading="lazy"],
.haberpro-trending-post-image img[loading="lazy"],
.haberpro-category-post-image img[loading="lazy"],
.haberpro-recent-post-image img[loading="lazy"],
.haberpro-popular-post-image img,
.haberpro-most-read-image img,
.haberpro-trending-post-image img,
.haberpro-category-post-image img,
.haberpro-recent-post-image img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Slider görselleri için lazy loading override */
.new3slide img[loading="lazy"],
.new3slide img[loading="eager"] {
    opacity: 1 !important;
}

/* Web Stories görselleri için lazy loading override */
.web-story-thumbnail img[loading="lazy"] {
    opacity: 1 !important;
}

/* Kategori sayfaları ve post card görselleri için lazy loading override */
.post-card-thumbnail img[loading="lazy"],
.post-thumbnail-img[loading="lazy"],
.posts-grid img[loading="lazy"],
.category-news-section img[loading="lazy"],
.news-item img[loading="lazy"],
.img-wrapper img[loading="lazy"] {
    opacity: 1 !important;
}

/* Widget görselleri için genel override - Tüm widget container'ları */
.widget .haberpro-popular-post-image img,
.widget .haberpro-most-read-image img,
.widget .haberpro-trending-post-image img,
.widget .haberpro-category-post-image img,
.widget .haberpro-recent-post-image img,
.widget .haberpro-popular-post-image,
.widget .haberpro-most-read-image,
.widget .haberpro-trending-post-image,
.widget .haberpro-category-post-image,
.widget .haberpro-recent-post-image {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Image dimensions için fallback */
img[width][height]:not([style*="width"]):not([style*="height"]) {
    max-width: 100%;
    height: auto;
}

/* SEO-friendly image attributes */
img[alt=""],
img:not([alt]) {
    border: 2px dashed #ff0000;
}

/* Print styles için görseller */
@media print {
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }
}

