/* =========================================================
   ADVANCED CSS ARCHITECTURE
   ========================================================= */

/* --- 1. CSS Custom Properties (Theme Engine) --- */
:root {
    /* Base Colors */
    --hue-primary: 221;
    --color-primary: hsl(var(--hue-primary), 83%, 53%);     /* Blue-500 */
    --color-primary-hover: hsl(var(--hue-primary), 83%, 45%);
    --color-primary-alpha: hsla(var(--hue-primary), 83%, 53%, 0.2);
    --color-danger: hsl(0, 84%, 60%);
    --color-success: hsl(152, 69%, 31%);
    
    /* Sizing & Borders */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --container-max: 1280px;
    --header-height: 80px;

    /* Transitions */
    --trans-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* System Typography (No External Resources) */
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-body: #020617;
    --bg-glass: rgba(15, 23, 42, 0.65);
    --bg-glass-heavy: rgba(15, 23, 42, 0.95);
    --bg-element: rgba(255, 255, 255, 0.03);
    --bg-element-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.03);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --shadow-glass: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
    
    /* Advanced Gradients */
    --gradient-glow: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.15), transparent 70%);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-heavy: rgba(255, 255, 255, 0.95);
    --bg-element: rgba(0, 0, 0, 0.03);
    --bg-element-hover: rgba(0, 0, 0, 0.08);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.03);
    --text-main: #0f172a;
    --text-muted: #475569;
    --shadow-glass: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.1);
    
    /* Advanced Gradients */
    --gradient-glow: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.1), transparent 70%);
}

/* --- 2. Reset & Global Styles --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
}

body {
    background-color: var(--bg-body);
    background-image: var(--gradient-glow);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.7;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    transition: background-color var(--trans-normal), color var(--trans-normal);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: inherit; text-decoration: none; transition: color var(--trans-fast); }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
ul, ol { list-style: none; }
button, input, textarea { background: none; border: none; outline: none; color: inherit; font: inherit; }

/* Reading Progress Bar */
#progress-bar {
    position: fixed; top: 0; left: 0; height: 4px; background: var(--color-primary);
    z-index: 10000; width: 0%; box-shadow: 0 0 10px var(--color-primary);
    transition: width 0.1s ease;
}

/* --- 3. Layout System --- */
.container {
    width: 100%; 
    max-width: var(--container-max); 
    margin: 0 auto; 
    padding: 0 24px;
    box-sizing: border-box !important;
}

.main-wrapper {
    display: grid; 
    grid-template-columns: 1fr 340px; 
    gap: 40px; 
    margin-top: 40px; 
    min-height: 70vh;
    width: 100%;
}

@media (max-width: 1024px) {
    .container { padding: 0 16px; }
    .main-wrapper { 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 30px !important; 
        width: 100% !important;
    }
    .sidebar, .content-area { 
        width: 100% !important; 
        max-width: 100% !important; 
    }
    .sidebar { order: 2 !important; }
}

/* --- 4. Components & Glassmorphism --- */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: background-color var(--trans-normal), border-color var(--trans-normal), transform var(--trans-normal), box-shadow var(--trans-normal);
}

