/* =================================================================
   PRD TEST - SEO UYUMLU MODERN BLOG VE BİLGİ MERKEZİ STYLES
   ================================================================= */

/* --- LAYOUT GRID --- */
.blog-page-layout {
    background-color: var(--surface-gray);
    /* Mobildeki negatif marginlerin yatay scroll (taşma) yaratmasını kesin önler */
    overflow-x: hidden;
}

.blog-hero {
    min-height: 550px !important;
    height: 60vh !important;
    padding-top: 160px !important;
    padding-bottom: 40px !important;
}

.blog-layout-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr; /* Sol içerik %68, Sağ Sidebar %32 */
    gap: 50px;
    align-items: start;
}

/* --- SIDEBAR WIDGETS --- */
.blog-sidebar {
    position: sticky;
    top: 130px; /* Scroll ederken ekranın üstüne yapışır */
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: #fff;
    padding: 35px 30px;
    border-radius: var(--radius-sleek);
    border: 1px solid var(--border-delicate);
    box-shadow: var(--shadow-card);
    transition: var(--transition-snappy);
    position: relative;
    overflow: hidden;
}

.widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--brand-navy), var(--brand-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    .widget:hover {
        box-shadow: var(--shadow-float);
        border-color: rgba(37, 99, 235, 0.2);
        transform: translateY(-3px);
    }
    .widget:hover::before {
        opacity: 1;
    }
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--brand-blue);
}

/* Search Widget */
.search-form {
    display: flex;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 85px 15px 20px;
    border: 1px solid var(--border-delicate);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-body);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-snappy);
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--brand-blue);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-snappy);
    z-index: 10; /* Input'un altında ezilmesin diye üste çıkarıldı */
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (hover: hover) {
    .search-btn:hover { background: var(--brand-navy); }
}

/* Search Clear Button (X İkonu) */
.clear-btn {
    position: absolute;
    right: 55px; /* Arama butonunun hemen soluna konumlanır */
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-snappy);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (hover: hover) {
    .clear-btn:hover { color: #ef4444; }
}

/* Categories Widget */
.widget-list { list-style: none; padding: 0; margin: 0; }
.widget-list li { margin-bottom: 12px; }
.widget-list li:last-child { margin-bottom: 0; }
.widget-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-body);
    font-weight: 500;
    border-radius: 8px;
    background: #f8fafc;
    text-decoration: none;
    transition: var(--transition-snappy);
    border: 1px solid transparent;
    min-height: 44px; /* A11y Tıklama Alanı Standardı */
}

.cat-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-left i {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition-snappy);
}

