@charset "UTF-8";
/* =====================================================================
   قلم | استایل عمومی سایت (RTL — فارسی)
   ---------------------------------------------------------------------
   ساختار:
     ۱) فونت وزیرمتن (Local)
     ۲) متغیرهای رنگ (روشن / تاریک) + توکن‌ها
     ۳) پایه و تایپوگرافی
     ۴) دکمه‌ها و اجزای کوچک
     ۵) سربرگ و ناوبری (منوی آبشاری)
     ۶) هیرو (صفحه اصلی)
     ۷) کارت مقاله / دوره
     ۸) سربرگ صفحات + بردکرامب + صفحه‌بندی
     ۹) مقاله تکی + استایل محتوای ادیتور
    ۱۰) گالری + لایت‌باکس
    ۱۱) تماس با ما + فرم‌ها
    ۱۲) جستجو / 404 / حالت خالی
    ۱۳) Toast و دکمه بازگشت به بالا
    ۱۴) پابرگ
    ۱۵) واکنش‌گرایی و انیمیشن‌ها
   ===================================================================== */

/* ============================ ۱) فونت ============================ */

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

/* ===================== ۲) متغیرهای رنگ و توکن‌ها ===================== */

:root {
  --accent: #4f46e5;          /* از تنظیمات در header تزریق می‌شود */
  --accent-2: #06b6d4;
  --accent-rgb: 79, 70, 229;

  --bg: #f6f8fb;
  --bg-2: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f4f7fc;
  --text: #1e2a3a;
  --text-2: #41506b;
  --muted: #5c6b84;
  --border: #e4e9f2;
  --border-2: #d5dcea;

  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0891b2;

  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 22px -6px rgba(16, 24, 40, .12);
  --shadow-lg: 0 18px 45px -12px rgba(16, 24, 40, .18);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --header-h: 74px;
  --container: 1140px;

  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --transition: .22s ease;
}

html[data-theme="dark"] {
  --bg: #0c1322;
  --bg-2: #0a101d;
  --surface: #141f36;
  --surface-2: #1a2742;
  --text: #e5ebf6;
  --text-2: #c3cddd;
  --muted: #8fa0bd;
  --border: #253350;
  --border-2: #2f3f61;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-md: 0 6px 22px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 18px 45px -12px rgba(0, 0, 0, .6);
}

/* ======================= ۳) پایه و تایپوگرافی ======================= */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: 1.5; color: var(--text); margin: 0 0 .6em; }

::selection { background: rgba(var(--accent-rgb), .25); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -60px; right: 16px; z-index: 9999;
  background: var(--accent); color: #fff; padding: 10px 18px;
  border-radius: 0 0 10px 10px; font-weight: 500;
}
.skip-link:focus { top: 0; color: #fff; }

.container-xl { max-width: var(--container); margin-inline: auto; padding-inline: 20px; }

/* ===================== ۴) دکمه‌ها و اجزای کوچک ===================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .95rem; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: all var(--transition); line-height: 1.6; white-space: nowrap;
}
.btn i { font-size: .9em; }
.btn-lg { padding: 13px 30px; font-size: 1.05rem; }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.btn-block { width: 100%; }

.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(var(--accent-rgb), .5); }
.btn-accent:hover { background: var(--accent-2); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 22px -6px rgba(var(--accent-rgb), .55); }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.badge-accent {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700;
}

.mini-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(var(--accent-rgb), .12); color: var(--accent);
  padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600;
}

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); padding: 8px 16px; border-radius: 999px;
  font-size: .9rem; font-weight: 500; transition: all var(--transition);
}
.chip b {
  background: rgba(var(--accent-rgb), .12); color: var(--accent);
  border-radius: 999px; padding: 0 8px; font-size: .78rem;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.empty-state {
  text-align: center; padding: 70px 20px; border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg); background: var(--surface);
}
.empty-state i { font-size: 3rem; color: var(--muted); opacity: .5; margin-bottom: 14px; display: block; }
.empty-state h2 { font-size: 1.4rem; }
.empty-state p { color: var(--muted); margin: 0 0 22px; }

.preview-bar {
  margin-top: 16px; padding: 12px 20px; border-radius: var(--radius-sm);
  background: rgba(217, 119, 6, .12); color: var(--warning);
  border: 1px solid rgba(217, 119, 6, .3); font-weight: 500; font-size: .92rem;
}

/* ================= ۵) سربرگ و ناوبری (منوی آبشاری) ================= */

/* پس‌زمینه مات روی شبه‌عنصر منتقل شده است (نه خودِ سربرگ):
   هر عنصری که backdrop-filter دارد می‌شود containing block فرزندان
   position:fixed — و در نتیجه پنل منوی کشویی موبایل به‌جای تمام‌صفحه
   به ارتفاع هدر محدود می‌شد. با شبه‌عنصر، بلور همان جاست اما دام برمی‌خورد. */
.site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header::before { background: var(--surface); }
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }

