/*
Theme Name: Bonsa (بن‌سا)
Theme URI: https://bonsa.ir
Author: Bonsa Team
Author URI: https://bonsa.ir
Description: قالب حرفه‌ای وردپرس بن‌سا — صفحه فرود افزونه مدیریت اعتبار و باشگاه مشتریان. شامل بخش‌های لندینگ قابل تنظیم از سفارشی‌سازی، منوهای قابل مدیریت، وبلاگ کامل با تصویر شاخص، ابزارک‌ها، قالب‌های برگه و پشتیبانی کامل RTL فارسی.
Version: 1.1.0
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bonsa
Domain Path: /languages
Tags: rtl-language-support, blog, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, wide-blocks, sticky-post, custom-colors
*/

/* ===================== فونت وزیرمتن (لوکال، متغیر ۱۰۰–۹۰۰) ===================== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('assets/fonts/Vazirmatn-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ===================== متغیرها و ریست ===================== */
:root {
    --primary: #6C2BD9;
    --primary-dark: #4A1C99;
    --primary-light: #8E5BEA;
    --accent: #00C4CC;
    --bg-dark: #0F0B1E;
    --bg-light: #F8F9FD;
    --text-dark: #1A1A2E;
    --text-light: #FFFFFF;
    --text-muted: #5B6180;
    --gradient: linear-gradient(135deg, #6C2BD9 0%, #00C4CC 100%);
    --radius: 20px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    --header-h: 84px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
}

button, input, select, textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--primary);
    color: #fff;
}

[id] {
    scroll-margin-top: 100px;
}

/* کاهش حرکت برای کاربران حساس */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* فوکوس قابل مشاهده برای دسترسی‌پذیری */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

/* ===================== ابزارهای عمومی ===================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    right: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

.skip-link {
    position: absolute;
    top: -100px;
    z-index: 100001;
}

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

.content-narrow {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================== هدر و منو ===================== */
.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding: 15px 0;
    transition: padding 0.3s, box-shadow 0.3s;
}

.site-header.is-scrolled {
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar .site-header { top: 46px; }
}

.site-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

.brand {
    flex-shrink: 0;
}

.brand .custom-logo {
    max-height: 52px;
    width: auto;
}

.brand .custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    white-space: nowrap;
}

.site-header .nav-links ul {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.site-header .nav-links li {
    position: relative;
}

.site-header .nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    padding: 8px 0;
    display: block;
}

.site-header .nav-links > ul > li > a:hover,
.site-header .nav-links > ul > li.current-menu-item > a,
.site-header .nav-links > ul > li.current_page_item > a {
    color: var(--primary);
}

.site-header .nav-links li.menu-item-has-children > a::after {
    content: ' ⌄';
    font-size: 0.8em;
    opacity: 0.7;
}

/* زیرمنو */
.site-header .nav-links ul ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
    z-index: 100;
}

.site-header .nav-links li:hover > ul,
.site-header .nav-links li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-header .nav-links ul ul a {
    padding: 9px 18px;
    font-weight: 500;
    font-size: 0.95rem;
}

.site-header .nav-links ul ul a:hover {
    background: rgba(108, 43, 217, 0.06);
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-nav {
    background: var(--primary);
    color: #fff;
    padding: 10px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
    white-space: nowrap;
}

.btn-nav:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    color: #fff;
}

/* دکمه منوی موبایل */
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    line-height: 0;
}

.nav-toggle span:not(.screen-reader-text) {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--text-dark);
    margin: 5px 0;
    border-radius: 3px;
    transition: 0.3s;
}

/* ===================== بخش هیرو (Hero) ===================== */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-dark);
    color: #fff;
    position: relative;
    overflow: hidden;
    padding: 100px 20px 0;
}

.hero::before {
    content: '';
    position: absolute;
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(108, 43, 217, 0.5) 0%, rgba(108, 43, 217, 0) 65%);
    top: -400px;
    right: -400px;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 196, 204, 0.38) 0%, rgba(0, 196, 204, 0) 65%);
    bottom: -350px;
    left: -350px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.4;
}

.hero h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: #C4B5E0;
    margin-bottom: 30px;
}

.hero-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 15px 35px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: 0.3s;
    box-shadow: 0 10px 20px rgba(108, 43, 217, 0.4);
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(108, 43, 217, 0.5);
    color: #fff;
}