@media (hover: hover) {
    .widget-list a:hover {
        background: var(--brand-blue);
        color: #fff;
        padding-left: 20px;
        border-color: var(--brand-blue);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    }
    .widget-list a:hover .cat-left i {
        color: #fff;
    }
}
.widget-list a.active-filter .cat-left i { color: #fff; }

.widget-list a span { background: #fff; color: var(--brand-blue); padding: 2px 8px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }

/* Popular Posts Widget */
.popular-post-item { display: flex; gap: 15px; align-items: center; margin-bottom: 20px; }
.popular-post-item:last-child { margin-bottom: 0; }
.popular-post-item img { width: 70px; height: 70px; border-radius: 8px; object-fit: contain; padding: 5px; background: #f8fafc; border: 1px solid var(--border-delicate); }
.popular-post-info h4 { margin: 0 0 5px 0; font-size: 0.95rem; line-height: 1.4; }
.popular-post-info a { color: var(--brand-navy); text-decoration: none; font-weight: 700; transition: color 0.3s; }
@media (hover: hover) {
    .popular-post-info a:hover { color: var(--brand-blue); }
}
.popular-post-info .date { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* Tag Cloud Widget */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud a {
    padding: 8px 15px;
    background: #f1f5f9;
    color: var(--text-body);
    border: 1px solid var(--border-delicate);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-snappy);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    min-height: 44px; /* A11y Tıklama Alanı Standardı */
}

.tag-cloud a.active-tag { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25); transform: translateY(-2px); }
@media (hover: hover) {
    .tag-cloud a:hover { 
        background: var(--brand-blue); 
        color: #fff; 
        border-color: var(--brand-blue); 
        box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
        transform: translateY(-2px);
    }
}

/* --- NO RESULTS MESSAGE (BOŞ DURUM) --- */
.no-results-box {
    text-align: center;
    padding: 80px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    border: 1px solid var(--border-delicate);
    box-shadow: var(--shadow-card);
    margin-top: 30px;
    animation: fadeIn 0.5s ease forwards;
}

.no-results-icon {
    width: 80px; height: 80px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 25px;
    color: var(--brand-blue);
    font-size: 2.2rem;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.05);
    animation: bounceIcon 2s infinite ease-in-out;
}

.no-results-box h3 {
    color: var(--brand-navy);
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.no-results-box p {
    color: var(--text-body);
    font-size: 1.1rem;
    max-width: 450px;
    margin: 0 auto;
    line-height: 1.6;
}

.no-results-box .reset-btn {
    padding: 15px 30px;
    font-size: 1rem;
    margin-top: 30px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(37,99,235,0.4);
    width: auto;
    border-radius: 50px;
}

@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- PAGINATION (SAYFALAMA) --- */
.prd-pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 60px !important; margin-bottom: 30px; }
.page-link {
    width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    color: var(--text-heading);
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid var(--border-delicate);
    text-decoration: none;
    transition: var(--transition-snappy);
}
@media (hover: hover) {
    .page-link:hover:not(.disabled) { background: var(--surface-gray); color: var(--brand-blue); border-color: var(--brand-blue); }
}
.page-link.active { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3); pointer-events: none; }
.page-link.disabled { opacity: 0.5; cursor: not-allowed; }
.page-dots { font-weight: 700; color: var(--text-muted); letter-spacing: 2px; }