.form-group { margin-bottom: 20px; }
.form-control {
    width: 100%; padding: 14px 20px; background: var(--bg-element); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); color: var(--text-main); transition: all var(--trans-fast);
}
.form-control:focus {
    border-color: var(--color-primary); background: transparent; box-shadow: 0 0 0 4px var(--color-primary-alpha);
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 24px; font-weight: 600; border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--trans-fast); text-align: center;
}
.btn-primary {
    background: var(--color-primary); color: #fff; box-shadow: 0 4px 14px var(--color-primary-alpha);
}
.btn-primary:hover {
    background: var(--color-primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px var(--color-primary-alpha);
}
.btn-outline {
    background: transparent; border: 1px solid var(--border-color); color: var(--text-main);
}
.btn-outline:hover {
    background: var(--bg-element-hover); border-color: var(--text-muted);
}
.btn-icon { padding: 10px; border-radius: var(--radius-full); }

/* --- 5. Header & Navigation --- */
.header-wrapper {
    position: sticky; top: 0; z-index: 1000; width: 100%; margin-bottom: 30px;
    background: var(--bg-glass-heavy); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.4s ease, background-color var(--trans-normal);
}
.header-wrapper.scrolled-down { transform: translateY(-100%); }
.header-inner {
    display: flex; align-items: center; justify-content: space-between; height: var(--header-height);
}

.logo { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.logo img { height: 40px; border-radius: var(--radius-sm); }
.logo span { background: linear-gradient(to right, var(--color-primary), #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.main-nav { display: flex; align-items: center; gap: 8px; }
.nav-item { padding: 8px 16px; border-radius: var(--radius-full); font-weight: 500; transition: var(--trans-fast); }
.nav-item:hover, .nav-item.active { background: var(--bg-element-hover); color: var(--color-primary); }

.header-actions { display: flex; align-items: center; gap: 15px; }

/* Live Search */
.search-container { position: relative; }
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-input-wrapper svg { position: absolute; right: 16px; color: var(--text-muted); width: 20px; pointer-events: none; }
.search-input {
    width: 240px; padding: 10px 45px 10px 20px; border-radius: var(--radius-full);
    background: var(--bg-element); border: 1px solid var(--border-color); color: var(--text-main);
    transition: all var(--trans-normal);
}
.search-input:focus { width: 320px; border-color: var(--color-primary); background: var(--bg-glass); box-shadow: var(--shadow-glow); }

.live-search-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0; width: 320px; background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px); border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass); opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all var(--trans-normal); z-index: 1010; overflow: hidden;
}
.live-search-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.live-search-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-light);
    transition: var(--trans-fast);
}
.live-search-item:hover { background: var(--bg-element-hover); }
.live-search-item img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); }
.ls-info h4 { font-size: 0.95rem; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ls-info span { font-size: 0.75rem; color: var(--text-muted); }
.live-search-more { display: block; padding: 12px; text-align: center; color: var(--color-primary); font-size: 0.9rem; font-weight: 500; }
.live-search-more:hover { background: var(--color-primary-alpha); }
.live-search-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Mobile Menu & Responsive Header */
.mobile-toggle { display: none; cursor: pointer; padding: 10px; color: var(--text-main); }
@media (max-width: 900px) {
    .search-input, .search-input:focus, .search-input-wrapper { display: none !important; }
    .mobile-toggle {
        display: flex !important; align-items: center !important; justify-content: center !important; z-index: 10000 !important;
    }
    .main-nav {
        display: flex !important; flex-direction: column !important;
        position: absolute !important; top: 100% !important; left: 50% !important; transform: translateX(-50%) !important;
        width: 100vw !important; max-width: 100vw !important;
        background: rgba(11, 15, 25, 0.98) !important; backdrop-filter: blur(24px) !important; -webkit-backdrop-filter: blur(24px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important; box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8) !important;
        margin: 0 !important; max-height: 0 !important; overflow: hidden !important; opacity: 0 !important; visibility: hidden !important; padding: 0 !important;
        transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, visibility 0.5s, padding 0.4s ease !important; z-index: 9999 !important;
    }
    .main-nav.active {
        max-height: 600px !important; opacity: 1 !important; visibility: visible !important; padding: 15px 0 25px 0 !important;
    }
    .nav-item {
        display: block !important; width: 100% !important; text-align: right !important; padding: 16px 35px !important; margin: 0 !important;
        border-radius: 0 !important; font-size: 1.15rem !important; font-weight: 500 !important; color: rgba(255, 255, 255, 0.85) !important;
        background: transparent !important; border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important; transition: all 0.3s ease !important; box-sizing: border-box !important;
    }
    .main-nav .nav-item:last-child { border-bottom: none !important; }
    .nav-item:hover, .nav-item:active, .nav-item.active {
        background: rgba(99, 102, 241, 0.08) !important; color: #818cf8 !important; padding-right: 45px !important; border-right: 3px solid #6366f1 !important;
    }
    .mobile-toggle svg { overflow: visible !important; width: 28px !important; height: 28px !important; }
    .mobile-toggle line { transition: transform 0.4s ease, opacity 0.3s ease !important; transform-origin: center !important; stroke: #e5e7eb !important; stroke-width: 2px !important; }
    .mobile-toggle.active line:nth-child(1) { opacity: 0 !important; transform: scale(0) !important; }
    .mobile-toggle.active line:nth-child(2) { transform: translateY(6px) rotate(45deg) !important; }
    .mobile-toggle.active line:nth-child(3) { transform: translateY(-6px) rotate(-45deg) !important; }
}

/* --- 6. Hero Section --- */
.hero-grid {
    display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 50px; height: 460px;
}
.hero-card {
    position: relative; border-radius: var(--radius-lg); overflow: hidden; display: block;
    background: var(--bg-element); transform: translateZ(0);
}
.hero-card.main { grid-row: span 2; }
.hero-card img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.hero-card:hover img { transform: scale(1.08); }
.hero-overlay {
    position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 50%, rgba(2,6,23,0.95) 100%);
    display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; z-index: 2;
}
.badge {
    display: inline-flex; align-items: center; padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    background: var(--color-primary); color: white; backdrop-filter: blur(4px); margin-bottom: 12px; width: fit-content;
}
.hero-title { font-size: 2rem; color: #fff; line-height: 1.3; margin-bottom: 12px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.hero-card:not(.main) .hero-title { font-size: 1.25rem; }
.hero-meta { display: flex; gap: 16px; color: rgba(255,255,255,0.7); font-size: 0.85rem; }

@media (max-width: 768px) {
    .hero-grid { 
        display: flex !important; 
        flex-direction: column !important; 
        height: auto !important; 
        gap: 16px !important;
    }
    .hero-card { width: 100% !important; height: 260px !important; }
    .hero-card.main { height: 320px !important; }
    .hero-title { font-size: 1.4rem !important; }
}

/* --- 7. Post Grid & Cards --- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; width: 4px; height: 24px; background: var(--color-primary); border-radius: 4px; }

.post-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px;
}
.post-card {
    display: flex; flex-direction: column; height: 100%; transition: all var(--trans-normal);
    position: relative; overflow: hidden;
}
.post-card:hover { transform: translateY(-8px); border-color: var(--color-primary-alpha); box-shadow: var(--shadow-glow); }
.post-card-img-wrap { position: relative; padding-top: 60%; overflow: hidden; border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; }
.post-card-img-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.post-card:hover .post-card-img-wrap img { transform: scale(1.05); }
.post-card-badge { position: absolute; top: 16px; right: 16px; z-index: 2; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.post-card-content { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.post-card-title { font-size: 1.25rem; font-weight: 700; line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-excerpt { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border-light); color: var(--text-muted); font-size: 0.85rem; }
.meta-stats { display: flex; gap: 12px; }
.meta-stats span { display: flex; align-items: center; gap: 4px; }
.meta-stats svg { width: 16px; height: 16px; }

@media (max-width: 600px) {
    .post-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 50px; }
.page-link {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border-radius: var(--radius-md); background: var(--bg-element); border: 1px solid var(--border-color);
    font-weight: 600; transition: all var(--trans-fast);
}
.page-link:hover { background: var(--bg-element-hover); transform: translateY(-2px); }
.page-link.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); box-shadow: 0 4px 10px var(--color-primary-alpha); }
.page-dots { color: var(--text-muted); }

/* --- 8. Sidebar Widgets --- */
.widget { padding: 24px; margin-bottom: 30px; }
.widget-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; }

.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--bg-element); transition: var(--trans-fast); }
.cat-item:hover { background: var(--color-primary-alpha); color: var(--color-primary); padding-right: 20px; }
.cat-count { background: var(--bg-glass); padding: 2px 8px; border-radius: 20px; font-size: 0.8rem; border: 1px solid var(--border-light); }

