/* ========== فونت‌های لوکال ========== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-800.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-900.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-v24-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-v24-latin-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
}

/* ========== متغیرهای رنگی ========== */
:root {
    --bg-dark: #000000;
    --bg-card: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-color: #222222;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Vazirmatn', sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--text-muted);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2vw;
}

/* --- Navbar --- */
header {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    position: relative;
}

.nav-section {
    flex: 1;
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-right { justify-content: flex-start; }

.logo {
    flex: 1;
    text-align: center;
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
}

.logo-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
}

.nav-actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

.btn-outline {
    padding: 7px 18px;
    border: 1px solid var(--text-main);
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    cursor: pointer;
}

.btn-outline:hover {
    background: var(--text-main);
    color: #000;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    order: -1;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: 0.3s;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 999;
}

/* --- Hero Section --- */
.hero {
    padding: 80px 0 60px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    border: 1px solid var(--border-color);
    padding: 6px 22px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 28px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero p.desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 30px;
}

.features-list {
    list-style: none;
    text-align: right;
    max-width: 550px;
    margin: 0 auto;
    padding: 0 10px;
}

.features-list li {
    margin-bottom: 12px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Statistics --- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    background: linear-gradient(90deg, rgba(10,10,10,0) 0%, rgba(15,15,15,1) 50%, rgba(10,10,10,0) 100%);
    margin: 0;
    padding: 0;
}

.stat-box {
    padding: 40px 20px;
    border-left: 1px solid var(--border-color);
}
.stat-box:last-child { border-left: none; }

.stat-box h3 {
    font-family: monospace;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.stat-box span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Content Grids --- */
.section-header {
    margin: 60px 0 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.5rem;
    border-right: 4px solid var(--text-main);
    padding-right: 15px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--text-main);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.05);
}

.card-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #111;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-img img {
    transform: scale(1.05);
}

.card-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex: 1;
}

.card-meta {
    margin-top: 20px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.card-tags span {
    font-size: 0.7rem;
    padding: 2px 10px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: monospace;
}

/* --- نشانگر سختی (مونوکروم) --- */
.difficulty-bar {
    display: flex;
    gap: 4px;
    margin-top: 15px;
}

.difficulty-bar .bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: background 0.2s;
}

/* فعال‌سازی سفید بر اساس تعداد */
.difficulty-bar[data-difficulty="1"] .bar:nth-child(1) { background: #ffffff; }
.difficulty-bar[data-difficulty="2"] .bar:nth-child(1),
.difficulty-bar[data-difficulty="2"] .bar:nth-child(2) { background: #ffffff; }
.difficulty-bar[data-difficulty="3"] .bar:nth-child(1),
.difficulty-bar[data-difficulty="3"] .bar:nth-child(2),
.difficulty-bar[data-difficulty="3"] .bar:nth-child(3) { background: #ffffff; }

/* --- Buttons --- */
.btn-container {
    text-align: center;
    margin-bottom: 60px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--text-main);
    background-color: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--text-main);
    color: var(--bg-dark);
}



/* --- Footer --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 50px 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    list-style: none;
    flex-wrap: wrap;
}

.social-links a {
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: monospace;
}

/* تصویر کتاب‌ها (حفظ نسبت عمودی) */
.book-card-img {
    width: 100%;
    height: 250px;               /* ارتفاع بیشتر برای کتاب‌های عمودی */
    overflow: hidden;
    background: #111;
}

.book-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;         /* کل جلد کتاب دیده شود */
    object-position: center;
    padding: 8px;                /* کمی فاصله از لبه‌ها */
    transition: transform 0.4s ease;
}

.card:hover .book-card-img img {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-right, .nav-actions { display: none; }
    .logo { position: static; text-align: center; flex: 1; }
    .hamburger { display: block; }
    .nav-wrapper { height: auto; padding: 15px 0; gap: 15px; flex-wrap: wrap; justify-content: center; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .mobile-open .nav-right {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0; right: 0;
        width: 260px; height: 100vh;
        background: #000;
        border-left: 1px solid var(--border-color);
        padding: 80px 24px;
        gap: 20px;
        z-index: 1001;
    }
    .mobile-open .mobile-overlay { display: block; }

    .hero {
        text-align: center;
        padding: 40px 10px 50px;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p.desc {
        padding: 0 10px;
        margin-bottom: 25px;
    }
    .features-list {
        text-align: center;
        max-width: 100%;
        padding: 0 10px;
    }
    .features-list li {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .btn { width: 100%; text-align: center; }
    .grid-container { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .stat-box { border-left: none; border-bottom: 1px solid var(--border-color); }
    .stat-box:last-child { border-bottom: none; }
}