.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo {
  display: inline-flex; width: 44px; height: 44px; border-radius: 13px;
  background: rgba(var(--accent-rgb), .1); align-items: center; justify-content: center;
}
.brand-logo img { width: 42px; height: 42px; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.4; }
.brand-text strong { font-size: 1.06rem; font-weight: 800; color: var(--text); }
.brand-text small { font-size: .72rem; color: var(--muted); }
.brand:hover { opacity: .9; }

/* --- منوی اصلی --- */
.main-nav { margin-inline-start: auto; }
.nav-menu { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; margin: 0 1px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: .95rem;
  transition: all var(--transition);
}
.nav-link span { position: relative; }
.nav-link:hover, .nav-item.current > .nav-link { color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.nav-item.current > .nav-link span::after {
  content: ''; position: absolute; bottom: -4px; right: 0; left: 0;
  height: 2.5px; border-radius: 2px; background: var(--accent);
}
.nav-caret { transition: transform var(--transition); margin-top: 1px; }
.nav-item:hover .nav-caret, .nav-item.open .nav-caret { transform: rotate(180deg); }

/* زیرمنوی آبشاری — چیدمان عمودی زیر هم */
.nav-sub {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 50;
  min-width: 225px; list-style: none; margin: 0; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
}
.nav-item:hover > .nav-sub, .nav-item.open > .nav-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-sub .nav-sub { top: -9px; right: calc(100% + 2px); }
.nav-sub .nav-link { padding: 9px 14px; font-size: .9rem; border-radius: 9px; }
.nav-sub::before {
  content: ''; position: absolute; top: -10px; right: 0; left: 0; height: 10px;
}
.nav-item.has-sub > .nav-link::after {
  content: ''; position: absolute; inset: 0; border-radius: 10px;
}

/* --- اکشن‌های سربرگ --- */
.header-actions { display: flex; align-items: center; gap: 9px; }

/* سوییچ تم */
.theme-toggle-btn .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle-btn .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle-btn .icon-moon { display: block; }

/* دکمه همبرگری — خطوط با شبه‌عناصر نسبت به خودِ اسپن هم‌تراز می‌شوند
   (الگوی قبلی: right:11px روی شبه‌عناصر نسبت به اسپن ۲۰px محاسبه می‌شد
   و خطوط بالا/پایین ۱۱px به چپ می‌لغزیدند) */
.nav-toggle-btn { display: none; position: relative; }
.hamburger {
  position: relative; display: block;
  width: 20px; height: 2px; border-radius: 2px;
  background: currentColor;
  transition: background-color var(--transition), transform var(--transition);
}
.hamburger::before, .hamburger::after {
  content: ''; position: absolute; right: 0; left: 0;
  height: 2px; border-radius: 2px; background: currentColor;
  transition: transform var(--transition);
}
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }
.nav-toggle-btn.is-open .hamburger { background: transparent; }
.nav-toggle-btn.is-open .hamburger::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle-btn.is-open .hamburger::after { transform: translateY(-6px) rotate(-45deg); }

/* دکمه بستن داخل پنل منوی موبایل (فقط موبایل) */
.nav-close-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); cursor: pointer;
  transition: all var(--transition);
}
.nav-close-btn:hover { color: var(--danger); border-color: var(--danger); background: rgba(220, 38, 38, .06); }

/* --- نوار جستجو --- */
.search-bar {
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
  border-top: 1px solid transparent;
}
.search-bar.is-open { max-height: 90px; padding: 14px 0; border-top-color: var(--border); background: var(--surface); }
.search-form { display: flex; gap: 10px; }
.search-form input[type="search"] {
  flex: 1; padding: 11px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  font-family: var(--font); font-size: .95rem; transition: all var(--transition);
}
.search-form input[type="search"]:focus {
  outline: none; border-color: var(--accent);
  background: var(--surface); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12);
}
.search-form-lg { max-width: 560px; margin-top: 18px; }

/* ========================= ۶) هیرو (صفحه اصلی) ========================= */

.hero {
  position: relative; overflow: hidden;
  padding: 100px 0 84px;
  background:
    radial-gradient(ellipse 60% 45% at 85% 8%, rgba(var(--accent-rgb), .14), transparent),
    radial-gradient(ellipse 45% 40% at 10% 90%, rgba(6, 182, 212, .1), transparent),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 60% 45% at 85% 8%, rgba(var(--accent-rgb), .16), transparent),
    radial-gradient(ellipse 45% 40% at 10% 90%, rgba(34, 211, 238, .07), transparent),
    var(--bg-2);
}

/* ---------- پس‌زمینه تصویری متحرک ---------- */
/* تصاویر مرتبط با موضوع وبلاگ با انیمیشن نرم زیر عنوان تغییر می‌کنند */
/* زوم روی «کانتینر مشترک» اجرا می‌شود (نه تک‌تک تصاویر) تا همه‌ی لایه‌ها
   همیشه هم‌فاز باشند: هیچ ری‌ستارت/پرش زوم در تعویض تصاویر رخ نمی‌دهد؛
   یک انیمیشن GPU سبک (فقط transform، بدون فیلتر) = بیشترین روانی */