.pop-list { display: flex; flex-direction: column; gap: 16px; }
.pop-item { display: flex; gap: 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border-light); transition: var(--trans-fast); }
.pop-item:last-child { border-bottom: none; padding-bottom: 0; }
.pop-item:hover { transform: translateX(-5px); }
.pop-img { width: 70px; height: 70px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.pop-info h4 { font-size: 0.95rem; line-height: 1.4; margin-bottom: 6px; }
.pop-info span { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.nl-widget { text-align: center; }
.nl-icon { width: 48px; height: 48px; color: var(--color-primary); margin-bottom: 16px; display: inline-block; background: var(--color-primary-alpha); border-radius: 50%; padding: 12px; }
.nl-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; }

/* --- 9. Single Post --- */
.single-header { text-align: center; margin-bottom: 40px; }
.single-title { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.3; margin: 20px 0; font-weight: 800; }
.single-meta-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; color: var(--text-muted); font-size: 0.95rem; margin-bottom: 30px; }
.single-meta-bar span { display: flex; align-items: center; gap: 6px; }

.single-cover { width: 100%; max-height: 550px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 40px; box-shadow: var(--shadow-glass); }

.single-content { font-size: 1.15rem; line-height: 1.9; color: var(--text-main); }
.single-content p { margin-bottom: 24px; }
.single-content h2, .single-content h3, .single-content h4 { margin: 40px 0 20px; font-weight: 700; line-height: 1.4; }
.single-content img { border-radius: var(--radius-md); margin: 30px auto; max-width: 100%; box-shadow: var(--shadow-glass); }
.single-content blockquote { border-right: 4px solid var(--color-primary); background: var(--bg-element); padding: 20px 30px; margin: 30px 0; border-radius: var(--radius-sm); font-style: italic; color: var(--text-muted); }
.single-content pre { background: #0f172a; color: #f8fafc; padding: 20px; border-radius: var(--radius-md); overflow-x: auto; margin: 30px 0; font-family: monospace; direction: ltr; }

.single-actions { display: flex; align-items: center; justify-content: space-between; padding: 30px 0; margin-top: 50px; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); flex-wrap: wrap; gap: 20px; }
.like-btn { padding: 12px 24px; border-radius: var(--radius-full); display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; transition: all var(--trans-bounce); background: var(--bg-element); border: 1px solid var(--border-color); color: var(--text-main); }
.like-btn:hover { background: var(--bg-element-hover); }
.like-btn.liked { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: var(--color-danger); box-shadow: 0 0 20px rgba(239, 68, 68, 0.15); }
.like-btn.liked svg { fill: currentColor; transform: scale(1.1); }
.like-btn svg { transition: transform var(--trans-bounce); }
.like-btn:active svg { transform: scale(0.8); }

