/*
Theme Name: قالب تاریک
Description: قالب با تم تاریک و مدرن، مناسب برای مطالعه طولانی و کاهش خستگی چشم
Version: 2.0.0
Author: LiteScript
*/

/* ===== متغیرهای اصلی ===== */
:root {
    --primary-bg: #0a0c0f;
    --secondary-bg: #1a1e24;
    --card-bg: #1f252b;
    --hover-bg: #2c333a;
    
    --primary-color: #81a1c1;
    --secondary-color: #5e81ac;
    --accent-color: #88c0d0;
    --success-color: #a3be8c;
    --warning-color: #ebcb8b;
    --error-color: #bf616a;
    
    --text-primary: #e5e9f0;
    --text-secondary: #d8dee9;
    --text-muted: #8f9bb3;
    
    --border-color: #2e3440;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    --font-main: 'Vazirmatn', 'Tahoma', sans-serif;
    --font-size-base: 16px;
    --line-height: 1.7;
    
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.25s ease;
}

/* ===== ریست و پایه ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: var(--line-height);
    font-size: var(--font-size-base);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== کانتینر ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 25px;
    width: 100%;
}

/* ===== هدر ===== */
.site-header {
    background: linear-gradient(165deg, #0f1419 0%, #1a1f26 100%);
    color: var(--text-primary);
    padding: 80px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(129, 161, 193, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.site-title {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
    position: relative;
}

.site-title a {
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

.site-title a:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.site-description {
    font-size: 20px;
    color: var(--text-secondary);
    opacity: 0.9;
    font-weight: 300;
    position: relative;
}

/* ===== ناوبری ===== */
.main-nav {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(26, 30, 36, 0.95);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 35px;
    justify-content: flex-start;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
    font-size: 15px;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: var(--transition);
    border-radius: 2px;
}

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

.main-nav a:hover::after {
    width: 100%;
}

/* ===== محتوای اصلی ===== */
.main-content {
    padding: 60px 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

/* ===== نوشته‌ها ===== */
.posts {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.post {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 35px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow-color);
    border-color: var(--primary-color);
}

.post::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: var(--transition);
}

.post:hover::before {
    opacity: 1;
}

.post-title {
    font-size: 28px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.post-meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.post-content {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: var(--line-height);
}

.read-more {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    font-size: 14px;
}

.read-more:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(94, 129, 172, 0.3);
}

/* ===== سایدبار ===== */
.sidebar {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 35px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 90px;
    height: fit-content;
}

.widget {
    margin-bottom: 45px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 20px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget ul {
    list-style: none;
}

.widget ul li {
    margin-bottom: 12px;
    padding-right: 20px;
    position: relative;
}

.widget ul li::before {
    content: '•';
    color: var(--primary-color);
    font-size: 20px;
    position: absolute;
    right: 0;
    top: -4px;
}

.widget ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 15px;
}

.widget ul li a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

/* ===== فوتر ===== */
.site-footer {
    background: var(--secondary-bg);
    color: var(--text-muted);
    padding: 60px 0 40px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.site-footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-widget {
    margin-bottom: 30px;
}

.footer-widget h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 18px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.footer-widget ul {
    list-style: none;
}

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

.footer-widget ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-widget ul li a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

.footer-bottom {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== صفحات داخلی ===== */
.single-post {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 45px;
    border: 1px solid var(--border-color);
}

.single-post .post-title {
    font-size: 36px;
    margin-bottom: 25px;
}

.single-post .post-content {
    font-size: 18px;
    line-height: 1.8;
}

.single-post .post-content h2,
.single-post .post-content h3,
.single-post .post-content h4 {
    color: var(--text-primary);
    margin: 35px 0 20px;
}

.single-post .post-content p {
    margin-bottom: 25px;
}

.single-post .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin: 30px 0;
}

/* ===== صفحه ۴۰۴ ===== */
.error-404 {
    text-align: center;
    padding: 80px 0;
}

.error-404 h1 {
    font-size: 120px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 800;
}

.error-404 h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.error-404 p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 18px;
}

/* ===== دکمه‌ها ===== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(94, 129, 172, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== فرم‌ها ===== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--secondary-bg);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(129, 161, 193, 0.1);
    background: var(--card-bg);
}

/* ===== اسکرول بار ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ===== انیمیشن‌ها ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post {
    animation: fadeIn 0.6s ease-out;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .sidebar {
        position: static;
    }
    
    .site-title {
        font-size: 42px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .site-header {
        padding: 60px 0;
    }
    
    .site-title {
        font-size: 36px;
    }
    
    .site-description {
        font-size: 18px;
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .main-nav a::after {
        display: none;
    }
    
    .post {
        padding: 25px;
    }
    
    .post-title {
        font-size: 24px;
    }
    
    .single-post {
        padding: 25px;
    }
    
    .single-post .post-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 28px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .read-more {
        width: 100%;
        text-align: center;
    }
}

/* ===== حالت چاپ ===== */
@media print {
    .site-header,
    .main-nav,
    .sidebar,
    .site-footer {
        display: none;
    }
    
    .main-content {
        display: block;
    }
    
    .post {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ===== کلاس‌های کمکی ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 10px; }
.mt-4 { margin-top: 20px; }
.mt-6 { margin-top: 30px; }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 30px; }

.p-4 { padding: 20px; }
.p-6 { padding: 30px; }

.bg-dark { background: var(--secondary-bg); }
.bg-darker { background: var(--card-bg); }

.rounded { border-radius: var(--border-radius); }
.rounded-sm { border-radius: var(--border-radius-sm); }

.shadow { box-shadow: 0 5px 20px var(--shadow-color); }
.shadow-lg { box-shadow: 0 10px 30px var(--shadow-color); }