/* --- 1. تعریف فونت‌های محلی (Local Fonts) --- */

/* تعریف فونت وزیر (برای متن اصلی) */
@font-face {
    font-family: 'MyVazir';
    src: url('fonts/Vazir.woff2') format('woff2'); 
    font-weight: normal;
    font-style: normal;
}

/* تضمین قطعی عدم بیرون‌زدگی کادرها در موبایل */
*, *::before, *::after {
    box-sizing: border-box;
}

/* تعریف فونت لاله‌زار (برای تیترها) */
@font-face {
    font-family: 'MyLalezar';
    src: url('fonts/Lalezar.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* --- 2. متغیرها و تنظیمات پایه --- */
:root {
    --bg-color: #f0f4f8;
    --text-color: #2d3748;
    --card-bg: #ffffff;
    --accent-color: #4CAF50; /* سبز سیدی */
    --shadow-light: 8px 8px 16px #d1d9e6;
    --shadow-dark: -8px -8px 16px #ffffff;
    
    /* گرادینت روز: روشن و آسمانی */
    --bg-image: linear-gradient(135deg, rgba(227, 242, 253, 0.8) 0%, rgba(241, 248, 233, 0.8) 100%);
}

/* تنظیمات کلی صفحه */
html {
    scroll-behavior: smooth; /* اسکرول نرم برای لینک‌های داخلی */
}

/* اسکرول بار سفارشی (خوشگل‌سازی نوار سمت راست مرورگر) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #388E3C; /* تیره شدن موقع هاور */
}

/* حالت شب (اصلاح شده برای رنگ عمیق) */
body.dark-mode {
    --bg-color: #0f172a; /* سرمه‌ای خیلی تیره (نزدیک به مشکی) */
    --text-color: #e2e8f0;
    --card-bg: #1e293b; /* خاکستری-آبی تیره برای کارت‌ها */
    --accent-color: #81E6D9;
    --shadow-light: 4px 4px 10px #020617; /* سایه مشکی */
    --shadow-dark: -4px -4px 10px #334155; /* نور ملایم */
    
    /* گرادینت شب: تاریک و مرموز */
    --bg-image: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body {
    background-color: var(--bg-color);
    /* استفاده از متغیر هوشمند برای پس‌زمینه */
    background-image: var(--bg-image);
    color: var(--text-color);
    
    /* فونت‌های سیستمی */
    font-family: 'MyVazir', Tahoma, sans-serif;
    
    margin: 0;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease, background-image 0.4s ease;
    overflow-x: hidden;
}

/* استفاده از فونت لاله‌زار برای تیترها */
h1, h2, h3, h4, .stat-number, .clay-btn, .social-btn {
    font-family: 'MyLalezar', 'MyVazir', Tahoma, sans-serif;
}

/* --- 3. استایل‌های اصلی (Hero, Cards, Tools) --- */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

/* هدر و آواتار */
.hero {
    margin-top: 40px;
    margin-bottom: 40px;
}

.avatar-box {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    border: 3px solid rgba(255,255,255,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 10px;
    margin: 0 auto 25px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top; /* تنظیم روی صورت */
    transform: scale(1.35) translateY(15px);
    transition: transform 0.3s ease;
}

.avatar-box:hover .avatar-img {
    transform: scale(1.45) translateY(15px);
}

.tagline {
    font-size: 1.2rem;
    margin-top: 10px;
    opacity: 0.8;
}

/* =========================================
   کدهای نهایی و قطعی منو (ناوبری)
   ========================================= */
nav {
    position: sticky;
    top: 20px;
    z-index: 100;
    margin-bottom: 60px;
    display: flex;
    justify-content: center; /* کپسول را دقیقاً وسط صفحه نگه می‌دارد */
    padding: 0 15px; 
}

nav ul {
    display: flex;
    align-items: center;
    gap: 15px;
    list-style: none;
    padding: 10px 20px;
    margin: 0;
    
    /* ⛔ جادوی اصلی برای جلوگیری از کشیده شدن و سفره شدن منو */
    width: max-content; 
    max-width: 100%;
    
    /* استفاده از متغیر کارت برای هماهنگی خودکار و خوانایی در تم شب و روز */
    background: var(--card-bg); 
    backdrop-filter: blur(10px);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    
    /* تنظیمات اسکرول نرم برای موبایل */
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; 
}

/* مخفی کردن اسکرول‌بار زشت مرورگر */
nav ul::-webkit-scrollbar {
    display: none;
}

/* جلوگیری قطعی از له‌شدگی دکمه‌ها و لینک‌ها */
nav ul li, nav ul a, nav ul button {
    flex-shrink: 0 !important;
}

/* 🎨 بازگرداندن زیبایی لینک‌ها (کشتن رنگ آبی و خط زیرشان!) */
nav a {
    text-decoration: none !important;
    color: var(--text-color) !important; /* در روز تیره، در شب روشن */
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 20px;
    transition: 0.3s;
    display: inline-block;
}

/* افکت هاور (رفتن موس روی لینک‌ها) */
nav a:hover, nav a.cta-link {
    background: var(--accent-color) !important;
    color: #ffffff !important;
}

.clay-card {
    background: var(--card-bg);
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--shadow-light), var(--shadow-dark);
    border: 1px solid rgba(255,255,255,0.4);
    transition: transform 0.3s ease;
}

/* دکمه‌ها و فرم‌ها */
.clay-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 5px 5px 10px rgba(0,0,0,0.1), -5px -5px 10px rgba(255,255,255,0.2);
    transition: transform 0.1s;
}

.clay-btn:active {
    box-shadow: inset 5px 5px 10px rgba(0,0,0,0.1);
    transform: scale(0.98);
}

.clay-input {
    background: var(--bg-color);
    border: none;
    padding: 12px;
    border-radius: 10px;
    width: 70%;
    box-shadow: inset 4px 4px 8px rgba(0,0,0,0.1), inset -4px -4px 8px rgba(255,255,255,0.5);
    margin-bottom: 10px;
    text-align: center;
}

/* انیمیشن‌ها و بخش اژدها */
.mystery-box {
    border: 2px dashed var(--accent-color);
    animation: breathe 3s infinite ease-in-out;
    position: relative;
    overflow: hidden;
    margin-top: 30px;
}

@keyframes breathe {
    0% { transform: scale(1); box-shadow: var(--shadow-light), var(--shadow-dark); }
    50% { transform: scale(1.02); box-shadow: 0 0 25px rgba(212, 163, 115, 0.5); }
    100% { transform: scale(1); box-shadow: var(--shadow-light), var(--shadow-dark); }
}

/* انیمیشن شناور */
@keyframes float-up-down {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

.floating-card {
    animation: float-up-down 6s ease-in-out infinite;
}
.floating-card:nth-child(even) {
    animation-delay: 0.5s;
}

.hover-lift:hover {
    transform: translateY(-10px);
}

/* فوتر */
.social-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 30px 0;
}
.social-btn {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 15px;
    color: white;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.social-btn:hover { transform: scale(1.1); }
.linkedin { background: #0077b5; }
.telegram { background: #229ED9; }
.whatsapp { background: #25D366; }
.bale { background: #37A000; }

.secondary-btn { background: var(--text-color); }
body.dark-mode .secondary-btn { background-color: #444 !important; color: #fff !important; }

#contact {
    margin-top: 40px;
    padding: 30px 0;
    opacity: 0.9;
}

/* --- استایل‌های اختصاصی صفحه مقاله (Blog Post) --- */

/* نوار پیشرفت مطالعه */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: transparent;
    z-index: 999;
}
#progress-bar {
    height: 5px;
    background: var(--accent-color);
    width: 0%;
    border-radius: 0 5px 5px 0;
    box-shadow: 0 0 10px var(--accent-color);
}

/* بدنه مقاله */
.article-container {
    max-width: 700px; /* متن مقاله نباید خیلی پهن باشه */
}

.article-header {
    text-align: center;
    margin-bottom: 30px;
}

.article-tag {
    background: rgba(76, 175, 80, 0.1);
    color: var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.article-title {
    font-size: 2rem;
    margin: 20px 0;
    line-height: 1.4;
}

.article-meta {
    font-size: 0.9rem;
    opacity: 0.7;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* تایپوگرافی متن اصلی */
.article-content {
    text-align: justify;
    line-height: 1.8; /* فاصله خطوط زیاد برای خوانایی */
    font-size: 1.1rem;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content h3 {
    margin-top: 40px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

/* پاراگراف مقدمه (Lead) */
.lead {
    font-size: 1.2rem;
    font-weight: bold;
    opacity: 0.9;
}

/* باکس نکته (Highlight Box) */
.highlight-box {
    background: rgba(255, 193, 7, 0.1); /* زرد خیلی کمرنگ */
    border-right: 4px solid #FFC107;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
}
body.dark-mode .highlight-box {
    background: rgba(255, 193, 7, 0.05);
}

/* باکس نویسنده */
.author-box {
    margin-top: 40px;
    padding: 20px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px 0;
    margin-top: auto;
    border-top: 1px dashed rgba(0,0,0,0.1); /* خط چین جداکننده */
}

.small-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 50px; /* دکمه گرد */
}

/* بخش دکمه و تاریخ */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 15px;
    margin-top: auto; /* چسبیدن به پایین کارت */
}

.small-btn {
    padding: 8px 15px;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
}

/* =========================================
   استایل‌های اختصاصی برای متن مقالات (تایپوگرافی)
   ========================================= */

/* فاصله خطوط و فونت برای خوانایی بهتر */
#post-content {
    line-height: 2; /* فاصله خطوط بیشتر برای راحتی چشم */
    font-size: 1.15rem; /* کمی درشت‌تر */
    color: #333;
}

/* تیترهای داخلی مقاله */
#post-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--accent-color);
    border-right: 4px solid var(--accent-color);
    padding-right: 15px; /* فاصله از خط راست */
}

#post-content h3 {
    margin-top: 30px;
    font-size: 1.3rem;
    font-weight: bold;
}

/* نقل‌قول‌ها (برای بخش‌های طنز یا مهم) */
#post-content blockquote {
    background: rgba(108, 92, 231, 0.1); /* رنگ محو */
    border-right: 5px solid var(--accent-color);
    margin: 30px 0;
    padding: 20px;
    border-radius: 8px 0 0 8px;
    font-style: italic;
    color: #555;
}

/* لیست‌های داخل مقاله */
#post-content ul, #post-content ol {
    margin-right: 20px;
    margin-bottom: 20px;
}
#post-content li {
    margin-bottom: 10px;
}