.share-btns { display: flex; gap: 10px; }
.share-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-element); border: 1px solid var(--border-color); transition: var(--trans-fast); cursor: pointer; }
.share-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); transform: translateY(-3px); }

/* --- 10. Comments Section --- */
.comments-section { margin-top: 60px; }
.comment-form-wrap { padding: 30px; margin-bottom: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; gap: 15px !important; } .single-title { font-size: 1.5rem !important; line-height: 1.4; } }

.comments-list { display: flex; flex-direction: column; gap: 24px; }
.comment-item { padding: 24px; background: var(--bg-element); border-radius: var(--radius-md); border: 1px solid var(--border-light); transition: var(--trans-fast); }
.comment-item:hover { border-color: var(--border-color); background: var(--bg-element-hover); }
.comment-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.comment-author { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.avatar-circle { width: 40px; height: 40px; background: linear-gradient(135deg, var(--color-primary), #8b5cf6); color: white; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.2rem; }
.comment-date { font-size: 0.85rem; color: var(--text-muted); }
.comment-text { font-size: 1rem; color: var(--text-main); line-height: 1.6; }

/* --- 11. Footer & Socials (Upgraded Premium Grid UI) --- */
.site-footer {
    margin-top: 80px; 
    padding: 60px 0 0; /* پدینگ پایین صفر شد چون footer-bottom خودش پدینگ دارد */
    background: var(--bg-glass-heavy); 
    border-top: 1px solid var(--border-color); 
    position: relative;
    overflow: hidden;
}

/* ساختار چند ستونه فوتر با CSS Grid */
.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

/* ستون اول: درباره ما و لوگو */
.footer-logo { 
    font-size: 2rem; 
    font-weight: 800; 
    color: var(--color-primary); 
    margin-bottom: 16px; 
    display: inline-block; 
    text-decoration: none;
    transition: text-shadow 0.3s ease;
}
.footer-logo:hover {
    text-shadow: 0 0 15px var(--color-primary-alpha);
}
.footer-desc { 
    max-width: 90%; 
    margin: 0 0 20px; 
    color: var(--text-muted); 
    line-height: 1.8;
    text-align: justify;
}

/* عنوان ستون‌های فوتر (با افکت خط نئونی زیرین) */
.footer-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
}
.footer-title::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--color-primary-alpha);
    transition: width 0.3s ease;
}
.footer-col:hover .footer-title::after {
    width: 60px; /* کشیده شدن خط در زمان هاور روی ستون */
}