.btn-outline {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 13px 35px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: 0.3s;
    display: inline-block;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ===================== سربرگ صفحات داخلی ===================== */
.page-head {
    background: var(--bg-dark);
    color: #fff;
    padding: 150px 0 60px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.page-head::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.35;
    top: -250px;
    right: -150px;
}

.page-head::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--accent);
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.2;
    bottom: -200px;
    left: -100px;
}

.page-head .container {
    position: relative;
    z-index: 2;
}

.page-head h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.page-head .archive-desc {
    color: #C4B5E0;
    max-width: 700px;
    margin: 0 auto;
}

.page-head .entry-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    color: #C4B5E0;
    font-size: 0.95rem;
}

.page-head .search-form {
    max-width: 480px;
    margin: 20px auto 0;
}

/* مسیر راهنما */
.breadcrumbs {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.page-head .breadcrumbs {
    color: #C4B5E0;
}

.breadcrumbs a {
    color: inherit;
    text-decoration: none;
    transition: 0.3s;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.page-head .breadcrumbs a:hover {
    color: #fff;
}

.breadcrumbs .sep {
    margin: 0 10px;
    opacity: 0.5;
}

/* ===================== بخش‌ها و کارت‌ها ===================== */
.section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.section-more {
    text-align: center;
    margin-top: 45px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch;
}

/* گرید نوشته‌ها — کارت‌ها عرض معقول دارند تا با یک یا چند نوشته صفحه به هم نریزد */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 360px));
    gap: 30px;
    align-items: stretch;
    justify-content: center;
}

.feature-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: 0.4s;
    border: 1px solid #eee;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(108, 43, 217, 0.1);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: rgba(108, 43, 217, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 25px;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

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

/* ===================== بخش امنیت ===================== */
.security-section {
    background: var(--bg-dark);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.security-section h2 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.security-section > p {
    color: #C4B5E0;
    font-size: 1.05rem;
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 40px auto 0;
}

.security-item i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 15px;
}

.security-item .security-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.security-item h3,
.security-item h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.security-item p {
    color: #A0A0B0;
    font-size: 0.95rem;
}

/* ===================== فراخوان به اقدام (CTA) ===================== */
.cta-section {
    padding: 100px 20px;
    text-align: center;
    background: var(--bg-light);
}

.cta-box {
    max-width: 800px;
    margin: 0 auto;
    background: var(--gradient);
    padding: 60px 40px;
    border-radius: 30px;
    color: #fff;
    box-shadow: 0 20px 60px rgba(108, 43, 217, 0.3);
}

.cta-box h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-box p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-white {
    background: #fff;
    color: var(--primary);
    padding: 15px 40px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    transition: 0.3s;
    display: inline-block;
}

.btn-white:hover {
    transform: scale(1.05);
    color: var(--primary-dark);
}

/* ===================== کارت‌های نوشته (وبلاگ) ===================== */
.post-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: var(--shadow);
    transition: 0.4s;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(108, 43, 217, 0.1);
    border-color: var(--primary-light);
}

.post-card .post-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    line-height: 0;
    flex-shrink: 0;
    background: var(--bg-light);
}

.post-card .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
    display: block;
}

.post-card:hover .post-thumb img {
    transform: scale(1.06);
}

.thumb-fallback {
    width: 100%;
    height: 100%;
    min-height: 180px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

.post-card .post-body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.post-cat {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.8rem;
    color: var(--primary);
    background: rgba(108, 43, 217, 0.08);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    font-weight: 700;
    text-decoration: none;
}

.post-cat:hover {
    background: var(--primary);
    color: #fff;
}

.post-card .entry-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    line-height: 1.6;
}

.post-card .entry-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: 0.3s;
}

.post-card .entry-title a:hover {
    color: var(--primary);
}

.post-meta {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.read-more {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    margin-top: auto;
    transition: 0.3s;
}

.read-more:hover {
    color: var(--primary-dark);
    margin-right: 5px;
}

.sticky .post-card,
.post-card.sticky {
    border-color: var(--primary-light);
}

/* انیمیشن ظاهر شدن کارت‌ها */
.feature-card.reveal,
.post-card.reveal,
.security-item.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.feature-card.reveal.in-view,
.post-card.reveal.in-view,
.security-item.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ===================== نوشته تکی و برگه ===================== */
.single-post .entry-header,
.single-page .page-hero {
    margin-bottom: 30px;
}

.single-post .entry-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.4;
    margin: 12px 0 18px;
}

.single-post .post-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.single-post .post-meta {
    margin-bottom: 0;
}

