/* =====================================================================
   home.css — نسخه بهینه‌شده
   - حذف @import تکراری فونت (فقط از <link> در HTML لود می‌شود)
   - رفع باگ ریست سراسری و فونت (بلاک‌های { } بدون سلکتور → *)
   - رفع کامنت‌های شکسته که قوانین را می‌بلعیدند
   - حذف تعاریف تکراری (.top-bar، .menu li a، body و...)
   - اصلاح جایگاه دکمه «ارسال خبر» (حذف margin-left: 265px)
   - افزودن کلاس gallery-grid-6 و ادغام media queryها
   ===================================================================== */

/* ==================== فونت و ریست سراسری ==================== */
/* ✅ فونت وزیرمتن از طریق <link> در <head> صفحات لود می‌شود.
   اگر home.css در صفحه دیگری هم استفاده می‌شود، آن <link> را اضافه کنید. */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ✅ اعمال فونت به همه عناصر (جایگزین قانون شکسته قبلی) */
html, body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}
body {
    background-color: #f4f6f8;
    color: #333;
    line-height: 1.6;
    direction: rtl;
}
button, input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== هدر بالایی (top-bar) ==================== */
.top-bar {
    background-color: #8B0000;
    color: #fff;
    padding: 5px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 8px;
}
.top-bar .social-icons { display: flex; gap: 12px; align-items: center; }
.top-bar .social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    transition: all 0.3s;
    color: #fff;
}
.top-bar .social-icons a:hover { background: rgba(255,255,255,0.25); transform: scale(1.1); }
.top-bar .social-icons a img { width: 18px; height: 18px; object-fit: contain; }