/* تصاویر داخل متن مقاله */
#post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* لینک‌های داخل متن */
#post-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-color);
}
#post-content a:hover {
    background-color: var(--accent-color);
    color: white;
}

/* دارک مود برای مقاله */
body.dark-mode #post-content {
    color: #e0e0e0;
}
body.dark-mode #post-content blockquote {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

/* =========================================
   اصلاح نهایی و قطعی پست‌ها (نسخه تضمینی)
   ========================================= */

/* 1. هم‌اندازه کردن عرض پست‌ها با پروفایل بالا */
.grid-container {
    display: grid;
    grid-template-columns: 1fr; /* در موبایل تک ستونه */
    gap: 30px;
    width: 100%;
    max-width: 800px; /* ✅ دقیقاً هم‌اندازه با کانتینر اصلی سایت */
    margin: 0 auto 30px auto; /* وسط‌چین کردن */
    padding: 0 20px; /* فاصله از لبه‌های گوشی */
    box-sizing: border-box;
}

/* حالت دو ستونه فقط برای مانیتورهای بزرگ */
@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 2. استایل کارت (حذف رنگ بنفش لینک‌ها با زور!) */
a.post-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none !important; /* خط زیر لینک را حذف کن */
    box-shadow: var(--shadow-light), var(--shadow-dark);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
    min-height: 380px;
    color: var(--text-color) !important; /* رنگ اصلی را اعمال کن */
}