.post-thumbnail {
    margin: 0 0 30px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    line-height: 0;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 480px;
    object-fit: cover;
}

.post-hero {
    margin: 0 0 30px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-hero img {
    width: 100%;
    display: block;
}

.entry-content {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    font-size: 1.05rem;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin: 35px 0 15px;
    line-height: 1.5;
    color: var(--text-dark);
}

.entry-content h2 { font-size: 1.7rem; }
.entry-content h3 { font-size: 1.4rem; }
.entry-content h4 { font-size: 1.2rem; }

.entry-content p {
    margin-bottom: 18px;
}

.entry-content a {
    color: var(--primary);
}

.entry-content a:hover {
    color: var(--primary-dark);
}

.entry-content ul,
.entry-content ol {
    padding-right: 25px;
    margin-bottom: 18px;
}

.entry-content ul li { list-style: disc; }
.entry-content ol li { list-style: arabic-indic; }

.entry-content blockquote {
    border-right: 4px solid var(--primary);
    background: rgba(108, 43, 217, 0.05);
    padding: 20px 25px;
    border-radius: 12px;
    margin: 25px 0;
    color: #444;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content img {
    border-radius: 12px;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.entry-content th,
.entry-content td {
    border: 1px solid #eee;
    padding: 10px 14px;
    text-align: right;
}

.entry-content th {
    background: rgba(108, 43, 217, 0.06);
}

.entry-content code {
    background: #f1eefc;
    padding: 2px 8px;
    border-radius: 6px;
    direction: ltr;
    unicode-bidi: embed;
    font-size: 0.9em;
}

.entry-content pre {
    background: var(--bg-dark);
    color: #e0d8f5;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    margin: 20px 0;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

.entry-content iframe,
.entry-content video {
    max-width: 100%;
    border-radius: 12px;
}

.entry-content .wp-caption-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ترازبندی بلوک‌ها */
.alignleft {
    float: left;
    margin: 5px 25px 20px 0;
}

.alignright {
    float: right;
    margin: 5px 0 20px 25px;
}

.aligncenter {
    display: block;
    margin: 0 auto 20px;
}

.alignwide,
.alignfull {
    max-width: 100%;
}

/* برچسب‌ها */
.tags-links {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.9rem;
}

.tags-links a {
    display: inline-block;
    background: rgba(108, 43, 217, 0.08);
    color: var(--primary);
    border-radius: 20px;
    padding: 4px 14px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.tags-links a:hover {
    background: var(--primary);
    color: #fff;
}

/* جعبه نویسنده */
.author-box,
.post-author-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 25px 30px;
    margin-top: 40px;
    box-shadow: var(--shadow);
}

.author-box .avatar,
.post-author-box .avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.author-box h3,
.author-box h4,
.post-author-box h3,
.post-author-box h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.author-box p,
.post-author-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 8px;
}

.post-author-box a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.post-author-box a:hover {
    color: var(--primary-dark);
}

/* ناوبری نوشته‌ها */
.post-navigation {
    margin: 40px 0;
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 20px 25px;
    transition: 0.3s;
}

.post-navigation .nav-previous:hover,
.post-navigation .nav-next:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.post-navigation a {
    text-decoration: none;
}

.nav-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.nav-title {
    font-weight: 700;
    color: var(--text-dark);
    transition: 0.3s;
}

.post-navigation a:hover .nav-title {
    color: var(--primary);
}

/* ===================== چیدمان وبلاگ / آرشیو / تکی ===================== */
.blog-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    align-items: start;
}

.blog-wrap .site-main {
    min-width: 0;
}

.page-hero {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.page-hero .page-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.page-hero p,
.page-hero .archive-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* در صفحات دارای سایدبار، کارت‌ها عرض کامل ستون اصلی را بگیرند */
.posts-grid.has-sidebar {
    grid-template-columns: 1fr;
    justify-content: stretch;
    max-width: none;
}

.posts-grid.has-sidebar .post-card {
    max-width: none;
}

/* جلوگیری از ارتفاع بیش از حد تصویر در کارت‌ها */
.posts-grid.has-sidebar .post-card .post-thumb {
    aspect-ratio: 16 / 9;
    max-height: 280px;
}

.posts-grid.has-sidebar .thumb-fallback {
    min-height: 180px;
    max-height: 280px;
}

/* ===================== سایدبار و ابزارک‌ها ===================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 20px;
    align-items: start;
}

.widget-area .widget {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--gradient);
    border-radius: 3px;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 9px 0;
    border-bottom: 1px dashed #eee;
}

.widget ul li:last-child {
    border-bottom: 0;
}

.widget ul li ul {
    padding-right: 15px;
    margin-top: 8px;
}

.widget a {
    color: var(--text-dark);
    text-decoration: none;
    transition: 0.3s;
}

.widget a:hover {
    color: var(--primary);
}

.widget select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.widget .tagcloud a {
    display: inline-block;
    background: rgba(108, 43, 217, 0.08);
    color: var(--primary);
    border-radius: 20px;
    padding: 4px 12px;
    margin: 0 0 8px 8px;
    text-decoration: none;
    transition: 0.3s;
}

.widget .tagcloud a:hover {
    background: var(--primary);
    color: #fff;
}

.widget .post-date {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===================== فرم‌ها و جستجو ===================== */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 11px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    outline: none;
    transition: 0.3s;
    min-width: 0;
}

.search-form input[type="search"]:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(108, 43, 217, 0.1);
}