.hero-slideshow {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-slideshow {
    animation: heroZoom 36s ease-in-out infinite;
    will-change: transform;
  }
}
/* «تنفس سینمایی»: زوم بسیار آرام و متقارن — شروع و پایان یکسان است،
   حلقه بی‌درز است و سرعت در نقاط بازگشت به‌نرمی صفر می‌شود.
   translate3d تخت در مسیر GPU سه‌بعدی اجرا می‌شود */
@keyframes heroZoom {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.07); }
  50%      { transform: translate3d(0, 0, 0) scale(1.15); }
}
.hero-slide {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0;
  transition: opacity 2s cubic-bezier(.4, 0, .2, 1);
  /* هر اسلاید لایه‌ی مستقل خودش را می‌گیرد تا گذار opacity روی کامپوزیتور
     (GPU) اجرا شود؛ بدون این، فایرفاکس/WebRender به‌جای تغییر شفافیتِ
     سبک، لایه‌ی تمام‌صفحه‌ی زیرین را در «هر فریمِ» کراس‌فید بازنمونه‌برداری
     می‌کند = لکنت دوره‌ای هم‌زمان با تعویض تصاویر (در کروم/ادج روان است) */
  will-change: opacity;
}

/* ---------- مسیر اختصاصی فایرفاکس (رفع لکنت زوم) ---------- */
/* موتور WebRender فایرفاکس هنگام انیمیشن scale روی لایه‌ی تصویرِ
   تمام‌صفحه، در پله‌های مقیاس ری‌رستر سنگین CPU اجرا می‌کند (کروم/ادج
   رستر اولیه را با GPU مقیاس می‌کنند و روان می‌مانند). راه‌حل قطعی:
   در فایرفاکس حرکت = translate خالص؛ مقیاس رستر ثابت می‌ماند و هیچ
   بازنمونه‌برداری‌ای در حین انیمیشن رخ نمی‌دهد. برای همین اسلایدها
   ۲۰٪ بزرگ‌تر از قاب‌اند و برشِ نهایی بر عهده‌ی .hero است (استاتیک) */
@supports (-moz-appearance: none) {
  .hero-slideshow { overflow: visible; }
  /* max-width:none الزامی است: قاعده‌ی سراسری img{max-width:100%}
     عرض ۱۲۰٪ را به ۱۰۰٪ قفل می‌کرد و لبه‌ی خالی می‌ساخت */
  .hero-slide { inset: -10%; width: 120%; height: 120%; max-width: none; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (-moz-appearance: none) {
    .hero-slideshow { animation-name: heroDrift; }
  }
}
/* درفت سینمایی مورب با همان ریتم «تنفس»: حلقه بی‌درز و ۱۰٪ خونیزیِ
   اطراف تضمین می‌کند هیچ لبه‌ی خالی دیده نشود */
@keyframes heroDrift {
  0%, 100% { transform: translate3d(-3%, -2%, 0); }
  50%      { transform: translate3d(3%, 2%, 0); }
}
/* کراس‌فید خالص: اسلاید فعال (ز) روی بقیه محو می‌شود و اسلاید در حالِ خروج
   کامل‌رنگ زیر آن می‌ماند؛ در نتیجه روشنایی هرگز افت نمی‌کند. چون زوم
   متعلق به کانتینر است، دو تصویرِ در حالِ ترکیب دقیقاً هم‌مقیاس‌اند */
.hero-slide.is-active { opacity: 1; z-index: 3; }
.hero-slide.is-leaving { opacity: 1; z-index: 2; }
.hero-slide.no-fade { transition: none !important; }
/* لایه‌ی اسکرِیم: تیره‌سازی مرکز + گرادیان عمودی + وینیتِ لبه‌ها
   برای خوانایی مطمئن متن روی تصویر (هر دو تم) — استاتیک و بدون هزینه‌ی فریم */
.hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 60% at 50% 40%, rgba(var(--accent-rgb), .14), transparent 70%),
    radial-gradient(ellipse 130% 105% at 50% 42%, transparent 30%, rgba(4, 8, 18, .62) 100%),
    linear-gradient(to top,
      rgba(4, 8, 17, .96) 0%,
      rgba(5, 9, 20, .76) 30%,
      rgba(5, 9, 20, .6) 58%,
      rgba(6, 10, 23, .55) 78%,
      rgba(6, 10, 23, .64) 100%);
}
/* دانه‌ی سینمایی خیلی خفیف روی اسکرِیم (پوشش نواربندی گرادیان) */
.hero-scrim::after {
  content: ""; position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* حالت تصویری: متن روشن روی اسکرِیم تیره در هر دو تم
   (پس‌زمینه‌ها بدون backdrop-filter: نمونه‌برداری هر-فریمی از پس‌زمینه‌ی
   متحرک حذف شد تا انیمیشن زوم کاملاً روان بماند) */
.hero.has-media { background: var(--bg-2); }
.hero.has-media .hero-badge {
  background: rgba(13, 20, 38, .6);
  border-color: rgba(255, 255, 255, .26);
  color: #e8eeff;
  box-shadow: none;
}
/* عنوان: سفیدِ برجسته (ExtraBold) با هاله — بدون انیمیشن گرادیان تا
   خط اصلی رشته‌ای (main thread) در حین زوم آزاد بماند */
.hero.has-media .hero-title {
  font-weight: 800;
  font-size: clamp(2.15rem, 5vw, 3.35rem);
  background: none;
  -webkit-background-clip: initial; background-clip: initial;
  -webkit-text-fill-color: #ffffff; color: #ffffff;
  animation: none;
  text-shadow: 0 2px 10px rgba(3, 8, 20, .65), 0 10px 44px rgba(3, 8, 20, .5), 0 0 80px rgba(var(--accent-rgb), .25);
}
.hero.has-media .hero-subtitle {
  color: rgba(240, 245, 252, .98);
  font-size: 1.08rem;
  text-shadow: 0 1px 12px rgba(3, 8, 20, .6);
}
.hero.has-media .btn-outline {
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
  background: rgba(255, 255, 255, .07);
}
.hero.has-media .btn-outline:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, .17);
}