/* این بخش جادویی است که رنگ بنفش را می‌کشد */
a.post-card * {
    text-decoration: none !important;
    color: inherit !important; /* همه اجزا باید رنگ پدرشان را بگیرند نه رنگ لینک را */
}

/* هاور */
a.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* عکس */
.post-card-img {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-bottom: 2px solid var(--accent-color);
}

/* بدنه متن */
.post-card-content {
    padding: 20px;
    text-align: right;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.4;
}

.post-card-content p {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* فوتر کارت */
.post-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    opacity: 0.7;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.read-btn {
    background: var(--accent-color);
    color: #fff !important; /* فقط دکمه سفید بماند */
    padding: 5px 12px;
    border-radius: 8px;
}

/* =========================================
   استایل باکس تیترهای اصلی (کلاس درس و روایت‌خانه)
   ========================================= */

   .section-title-box {
    /* تنظیمات موقعیت و اندازه */
    width: 100%;
    max-width: 800px; /* هم‌اندازه با بقیه بخش‌های اصلی */
    margin: 80px auto 40px auto; /* فاصله مناسب از بالا و پایین و وسط‌چین */
    padding: 30px 20px;
    box-sizing: border-box;
    text-align: center; /* متن‌ها دقیقاً وسط باشند */

    /* استایل ظاهری (شیشه‌ای و برجسته - Claymorphism) */
    background: var(--card-bg);
    border-radius: 30px; /* گوشه‌های گرد */
    box-shadow: var(--shadow-light), var(--shadow-dark); /* سایه نرم و برجسته */
    border: 1px solid rgba(255,255,255,0.4); /* خط دور ظریف */

    /* انیمیشن تپش (همان چیزی که خواستی) */
    animation: breathe 4s infinite ease-in-out;
}

/* تنظیم فونت تیتر داخل باکس */
.section-title-box h2 {
    margin: 0 0 15px 0;
    font-size: 2rem;
    color: var(--accent-color); /* رنگ سبز/تم اصلی */
}

/* تنظیم متن توضیحات داخل باکس */
.section-title-box p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* =========================================
   اضافه شده برای اسلایدر (مرحله ۱)
   ========================================= */

/* کانتینر اصلی اسلایدر که کارت‌ها توش قرار می‌گیرن */
.slider-container {
    display: flex; /* چیدمان خطی */
    gap: 20px;     /* فاصله بین کارت‌ها */
    overflow-x: auto; /* اسکرول افقی */
    padding: 20px 25px 40px 25px; /* پدینگ پایین بیشتر برای سایه کارت‌ها */
    scroll-behavior: smooth; /* حرکت نرم */
    scroll-snap-type: x mandatory; /* حالت آهنربایی */
    -webkit-overflow-scrolling: touch; /* نرمی در موبایل */
    
    /* مخفی کردن اسکرول‌بار پیش‌فرض (اختیاری) */
    scrollbar-width: none; 
}
.slider-container::-webkit-scrollbar {
    display: none;
}

/* کارت‌ها وقتی داخل اسلایدر هستن */
.slider-container .post-card {
    min-width: 280px; /* عرض ثابت کارت */
    max-width: 280px;
    flex: 0 0 auto;   /* جلوگیری از جمع شدن کارت */
    scroll-snap-align: start; /* تنظیم آهنربا */
    height: auto;     /* ارتفاع خودکار */
    margin-bottom: 0; /* حذف مارجین پایین چون افقی شدیم */
}

/* هدر سکشن‌ها (تیتر + دکمه‌ها) */
.section-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 20px;
    padding: 0 10px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

/* استایل دکمه‌های چپ و راست */
.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.nav-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* لینک مشاهده همه */
.view-all-btn {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-color);
}