.search-form .search-submit {
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 0 18px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

.search-form .search-submit:hover {
    background: var(--primary-dark);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form input[type="tel"],
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: 0.3s;
    background: #fff;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(108, 43, 217, 0.1);
    outline: none;
}

.comment-form .submit {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 13px 35px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1rem;
}

.comment-form .submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.comment-form .comment-notes {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* ===================== دیدگاه‌ها ===================== */
.comments-area {
    margin-top: 45px;
}

.comments-title,
.comment-reply-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list ol.children {
    list-style: none;
    padding-right: 40px;
    margin-top: 15px;
}

.comment-body {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-meta .avatar {
    border-radius: 50%;
}

.comment-meta .fn {
    font-weight: 700;
    font-style: normal;
}

.comment-metadata {
    font-size: 0.8rem;
}

.comment-metadata a {
    color: var(--text-muted);
    text-decoration: none;
}

.comment-metadata a:hover {
    color: var(--primary);
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.reply a {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.bypostauthor > .comment-body {
    border-color: var(--primary-light);
}

.no-comments {
    color: var(--text-muted);
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
}

/* ===================== صفحه‌بندی ===================== */
.navigation.pagination {
    margin: 45px 0 0;
    text-align: center;
}

.navigation.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-block;
    min-width: 44px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eee;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: 0.3s;
}

.page-numbers.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-numbers:hover:not(.current) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-numbers.dots {
    border: 0;
    background: none;
}

.comment-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
}

.comment-navigation .nav-previous a,
.comment-navigation .nav-next a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* ===================== صفحه ۴۰۴ و نتیجه خالی ===================== */
.error-404 {
    max-width: 640px;
    margin: 0 auto;
    padding: 160px 20px 100px;
    text-align: center;
}

.error-404 .code-404 {
    font-size: 7rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 10px;
}

.error-404 h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.error-404 p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.error-404 .search-form {
    max-width: 420px;
    margin: 0 auto 30px;
}

.no-results {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 60px 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.no-results .feature-icon {
    margin: 0 auto 20px;
}

.no-results h2 {
    margin-bottom: 12px;
}

.no-results p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.no-results .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* ===================== فوتر ===================== */
.site-footer {
    background: #111;
    color: #888;
    padding: 60px 20px 30px;
    margin-top: 0;
}

.footer-widgets {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px;
}

.site-footer .widget {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.site-footer .widget-title {
    color: #fff;
    font-size: 1.05rem;
}

.site-footer .widget-title::after {
    right: auto;
    margin-right: 0;
    right: 0;
}

.site-footer .widget a {
    color: #999;
}

.site-footer .widget a:hover {
    color: var(--primary-light);
}

.site-footer .widget ul li {
    border-bottom-color: #222;
}

.site-footer .widget .tagcloud a {
    background: #1c1c1c;
    color: #aaa;
}

.site-footer .widget .tagcloud a:hover {
    background: var(--primary);
    color: #fff;
}

.footer-about {
    color: #999;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid #222;
    padding-top: 25px;
    text-align: center;
    font-size: 0.9rem;
}

.footer-nav {
    margin-bottom: 15px;
}

.footer-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 25px;
}

.footer-menu a {
    color: #999;
    text-decoration: none;
    transition: 0.3s;
}

.footer-menu a:hover {
    color: #fff;
}

.footer-info p {
    margin-bottom: 12px;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.socials a {
    display: inline-block;
    background: #1c1c1c;
    color: #aaa;
    border-radius: 10px;
    padding: 7px 16px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: 0.3s;
}

.socials a:hover {
    background: var(--primary);
    color: #fff;
}

/* دکمه بازگشت به بالا */
#backToTop {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 999;
    box-shadow: 0 10px 25px rgba(108, 43, 217, 0.4);
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===================== حالت‌های خاص ===================== */
.no-results.not-found,
.search-no-results {
    margin-top: 20px;
}

.comment-respond {
    margin-top: 35px;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.comment-form-cookies-consent input[type="checkbox"] {
    width: auto;
}

.gallery {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.gallery-item {
    margin: 0;
}

.gallery img {
    border-radius: 10px;
    width: 100%;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }

.sticky {
    position: relative;
}

.updated:not(.published) {
    display: none;
}

/* ===================== ریسپانسیو ===================== */
@media (max-width: 992px) {
    .layout-with-sidebar,
    .blog-wrap {
        grid-template-columns: 1fr;
    }

    .blog-wrap .widget-area {
        order: 2;
        margin-top: 20px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .nav-toggle {
        display: block;
    }

    .site-header .nav-links {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #fff;
        flex-direction: column;
        padding: 5px 20px 20px;
        display: none;
        box-shadow: 0 25px 35px rgba(0, 0, 0, 0.12);
        border-radius: 0 0 20px 20px;
    }

    .site-header.nav-open .nav-links,
    .nav-links.is-open {
        display: block;
    }

    body.nav-open {
        overflow: hidden;
    }

    .site-header .nav-links ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .site-header .nav-links a {
        margin: 0;
        padding: 13px 0;
        border-bottom: 1px solid #f0f0f5;
    }

    .site-header .nav-links ul ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(108, 43, 217, 0.03);
        border-radius: 10px;
        margin: 5px 0 10px;
        padding: 5px 10px;
        display: none;
    }

    .site-header .nav-links li.menu-item-has-children.open > ul {
        display: flex;
    }

    .site-header .nav-links ul ul a {
        padding: 10px 12px;
        border-bottom: 0;
    }

    .site-header.nav-open .nav-toggle span:not(.screen-reader-text):nth-child(1),
    body.nav-open .nav-toggle span:not(.screen-reader-text):nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .site-header.nav-open .nav-toggle span:not(.screen-reader-text):nth-child(2),
    body.nav-open .nav-toggle span:not(.screen-reader-text):nth-child(2) {
        opacity: 0;
    }

    .site-header.nav-open .nav-toggle span:not(.screen-reader-text):nth-child(3),
    body.nav-open .nav-toggle span:not(.screen-reader-text):nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero {
        min-height: auto;
        padding: 140px 20px 80px;
    }

    .section {
        padding: 70px 20px;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .security-section h2,
    .cta-box h2 {
        font-size: 1.7rem;
    }

    .page-head {
        padding: 130px 0 45px;
    }

    .page-head h1 {
        font-size: 1.6rem;
    }

    .entry-content {
        padding: 25px 20px;
    }

    .post-navigation .nav-links {
        grid-template-columns: 1fr;
    }

    .comment-list ol.children {
        padding-right: 20px;
    }

    .btn-primary,
    .btn-outline,
    .btn-white {
        padding: 13px 25px;
        font-size: 1rem;
    }

    .btn-nav {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

    .error-404 .code-404 {
        font-size: 5rem;
    }
}

/* ===================== پشتیبانی از بلوک‌های وردپرس ===================== */
.wp-block-button__link {
    border-radius: 12px;
}

.wp-block-quote {
    border-right: 4px solid var(--primary);
    background: rgba(108, 43, 217, 0.05);
    padding: 20px 25px;
    border-radius: 12px;
    margin: 25px 0;
}

.wp-block-quote.is-style-plain {
    border: 0;
    background: none;
}

.entry-content .wp-block-separator {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 35px auto;
}

/* =====================================================================
   نسخه ۱.۱ — بهینه‌سازی تجربه کاربری، دسترس‌پذیری و عملکرد
   ===================================================================== */

/* فاصله زیر هدر ثابت (جلوگیری از رفتن تیتر صفحات داخلی زیر هدر) */
body:not(.bonsa-has-hero):not(.landing-page) #page {
    padding-top: var(--header-h);
}

/* کانتینر برگه‌ها */
.site-main.content-narrow,
.site-main.content-wide {
    padding-bottom: 80px;
}

.site-main.content-narrow {
    padding-top: 30px;
}

.site-main.content-wide {
    padding-top: 30px;
}

/* فوکوس روی پس‌زمینه‌های تیره */
.hero :focus-visible,
.security-section :focus-visible,
.site-footer :focus-visible,
.cta-box :focus-visible {
    outline-color: var(--accent);
}

/* مسیر راهنما (لیست معنایی) */
.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
}

.breadcrumbs li + li::before {
    content: '/';
    margin: 0 10px;
    opacity: 0.5;
}

.breadcrumbs [aria-current='page'] {
    color: var(--text-dark);
    font-weight: 600;
}

/* اهداف لمسی مناسب (حداقل ۴۴ پیکسل) */
.nav-toggle {
    min-width: 44px;
    min-height: 44px;
}

.search-form .search-submit {
    min-width: 46px;
}

.page-numbers {
    min-height: 44px;
}

/* پیوند متا و نویسنده در نوشته */
.post-meta a {
    color: inherit;
    text-decoration: none;
}

.post-meta a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.entry-content a {
    text-underline-offset: 3px;
}

/* برچسب‌های نوشته */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 25px;
    font-size: 0.9rem;
}

.post-tags a {
    display: inline-block;
    background: rgba(108, 43, 217, 0.08);
    color: var(--primary);
    border-radius: 20px;
    padding: 4px 14px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.post-tags a:hover {
    background: var(--primary);
    color: #fff;
}

.post-author-box .author-name {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

/* ناوبری قبلی/بعدی نوشته */
.post-navigation .nav-previous a,
.post-navigation .nav-next a {
    display: block;
}

.post-navigation .nav-next {
    text-align: left;
}

/* نوشته‌های مرتبط */
.related-posts {
    margin-top: 50px;
}

.related-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
}

.related-posts .posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    justify-content: stretch;
}

.related-posts .post-card .post-body {
    padding: 18px 18px 20px;
}

.related-posts .post-card .entry-title {
    font-size: 1.05rem;
}

/* دیدگاه‌ها: هم‌خوان‌سازی با ساختار HTML واقعی کال‌بک */
.comment-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.comment-avatar .avatar {
    border-radius: 50%;
    display: block;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 700;
}

.comment-author a {
    color: inherit;
    text-decoration: none;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}

.comment-date:hover {
    color: var(--primary);
}

.comment-awaiting-moderation {
    background: rgba(108, 43, 217, 0.06);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.comment-content .comment-reply-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.comment-content .comment-reply-link:hover {
    color: var(--primary-dark);
}

/* صفحه ۴۰۴ */
.error-404 .search-form {
    margin-bottom: 25px;
}

.error-suggest {
    margin-top: 50px;
    text-align: right;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 25px 30px;
    box-shadow: var(--shadow);
}

.error-suggest h2 {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.error-suggest ul {
    list-style: none;
}

.error-suggest li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.error-suggest li:last-child {
    border-bottom: 0;
}

.error-suggest a {
    color: var(--text-dark);
    text-decoration: none;
}

.error-suggest a:hover {
    color: var(--primary);
}

/* دکمه باز/بسته زیرمنو (فقط موبایل) */
.submenu-toggle {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --header-h: 72px;
    }

    .site-header .nav-links li.menu-item-has-children {
        position: relative;
    }

    .site-header .nav-links li.menu-item-has-children > a {
        padding-left: 50px;
    }

    .site-header .nav-links li.menu-item-has-children > a::after {
        content: none;
    }

    .submenu-toggle {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 48px;
        height: 48px;
        background: none;
        border: 0;
        cursor: pointer;
        color: var(--text-dark);
    }

    .submenu-toggle::before {
        content: '⌄';
        display: inline-block;
        font-size: 1.3rem;
        transition: transform 0.3s;
    }

    .submenu-toggle[aria-expanded='true']::before {
        transform: rotate(180deg);
    }

    .site-header .nav-links {
        max-height: calc(100vh - var(--header-h) - 20px);
        overflow-y: auto;
    }

    .related-posts .posts-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .post-navigation .nav-next {
        text-align: right;
    }

    .comment-body {
        flex-direction: column;
        gap: 10px;
    }
}

/* چاپ: حذف عناصر غیرضروری */
@media print {
    .site-header,
    .site-footer,
    #backToTop,
    .widget-area,
    .related-posts,
    .comments-area,
    .post-navigation {
        display: none !important;
    }

    body {
        background: #fff;
    }

    body:not(.bonsa-has-hero) #page {
        padding-top: 0;
    }

    .entry-content {
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}