/* منوهای فوتر (لینک‌های سریع و خدمات) */
.footer-menu { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}
.footer-menu li { 
    margin-bottom: 16px; 
}
.footer-menu a {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}
/* آیکون فلش برای منوها (سازگار با RTL) */
.footer-menu a::before {
    content: '\203A'; /* کاراکتر فلش سمت چپ/راست */
    margin-left: 8px;
    font-size: 1.4rem;
    color: var(--color-primary);
    transition: transform 0.3s ease;
    line-height: 0;
}
.footer-menu a:hover {
    color: var(--color-primary);
    transform: translateX(-8px); /* حرکت جذاب به سمت راست در هاور */
}
.footer-menu a:hover::before {
    transform: translateX(-3px);
}

/* شبکه های اجتماعی */
.footer-social-wrapper {
    display: flex; 
    justify-content: flex-start; /* هم‌تراز با راستچین شدن متن‌ها */
    align-items: center; 
    margin-top: auto; 
    padding: 20px 0 0; 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer-social { 
    display: flex; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-bottom: 0; 
}
.social-link {
    display: flex; align-items: center; justify-content: center; width: 45px; height: 45px;
    background: var(--bg-element, rgba(255, 255, 255, 0.05)); border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative; overflow: hidden; color: var(--text-main);
}
.social-link:hover {
    transform: translateY(-5px) scale(1.1); background: var(--color-primary); color: white;
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4); border-color: transparent;
}
.social-icon-img {
    width: 24px; height: 24px; object-fit: contain; transition: transform 0.3s ease;
}
.social-link:hover .social-icon-img { 
    transform: scale(1.15) rotate(5deg); 
}

/* بخش پایینی فوتر (کپی رایت) */
.footer-bottom { 
    padding: 25px 0; 
    background: rgba(0, 0, 0, 0.15); /* پس‌زمینه کمی تیره‌تر برای تفکیک بهتر */
    border-top: 1px solid var(--border-light); 
    color: var(--text-muted); 
    font-size: 0.9rem; 
}
.footer-bottom .container {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    text-align: center;
}

/* --- Responsive Footer --- */
@media (max-width: 992px) {
    .footer-container { grid-template-columns: 1fr 1fr; gap: 30px; }
    .footer-col-about { grid-column: span 2; text-align: center; align-items: center; }
    .footer-desc { text-align: center; margin: 0 auto 20px; max-width: 100%; }
    .footer-social-wrapper { justify-content: center; width: 100%; }
    .footer-title::after { right: 50%; transform: translateX(50%); }
    .footer-col:hover .footer-title::after { width: 50px; }
}
@media (max-width: 576px) {
    .footer-container { grid-template-columns: 1fr; text-align: center; }
    .footer-col-about { grid-column: span 1; }
    .footer-col { align-items: center; }
    .footer-menu a:hover { transform: translateX(0) scale(1.05); } /* خاموش کردن حرکت افقی در موبایل برای جلوگیری از به‌هم‌ریختگی */
}


