/*
Theme Name: Proİmalat Özel Tema
Description: Ana site ile aynı görünüme sahip WordPress teması.
Version: 1.0
Author: Proİmalat
*/
/* WordPress admin bar boşluğunu ve üst boşlukları tamamen kilitleme */
html {
    margin-top: 0 !important;
}

body {
    margin: 0 !important;
    padding: 0 !important;
}

#wpadminbar {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
}
/* ==========================================================================
   1. DEĞİŞKENLER VE SIFIRLAMA (VARIABLES & RESETS)
   ========================================================================== */
:root {
    --primary: #d92323;
    --primary-hover: #b91c1c;
    --dark: #0f172a;
    --nav-bg: #020617;
    --light: #f8fafc;
    --border: #e2e8f0;
    --gray: #64748b;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
}

body { 
    background: var(--light); 
    color: var(--dark); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    transform: none !important;
    perspective: none !important;
}

/* WordPress Admin Bar Gizleme & Hizalama Sıfırlamaları */
#wpadminbar { display: none !important; }
.alignleft { float: left; margin: 0 15px 15px 0; }
.alignright { float: right; margin: 0 0 15px 15px; }
.aligncenter { display: block; margin: 15px auto; }

/* ==========================================================================
   2. HEADER & TOP BAR (EN ÜST KATMAN GARANTİSİ)
   ========================================================================== */
header { 
    background: #fff; 
    position: sticky; 
    top: 0; 
    z-index: 99999 !important; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: visible !important;
    transform: none !important;
}

.top-bar { 
    padding: 12px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1300px; 
    margin: 0 auto; 
}

.logo { 
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none; 
    line-height: 1.1;
}

.logo-img {
    max-height: 60px;
    width: auto;     
    object-fit: contain;
    display: block;
}

.logo small {
    display: block; 
    font-size: 0.65rem; 
    font-weight: 500; 
    color: var(--gray); 
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* ==========================================================================
   3. BUTON STİLLERİ
   ========================================================================== */
.nav-btns { 
    display: flex; 
    gap: 12px; 
}

.btn { 
    padding: 9px 18px; 
    border-radius: 6px; 
    text-decoration: none; 
    font-size: 0.875rem; 
    font-weight: 600; 
    border: none; 
    cursor: pointer; 
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline { 
    border: 1px solid var(--border); 
    color: var(--dark); 
    background: transparent; 
}

.btn-outline:hover {
    background: var(--light);
    border-color: #cbd5e1;
}

.btn-primary { 
    background: var(--primary); 
    color: #fff; 
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline-sm { 
    border: 1px solid var(--border); 
    color: var(--dark); 
    padding: 6px 14px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 0.8rem; 
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline-sm:hover {
    background: var(--light);
    border-color: var(--gray);
}

/* ==========================================================================
   4. ANA NAVİGASYON & DROPDOWN (Z-INDEX KESİN ÇÖZÜM)
   ========================================================================== */
nav.main-nav { 
    background: var(--nav-bg); 
    padding: 0 5%; 
    position: relative;
    z-index: 99999 !important;
    overflow: visible !important;
}

.nav-list { 
    display: flex; 
    justify-content: center; 
    align-items: center;
    list-style: none; 
    max-width: 1300px; 
    margin: 0 auto; 
    padding: 0;
    overflow: visible !important;
}

.nav-list li.dropdown,
.nav-list li.menu-item-has-children {
    position: relative;
}

.nav-list li a,
.nav-list li.dropdown > a,
.nav-list li.menu-item-has-children > a,
nav.main-nav a { 
    display: block; 
    padding: 16px 22px; 
    color: #94a3b8 !important; 
    text-decoration: none !important; 
    font-size: 0.875rem; 
    font-weight: 600; 
    white-space: nowrap; 
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-list li.dropdown:hover > a,
.nav-list li.menu-item-has-children:hover > a,
.nav-list li a:hover { 
    color: #ffffff !important; 
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: var(--primary);
}

.dropdown-menu,
.nav-list ul.sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 240px;
    background: #090d16;
    border: 1px solid #1e293b;
    border-top: 2px solid var(--primary);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 2147483647 !important; /* Tarayıcının izin verdiği maksimum üst katman */
}

.nav-list li.dropdown:hover .dropdown-menu,
.nav-list li.menu-item-has-children:hover ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a,
.nav-list ul.sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: #cbd5e1 !important;
    text-align: left;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.dropdown-menu li a:hover,
.nav-list ul.sub-menu li a:hover {
    color: #ffffff !important;
    background: rgba(217, 35, 35, 0.15);
    padding-left: 24px;
}

/* ==========================================================================
   5. HERO & ARAMA MOTORU
   ========================================================================== */
.hero { 
    background: var(--dark); 
    color: #fff; 
    padding: 55px 20px 65px; 
    text-align: center; 
    position: relative;
    z-index: 1;
}

.hero h1 { 
    font-size: 2.1rem; 
    font-weight: 700;
    margin-bottom: 10px; 
    letter-spacing: -0.5px;
}

.hero p { 
    color: #94a3b8; 
    font-size: 1rem; 
}

/* ==========================================================================
   6. SPONSOR LOGO BANDI
   ========================================================================== */
.sponsor-slider {
    width: 100%;
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-bottom: 30px;
    display: block !important;
}

.sponsor-track {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.sponsor-item {
    width: 120px !important;
    height: 120px !important;
    flex-shrink: 0;
    display: block !important;
}

.sponsor-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 120px !important;
    height: 120px !important;
    text-decoration: none;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.sponsor-link img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

.sponsor-link:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(217, 35, 35, 0.12);
}

/* ==========================================================================
   7. ANA İÇERİK & HABER DETAY (SINGLE) STABİLİZASYONU
   ========================================================================== */
main.container { 
    flex: 1; 
    max-width: 1300px !important; 
    width: 100% !important; 
    margin: 0 auto !important; 
    padding: 40px 20px; 
    display: flex !important;
    gap: 40px !important;
    align-items: flex-start !important;
    box-sizing: border-box !important;
    position: relative;
    z-index: 1;
    transform: none !important;
}

.content-area {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    z-index: 1 !important;
    transform: none !important;
}

.haber-detay-content img,
.content-area img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    display: block;
    margin: 20px auto;
    object-fit: contain;
}

.haber-detay-content table,
.content-area table {
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    border-collapse: collapse;
}

/* Başlıkların alt katmanda kalması garantisi */
main.container h1,
.content-area h1,
article h1 {
    position: relative;
    z-index: 0 !important;
}

/* Sağ Sidebar */
aside.sidebar {
    width: 320px !important;
    flex-shrink: 0 !important;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    position: sticky;
    top: 90px;
    box-sizing: border-box !important;
    z-index: 2;
}

aside.sidebar h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
    margin-bottom: 16px;
    margin-top: 24px;
}

aside.sidebar h4:first-child {
    margin-top: 0;
}

aside.sidebar ul {
    list-style: none;
    padding: 0;
}

aside.sidebar ul li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
}

aside.sidebar ul li a {
    color: #334155;
    text-decoration: none;
    transition: color 0.2s ease;
}

aside.sidebar ul li a:hover {
    color: var(--primary);
}

/* ==========================================================================
   8. KATEGORİ & HABER KARTLARI
   ========================================================================== */
.categories-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 20px; 
    margin-bottom: 50px; 
}