/* =========================================
   سایدبار شناور هویتی (نسخه کلی‌مورفیک)
   ========================================= */
.floating-sidebar {
    position: fixed;
    top: 130px;
    left: 40px; /* قرارگیری در فضای خالی سمت چپ */
    width: 160px;
    text-align: center;
    z-index: 100;
    padding: 20px 15px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* عکس آواتار سایدبار */
.floating-sidebar img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 3px solid var(--accent-color);
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.floating-sidebar h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.floating-sidebar p {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

/* آیکون‌های دسترسی سریع */
.sidebar-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    padding-top: 15px;
}
body.dark-mode .sidebar-links {
    border-top-color: rgba(255,255,255,0.1);
}

.sidebar-links a {
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.2s;
    opacity: 0.8;
}
.sidebar-links a:hover {
    transform: scale(1.3);
    opacity: 1;
}

/* حالت محو شده هنگام اسکرول به پایین مقاله */
.floating-sidebar.faded {
    opacity: 0.2;
    transform: translateX(-15px); /* کمی به عقب می‌رود */
}

/* بازگشت با قدرت هنگام هاور */
.floating-sidebar:hover {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* مخفی کردن کامل در موبایل و تبلت برای جلوگیری از شلوغی */
@media (max-width: 1100px) {
    .floating-sidebar {
        display: none;
    }
}

/* =========================================
   اصلاح خوانایی دکمه‌ها در حالت شب
   ========================================= */
body.dark-mode .clay-btn {
    color: #0f172a !important; /* رنگ سرمه‌ای تیره برای متن دکمه‌ها */
    font-weight: bold !important; /* کمی ضخیم‌تر برای خوانایی بهتر */
}

/* =========================================
   بهینه‌سازی قطعی و اورژانسی برای موبایل و تبلت
   ========================================= */
@media (max-width: 768px) {
    
    /* ۱. مهار کردن آواتار غول‌پیکر */
    .avatar-box {
        width: 140px; 
        height: 140px;
        margin-bottom: 15px;
    }
    .avatar-img {
        transform: scale(1.15) translateY(10px); 
    }
    
    /* ۲. تنظیم سایز تیترها */
    .text-box h1 { font-size: 1.5rem; }
    .tagline { font-size: 1rem; }

    /* ۳. اصلاح حاشیه‌ها */
    .hero {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    /* 🚀 ۴. جادوی جدید: شناور کردن دکمه تم در موبایل */
    #theme-toggle {
        position: fixed !important;
        bottom: 30px !important;
        left: 20px !important; /* قرارگیری در پایین سمت چپ */
        z-index: 9999 !important; /* همیشه روی همه‌چیز باشه */
        width: 55px !important;
        height: 55px !important;
        border-radius: 50% !important;
        background: var(--card-bg) !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
        border: 2px solid rgba(255,255,255,0.1) !important;
        margin: 0 !important;
        font-size: 1.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ۵. بهینه‌سازی منو و شکستن طلسم زندان! */
    nav ul {
        justify-content: flex-start !important;
        padding-right: 20px !important;
        backdrop-filter: none !important; /* 👈 کلید فرار دکمه! */
    }
    
    /* مخفی کردن خطِ جداکنندهِ قبل از دکمه تم که حالا اضافه است */
    nav ul li:nth-last-child(2) {
        display: none !important;
    }
}

/* =========================================
   افکت‌های جذاب حرکتی و مواجی
   ========================================= */

/* متن مواجی و زنده (قابل استفاده برای شعار زیر اسم یا تیترها) */
.wavy-text {
    display: inline-block;
    animation: gentle-wave 4s ease-in-out infinite;
}

@keyframes gentle-wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* افکت موج نوری ملایم روی متن (Shimmer Text) */
.shimmer-text {
    background: linear-gradient(90deg, var(--text-color) 0%, var(--accent-color) 50%, var(--text-color) 100%);
    background-size: 200% auto;
    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;
    animation: textShine 5s linear infinite;
}

@keyframes textShine {
    to {
        background-position: 200% center;
    }
}

/* بهینه‌سازی ریسپانسیو بخش خبرنامه در موبایل */
@media (max-width: 600px) {
    .newsletter {
        flex-direction: column;
        align-items: stretch !important;
    }
    .newsletter .clay-input {
        width: 100% !important;
        max-width: 100% !important;
    }
    .newsletter .clay-btn {
        width: 100% !important;
    }
}

/* =========================================
   ارتقای بصری صفحه اصلی، زیردسته‌ها و ترازبندی
   ========================================= */
@media (min-width: 650px) {
    /* چیدمان عمودی Hero با قاب مربع گوشه‌گرد کلی‌مورفیک */
    .hero {
        margin-top: 25px;
        margin-bottom: 25px;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-content .avatar-box {
        width: 170px;
        height: 170px;
        border-radius: 34px;
        margin: 0 auto 18px auto;
        padding: 8px;
        overflow: hidden;
    }

    .hero-content .avatar-img {
        border-radius: 26px;
        object-fit: cover;
        transform-origin: center 14%;
        transform: scale(1.75);
        transition: transform 0.3s ease;
    }

    .hero-content .avatar-box:hover .avatar-img {
        transform: scale(1.83);
    }

    @media (max-width: 768px) {
    .hero-content .avatar-box {
        width: 145px;
        height: 145px;
    }
}
}

.toolbox-grid {
    padding: 0 !important;
}

.tool-card {
    position: relative;
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    transition: transform 0.3s;
}
.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.status-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.15);
    z-index: 10;
}
.badge-beta { background: #2ed573; }

.section-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.subcat-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 0 10px;
}

.pill-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid rgba(128,128,128,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: 'MyVazir', Tahoma, sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pill-btn:hover, .pill-btn.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}
body.dark-mode .pill-btn.active {
    color: #0f172a;
    font-weight: bold;
}

.post-card-img {
    position: relative;
}
.card-sub-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    backdrop-filter: blur(4px);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.breadcrumb-nav a {
    color: var(--accent-color);
    text-decoration: none;
}

.secondary-btn {
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    border: 1px solid rgba(128,128,128,0.25) !important;
}
.secondary-btn:hover {
    background: var(--accent-color) !important;
    color: #fff !important;
}
body.dark-mode .secondary-btn:hover {
    color: #0f172a !important;
}

.clay-input {
    color: var(--text-color);
}