/* تزئین گرادیانی حالت بدون تصویر */
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35;
  animation: blobFloat 14s ease-in-out infinite alternate;
}
.hero-blob-1 { width: 420px; height: 420px; background: var(--accent); top: -160px; left: -100px; }
.hero-blob-2 { width: 340px; height: 340px; background: var(--accent-2); bottom: -170px; right: -80px; animation-delay: -7s; }
@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 25px) scale(1.12); }
}
.hero-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 65% 60% at 50% 35%, #000 20%, transparent 75%);
}

.hero-inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 42px;
  align-items: center;
  text-align: center;
}

.hero-copy { text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--accent); font-size: .85rem; font-weight: 600;
  padding: 8px 18px; border-radius: 999px; box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; line-height: 1.45;
  background: linear-gradient(120deg, var(--accent) 15%, var(--accent-2) 60%, var(--accent) 95%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradientMove 7s ease infinite alternate;
  margin-bottom: 16px;
}
@keyframes gradientMove { to { background-position: 100% center; } }
.hero-subtitle { font-size: 1.05rem; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }

.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ---------- آمار هیرو ---------- */
.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 34px; box-shadow: var(--shadow-sm);
}
/* در حالت تصویری، آمار روی قرص نیمه‌مات می‌نشیند (بدون backdrop-filter
   تا نمونه‌برداری از پس‌زمینه‌ی متحرک انجام نشود و زوم روان بماند) */
.hero.has-media .hero-stats {
  background: rgba(9, 14, 28, .74);
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 14px 38px -16px rgba(0, 0, 0, .6);
}
.hero.has-media .stat-sep { background: rgba(255, 255, 255, .2); }
.hero.has-media .stat-item span { color: rgba(214, 223, 240, .95); }
.stat-item { display: flex; flex-direction: column; min-width: 120px; }
.stat-item strong {
  font-size: 1.65rem; font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.stat-item span { font-size: .82rem; color: var(--muted); }
.stat-sep { width: 1px; height: 42px; background: var(--border-2); }

/* ---------- دکمه «نمایش مقالات بیشتر» ---------- */
.load-more { display: flex; justify-content: center; margin-top: 36px; }
.btn-load-more {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 36px; border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2); font-family: inherit; font-size: .95rem; font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-load-more:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--surface-2); transform: translateY(-2px);
}
.btn-load-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-load-more:disabled { opacity: .75; cursor: progress; }
.btn-load-more i { transition: transform var(--transition); }
.btn-load-more:hover i { transform: translateY(3px); }
.btn-load-more.is-loading i { animation: lmSpin 1s linear infinite; }
@keyframes lmSpin { to { transform: rotate(360deg); } }
.load-more-done {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: 999px;
  background: var(--surface); border: 1px dashed var(--border-2);
  color: var(--muted); font-size: .9rem;
}
.load-more-done i { color: var(--success); }
/* ورود کارت‌های تازه‌اضافه‌شده با AJAX */
.card-enter { animation: cardEnter .5s ease both; }
@keyframes cardEnter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card-enter { animation: none; } }

/* ============================ ۷) کارت‌ها ============================ */

.section { padding: 56px 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-tight { padding: 30px 0 46px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; flex-wrap: wrap; gap: 12px; }
.section-title { font-size: 1.5rem; margin: 0; position: relative; padding-inline-start: 16px; }
.section-title::before {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 70%; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.section-more {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-weight: 500; font-size: .9rem;
  padding: 7px 14px; border-radius: 999px; transition: all var(--transition);
}
.section-more svg { transition: transform var(--transition); }
.section-more:hover { color: var(--accent); background: rgba(var(--accent-rgb), .07); }
.section-more:hover svg { transform: translateX(-4px); }

/* شبکه کارت‌ها */
.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}
.featured-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }

.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(var(--accent-rgb), .35); }

.post-card-media { position: relative; display: block; aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-card:hover .post-card-media img { transform: scale(1.05); }
.post-card-noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2.2rem; color: var(--border-2); }
.post-card-type {
  position: absolute; top: 14px; right: 14px;
  background: rgba(12, 19, 34, .72); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 4px 12px; border-radius: 999px; font-size: .74rem; font-weight: 600;
}

