/*
Theme Name: قالب انجمن ناشران (Anjoman)
Author: توسعه‌دهنده
Version: 3.5
Description: نسخه نهایی با اصلاح رنگ دکمه کاربری و تیتر هیرو.
*/

/* --- متغیرهای رنگ و تنظیمات پایه --- */
:root {
    /* رنگ‌ها */
    --primary-color: #1a5276;
    --primary-hover: #154360;
    --accent-color: #d35400;
    --accent-hover: #a04000;
    --text-color: #444;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --light-gray: #eee;
    --cta-bg: #ecf0f1;
    
    /* ابعاد */
    --sidebar-width: 280px;
    
    /* --- تنظیمات گردی گوشه‌ها --- */
    --radius-btn: 6px;  /* دکمه‌ها */
    --radius-box: 4px;  /* باکس‌ها و تصاویر */
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-Thin.woff2') format('woff2');
    font-weight: 100;
    font-display: swap;
}

@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'VazirMatn';
    src: url('assets/fonts/VazirMatn/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.8;
    overflow-x: hidden;
    direction: rtl;
}

h1, h2, h3, h4, h5, h6 { font-weight: 800; color: #2c3e50; margin-bottom: 0.8rem; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* اعمال گردی باکس به تمام تصاویر */
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-box); }

/* --- کلاس‌های کاربردی --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* استایل کلی دکمه‌ها */
.btn {
    display: inline-block; padding: 8px 20px; 
    border-radius: var(--radius-btn);
    cursor: pointer; font-size: 13px; font-weight: bold; text-align: center;
    border: 1px solid transparent;
}

.d-flex { display: flex; align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 20px; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* --- نوار ناوبری --- */
.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 10px 0;
    position: sticky; top: 0; z-index: 1000;
}

.navbar-container { display: flex; align-items: center; }

.navbar-brand {
    font-weight: 900; font-size: 1.4rem; color: var(--primary-color);
    display: flex; align-items: center; gap: 10px; z-index: 1001;
    margin-left: 40px;
}
.navbar-brand img { max-height: 45px; width: auto; border-radius: 0; }

.nav-menu { 
    display: flex; align-items: center; flex-grow: 1; justify-content: space-between;
}

