/*
Theme Name: Tema
Author: Zahit
Description: Modern, hızlı ve SEO uyumlu WordPress tema
Version: 2.1
Text Domain: tema
*/

/* =====================================================
   1. TEMEL AYARLAR & SIFIRLAMALAR
===================================================== */
:root {
    --color-primary: #CD3333;
    --color-primary-dark: #A82828;
    --color-bg: #FFFBF9;
    --color-white: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #E5E5E5;
    --color-bg-light: #F9F9F9;
    
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --container-width: 1200px;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   2. HEADER (UST KISIM)
===================================================== */
.site-header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.site-branding .site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.site-branding .site-description {
    font-size: 13px;
    color: var(--color-text-light);
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

/* Mobil cihazlarda ana menü kutusunu gizle */
.main-navigation {
    display: none;
}

.main-navigation a {
    font-weight: 500;
    color: var(--color-text);
    font-size: 15px;
}

.main-navigation a:hover {
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle, .menu-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--color-text);
}

.header-search {
    background-color: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 20px 0;
    display: none; /* JS ile toggle edilecek */
}

.header-search.active {
    display: block;
}

/* Arama Formu */
.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-field {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 16px;
    outline: none;
}

.search-field:focus {
    border-color: var(--color-primary);
}

.search-form button {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 0 25px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600;
}

/* Masaüstü Arama Çubuğu */
.header-search-desktop {
    display: none; /* Varsayılan olarak gizle */
}

@media (min-width: 769px) {
    /* Sadece masaüstünde göster */
    .header-search-desktop {
        display: flex;
        align-items: center;
    }

    /* Masaüstündeki arama formunu yatay ve kompakt yap */
    .header-search-desktop .search-form {
        max-width: 280px; /* Genişliği istediğiniz gibi ayarlayabilirsiniz */
        margin: 0;
    }

    .header-search-desktop .search-field {
        padding: 8px 12px;
        font-size: 14px;
    }

    .header-search-desktop .search-form button {
        padding: 0 15px;
        font-size: 14px;
    }
}

/* =====================================================
   3. HERO BÖLÜMÜ
===================================================== */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8B1A1A 100%);
    color: var(--color-white);
    padding: 30px 0;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    flex: 1;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-btn {
    background-color: var(--color-white);
    color: var(--color-primary);
    padding: 14px 30px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 16px;
    display: inline-block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-self: center; /* Butonu sağdaki kutuda dikey olarak ortalar */
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: var(--color-primary-dark);
}

.hero-box {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hero-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: var(--radius);
}

.hero-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.hero-card span {
    font-size: 14px;
    opacity: 0.8;
}

/* Single Post Hero */
.single-hero {
    padding: 40px 0;
}