.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 22px 18px; }
.post-card-toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; min-height: 26px; }
.post-card-cat {
  display: inline-flex; align-self: flex-start;
  color: var(--accent); font-size: .78rem; font-weight: 700;
  background: rgba(var(--accent-rgb), .1); padding: 3px 11px; border-radius: 999px;
  transition: all var(--transition);
}
.post-card-cat:hover { background: rgba(var(--accent-rgb), .2); }
.post-card-title { font-size: 1.08rem; margin: 0 0 10px; line-height: 1.65; }
.post-card-title a { color: var(--text); }
.post-card-title a::after { content: ''; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt {
  font-size: .88rem; color: var(--muted); margin: 0 0 16px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta {
  display: flex; flex-wrap: wrap; gap: 14px; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted);
}
.post-card-meta span { display: inline-flex; align-items: center; gap: 5px; }

.post-card-featured .post-card-media { aspect-ratio: 16/8.5; }
.post-card-featured .post-card-title { font-size: 1.3rem; }

/* --- کارت دوره --- */
.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(var(--accent-rgb), .35); }
.course-card-media { position: relative; display: block; aspect-ratio: 16/9.5; background: var(--surface-2); overflow: hidden; }
.course-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.course-card:hover .course-card-media img { transform: scale(1.05); }
.course-card-badge {
  position: absolute; top: 14px; right: 14px; display: inline-flex; gap: 6px; align-items: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; padding: 5px 13px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  box-shadow: 0 4px 12px -2px rgba(var(--accent-rgb), .5);
}
.course-card-level {
  position: absolute; bottom: 14px; right: 14px;
  background: rgba(12, 19, 34, .72); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 3px 11px; border-radius: 999px; font-size: .72rem; font-weight: 600;
}
.course-card-body { padding: 20px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.course-card-title { font-size: 1.05rem; margin: 0 0 8px; }
.course-card-title a { color: var(--text); }
.course-card-title a:hover { color: var(--accent); }
.course-card-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); margin-bottom: 14px; flex: 1; }
.course-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.course-price { font-weight: 800; font-size: 1.02rem; color: var(--text); display: inline-flex; gap: 8px; align-items: baseline; }
.course-price .old-price { color: var(--muted); font-weight: 400; font-size: .82rem; }
.course-price-free { color: var(--success); }

