/* --- تنظیمات پایه --- */
body {
    /* رنگ پس‌زمینه مینیمال و گرم‌تر */
    background: radial-gradient(circle at 50% 0%, #1a1a1e 0%, #111113 100%);
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    font-family: 'samim', sans-serif;
}

/* --- هدر و بخش فیلترها (Reels) --- */
.news-header {
    padding: 140px 6vw 60px;
    background: transparent;
    position: relative;
    text-align: center;
}

.news-header-top h1 {
    font-size: clamp(32px, 5vw, 62px);
    color: #ffffff;
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.news-header-top p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    max-width: 580px;
    line-height: 1.8;
    margin: 0 auto 40px;
}

/* --- استایل جدید دکمه‌های فیلتر (Reels) --- */
.reels-bar {
    direction: rtl;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 20px;
    scrollbar-width: none;
    justify-content: center; /* در دسکتاپ وسط‌چین */
}

.reels-bar::-webkit-scrollbar { display: none; }

/* --- استایل اصلاح شده فیلترها با حالت فرو رفته --- */
.reel-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50px;
    padding: 8px 20px 8px 10px;
    display: flex;
    flex-direction: row-reverse; /* آیکون سمت راست، متن سمت چپ */
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

/* دایره تصویر */
.reel-thumb {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1a1a1e;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تصویر داخل دایره */
.reel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
    opacity: 0.8;
}

/* --- حالت فعال (Active) و هاور --- */

.reel-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* وقتی دکمه فعال است */
.reel-chip.active {
    background: rgba(255, 255, 255, 0.1); /* بگراند کمی روشن‌تر برای کل چیپ */
    border-color: #d6b36a;
    color: #d6b36a;
}

/* افکت فرو رفتگی برای دایره در حالت فعال */
.reel-chip.active .reel-thumb {
    background: #08080a; /* رنگ تیره‌تر برای عمق */
    border-color: rgba(0, 0, 0, 0.5);
    /* ایجاد سایه داخلی برای حالت فرو رفتگی */
    box-shadow: 
        inset 2px 2px 6px rgba(0, 0, 0, 0.8), 
        inset -1px -1px 3px rgba(255, 255, 255, 0.05);
}

.reel-chip.active .reel-thumb img {
    opacity: 0.5; /* تیره کردن تصویر برای هماهنگی با عمق */
    transform: scale(0.9); /* کمی کوچک‌تر شدن تصویر برای حس فرو رفتگی بیشتر */
}

/* افکت نئونی خیلی ظریف دور چیپ فعال */
.reel-chip.active {
    box-shadow: 0 0 15px rgba(214, 179, 106, 0.15);
}

/* --- شبکه پروژه‌ها --- */
.news-feed {
    padding: 0 6vw 120px;
}

.news-grid {
    position: relative;
    margin: 0 -15px;
}

/* --- استایل کارت مینیمال (Apple Style) --- */
.news-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    
    width: calc(33.333% - 30px); 
    margin: 15px;
    float: right;
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.news-image {
    width: 100%;
    aspect-ratio: 16 / 11;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%); /* ظاهر هنری‌تر */
    transition: all 0.8s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.news-content {
    padding: 30px;
    text-align: right; /* راست‌چین برای متن فارسی */
}

.news-date {
    font-size: 12px;
    color: #d6b36a; /* رنگ طلایی ملایم برای تاریخ */
    margin-bottom: 8px;
    display: block;
}

.news-content h3 {
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 600;
}

.news-content p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- ریسپانسیو --- */
@media (max-width: 1100px) {
    .news-card { width: calc(50% - 30px); }
    .reels-bar { justify-content: flex-start; }
}

@media (max-width: 768px) {
    .news-card { width: calc(100% - 30px); }
    .news-header { padding-top: 100px; }
}


 .modal-overlay {
        display: none;
        /* در ابتدا مخفی */
        position: fixed;
        z-index: 99999;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.85);
        /* تیرگی پشت مدال */
        backdrop-filter: blur(8px);
        /* افکت مات شدن پشت مدال */
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    /* وقتی مدال فعال می‌شود (استایل کمکی برای JS) */
    .modal-overlay.active {
        display: flex;
        opacity: 1;
    }

    /* ۲. محفظه داخلی مدال */
    .modal-content {
        background: #ddd;
        width: 90%;
        max-width: 900px;
        padding: 30px;
        border-radius: 20px;
        position: relative;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        transform: translateY(20px);
        transition: transform 0.3s ease;
    }

    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }

    /* ۳. دکمه بستن */
    .close-modal {
        position: absolute;
        top: 30px;
        right: 30px;
        color: #302f2f;
        font-size: 35px;
        font-weight: bold;
        cursor: pointer;
        transition: color 0.2s;
        line-height: 1;
    }

    .close-modal:hover {
        color: #ff4d4d;
    }

    /* ۴. عنوان پروژه در مدال */
    #modalTitle {
        font-size: 1.5rem;
        color: #2d3436;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #eee;
        font-weight: 700;
        text-align: right;
        /* برای راست‌چین بودن */
    }

    .projectSwiper {
    width: 100%;
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    position: relative; /* برای قرارگیری درست دکمه‌ها */
}

/* اصلاح دکمه‌های ناوبری (Next/Prev) */
.swiper-button-next,
.swiper-button-prev {
    background: rgba(255, 255, 255, 0.8); /* پس‌زمینه سفید نیمه‌شفاف برای دیده شدن روی عکس */
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    color: #1a1a1e !important; /* رنگ فلش‌ها تیره */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10; /* اطمینان از قرارگیری روی عکس */
}

/* تغییر اندازه فلش‌ها */
.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 18px !important;
    font-weight: bold;
}

/* جابجایی دکمه‌ها به داخل تصویر */
.swiper-button-next { right: 15px !important; }
.swiper-button-prev { left: 15px !important; }

/* --- شخصی‌سازی Swiper Pagination --- */
.swiper-pagination-bullet {
    background: #000 !important;
    opacity: 0.3;
    width: 8px;
    height: 8px;
}

.swiper-pagination-bullet-active {
    background: #000 !important;
    opacity: 1;
    width: 20px;
    border-radius: 4px;
}

/* اصلاح برای موبایل - دکمه‌ها را دوباره فعال می‌کنیم اما کوچک‌تر */
@media (max-width: 768px) {
    .projectSwiper {
        height: 300px;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        display: flex !important; /* نمایش دوباره در موبایل */
        width: 32px !important;
        height: 32px !important;
        transform: scale(0.8);
    }
}


.news-header{
    direction: rtl;
    text-align: right;
}

.news-header .page-header{
    text-align: center;
    padding: 70px 20px 30px;
}

.news-header .page-header h1{
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: #fff; /* اگر بک‌گراند تیره است */
}

.news-header .page-header p{
    margin: 0;
    color: #b3b3b3;
    font-size: 1rem;
    line-height: 1.9;
}

    /* ۶. بهینه‌سازی برای موبایل (Responsive) */
    @media (max-width: 768px) {
        .modal-content {
            width: 95%;
            padding: 15px;
            margin-top: 50px;
        }

        .projectSwiper {
            height: 300px;
            /* ارتفاع کمتر در موبایل */
        }

        #modalTitle {
            font-size: 1.1rem;
            margin-bottom: 10px;
        }

        .close-modal {
            top: -40px;
            right: 10px;
        }

        /* مخفی کردن دکمه‌های ناوبری در موبایل برای فضای بیشتر (اختیاری) */
        .swiper-button-next,
        .swiper-button-prev {
            display: none !important;
        }
    }