/* Kategori bilgisini yan satıra al ve büyük harfi kapat */
.single-hero .post-meta-top {
    display: inline;
    margin-bottom: 0;
    text-transform: none; /* Büyük harfi kaldırır */
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.single-hero .post-meta-top a {
    color: #FFFFFF !important;
}

.single-hero .post-meta-top a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.single-hero .post-meta-bottom a {
    color: #FFFFFF !important;
}

.single-hero .post-meta-bottom a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.single-hero .entry-title {
    font-size: 36px;
    margin-bottom: 15px;
}

/* Tüm meta verilerini (Kategori, Yazar, Tarih) aynı satırda toplar */
.post-meta-bottom {
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.meta-sep {
    opacity: 0.5;
}

/* =====================================================
   4. ANA İÇERİK & GRID LAYOUT
===================================================== */
.site-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 60px;
}

.content-area {
    min-width: 0; /* Grid taşma hatası önleme */
}

/* =====================================================
   5. YAZI KARTLARI (POST GRID)
===================================================== */
.section-title {
    margin-bottom: 25px;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
}

.section-title h2 {
    font-size: 24px;
    color: var(--color-text);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.post-card {
    background-color: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.post-thumb {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumb img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta {
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.post-title {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--color-text);
}

.post-title a:hover {
    color: var(--color-primary);
}

.post-excerpt {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 15px;
    flex: 1;
}

.read-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    align-self: flex-start;
}

/* =====================================================
   6. SAYFALAMA (PAGINATION)
===================================================== */
.pagination-wrap {
    margin-top: 40px;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.nav-links a, .nav-links span {
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.nav-links span.current {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* =====================================================
   7. SIDEBAR
===================================================== */
.sidebar-area {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.widget {
    background-color: var(--color-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    padding-left: 15px; /* Yazının soluna çizgi için boşluk açar */
    border-bottom: 2px solid var(--color-bg);
    color: var(--color-text);
    position: relative;
}

/* Sol tarana kırmızı dikdörtgen çizgi ekler */
.widget-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px; /* Yazıyla aynı hizada olmasını sağlar */
    width: 10px;
    height: 20px;
    background-color: var(--color-primary);
    border-radius: 3px; /* Hafif yuvarlak köşe verir */
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-bg);
    font-size: 14px;
}

.widget ul li:last-child {
    border-bottom: none;
}

/* =====================================================
   8. TEKİL YAZI (SINGLE POST)
===================================================== */
.single-post {
    background-color: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.single-post .featured-image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 25px;
}

/* İçindekiler (TOC) */
/* =========================================
   İÇİNDEKİLER TABLOSU (TOC) STİLLERİ
   ========================================= */

/* Ana Kutu */
.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 4px solid #0073aa; /* Tema renginiz buradan değiştirilebilir */
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 30px;
}

/* Başlık (📑 İçindekiler) */
.toc-title {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
}

/* Liste Kapsayıcısı */
.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    counter-reset: toc-h2-counter; /* Sadece H2'leri sayacak sayaç */
}

/* Her Bir Liste Elemanı */
.toc-item {
    margin-bottom: 8px;
}
.toc-item:last-child {
    margin-bottom: 0;
}

/* Link Stilleri */
.toc-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: block;
    transition: color 0.2s ease;
}
.toc-item a:hover {
    color: #0073aa;
}


/* -----------------------------------------
   H2 (Ana Başlık) Stili ve Numaralandırma
   ----------------------------------------- */
.toc-item:not(.toc-h3):not(.toc-h4) {
    counter-increment: toc-h2-counter; /* Sadece H2'lere numara ver */
}

.toc-item:not(.toc-h3):not(.toc-h4) > a::before {
    content: counter(toc-h2-counter) ". ";
    font-weight: 700;
    color: #0073aa;
    margin-right: 5px;
}


/* -----------------------------------------
   H3 (Alt Başlık) Stili
   ----------------------------------------- */
.toc-h3 {
    margin-left: 25px;
    margin-top: 6px;
    padding-left: 10px;
    border-left: 2px solid #dee2e6; /* Sol tarafa ince çizgi */
}

.toc-h3 a {
    font-weight: 400;
    font-size: 0.95em;
}


/* -----------------------------------------
   H4 (Alt Alt Başlık) Stili
   ----------------------------------------- */
.toc-h4 {
    margin-left: 55px; /* H3'ten daha fazla içerde */
    margin-top: 4px;
    list-style-type: '– '; /* Başına tire işareti */
    padding-left: 5px;
}

.toc-h4 a {
    font-weight: 400;
    font-size: 0.9em;
    color: #555; /* Biraz daha soluk renk */
}

/* Yazı İçeriği */
.entry-content {
    line-height: 1.8;
    font-size: 16px;
	padding-left: 10px;
}

.entry-content h2, .entry-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--color-text);
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content img {
    border-radius: var(--radius);
    margin: 20px 0;
}

/* Etiketler */
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tags-label {
    font-weight: 700;
    font-size: 14px;
}

.post-tags a {
    background-color: var(--color-bg);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 13px;
    border: 1px solid var(--color-border);
    color: var(--color-text-light);
}

.post-tags a:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* Benzer Yazılar */
.related-posts {
    margin-top: 40px;
}

.related-title {
    font-size: 20px;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.related-card {
    background-color: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}

.related-card:hover {
    transform: translateY(-3px);
}

.related-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-no-thumb {
    aspect-ratio: 16/9;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.related-content {
    padding: 12px;
}

.related-content h4 {
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text);
}

/* Post Navigasyonu */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
}

/* =====================================================
   9. YORUMLAR
===================================================== */
.comments-area {
    margin-top: 40px;
}

.comments-title {
    font-size: 20px;
    margin-bottom: 20px;
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 20px;
    background-color: var(--color-bg);
    border-radius: var(--radius);
    margin-bottom: 15px;
}

.comment-author img {
    border-radius: 50%;
    margin-right: 10px;
}

.comment-form {
    margin-top: 30px;
}

.comment-form p {
    margin-bottom: 15px;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 14px;
}

.submit-button {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 12px 30px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-button:hover {
    background-color: var(--color-primary-dark);
}

/* =====================================================
   10. SAYFA ŞABLONU (PAGE)
===================================================== */
.page-container {
    padding-top: 40px;
    padding-bottom: 60px;
    max-width: 900px;
    margin: 0 auto;
}

.page-content {
    background-color: var(--color-white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.entry-header .entry-title {
    font-size: 32px;
    margin-bottom: 20px;
}

/* =====================================================
   11. FOOTER
===================================================== */
.site-footer {
    background-color: #222;
    color: #ccc;
    font-size: 14px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    padding: 60px 0;
}

.footer-title {
    color: var(--color-white);
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-text {
    margin-top: 15px;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-white);
}

.footer-social {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.footer-social a {
    color: #ccc;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: var(--color-white);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding: 20px 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =====================================================
   12. ARAMA SONUÇLARI & 404
===================================================== */
.search-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.search-item .entry-title {
    font-size: 20px;
    margin-bottom: 5px;
}

.search-item .entry-meta {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 10px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    margin-bottom: 10px;
}

/* =====================================================
   13. MOBİL UYUMLULUK (RESPONSIVE)
===================================================== */
@media (max-width: 1024px) {
    .site-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar-area {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-content p {
        margin: 0 auto 30px auto;
    }
    
    .hero-box {
        flex: 0 0 auto;
        width: 100%;
        flex-direction: row;
        justify-content: center;		
        overflow-x: auto;
    }
    
    .hero-card {
        min-width: 200px;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* MOBİL MENÜ AÇILIR PANELİ */
    .main-navigation {
        display: block; /* display: none yerine block yapıyoruz ki JS üzerinden oynatabilelim */
        position: fixed;
        top: 70px; /* Header yüksekliği kadar aşağıdan başlasın */
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--color-white);
        padding: 30px 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%); /* Varsayılan olarak ekranın sol dışına gizle */
        transition: transform 0.3s ease-in-out;
        overflow-y: auto; /* Uzun menülerde aşağı kaydırma olsun */
        z-index: 999;
    }

    /* JS Butona Basınca .active Sınıfı Ekler, Menüyü Ekrana Kaydırır */
    .main-navigation.active {
        transform: translateX(0);
    }

    /* Mobilde menü linkleri alt alta dizilsin */
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation ul li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .main-navigation ul li a {
        display: block;
        padding: 15px 0;
        font-size: 18px;
    }

    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .single-hero .entry-title {
        font-size: 26px;
    }
    
    .post-meta-bottom {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* WordPress Resim Altyazıları (Caption) Mobil Taşma Düzeltmesi */
.wp-caption {
    max-width: 100% !important;
}

.wp-caption img {
    max-width: 100%;
    height: auto;
}