/* تراز سطح دوره در نشان‌ها */
.level-beginner { border-color: var(--success); color: #4ade80; }
.level-intermediate { border-color: var(--warning); color: #fbbf24; }
.level-advanced { border-color: var(--danger); color: #f87171; }
.level-all { border-color: var(--info); color: #38bdf8; }

/* چیپ‌های موضوعات */
.category-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chips-label { color: var(--muted); font-size: .9rem; display: inline-flex; gap: 7px; align-items: center; }

/* پیش‌نمایش گالری در صفحه اصلی */
.gallery-preview-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
}
.gallery-preview-item {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3;
  background: var(--surface-2); position: relative;
}
.gallery-preview-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-preview-item:hover img { transform: scale(1.08); }
.gallery-preview-item:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }

/* ============== ۸) سربرگ صفحات + بردکرامب + صفحه‌بندی ============== */

.page-head {
  padding: 48px 0 40px;
  background:
    radial-gradient(ellipse 55% 65% at 88% 0%, rgba(var(--accent-rgb), .1), transparent),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-head-courses { background: radial-gradient(ellipse 55% 65% at 88% 0%, rgba(6, 182, 212, .1), transparent), var(--bg); }

/* بردکرامب — قرص با پس‌زمینه برای خوانایی و کنتراست در همه حالات */
.breadcrumb {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: .84rem; color: var(--text-2); margin-bottom: 16px;
  padding: 7px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.breadcrumb a { color: var(--text-2); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--muted); opacity: 1; }
.breadcrumb [aria-current] { color: var(--accent); font-weight: 700; }

.page-title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 8px; display: flex; align-items: center; gap: 12px; }
.page-title i { color: var(--accent); font-size: .85em; }
.page-subtitle { color: var(--muted); margin: 0; font-size: .98rem; }
.page-subtitle b { color: var(--accent); }

/* صفحه‌بندی */
.pagination-wrap { display: flex; justify-content: center; margin-top: 42px; }
.pagination { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.page-item .page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 12px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-weight: 600; font-size: .92rem;
  transition: all var(--transition);
}
.page-item .page-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.page-item.active .page-link {
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent;
  color: #fff; box-shadow: 0 6px 16px -6px rgba(var(--accent-rgb), .55);
}
.page-item.disabled .page-link { opacity: .4; cursor: default; pointer-events: none; }

/* ================== ۹) مقاله تکی + استایل محتوای ادیتور ================== */

.post-single { display: flex; flex-direction: column; }
.post-hero {
  position: relative; padding: 54px 0 46px;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), .12), transparent 55%), var(--bg);
  border-bottom: 1px solid var(--border); overflow: hidden;
}
.post-hero.has-image .post-hero-bg { position: absolute; inset: 0; }
.post-hero.has-image .post-hero-bg img {
  width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.5) saturate(1.1);
  transform: scale(1.04);
}
.post-hero.has-image .post-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,19,34,.55), rgba(12,19,34,.85));
}
.post-hero .container-xl { position: relative; z-index: 1; }
.post-hero.has-image .breadcrumb {
  background: rgba(12, 19, 34, .62);
  border-color: rgba(255, 255, 255, .18);
  color: #dbe4f3; box-shadow: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.post-hero.has-image .breadcrumb a,
.post-hero.has-image .breadcrumb .sep { color: #eef2fa; }
.post-hero.has-image .breadcrumb a:hover { color: #a5b4fc; }
.post-hero.has-image .breadcrumb [aria-current] { color: #a5b4fc; font-weight: 700; }
.post-hero.has-image .post-title,
.post-hero.has-image .post-meta,
.post-hero.has-image .post-meta-item,
.post-hero.has-image .cqm-chip { color: #eef2fa; }

.post-title { font-size: clamp(1.55rem, 4.2vw, 2.3rem); line-height: 1.6; margin: 0 0 18px; }

.post-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); font-size: .88rem; }
.post-meta-item { display: inline-flex; align-items: center; gap: 7px; }
.post-meta-item i { color: var(--accent); }
.author-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; font-size: .95rem; font-weight: 700;
}

.course-quickmeta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.cqm-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(12, 19, 34, .55); color: #e2e8f0;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600;
}
.post-hero:not(.has-image) .cqm-chip { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.cqm-price { border-color: rgba(74, 222, 128, .5); color: #4ade80 !important; }
.post-hero:not(.has-image) .cqm-price { color: var(--success) !important; }

.post-layout { padding: 44px 20px 30px; }

/* جعبه CTA دوره */
.course-cta {
  margin: 0 auto 34px; max-width: 640px; width: 100%;
}
.course-cta-inner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 26px 28px; display: flex; flex-direction: column; gap: 16px;
}
.course-cta-price { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.course-cta-price strong { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.course-cta-price .old-price { color: var(--muted); font-size: .95rem; }
.course-cta-price .text-free { color: var(--success); font-size: 1.5rem; }
.course-cta-alt { text-align: center; color: var(--muted); font-size: .85rem; }
.course-cta-alt:hover { color: var(--accent); }

/* --- محتوای مقاله (خروجی ادیتور WYSIWYG) --- */
.post-content {
  max-width: 760px; margin: 0 auto; font-size: 1.03rem; line-height: 2.15;
}
.post-lead {
  font-size: 1.15rem; color: var(--text-2); line-height: 2;
  border-inline-start: 4px solid var(--accent); padding-inline-start: 20px;
  margin: 0 0 30px;
}
.post-content h2 {
  font-size: 1.5rem; margin: 44px 0 16px; padding-inline-start: 14px;
  border-inline-start: 5px solid var(--accent);
}
.post-content h3 { font-size: 1.22rem; margin: 34px 0 12px; color: var(--accent); }
.post-content h4 { font-size: 1.08rem; margin: 28px 0 10px; }
.post-content p { margin: 0 0 20px; }
.post-content a { text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), .4); text-underline-offset: 4px; }
.post-content a:hover { text-decoration-color: var(--accent); }
.post-content ul, .post-content ol { padding-inline-start: 26px; margin: 0 0 22px; }
.post-content ol { list-style-type: persian; } /* شماره‌های فارسی برای لیست‌های مرتب */
.post-content li { margin-bottom: 9px; }
.post-content li::marker { color: var(--accent); }
.post-content b, .post-content strong { color: var(--text); font-weight: 800; }
.post-content mark { background: rgba(255, 200, 0, .35); border-radius: 4px; padding: 0 3px; }

.post-content blockquote {
  margin: 28px 0; padding: 18px 24px;
  background: rgba(var(--accent-rgb), .06); border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2); font-style: italic;
}

.post-content img {
  border-radius: var(--radius); margin: 10px auto 6px; display: block;
  max-width: 100%; height: auto;
}
.post-content figure { margin: 28px 0; }
.post-content figcaption {
  text-align: center; color: var(--muted); font-size: .82rem; margin-top: 10px;
}
.post-content pre {
  direction: ltr; text-align: left; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px 20px; overflow-x: auto; font-size: .88rem; line-height: 1.8;
}
.post-content code {
  background: rgba(var(--accent-rgb), .09); color: var(--accent);
  padding: 2px 7px; border-radius: 6px; font-size: .88em;
  direction: ltr; display: inline-block;
}
.post-content pre code { background: none; padding: 0; }
.post-content hr { border: none; height: 1px; background: var(--border-2); margin: 36px 0; }

.post-content table {
  width: 100%; border-collapse: collapse; margin: 26px 0;
  background: var(--surface); border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border); font-size: .92rem;
}
.post-content table th {
  background: rgba(var(--accent-rgb), .1); color: var(--text);
  font-weight: 700; text-align: right;
}
.post-content table th, .post-content table td {
  padding: 11px 15px; border: 1px solid var(--border);
}
.post-content table tbody tr:nth-child(even) { background: var(--surface-2); }
.table-responsive { overflow-x: auto; margin: 26px 0; }
.table-responsive table { margin: 0; min-width: 420px; }

