/*
Theme Name: TR Defense Port
Theme URI: https://trdefenseport.com
Author: TRDefense
Author URI: https://trdefenseport.com
Description: Türk Savunma Sanayi Haber Portalı - Özel Admin Paneli, Reklam Alanları, Video Embed Desteği
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trdefense
Tags: news, blog, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ========== CSS VARIABLES ========== */
:root {
    --primary-color: #1a3a5c;
    --secondary-color: #c8102e;
    --accent-color: #f0b323;
    --bg-color: #f5f6f8;
    --card-bg: #ffffff;
    --text-color: #2d2d2d;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --header-bg: #0f1923;
    --header-text: #ffffff;
    --footer-bg: #111827;
    --footer-text: #d1d5db;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.25s ease;
    --max-width: 1280px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.7;
}

a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--secondary-color); }

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color);
}

ul, ol { list-style: none; }

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

.site-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 30px 0;
}

.site-main.full-width {
    grid-template-columns: 1fr;
}

/* ========== TOP BAR ========== */
.top-bar {
    background: var(--header-bg);
    color: var(--header-text);
    font-size: 0.8rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-date { opacity: 0.7; }

.top-bar-social a {
    color: var(--header-text);
    margin-left: 12px;
    opacity: 0.7;
    font-size: 0.85rem;
}

.top-bar-social a:hover { opacity: 1; color: var(--accent-color); }

/* ========== HEADER ========== */
.site-header {
    background: var(--header-bg);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

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

.site-logo img { max-height: 50px; width: auto; }
.site-logo .site-title-text {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--header-text);
    letter-spacing: -0.5px;
}

.site-logo .site-title-text span { color: var(--secondary-color); }

/* ========== NAVIGATION ========== */
.main-nav ul {
    display: flex;
    gap: 0;
}

.main-nav ul li a {
    display: block;
    padding: 10px 16px;
    color: var(--header-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.main-nav ul li a:hover,
.main-nav ul li.current-menu-item a {
    background: var(--secondary-color);
    color: #fff;
}

/* Sub-menu */
.main-nav ul li { position: relative; }
.main-nav ul li ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    min-width: 220px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    padding: 8px 0;
}

.main-nav ul li:hover > ul.sub-menu { display: block; }

.main-nav ul li ul.sub-menu li a {
    color: var(--text-color);
    padding: 8px 16px;
    font-size: 0.85rem;
    text-transform: none;
    border-radius: 0;
}

.main-nav ul li ul.sub-menu li a:hover {
    background: var(--bg-color);
    color: var(--secondary-color);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--header-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* ========== SEARCH BAR ========== */
.header-search {
    position: relative;
}

.header-search input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 36px 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    width: 200px;
    transition: var(--transition);
}

.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search input:focus {
    outline: none;
    border-color: var(--accent-color);
    width: 260px;
    background: rgba(255,255,255,0.15);
}

.header-search button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
}

/* ========== BREAKING NEWS TICKER ========== */
.breaking-news {
    background: var(--secondary-color);
    color: #fff;
    padding: 8px 0;
    overflow: hidden;
}

.breaking-news .container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.breaking-label {
    background: rgba(0,0,0,0.3);
    padding: 3px 12px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
}

.breaking-ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.breaking-ticker-inner {
    display: flex;
    animation: ticker 30s linear infinite;
    white-space: nowrap;
}

.breaking-ticker-inner a {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 40px;
}

.breaking-ticker-inner a:hover { color: var(--accent-color); }

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========== AD SLOTS ========== */
.ad-slot {
    text-align: center;
    padding: 15px 0;
    margin: 20px 0;
    position: relative;
}

.ad-slot img { margin: 0 auto; border-radius: var(--radius); }

.ad-slot-label {
    font-size: 0.65rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.5;
}

.ad-slot-sidebar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

/* ========== POST CARDS ========== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

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

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

.post-card-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--secondary-color);
    color: #fff;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-body { padding: 16px; }

.post-card-title {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-card-title a { color: var(--text-color); }
.post-card-title a:hover { color: var(--secondary-color); }

.post-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.75rem;
    color: var(--text-light);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.post-card-meta span { display: flex; align-items: center; gap: 4px; }

/* Featured / Hero Post */
.featured-post {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
}

.featured-post .post-card-thumb { aspect-ratio: 16/9; }
.featured-post .post-card-body { padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.featured-post .post-card-title { font-size: 1.5rem; margin-bottom: 12px; }
.featured-post .post-card-excerpt { -webkit-line-clamp: 4; }

/* ========== SIDEBAR ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1rem;
    font-family: var(--font-family);
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Popular posts widget */
.popular-post-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-post-item:last-child { border-bottom: none; }

.popular-post-thumb {
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.popular-post-info h4 {
    font-size: 0.8rem;
    font-family: var(--font-family);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.popular-post-info h4 a { color: var(--text-color); }
.popular-post-info h4 a:hover { color: var(--secondary-color); }
.popular-post-info .date { font-size: 0.7rem; color: var(--text-light); }

/* Category widget */
.widget-categories li a {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-color);
}

.widget-categories li:last-child a { border-bottom: none; }
.widget-categories li a:hover { color: var(--secondary-color); padding-left: 5px; }
.widget-categories li a .count {
    background: var(--bg-color);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ========== SINGLE POST ========== */
.single-post-header { margin-bottom: 24px; }

.single-post-cat {
    display: inline-block;
    background: var(--secondary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.single-post-title {
    font-size: 2rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.single-post-meta span { display: flex; align-items: center; gap: 5px; }

.single-post-thumb {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
}

.single-post-thumb img { width: 100%; }

.single-post-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.single-post-content p {
    margin-bottom: 1.2em;
    font-size: 1.05rem;
    line-height: 1.8;
}

.single-post-content h2 { font-size: 1.5rem; margin: 1.5em 0 0.8em; }
.single-post-content h3 { font-size: 1.25rem; margin: 1.3em 0 0.6em; }
.single-post-content blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 16px 24px;
    margin: 1.5em 0;
    background: var(--bg-color);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-light);
}

.single-post-content ul, .single-post-content ol {
    margin: 1em 0 1em 1.5em;
    list-style: disc;
}

.single-post-content ol { list-style: decimal; }
.single-post-content li { margin-bottom: 0.5em; }

/* Video embed */
.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5em 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.video-embed-wrap iframe,
.video-embed-wrap .twitter-tweet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tags */
.single-post-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.single-post-tags .tag-label { font-weight: 600; font-size: 0.85rem; }

.single-post-tags a {
    background: var(--bg-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.single-post-tags a:hover {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

/* Post navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.post-nav-link {
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-nav-link:hover { box-shadow: var(--shadow-md); }
.post-nav-link .nav-label { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; }
.post-nav-link .nav-title { font-size: 0.9rem; font-weight: 600; margin-top: 4px; color: var(--text-color); }
.post-nav-link.next { text-align: right; }

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.pagination a:hover { background: var(--primary-color); color: #fff; }
.pagination .current { background: var(--secondary-color); color: #fff; }

/* ========== FOOTER ========== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 50px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-widget h3 {
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-family);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
}

.footer-widget p { font-size: 0.85rem; line-height: 1.7; opacity: 0.8; }

.footer-widget ul li a {
    color: var(--footer-text);
    font-size: 0.85rem;
    display: block;
    padding: 5px 0;
    opacity: 0.8;
}

.footer-widget ul li a:hover { opacity: 1; color: var(--accent-color); padding-left: 5px; }

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ========== CATEGORY HEADER ========== */
.category-header {
    background: var(--primary-color);
    color: #fff;
    padding: 30px 0;
    margin-bottom: 30px;
}

.category-header h1 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.category-header p { opacity: 0.8; font-size: 0.9rem; }

/* ========== SEARCH RESULTS ========== */
.search-header {
    background: var(--primary-color);
    color: #fff;
    padding: 30px 0;
    margin-bottom: 30px;
}

.search-header h1 { color: #fff; font-size: 1.5rem; }

/* ========== 404 PAGE ========== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 h1 { font-size: 6rem; color: var(--secondary-color); }
.error-404 p { font-size: 1.2rem; color: var(--text-light); margin: 16px 0 30px; }

.error-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}

.error-404 .search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
}

.error-404 .search-form button {
    padding: 12px 24px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

/* ========== SECTION TITLES ========== */
.section-title {
    font-size: 1.2rem;
    font-family: var(--font-family);
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 2px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .site-main { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .top-bar { display: none; }
    .main-nav { display: none; }
    .main-nav.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        padding: 10px;
        box-shadow: var(--shadow-md);
    }
    .main-nav.active ul { flex-direction: column; }
    .menu-toggle { display: block; }
    .header-search input { width: 140px; }
    .header-search input:focus { width: 180px; }
    .posts-grid { grid-template-columns: 1fr; }
    .featured-post { grid-template-columns: 1fr; }
    .post-navigation { grid-template-columns: 1fr; }
    .single-post-title { font-size: 1.4rem; }
    .single-post-content { padding: 20px; }
    .footer-grid { grid-template-columns: 1fr; }
}
