/* ==========================================================
   ۰. تنظیمات پایه و رفع بیرون‌زدگی در موبایل (Responsive Fixes)
   ========================================================== */


*, *::before, *::after {
    box-sizing: border-box; /* جلوگیری از افزایش عرض توسط پدینگ‌ها */
}

/* ==========================================================
   ۱. متغیرهای رنگی (تم روشن / Light Mode)
   ========================================================== */
:root {
    --gold: #ccb200;
    --gold-light: #e6ca00;
    --gold-glow: rgba(204, 178, 0, 0.15);
    --gold-glow-strong: rgba(204, 178, 0, 0.3);
    
    --bg-main: #f8f9fa;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    
    --text-main: #333333;
    --text-muted: #666666;
    
    --border-radius: 24px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.home {
    background-color: var(--bg-main);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(204, 178, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(204, 178, 0, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
}

/* ==========================================================
   ۲. ساختار کلی و گرید
   ========================================================== */
.pardis-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    direction: rtl;
}

.full-width-layout {
    max-width: 100%;
    padding: 0;
    margin-bottom: 0;
}

.two-column-layout {
    margin-top: 40px;
    margin-bottom: 60px;
}

.main-content {
    flex: 1 1 65%;
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-width: 0; /* حیاتی برای جلوگیری از شکستن گرید در موبایل */
}

.sidebar {
    flex: 1 1 30%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 30px;
    border-radius: var(--border-radius);
    align-self: flex-start;
    position: sticky;
    top: 100px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    min-width: 0; /* حیاتی برای جلوگیری از شکستن گرید در موبایل */
}

/* ==========================================================
   ۳. استایل پایه کارت‌ها و سکشن‌ها
   ========================================================== */
.section-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 35px;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.section-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.8;
}

.section-badge {
    display: inline-block;
    font-size: 11px;
    color: #a38e00;
    border: 1px solid rgba(204, 178, 0, 0.3);
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 1px;
    margin-bottom: 15px;
    background: rgba(204, 178, 0, 0.08);
    font-weight: bold;
}

.section-title {
    color: var(--text-main);
    font-size: 26px;
    margin-bottom: 30px;
    font-weight: 700;
}

/* ==========================================================
   ۴. دکمه‌ها
   ========================================================== */
.gold-btn {
    display: inline-block;
    background: linear-gradient(90deg, var(--gold-light) 0%, var(--gold) 100%);
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 14px;
    transition: var(--transition);
    text-align: center;
    border: none;
    box-shadow: 0 4px 15px var(--gold-glow-strong);
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.gold-btn:hover {
    box-shadow: 0 6px 20px rgba(204, 178, 0, 0.5);
    transform: translateY(-2px);
    color: #ffffff;
}

.outline-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--card-border);
    box-shadow: none;
    text-shadow: none;
}

.outline-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(204, 178, 0, 0.03);
}

/* ==========================================================
   ۵. بخش تمام عرض نرخ طلا و افکت Marquee
   ========================================================== */
.rates-section-full {
    width: 100%;
    padding: 60px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    border-radius: 0;
}

.rates-header-content {
    max-width: 800px;
    margin: 0 auto 40px auto;
    text-align: center;
}

.rates-header-content .section-badge { margin-bottom: 20px; font-size: 12px; padding: 6px 16px; }
.rates-description { color: var(--text-muted); font-size: 16px; line-height: 2; }

.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0 40px 0; 
    margin-top: -10px;
    display: flex;
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.marquee-content {
    display: flex; gap: 25px; white-space: nowrap;
    animation: marquee-scroll 35s linear infinite; animation-direction: normal; 
}
.marquee-container:hover .marquee-content { animation-play-state: paused; }

@keyframes marquee-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }
html[dir="rtl"] .marquee-content { animation-name: marquee-scroll-rtl; }
@keyframes marquee-scroll-rtl { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }

.rate-card-slider {
    width: 280px; flex-shrink: 0; background: #ffffff; padding: 30px 20px;
    border-radius: 20px; border: 1px solid rgba(204, 178, 0, 0.15); 
    text-align: center; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.02); position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transform: translateY(0); will-change: transform;
}