.cat-card { 
    background: #fff; 
    padding: 26px 20px; 
    border-radius: 8px; 
    border: 1px solid var(--border); 
    text-decoration: none; 
    color: inherit; 
    transition: all 0.25s ease; 
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cat-card:hover { 
    transform: translateY(-4px); 
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
}

.news-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}

.news-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.news-card img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    display: block;
}

.news-card > div {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ==========================================================================
   9. FOOTER & SOSYAL MEDYA
   ========================================================================== */
footer { 
    background: var(--dark); 
    color: #94a3b8; 
    padding: 40px 20px 20px; 
    margin-top: auto; 
}

.footer-inner { 
    max-width: 1300px; 
    margin: 0 auto; 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 30px; 
    padding-bottom: 30px; 
    border-bottom: 1px solid #1e293b; 
}

.footer-col h4 { 
    color: #fff; 
    margin-bottom: 15px; 
    font-size: 0.95rem;
}

.footer-col ul { 
    list-style: none; 
    font-size: 0.85rem; 
    line-height: 2; 
}

.footer-col ul a { 
    color: inherit; 
    text-decoration: none; 
    transition: color 0.2s ease;
}

.footer-col ul a:hover {
    color: #fff;
}

.footer-bottom { 
    max-width: 1300px; 
    margin: 20px auto 0; 
    text-align: center; 
    font-size: 0.8rem; 
}

/* ==========================================================================
   10. MOBİL RESPONSİVE KURALLAR
   ========================================================================== */
@media (max-width: 992px) {
    main.container {
        flex-direction: column !important;
        padding: 20px 15px !important;
    }
    aside.sidebar {
        width: 100% !important;
        position: static !important;
        margin-top: 30px !important;
    }
}

@media (max-width: 768px) {
    .logo-img {
        max-height: 32px;
    }
    .top-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        text-align: center;
    }
    .nav-btns {
        justify-content: center;
    }
    .nav-list {
        justify-content: flex-start;
        overflow-x: auto;
    }
    .dropdown-menu,
    .nav-list ul.sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        border: none;
        padding-left: 15px;
        display: none;
    }
    .nav-list li.dropdown:hover .dropdown-menu,
    .nav-list li.menu-item-has-children:hover ul.sub-menu {
        display: block;
    }
}