.nav-links { display: flex; gap: 25px; }
.nav-link { font-size: 14px; font-weight: 500; color: #555; }

/* رنگ منوی فعال (Accent Color) */
.nav-link:hover, .nav-link.active { color: var(--accent-color) !important; }

.auth-buttons { display: flex; align-items: center; gap: 15px; }

.btn-custom-login { 
    background-color: var(--primary-color); color: var(--white); border: 1px solid var(--primary-color);
    border-radius: var(--radius-btn);
}
.btn-custom-login:hover { background-color: var(--primary-hover); color: #fff; }

/* --- منوی کاربری (User Dropdown) --- */
.user-menu-wrap { position: relative; z-index: 1005; }

/* استایل جدید دکمه کاربری (رنگ Primary) */
.user-btn {
    display: flex; align-items: center; gap: 8px;
    background-color: var(--primary-color); /* تغییر رنگ پس‌زمینه */
    border: 1px solid var(--primary-color);
    padding: 5px 12px 5px 5px;
    border-radius: var(--radius-btn);
    cursor: pointer; transition: 0.2s;
    font-size: 13px; font-weight: 600; 
    color: var(--white); /* تغییر رنگ متن به سفید */
}

.user-btn:hover, .user-btn.active {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.user-avatar-img {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover; 
    border: 2px solid rgba(255,255,255,0.3); /* بوردر شفاف برای زیبایی */
}

/* آیکون جایگزین آواتار */
.user-avatar-icon {
    width: 32px; height: 32px; border-radius: 50%;
    background-color: rgba(255,255,255,0.2); /* سفید شفاف */
    color: var(--white);
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* آیکون فلش کوچک کنار دکمه */
.user-btn .fa-chevron-down {
    color: rgba(255,255,255,0.8) !important;
}

/* باکس باز شونده */
.user-dropdown-menu {
    position: absolute; top: 50px; left: 0; width: 200px;
    background: #fff;
    border-radius: var(--radius-box);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #eee; padding: 10px 0;
    visibility: hidden; opacity: 0; transform: translateY(10px);
    transition: all 0.2s ease; z-index: 1006;
}

.user-dropdown-menu.show { visibility: visible; opacity: 1; transform: translateY(0); }

.user-dropdown-header {
    padding: 0 15px 10px; border-bottom: 1px solid #f0f0f0; margin-bottom: 5px;
    font-size: 11px; color: #999; text-align: right;
}

.user-dropdown-menu a {
    display: flex; align-items: center; gap: 10px; padding: 10px 15px;
    font-size: 13px; color: #555; transition: 0.2s; text-decoration: none; text-align: right;
}

.user-dropdown-menu a:hover { background-color: #f8fbff; color: var(--primary-color); padding-right: 20px; }

.user-dropdown-menu a.logout-link { border-top: 1px dashed #eee; margin-top: 5px; color: #e74c3c; }
.user-dropdown-menu a.logout-link:hover { background-color: #fff5f5; color: #c0392b; }

/* --- ریسپانسیو --- */
.hamburger-btn { display: none; font-size: 24px; background: none; border: none; color: var(--primary-color); cursor: pointer; margin-right: auto; }
.close-menu-btn { display: none; position: absolute; top: 20px; left: 20px; background: none; border: none; font-size: 24px; color: #777; cursor: pointer; }
.menu-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; opacity: 0; transition: opacity 0.3s; }

@media (max-width: 992px) {
    .hamburger-btn { display: block; }
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: var(--sidebar-width); height: 100vh;
        background-color: var(--white); flex-direction: column; align-items: flex-start;
        padding: 60px 20px; box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease-in-out; z-index: 999; justify-content: flex-start;
    }
    .nav-menu.active { right: 0; }
    .menu-overlay.active { display: block; opacity: 1; }
    .nav-links { flex-direction: column; width: 100%; gap: 15px; margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
    .auth-buttons { flex-direction: column; width: 100%; align-items: flex-start; }
    .close-menu-btn { display: block; }
    .navbar-brand { margin-left: 0; }
    
    .user-menu-wrap { width: 100%; }
    .user-btn { width: 100%; justify-content: space-between; }
    .user-dropdown-menu { position: static; width: 100%; box-shadow: none; border: 1px solid #eee; margin-top: 10px; display: none; visibility: visible; opacity: 1; transform: none; }
    .user-dropdown-menu.show { display: block; }
}

/* --- هیرو --- */
.hero-section {
    background-size: cover; background-position: center center; background-repeat: no-repeat;
    color: white; padding: 140px 0; text-align: center; position: relative;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(rgba(26, 82, 118, 0.9), rgba(26, 82, 118, 0.8)); z-index: 1; }
.hero-content { position: relative; z-index: 2; }

/* اصلاح رنگ تیتر هیرو به سفید */
.hero-section h1 { 
    color: var(--white); /* سفید */
    font-size: 3.5rem; font-weight: 900; margin-bottom: 20px; letter-spacing: -1px; 
}

.hero-section p { max-width: 700px; margin: 20px auto 35px; color: #e0e0e0; font-size: 1.1rem; }

.btn-hero { padding: 12px 35px; border-radius: var(--radius-btn); margin: 5px; font-size: 14px; }
.btn-primary-hero { background-color: var(--accent-color); color: white; border: none; }
.btn-primary-hero:hover { background-color: var(--accent-hover); transform: translateY(-2px); color: #fff; }
.btn-outline-hero { border: 2px solid rgba(255,255,255,0.8); color: white; }
.btn-outline-hero:hover { background-color: white; color: var(--primary-color); }

/* --- خدمات --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-top: 20px; }
.service-card {
    background: white; padding: 30px; 
    border-radius: var(--radius-box);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03); text-align: center; border: 1px solid #eee; transition: transform 0.3s;
}
.service-card:hover { transform: translateY(-5px); }
.service-icon { font-size: 2.2rem; color: var(--primary-color); margin-bottom: 15px; }

/* --- اخبار --- */
.news-section { background-color: var(--white); border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.news-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
@media (max-width: 768px) { .news-layout { grid-template-columns: 1fr; } }

.news-header { border-bottom: 2px solid var(--primary-color); margin-bottom: 20px; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }

.see-all {
    font-size: 12px; color: #777; background: #f0f0f0; padding: 3px 12px; 
    border-radius: var(--radius-btn);
}
.see-all:hover { background: var(--accent-color); color: #fff; }

.lead-news-card {
    position: relative; 
    border-radius: var(--radius-box);
    overflow: hidden; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.lead-news-card img { width: 100%; height: 380px; object-fit: cover; transition: transform 0.5s; border-radius: 0; }
.lead-news-card:hover img { transform: scale(1.03); }
.lead-news-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); padding: 25px; color: #fff; }
.lead-news-tag {
    background-color: var(--accent-color); padding: 3px 10px; font-size: 11px; 
    border-radius: var(--radius-box);
    color: white;
}
.lead-news-title { color: white; margin-top: 10px; font-size: 1.3rem; }

.sub-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.sub-news-item {
    display: flex; gap: 12px; background: #fff; padding: 10px;
    border-radius: var(--radius-box);
    border: 1px solid #f0f0f0; align-items: start;
}
.sub-news-img {
    width: 90px; height: 70px; 
    border-radius: var(--radius-box);
    object-fit: cover; flex-shrink: 0;
}
.sub-news-content h5 { font-size: 13.5px; margin: 0 0 5px 0; line-height: 1.6; }

/* --- سایدبار --- */
.sidebar-box {
    background: #fff; border: 1px solid #eee; 
    border-radius: var(--radius-box);
    padding: 15px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.sidebar-header { font-weight: 700; color: var(--accent-color); border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.sidebar-news-list li { border-bottom: 1px dashed #e5e5e5; padding: 8px 0; }
.sidebar-news-list li a { font-size: 12.5px; display: block; color: var(--text-color); }
.sidebar-news-list li a:hover { color: var(--accent-color); padding-right: 5px; }
.meta { font-size: 10px; color: #aaa; display: block; margin-top: 3px; }

/* --- CTA --- */
.cta-section { background-color: var(--cta-bg); text-align: center; }

/* --- فوتر --- */
footer { background-color: #2c3e50; color: #bdc3c7; padding: 60px 0 20px 0; font-size: 12.5px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
footer h5 { color: white; border-bottom: 2px solid var(--accent-color); display: inline-block; padding-bottom: 5px; margin-bottom: 20px; }
footer ul li { margin-bottom: 10px; }
footer ul li a:hover { color: var(--accent-color); padding-right: 5px; }
.copyright { border-top: 1px solid #34495e; padding-top: 20px; margin-top: 40px; text-align: center; font-size: 11px; color: #7f8c8d; }

/* استایل سینگل و آرشیو */
.breadcrumb { margin-bottom: 20px; font-size: 12px; color: #777; }
.breadcrumb a { color: var(--primary-color); }
.single-content {
    background: #fff; padding: 30px; 
    border-radius: var(--radius-box);
    border: 1px solid #eee;
}
.single-meta { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; color: #777; font-size: 12px; display: flex; gap: 15px; }