/* --- 12. Utilities & Animations (بدون حتی یک حرف تغییر و حذفیات) --- */
.toast-container { position: fixed; bottom: 30px; left: 30px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast {
    min-width: 300px; padding: 16px 20px; background: var(--bg-glass-heavy); backdrop-filter: blur(10px);
    border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-glass);
    color: var(--text-main); display: flex; align-items: center; gap: 12px; pointer-events: auto;
    transform: translateX(-120%); transition: transform var(--trans-bounce), opacity 0.3s; opacity: 0;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: white; flex-shrink: 0; }
.toast.success .toast-icon { background: var(--color-success); }
.toast.error .toast-icon { background: var(--color-danger); }

.scroll-top-btn {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: var(--color-primary); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 4px 15px var(--color-primary-alpha); z-index: 900; opacity: 0; visibility: hidden;
    transform: translateY(20px); transition: all var(--trans-normal); border: none; outline: none;
}
.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { background: var(--color-primary-hover); transform: translateY(-5px); }

/* Preloader Skeleton */
.skeleton { background: linear-gradient(90deg, var(--bg-element) 25%, var(--bg-element-hover) 50%, var(--bg-element) 75%); background-size: 400% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Loading Button */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
    content: ""; position: absolute; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; top: calc(50% - 10px); left: calc(50% - 10px);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   --- 13. CLIENT-SIDE BLOG FILTER & SEARCH STYLES ---
   ========================================================= */

.blog-filter-manager {
    position: relative;
    z-index: 10;
    animation: fadeDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Advanced Search Box Styling */
.search-wrapper {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1);
}
.search-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--color-primary-alpha), transparent 30%);
    animation: rotateGlow 4s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}
.search-wrapper:focus-within::before {
    opacity: 1;
}
.search-wrapper:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--color-primary-alpha), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border-color: var(--color-primary);
}

#blog-search-input {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}
#blog-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
#blog-search-input:focus::placeholder {
    opacity: 0.3;
}

/* Category Filter Buttons Styling */
.category-filters {
    padding: 5px 0;
}
.glass-btn {
    position: relative;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Ripple effect inside buttons */
.glass-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.8s ease;
    opacity: 0;
    z-index: 0;
}
.glass-btn:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: 0s;
}

.glass-btn > span {
    position: relative;
    z-index: 1;
}

.glass-btn:hover {
    background: var(--bg-element-hover);
    border-color: var(--color-primary-alpha);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.glass-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 6px 15px var(--color-primary-alpha), inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}
.glass-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--color-primary-alpha), inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}

/* Responsive Filters */
@media (max-width: 768px) {
    .category-filters {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding-bottom: 15px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .category-filters::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    .glass-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
    }
}

/* --- 14. Infinite Beauty & Advanced Micro-Interactions --- */

