/* متغیرهای CSS (برای مدیریت سریع رنگ و فونت) */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f0f2f5; 
    --font-family: 'Vazirmatn', Tahoma, sans-serif; 
    --padding-section: 80px; 
    --max-width-desktop: 1200px; 
    --side-padding: 30px; 
    /* متغیرهای پایه برای اندازه فونت‌ها */
    --base-h1-size: 2.5em; 
    --base-h2-size: 1.8em; 
}

/* ---------------------------------------------------- */
/* تنظیمات فونت */
/* ---------------------------------------------------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); 
    font-weight: 400; 
    font-style: normal;
    font-display: swap; 
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'); 
    font-weight: 700; 
    font-display: swap; 
}

/* ---------------------------------------------------- */
/* تنظیمات کلی و پس‌زمینه */
/* ---------------------------------------------------- */
.bg-pattern { 
    background-color: var(--background-color);
    background-image: url('../img/background-pattern.png'); /* مسیر تصویر پس‌زمینه */
    background-repeat: repeat; 
    background-attachment: fixed;
}

body {
    direction: rtl; 
    text-align: right;
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    color: #333;
}
h2 {
    font-size: var(--base-h2-size);
}

/* ---------------------------------------------------- */
/* کلاس کانتینر (ایجاد فاصله از کناره‌ها) */
/* ---------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-width-desktop); 
    margin-left: auto; 
    margin-right: auto; 
    padding-left: var(--side-padding); 
    padding-right: var(--side-padding); 
}

/* ---------------------------------------------------- */
/* تنظیمات هدر و منو */
/* ---------------------------------------------------- */
header {
    background-color: rgba(255, 255, 255, 0.95); 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* نمایش افقی در دسکتاپ */
}

nav a {
    color: #333;
    text-decoration: none;
    padding: 0 15px;
    font-weight: 500;
    transition: color 0.3s;
}

/* پنهان‌سازی دکمه همبرگری در دسکتاپ */
.menu-toggle {
    display: none; 
}

/* ---------------------------------------------------- */
/* استایل‌دهی بخش‌ها (شفاف‌سازی برای دیده شدن پس‌زمینه) */
/* ---------------------------------------------------- */
section {
    padding: var(--padding-section) 0;
    margin-bottom: 20px; 
    background-color: transparent; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); 
}

.section-content-wrapper {
    background-color: rgba(255, 255, 255, 0.85); 
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.hero {
    background-color: rgba(0, 123, 255, 0.9); 
    color: white;
    text-align: center;
    padding: 100px var(--side-padding);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); 
    margin-top: 20px;
}
.hero .main-title {
    font-weight: 900; 
    font-size: var(--base-h1-size);
}
.hero p {
    font-weight: 500; 
    font-size: 1.2em;
}

/* ---------------------------------------------------- */
/* فوتر */
/* ---------------------------------------------------- */
footer {
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 30px 0;
    text-align: center;
}

/* ---------------------------------------------------- */
/* ریسپانسیو بودن (تنظیمات موبایل و تبلت - زیر 992 پیکسل) */
/* ---------------------------------------------------- */
@media (max-width: 992px) {
    /* تغییر متغیرها برای نمایش فشرده‌تر در موبایل */
    :root {
        --padding-section: 40px; 
        --side-padding: 15px; 
        --base-h1-size: 2em; /* کاهش اندازه H1 */
        --base-h2-size: 1.5em; /* کاهش اندازه H2 */
    }

    /* ************** استایل منوی همبرگری ************** */
    .menu-toggle {
        display: block; 
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        z-index: 10;
        /* پنهان‌سازی متن دکمه برای دسترسی‌پذیری */
        text-indent: 100%;
        white-space: nowrap;
        overflow: hidden;
    }
    .menu-toggle .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: var(--primary-color); /* رنگ بارها */
        transition: all 0.3s ease-in-out;
    }
    
    /* منو در حالت عادی پنهان است */
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%; /* زیر هدر قرار می‌گیرد */
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
    }

    /* نمایش منو وقتی کلاس 'nav-open' فعال شود */
    .header-container.nav-open .main-navigation {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column; 
        text-align: center;
    }
    .main-navigation a {
        padding: 10px 0;
        display: block;
        border-bottom: 1px solid #eee;
    }
    .main-navigation li:last-child a {
        border-bottom: none;
    }
    /* ************************************************* */


    /* ریسپانسیو کردن سایر عناصر */
    .header-container {
        justify-content: space-between; 
        align-items: center;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .hero {
        padding: 50px var(--side-padding);
    }
    
    .download-grid {
        display: block; /* آیتم‌های دانلود زیر هم قرار بگیرند */
    }
    .download-item {
        margin-bottom: 20px;
    }
}