/* --- RESPONSIVE DÜZENLEME --- */
@media (max-width: 1024px) {
    .blog-layout-grid { 
        display: flex; 
        flex-direction: column; 
        gap: 20px; 
    }
    
    .blog-sidebar { display: contents; }
    
    /* 1. Yüzen (Floating) Arama Çubuğu */
    .search-widget { 
        order: 1; 
        margin-bottom: 5px; 
        padding: 10px 20px; /* Yanlardan hafif boşluk */
        background: transparent;
        box-shadow: none;
        border: none;
        display: flex;
        justify-content: center;
        width: 100%;
        position: relative;
        z-index: 99999 !important; /* iOS Safari Overlay Bug Çözümü */
        pointer-events: auto !important;
    }
    .search-widget::before { display: none; } /* Üstteki mavi çizgiyi gizle */
    .search-widget .widget-title { display: none; }
    .search-form {
        width: 100%;
        max-width: 550px; /* Tam ortalı ve şık durması için */
        margin: 0 auto;
        box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.1);
        border-radius: 50px; /* Tam oval (hap) şeklinde daha modern */
        overflow: hidden;
        border: 1px solid #fff;
        position: relative;
        z-index: 99999 !important;
        pointer-events: auto !important;
        transform: translateZ(0) !important; /* iOS/Safari Hit-Testing (Tıklama Kayması) Bug Fix */
    }
    .search-input {
        border: none;
        background: #fff;
        padding: 18px 110px 18px 30px; /* Metnin butonların arkasında kalmasını engeller */
        font-size: 1.05rem;
        width: 100%;
        border-radius: 50px;
        position: relative;
        z-index: 99999 !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto !important;
    }
    .search-btn {
        right: 8px;
        border-radius: 50%;
        width: 44px; height: 44px; /* Mükemmel Dokunmatik Hedef */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto !important;
        z-index: 100000 !important;
    }
    .clear-btn {
        right: 55px;
        width: 44px; height: 44px;
        pointer-events: auto !important;
        z-index: 100000 !important;
    }
    
    /* 2. Yapışkan (Sticky) Filtre Menüsü - MÜKEMMEL UX */
    .category-widget { 
        order: 2; 
        margin-bottom: 10px; 
        padding: 15px 0;
        background: rgba(248, 250, 252, 0.85); /* Sayfanın zemin rengi ama buzlu */
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 10px 20px -10px rgba(0,0,0,0.06);
        border: none;
        border-bottom: 1px solid var(--border-delicate);
        border-radius: 0;
        position: sticky;
        top: 70px; /* Mobil header yüksekliği */
        z-index: 90;
        /* Ekranın tam kenarından başlaması için negatif margin hilesi */
        margin-left: -20px; 
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    .category-widget::before { display: none; }
    .category-widget .widget-title { display: none; }
    
    .widget-list {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Mobilde yağ gibi kaydırma */
        gap: 12px;
        padding: 5px 20px 15px 20px; /* Gölge kesilmesini önlemek için alt boşluk artırıldı */
        scrollbar-width: none;
        overscroll-behavior-x: contain; /* Sayfanın yanlışlıkla geri/ileri gitmesini engeller */
    }
    .widget-list::-webkit-scrollbar { display: none; }
    .widget-list li { margin-bottom: 0; flex-shrink: 0; }
    
    .widget-list a {
        padding: 10px 22px !important;
        border-radius: 50px;
        background: #fff;
        border: 1px solid var(--border-delicate);
        white-space: nowrap;
        box-shadow: 0 4px 8px -2px rgba(0,0,0,0.05);
        font-size: 0.95rem;
        /* TIKLAMA HIZLANDIRMASI VE YANLIŞ SEÇİM KORUMASI */
        -webkit-tap-highlight-color: transparent;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .widget-list a.active-filter {
        box-shadow: 0 8px 15px -3px rgba(37, 99, 235, 0.35);
        transform: translateY(-2px);
    }

    /* Mobilde formun daha iyi çalışması ve tıklandığında zoom yapmaması için */
    .search-input {
        font-size: 16px !important; 
    }

    /* 3. Ana İçerik */
    .blog-main-content { order: 3; width: 100%; z-index: 1; }
    
    /* 4. Alt Bileşenler (Popüler, Etiketler, CTA) */
    .popular-widget { order: 4; margin-top: 30px; }
    
    .tag-widget { order: 5; background: transparent; box-shadow: none; border: none; padding: 0 0 30px 0; }
    .tag-widget::before { display: none; }
    .tag-widget .widget-title { font-size: 1.1rem; border: none; margin-bottom: 15px; }
    .tag-widget .widget-title::after { display: none; }
    
    .tag-cloud { 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; /* Mobilde pürüzsüz kaydırma */
        padding-bottom: 15px; 
        scrollbar-width: none; 
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
        overscroll-behavior-x: contain;
    }
    .tag-cloud::-webkit-scrollbar { display: none; }
    .tag-cloud a { 
        flex-shrink: 0; white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
        -webkit-tap-highlight-color: transparent;
        -webkit-user-select: none; user-select: none;
    }
    
    .cta-widget { order: 6; }
}

@media (max-width: 768px) {
    .blog-page-layout .content-section {
        padding-top: 40px !important; /* Herodan olan devasa uzaklığı kısalttık */
    }
    .blog-hero {
        min-height: 400px !important; /* Mobilde hero çok yer kaplamasın */
        height: auto !important;
        padding-top: 120px !important;
        padding-bottom: 50px !important;
    }
    .blog-hero h1 { font-size: 2.2rem !important; }
    .hero-glass-badge { font-size: 0.75rem; padding: 8px 18px; }
    .widget { padding: 25px 20px; }
    .widget-list a { padding: 8px 18px !important; font-size: 0.9rem; }
}