/* اشتراک‌گذاری */
.post-share {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 42px; padding-top: 24px; border-top: 1px dashed var(--border-2);
}
.post-share-label { color: var(--muted); font-size: .88rem; font-weight: 600; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  transition: all var(--transition); cursor: pointer;
}
.share-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

/* ناوبری قبلی/بعدی */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 760px; margin: 40px auto 0;
}
.post-nav-item {
  display: flex; flex-direction: column; gap: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  transition: all var(--transition);
}
.post-nav-item:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.post-nav-item span { font-size: .75rem; color: var(--accent); font-weight: 700; }
.post-nav-item strong { font-size: .92rem; color: var(--text); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav-empty { visibility: hidden; }

.related-section { background: var(--bg-2); border-top: 1px solid var(--border); }

.page-content-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 38px 42px; box-shadow: var(--shadow-sm);
}

/* ===================== ۱۰) گالری + لایت‌باکس ===================== */

.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px;
}
.gallery-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.gallery-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(var(--accent-rgb), .35); }
.gallery-card-cover { aspect-ratio: 16/9.5; background: var(--surface-2); overflow: hidden; }
.gallery-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery-card:hover .gallery-card-cover img { transform: scale(1.06); }
.gallery-card-body { padding: 20px 22px; display: flex; flex-direction: column; flex: 1; }
.gallery-card-title { font-size: 1.12rem; margin: 0 0 8px; color: var(--text); }
.gallery-card-count {
  margin-top: auto; padding-top: 14px; display: inline-flex; gap: 7px; align-items: center;
  color: var(--accent); font-size: .85rem; font-weight: 600;
}

.lightbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px;
}
.lightbox-item { margin: 0; }
.lightbox-thumb {
  display: block; width: 100%; aspect-ratio: 4/3; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); cursor: zoom-in;
  transition: all var(--transition);
}
.lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.lightbox-thumb:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.lightbox-thumb:hover img { transform: scale(1.07); }
.lightbox-item figcaption {
  text-align: center; font-size: .8rem; color: var(--muted); margin-top: 8px;
}

/* لایت‌باکس */
.lightbox-modal {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 22, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 40px 60px;
}
.lightbox-modal[hidden] { display: none; }
.lightbox-figure { max-width: min(1100px, 92vw); margin: 0; text-align: center; }
.lightbox-figure img {
  max-width: 100%; max-height: 80vh; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); animation: lightboxIn .25s ease;
}
@keyframes lightboxIn { from { opacity: 0; transform: scale(.94); } }
.lightbox-figure figcaption {
  color: #cbd5e1; margin-top: 16px; font-size: .95rem;
}
.lightbox-close {
  position: absolute; top: 18px; left: 22px;
  background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .15);
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.5rem; line-height: 1;
  cursor: pointer; transition: all var(--transition);
}
.lightbox-close:hover { background: var(--danger); transform: rotate(90deg); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .15);
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.lightbox-nav:hover { background: var(--accent); }
.lightbox-prev { right: 24px; }
.lightbox-next { left: 24px; }

/* ===================== ۱۱) تماس با ما + فرم‌ها ===================== */

.contact-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start;
}
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  transition: all var(--transition);
}
.contact-card:hover { border-color: rgba(var(--accent-rgb), .4); box-shadow: var(--shadow-md); }
.contact-icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 13px;
  background: rgba(var(--accent-rgb), .1); color: var(--accent); font-size: 1.1rem;
}
.contact-card h3 { font-size: 1rem; margin: 0 0 4px; }
.contact-card p, .contact-card a { margin: 0; color: var(--muted); font-size: .92rem; }
.contact-card a:hover { color: var(--accent); }

.contact-form-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 34px 36px; box-shadow: var(--shadow-sm);
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.form-group label { font-weight: 600; font-size: .9rem; }
.form-group label b { color: var(--danger); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  font-family: var(--font); font-size: .95rem; transition: all var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12);
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-group input[dir="ltr"], .form-group textarea[dir="ltr"] { text-align: left; }

.form-errors {
  background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .3);
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 22px; font-size: .92rem;
}
.form-errors strong { display: flex; gap: 8px; margin-bottom: 8px; }
.form-errors ul { margin: 0; padding-inline-start: 20px; }

/* تله اسپم */
.hp-field {
  position: absolute !important; left: -9999px !important; top: -9999px !important;
  opacity: 0; height: 0; width: 0; overflow: hidden;
}

/* ===================== ۱۲) جستجو / 404 ===================== */

.notfound { padding: 90px 0 70px; text-align: center; }
.notfound-code {
  font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.notfound-title { font-size: 1.6rem; margin: 10px 0 12px; }
.notfound-text { color: var(--muted); margin: 0 0 30px; }
.notfound-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.notfound .search-form-lg { margin: 0 auto; }

/* ============ ۱۳) Toast و دکمه بازگشت به بالا ============ */

.toast-wrap {
  position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 400;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--info);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 14px 18px; font-size: .9rem; color: var(--text-2);
  animation: toastIn .3s ease; position: relative; overflow: hidden;
}
.toast.toast-out { animation: toastOut .3s ease forwards; }
.toast i { margin-top: 3px; }
.toast-success { border-inline-start-color: var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-inline-start-color: var(--danger); }
.toast-error i { color: var(--danger); }
.toast-warning { border-inline-start-color: var(--warning); }
.toast-warning i { color: var(--warning); }
.toast-info i { color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(.97); } }