/* Post Card Hide/Show Logic for Filtering */
.blog-post-card {
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s ease, 
                border-color 0.4s ease,
                height 0.4s ease,
                margin 0.4s ease,
                padding 0.4s ease;
    transform-origin: top center;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.blog-post-card.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

/* Multi-layered Shadows for cards */
.glass.post-card {
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.glass.post-card:hover {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1), 
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 20px var(--color-primary-alpha),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Advanced Keyframes */
@keyframes rotateGlow {
    100% {
        transform: rotate(360deg);
    }
}
@keyframes fadeDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 var(--color-primary-alpha); }
    70% { box-shadow: 0 0 0 15px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* Interactive Text selection */
::selection {
    background-color: var(--color-primary);
    color: #ffffff;
    text-shadow: none;
}
::-moz-selection {
    background-color: var(--color-primary);
    color: #ffffff;
    text-shadow: none;
}

/* Floating Elements Animation in Single View */
.single-cover {
    animation: floatImage 6s ease-in-out infinite;
}
@keyframes floatImage {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Fancy Tooltips Setup */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-glass-heavy);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    z-index: 100;
}
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}
/* استایل پایه دکمه‌های فیلتر دسته‌بندی */
.category-filter-btn {
    /* استفاده از متغیر با رنگ جایگزین آبی برای جلوگیری از ناپدید شدن متن در حالت روشن */
    color: var(--color-primary, var(--primary, #3b82f6));
    background-color: transparent;
    /* سایر استایل‌های دکمه (پدینگ، حاشیه و...) */
}

/* استایل حالت فعال (Active) دکمه در حالت لایت مود */
.category-filter-btn.active {
    color: var(--color-primary, var(--primary, #3b82f6));
    border: 1px solid var(--color-primary, var(--primary, #3b82f6));
    /* در صورت نیاز می‌توانید یک پس‌زمینه کم‌رنگ هم اضافه کنید */
    background-color: rgba(59, 130, 246, 0.1); 
}

/* استایل مخصوص حالت دارک مود (Dark Mode) برای حفظ ظاهر فعلی */
body.dark .category-filter-btn.active,
.dark-mode .category-filter-btn.active {
    color: #ffffff; /* متن سفید در دارک مود */
    border-color: var(--color-primary, var(--primary, #3b82f6)); /* حاشیه آبی */
    background-color: transparent; 
}
.category-filters::-webkit-scrollbar { 
        display: none; 
    }
    
    .category-filter-btn { 
        padding: 0.6rem 1.2rem; 
        border-radius: var(--radius-full, 50px); 
        border: 1px solid var(--border-color, #e5e7eb); 
        background: var(--bg-body, #ffffff); 
        color: var(--text-muted, #6b7280); 
        cursor: pointer; 
        white-space: nowrap; 
        transition: all 0.3s ease; 
        font-weight: 500; 
        font-size: 0.9rem; 
    }
    
    .category-filter-btn:hover { 
        border-color: var(--primary-color, var(--color-primary, #3b82f6)); 
        color: var(--primary-color, var(--color-primary, #3b82f6)); 
    }
    
    .category-filter-btn.active { 
        background: var(--primary-color, var(--color-primary, #3b82f6)); 
        color: #fff; 
        border-color: var(--primary-color, var(--color-primary, #3b82f6)); 
        box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); 
    }
    /* استایل کلی بخش سوالات متداول */
/* =========================================================
   --- بخش سوالات متداول (FAQ) یکپارچه با تم لایت/دارک ---
   ========================================================= */

   .faq-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.faq-item {
    background: var(--bg-element); /* هماهنگ با پس‌زمینه المان‌ها در تم */
    border: 1px solid var(--border-color); /* هماهنگ با حاشیه تم */
    border-radius: var(--radius-md); /* استفاده از شعاع انحنای سیستم */
    overflow: hidden;
    transition: all var(--trans-normal);
}

.faq-item:hover {
    background: var(--bg-element-hover);
    border-color: var(--color-primary-alpha);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main); /* تغییر رنگ متن به مشکی در لایت و سفید در دارک */
    user-select: none;
    transition: color var(--trans-fast);
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform var(--trans-bounce);
    color: var(--color-primary); /* هماهنگ با رنگ اصلی سایت */
    opacity: 0.7;
}

/* استایل پاسخ‌ها (پنهان به صورت پیش‌فرض) */
.faq-answer {
    max-height: 0;
    padding: 0 20px;
    color: var(--text-muted); /* رنگ متن کم‌رنگ هماهنگ با تم */
    line-height: 1.8;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

/* استایل حالت فعال (باز شده) */
.faq-item.active {
    border-color: var(--color-primary); 
    background: var(--bg-glass); /* شفافیت شیشه‌ای در زمان باز بودن */
    box-shadow: var(--shadow-glow); /* سایه نئونی تعریف شده در فایل خودتان */
}

.faq-item.active .faq-question {
    color: var(--color-primary); 
}

.faq-item.active .faq-icon {
    transform: rotate(45deg); /* تبدیل + به ضربدر */
    opacity: 1;
}

.faq-item.active .faq-answer {
    max-height: 800px; /* مقداری بیشتر از ارتفاع متن */
    padding-bottom: 20px;
    opacity: 1;
}