.rate-card-slider::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--gold-light), var(--gold)); opacity: 0.3; transition: all 0.4s ease;
}

.rate-card-slider:hover::before { opacity: 1; height: 6px; }
.rate-card-slider:hover {
    border-color: var(--gold); transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px var(--gold-glow); background: #fffdf5; z-index: 20;
}

.rate-name { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; font-weight: 600; letter-spacing: 0.5px; }
.rate-price { font-size: 26px; font-weight: 900; color: var(--gold); direction: ltr; display: inline-block; letter-spacing: 1px; text-shadow: 0 2px 4px rgba(204, 178, 0, 0.1); }

.more-rates-link { 
    color: var(--text-muted); font-size: 14px; display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-top: 15px; transition: var(--transition); text-decoration: none;
}
.more-rates-link span { color: var(--gold); font-weight: bold;}
.more-rates-link:hover { color: var(--text-main); }

/* ==========================================================
   ۶. اسلایدر معادن پردیس
   ========================================================== */
.mines-slider-container {
    position: relative; width: 100%; height: 450px; border-radius: 16px;
    overflow: hidden; background: #e0e0e0;
}
.mines-slider-track { display: flex; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.mine-slide { min-width: 100%; height: 100%; background-size: cover; background-position: center; position: relative; }
.mine-slide-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    padding: 50px 40px; display: flex; flex-direction: column; align-items: flex-start; color: #ffffff; height: 100%; justify-content: flex-end;
}
.mine-slide-title { font-size: 28px; font-weight: 700; margin-bottom: 15px; color: #ffffff; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
.mine-slide-desc { font-size: 15px; margin-bottom: 25px; line-height: 1.8; max-width: 600px; color: #e2e8f0; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.mine-slide-overlay .gold-btn { padding: 10px 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); border: none; }

.mines-slider-dots { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; z-index: 10; }
.mines-slider-dots .dot { width: 12px; height: 12px; background-color: rgba(255, 255, 255, 0.4); border-radius: 50%; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.mines-slider-dots .dot:hover { background-color: rgba(255, 255, 255, 0.9); }
.mines-slider-dots .dot.active { background-color: var(--gold); width: 30px; border-radius: 10px; }

/* ==========================================================
   ۷. بخش اختصاصی زرکاوش پردیس
   ========================================================== */
.zarkavosh-section { padding: 25px; background: #ffffff; border-color: rgba(204, 178, 0, 0.2); display: flex; flex-direction: column; gap: 30px; }
.zarkavosh-image-wrapper { width: 100%; height: 300px; border-radius: 16px; overflow: hidden; position: relative; box-shadow: 0 10px 20px rgba(0,0,0,0.04); }
.zarkavosh-image-wrapper::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.05) 100%); pointer-events: none; }
.zarkavosh-image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.zarkavosh-section:hover .zarkavosh-image-wrapper img { transform: scale(1.03); }
.zarkavosh-text-wrapper { padding: 0 15px 10px 15px; }
.zarkavosh-header { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 20px; }
.zarkavosh-header .section-badge { margin-bottom: 15px; }
.zarkavosh-header .section-title { margin-bottom: 0; }
.zarkavosh-desc { color: var(--text-muted); font-size: 15px; margin-bottom: 30px; line-height: 2; }
.zarkavosh-actions { display: flex; gap: 15px; }

/* ==========================================================
   ۸. اسلایدر مقالات (با فلش و بدون اسکرول‌بار)
   ========================================================== */
.articles-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
}

.articles-header-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.articles-header-titles .section-badge { margin-bottom: 15px; }
.articles-header-titles .section-title { margin-bottom: 0; }

.articles-nav-arrows {
    display: flex;
    gap: 10px;
}

.article-arrow {
    background: var(--bg-main);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    outline: none;
}

.article-arrow:hover {
    background: var(--gold);
    color: #ffffff;
    border-color: var(--gold);
    box-shadow: 0 4px 10px var(--gold-glow);
}

