/* Ortak Archive Sayfaları CSS - Category, Search, Tag */

/* Mobil Viewport ve Overflow Düzeltmeleri */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

#primary {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.site-main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Container Düzenlemeleri */
.archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Ortak Başlık Stilleri */
.archive-header {
    margin-bottom: 2rem;
    padding: 2rem;
    color: white;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Kategori Sayfası */
.archive-header.category-header {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

/* Arama Sayfası */
.archive-header.search-header {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.archive-header.search-header.no-results {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
}

/* Tag Sayfası */
.archive-header.tag-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.archive-description {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.archive-description p {
    margin: 0;
}

/* Arama sonuç sayısı */
.search-results-count {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Test Kartları Grid Sistemi */
.archive-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.archive-post-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.exam-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.exam-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.exam-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.exam-card-link:hover .exam-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.exam-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.exam-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Görsel optimizasyonu için */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    /* Gri alan sorunu düzeltildi - placeholder kaldırıldı */
    background: transparent;
}

/* WebP desteği için modern tarayıcılar */
.exam-image img[src$=".webp"] {
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* Lazy loading optimizasyonu - gri alan sorunu düzeltildi */
.exam-image img.lazy {
    opacity: 1; /* Gri alan yerine hemen görünür */
    filter: none; /* Blur efekti kaldırıldı */
    transition: transform 0.3s ease; /* Sadece hover animasyonu */
}

.exam-image img.lazy.loaded {
    opacity: 1;
    filter: none;
}

/* Responsive images için srcset optimizasyonu */
.exam-image img {
    /* Modern tarayıcılar için optimize edilmiş görsel boyutları */
    object-fit: cover;
    object-position: center;
}

/* Görsel yükleme performansı optimizasyonu */
.exam-image img[loading="lazy"] {
    content-visibility: visible; /* Gri alan sorunu için visible */
    contain-intrinsic-size: auto; /* Dinamik boyut */
}

/* Eager loading için kritik görseller */
.exam-image img[loading="eager"] {
    content-visibility: visible;
    contain-intrinsic-size: auto;
}

.exam-card-link:hover .exam-image img {
    transform: scale(1.05);
}

.exam-category-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(43, 170, 225, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exam-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.exam-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3644;
    margin: 0;
    line-height: 1.4;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sayfalama Stilleri */
.posts-navigation {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-previous a,
.nav-next a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2baae1 0%, #1976d2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(43, 170, 225, 0.3);
}

.nav-previous a:hover,
.nav-next a:hover {
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 170, 225, 0.4);
}

/* Responsive Tasarım - WordPress Standartları */
@media (max-width: 1024px) {
    .archive-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .archive-container {
        padding: 0 8px;
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        overflow-x: hidden;
        margin: 0 auto;
    }
    
    .archive-header {
        padding: 1.5rem 0.5rem;
        margin-bottom: 1.5rem;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .archive-title {
        font-size: 1.8rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .archive-description {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Mobilde tek sütun */
    .archive-posts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .archive-post-item {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .exam-card {
        max-width: 100%;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .exam-image {
        height: 180px;
        width: 100%;
        max-width: 100%;
    }
    
    .exam-image img {
        width: 100%;
        max-width: 100%;
        height: 100%;
        object-fit: cover;
        /* Mobil için görsel optimizasyonu */
        image-rendering: -webkit-optimize-contrast;
        contain-intrinsic-size: 100vw 180px;
    }
    
    .exam-content {
        padding: 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .exam-title {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .nav-previous a,
    .nav-next a {
        width: 100%;
        max-width: none;
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        min-height: 44px;
        line-height: 1.2;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .archive-container {
        padding: 0 4px;
        width: calc(100vw - 8px);
        max-width: calc(100vw - 8px);
        overflow-x: hidden;
        margin: 0 auto;
    }
    
    .archive-header {
        padding: 1rem 0.25rem;
        margin-bottom: 1rem;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .archive-title {
        font-size: 1.3rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .archive-description {
        font-size: 0.85rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .archive-posts-grid {
        padding: 0;
        gap: 8px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .archive-post-item {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .exam-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    .exam-image {
        height: 140px;
        width: 100%;
        max-width: 100%;
    }
    
    .exam-image img {
        width: 100%;
        max-width: 100%;
        height: 100%;
        object-fit: cover;
        /* 480px için görsel optimizasyonu */
        image-rendering: -webkit-optimize-contrast;
        contain-intrinsic-size: 100vw 140px;
    }
    
    .exam-content {
        padding: 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .exam-title {
        font-size: 0.9rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .exam-category-overlay {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    
    .nav-previous a,
    .nav-next a {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 15px;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
        white-space: nowrap;
    }
}

/* Çok küçük ekranlar için */
@media (max-width: 360px) {
    .archive-container {
        padding: 0 2px;
        width: calc(100vw - 4px);
        max-width: calc(100vw - 4px);
        overflow-x: hidden;
        margin: 0 auto;
    }
    
    .archive-header {
        padding: 0.75rem 0.125rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .archive-title {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.2;
    }
    
    .archive-posts-grid {
        padding: 0;
        gap: 6px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .archive-post-item {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .exam-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    .exam-image {
        height: 120px;
        width: 100%;
        max-width: 100%;
    }
    
    .exam-image img {
        width: 100%;
        max-width: 100%;
        height: 100%;
        object-fit: cover;
        /* 360px için görsel optimizasyonu */
        image-rendering: -webkit-optimize-contrast;
        contain-intrinsic-size: 100vw 120px;
    }
    
    .exam-content {
        padding: 0.4rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .exam-title {
        font-size: 0.85rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.2;
    }
    
    .nav-previous a,
    .nav-next a {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1.1;
        white-space: nowrap;
    }
}