.back-to-top {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 350;
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--border); box-shadow: var(--shadow-md); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: all var(--transition);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ========================= ۱۴) پابرگ ========================= */

.site-footer {
  margin-top: 70px; background: var(--surface);
  border-top: 1px solid var(--border); color: var(--muted);
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 40px;
  padding: 52px 20px 36px;
}
.brand-footer { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--text); }
.brand-footer img { border-radius: 10px; }
.brand-footer strong { font-size: 1.1rem; }
.footer-desc { font-size: .9rem; line-height: 2; margin: 0 0 20px; }
.footer-title { font-size: 1rem; color: var(--text); margin: 0 0 18px; padding-inline-start: 12px; border-inline-start: 3px solid var(--accent); }
.footer-links, .footer-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: var(--accent); }
.footer-contact li { display: flex; gap: 10px; align-items: center; font-size: .88rem; }
.footer-contact i { color: var(--accent); width: 18px; text-align: center; }
.footer-contact a { color: var(--muted); }
.footer-contact a:hover { color: var(--accent); }

.social-row { display: flex; gap: 10px; flex-wrap: wrap; }
.social-row a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  transition: all var(--transition);
}
.social-row a:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
  transform: translateY(-3px);
}
.social-row-start { justify-content: flex-start; }

.footer-note {
  text-align: center; font-size: .85rem; color: var(--muted);
  padding: 0 20px 18px; margin: 0;
}
.footer-bottom { border-top: 1px solid var(--border); background: var(--bg-2); }
.footer-bottom-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 20px; font-size: .82rem;
}
.footer-engine b { color: var(--accent); }

/* ================ ۱۵) واکنش‌گرایی و انیمیشن‌ها ================ */

/* ظاهرشدن هنگام اسکرول */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 991px) {
  .featured-grid { grid-template-columns: 1fr; }
  .gallery-preview-grid { grid-template-columns: repeat(4, 1fr); }
  .gallery-preview-item:first-child { grid-column: span 2; grid-row: span 1; aspect-ratio: 4/3; }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-empty { display: none; }
}

@media (max-width: 767px) {
  :root { --header-h: 64px; }

  .nav-toggle-btn { display: inline-flex; }

  /* منوی موبایل: کشویی از راست — تمام ارتفاع صفحه */
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
    width: min(320px, 86vw); background: var(--surface);
    box-shadow: var(--shadow-lg); margin: 0;
    transform: translateX(105%); transition: transform .3s ease;
    padding: 84px 18px 30px; overflow-y: auto;
    border-inline-start: 1px solid var(--border);
  }
  .main-nav.is-open { transform: none; }

  /* دکمه بستن پنل منو — لبه‌ی دور از محل اتصال (چپ فیزیکی در RTL) */
  .nav-close-btn {
    display: inline-flex;
    position: absolute; top: 20px; inset-inline-end: 14px;
  }

  /* هنگام باز بودن پنل، پشتِ صفحه اسکرول نمی‌شود */
  body.nav-open { overflow: hidden; }

  .nav-menu { flex-direction: column; align-items: stretch; }
  .nav-link { padding: 13px 16px; font-size: 1rem; }
  .nav-sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; border-inline-start: 2px solid var(--border);
    margin: 0 18px 8px 0; border-radius: 0; background: transparent; padding: 0;
    display: none;
  }
  .nav-item.open > .nav-sub { display: block; }
  .nav-caret { margin-inline-start: auto; transform: rotate(-90deg); }
  .nav-item.open .nav-caret { transform: rotate(0deg); }

  .hero { padding: 64px 0 56px; }
  .hero-inner { gap: 30px; }
  .hero-subtitle { font-size: .98rem; }
  .hero-stats { gap: 18px; padding: 18px 20px; }
  .stat-sep { display: none; }
  .stat-item { min-width: 100px; }

  .post-grid { grid-template-columns: 1fr; gap: 20px; }
  .section { padding: 42px 0; }

  .form-row-2 { grid-template-columns: 1fr; gap: 0; }
  .contact-form-wrap { padding: 26px 22px; }
  .page-content-box { padding: 26px 22px; }

  .gallery-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox-modal { padding: 20px 14px; }
  .lightbox-nav { display: none; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { justify-content: center; text-align: center; }

  .search-bar.is-open { max-height: 120px; }
}

@media (max-width: 480px) {
  .brand-text small { display: none; }
  .gallery-grid { grid-template-columns: 1fr; }
}

/* احترام به تنظیمات کاهش حرکت کاربر */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* چاپ */
@media print {
  .site-header, .site-footer, .post-share, .back-to-top, .toast-wrap, .search-bar, .hero-bg, .hero-slideshow, .hero-scrim { display: none !important; }
  body { background: #fff; color: #000; }
  .post-content { max-width: 100%; }
}