.articles-carousel { 
    display: flex; 
    gap: 20px; 
    overflow-x: auto; 
    padding-bottom: 15px; 
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth; 
    
    /* مخفی کردن اسکرول‌بار در مرورگرها */
    -ms-overflow-style: none;  /* IE & Edge */
    scrollbar-width: none;  /* Firefox */
}
.articles-carousel::-webkit-scrollbar { 
    display: none; /* Chrome & Safari */
}

.article-card { 
    flex: 0 0 calc(33.333% - 14px); 
    background: var(--card-bg); border-radius: 16px; overflow: hidden; border: 1px solid var(--card-border); 
    scroll-snap-align: start; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); display: flex; flex-direction: column;
}
.article-card:hover { border-color: rgba(204, 178, 0, 0.3); box-shadow: 0 15px 35px var(--gold-glow); transform: translateY(-6px); }

.article-img { height: 180px; position: relative; overflow: hidden; background: #f8f9fa; }
.article-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.article-card:hover .article-img img { transform: scale(1.05); }

.article-category { position: absolute; top: 15px; right: 15px; background: rgba(255, 255, 255, 0.95); color: var(--gold); padding: 6px 14px; border-radius: 50px; font-size: 11px; font-weight: 700; box-shadow: 0 4px 15px rgba(0,0,0,0.05); backdrop-filter: blur(5px); }
.article-content { padding: 25px 20px; display: flex; flex-direction: column; flex-grow: 1; }
.article-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 15px; font-weight: 500; }
.article-title { font-size: 16px; margin-bottom: 25px; color: var(--text-main); line-height: 1.7; font-weight: 700; }
.article-link { margin-top: auto; color: var(--gold); font-size: 13px; font-weight: bold; display: inline-flex; align-items: center; gap: 6px; transition: var(--transition); text-decoration: none; }
.article-link span { transition: transform 0.3s ease; font-size: 16px; line-height: 1; }
.article-card:hover .article-link { color: #a38e00; }
.article-card:hover .article-link span { transform: translateX(-5px); }

/* ==========================================================
   ۹. سایدبار تحلیل روز
   ========================================================== */
.sidebar .section-badge { margin-bottom: 20px; }
.analysis-text { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; text-align: justify; line-height: 1.9; }

/* ==========================================================
   ۱۰. واکنش‌گرایی (Responsive Design)
   ========================================================== */
@media (max-width: 992px) { 
    .article-card { flex: 0 0 calc(50% - 10px); } 
}

@media (max-width: 768px) {
    .main-content, .sidebar { flex: 1 1 100%; }
    .sidebar { position: static; }
    
    .rates-section-full { padding: 40px 15px; }
    .rates-header-content { text-align: right; }
    
    .mines-slider-container { height: 380px; }
    .mine-slide-overlay { padding: 30px 20px; }
    .mine-slide-title { font-size: 22px; }
    .mine-slide-desc { font-size: 14px; margin-bottom: 20px;}
    
    .zarkavosh-image-wrapper { height: 200px; }
    
    .article-card { flex: 0 0 calc(85% - 10px); } 
    
    /* در موبایل فلش‌ها را مخفی می‌کنیم (با لمس اسکرول می‌شود) */
    .articles-nav-arrows { display: none; }
    .articles-header-top { flex-direction: column; align-items: flex-start; border-bottom: none; padding-bottom: 0;}
    /* جلوگیری از توقف اسلایدر Marquee هنگام لمس در موبایل */
    .marquee-container:hover .marquee-content {
        animation-play-state: running !important;
    }

    /* حذف افکت هاور (زوم و تغییر رنگ) از کارت‌های نرخ طلا در موبایل */
    .rate-card-slider:hover {
        transform: translateY(0) scale(1) !important;
        box-shadow: 0 8px 20px rgba(0,0,0,0.02) !important;
        background: #ffffff !important;
        border-color: rgba(204, 178, 0, 0.15) !important;
        z-index: 1 !important;
    }

    .rate-card-slider:hover::before {
        opacity: 0.3 !important;
        height: 4px !important;
    }
}