/* ==================== هدر اصلی ==================== */
.main-header {
    background-color: #fff;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.logo { font-size: 1.6rem; font-weight: 800; color: #8B0000; }
.logo span { font-size: 2rem; }
.search-box { display: flex; border: 1px solid #ddd; border-radius: 5px; overflow: hidden; }
.search-box input { border: none; padding: 8px 15px; width: 250px; outline: none; font-size: 14px; }
.search-box button { background: #eee; border: none; padding: 0 15px; cursor: pointer; font-size: 1rem; }

/* ==================== منوی ناوبری ==================== */
nav.menu-container { background: #fff; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 12px 0; }
.menu li { position: relative; }
.menu li a {
    color: #555;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}
.menu li a:hover { color: #8B0000; border-bottom-color: #8B0000; }

/* ===== منوی کشویی ===== */
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e8e6df;
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    padding: 6px 0;
    z-index: 999;
}
.dropdown-menu li { display: block; }
.dropdown-menu li a {
    display: block;
    padding: 8px 18px;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    border-radius: 0;
    border-bottom: none;
}
.dropdown-menu li a:hover { background: #f5f5f5; color: #8B0000; border-bottom: none; }
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu { display: block; }
}
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid #eee;
        border-radius: 0;
        padding: 4px 0 4px 20px;
        background: #fafafa;
    }
    .dropdown-menu li a { padding: 6px 12px; font-size: 12px; }
    .dropdown.open .dropdown-menu { display: block; }
}

/* ===== دکمه ارسال خبر ===== */
/* ✅ رفع باگ: قانون margin-right:auto قبلاً خورده شده بود؛ حالا با margin-inline-start
   به‌درستی به ابتدای سطر می‌رود و عدد جادویی 265px حذف شد */
.menu .submit-news-btn { margin-inline-start: auto; }
.menu .submit-news-btn a {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #8B0000;
    color: #fff !important;
    padding: 6px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: none;
    transition: all 0.3s ease;
}
.menu .submit-news-btn a:hover {
    background: #f84a06;
    color: #fff;
    border-bottom: none;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(220,53,69,0.4);
}
.menu .submit-news-btn .btn-icon { font-size: 1.1rem; line-height: 1; }

/* ==================== بخش اصلی (اسلایدر + کناری) ==================== */
.hero-section { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; padding: 30px 0; }

.slider-wrapper { position: relative; overflow: hidden; border-radius: 8px; background: #1a1a2e; height: 400px; }
.slider-track { position: relative; height: 100%; width: 100%; }
.slider-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s;
}
.slider-slide.active { opacity: 1; visibility: visible; z-index: 1; }
.slider-slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgba(255,255,255,0.2);
}
.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 80%);
    color: #fff;
    padding: 25px 30px;
    z-index: 2;
}
.slider-caption .city-tag {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 11px;
    color: #fff;
    margin-bottom: 8px;
}
.slider-caption h2 { font-size: 22px; margin-bottom: 6px; }
.slider-caption h2 a { color: #fff; transition: color 0.3s; }
.slider-caption h2 a:hover { color: #ffd700; }
.slider-caption p {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.slider-caption .date { font-size: 12px; opacity: 0.6; }
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}
.slider-btn:hover { background: rgba(0,0,0,0.8); }
.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    border: none;
    transition: 0.3s;
}
.slider-dots .dot.active { background: #ffd700; transform: scale(1.2); }

/* ==================== اخبار کناری ==================== */
.sidebar-news { background: #fff; border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.sidebar-news .news-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.sidebar-news .news-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-news .news-list img { width: 60px; height: 60px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.sidebar-news .news-list h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.sidebar-news .news-list h4 a:hover { color: #8B0000; }
.sidebar-news .news-list span { font-size: 12px; color: #999; }

/* ==================== عنوان بخش‌ها ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.section-header h3 {
    color: #8B0000;
    font-size: 1.2rem;
    font-weight: 700;
    border-right: 4px solid #8B0000;
    padding-right: 10px;
}
.section-header a { color: #8B0000; font-size: 0.85rem; }

/* ==================== کارت شهرها ==================== */
.highlight-section { margin: 40px 0; }
.highlight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.city-card-new { position: relative; border-radius: 8px; overflow: hidden; height: 200px; }
.city-card-new img { width: 100%; height: 100%; object-fit: cover; }
.city-card-new .card-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 15px;
    text-align: center;
}
.city-card-new .card-body h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.city-card-new .card-body span { display: block; margin-bottom: 6px; }
.city-card-new .card-body .btn {
    display: inline-block;
    background: #8B0000;
    color: #fff;
    padding: 4px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
}
.city-card-new .card-body .btn:hover { background: #6b0000; }

/* ==================== گرید اخبار ==================== */
.news-grid-section { margin: 40px 0; }
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.news-grid-4 { grid-template-columns: repeat(4, 1fr); }
.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.3s, box-shadow 0.3s;
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.news-card img { width: 100%; height: 180px; object-fit: cover; }
.news-card .meta {
    padding: 10px 14px 4px;
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
}
.news-card h4 { padding: 4px 14px 0; font-size: 15px; font-weight: 600; line-height: 1.5; }
.news-card h4 a:hover { color: #8B0000; }
.news-card p {
    padding: 6px 14px 14px;
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== بخش سه ستونه ==================== */
.three-columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin: 40px 0; }
.three-columns .col { background: #fff; padding: 18px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.three-columns .col h3 {
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #1a1a2e;
}

/* پربازدید */
.numbered-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 8px;
}
.numbered-list li:last-child { border-bottom: none; }
.numbered-list .num {
    background: #8B0000;
    color: #fff;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}
.numbered-list li a { font-weight: 500; }
.numbered-list li a:hover { color: #8B0000; }

/* گالری */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
/* ✅ کلاس -6 که در HTML بود ولی تعریف نداشت؛ ۶ عکس را ۳ ستونه می‌چیند */
.gallery-grid-6 { grid-template-columns: repeat(3, 1fr); }
.gallery-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s;
    cursor: pointer;
}
.gallery-grid img:hover { transform: scale(1.03); }

/* ویدیو */
.video-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}
.video-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.video-item img { width: 100px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.video-item h5 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.video-item h5 a:hover { color: #8B0000; }
.video-item span { font-size: 12px; color: #999; display: block; }
.more-link { display: block; text-align: left; color: #8B0000; font-size: 13px; margin-top: 12px; font-weight: 600; }
.more-link:hover { text-decoration: underline; }

/* ==================== فوتر ==================== */
footer { background-color: #1a1a2e; color: #fff; padding: 40px 0 0 0; margin-top: 30px; }
.footer-top { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-top h4 { margin-bottom: 15px; font-size: 1.1rem; font-weight: 700; color: #fff; }
.footer-top p, .footer-top li { font-size: 14px; margin-bottom: 8px; color: #bdc3c7; }
.footer-top ul li a { color: #bdc3c7; transition: color 0.3s; }
.footer-top ul li a:hover { color: #ffd700; }
.copyright { background-color: #0f0f1f; text-align: center; padding: 15px 0; font-size: 13px; color: #666; }

/* =====================================================================
   ریسپانسیو — media queryهای پراکنده در یک جا ادغام شدند
   ===================================================================== */
@media (max-width: 992px) {
    .hero-section { grid-template-columns: 1fr; }
    .news-grid, .news-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .three-columns { grid-template-columns: 1fr 1fr; }
    .highlight-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .main-header { flex-direction: column; text-align: center; }
    .main-header .logo { font-size: 1.2rem; }
    .search-box input { width: 180px; }
    .menu { justify-content: center; }
    .menu .submit-news-btn { margin-inline-start: 0; width: 100%; }
    .menu .submit-news-btn a { justify-content: center; border-radius: 8px; padding: 10px 20px; margin: 5px 0; }
    .highlight-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr; }
    .three-columns { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; text-align: center; }
    .slider-wrapper { height: 350px; }
    .slider-caption h2 { font-size: 18px; }
    .slider-caption p { font-size: 13px; -webkit-line-clamp: 1; }
    .slider-btn { width: 30px; height: 30px; font-size: 14px; }
}

@media (max-width: 576px) {
    .news-card img { height: 200px; }
}

@media (max-width: 480px) {
    .slider-wrapper { height: 280px; }
    .slider-caption { padding: 15px; }
    .slider-caption h2 { font-size: 15px; }
    .slider-caption p { font-size: 12px; }
    .sidebar-news .news-list li { flex-direction: column; align-items: center; text-align: center; }
    .top-bar { flex-direction: column; text-align: center; padding: 6px 12px; gap: 5px; }
    .top-bar .social-icons a { width: 30px; height: 30px; }
}