/*
Theme Name: Webha
Theme URI: https://webha.ir
Author: Webha — UI/UX
Author URI: https://webha.ir
Description: قالب مجله‌ای فارسی، راست‌چین (RTL)، تمیز و روشن برای وب‌سایت webha.ir. دارای سایدبار استیکی، دسته‌بندی‌های مجله‌ای، فرم تماس، ارسال پست مهمان و سیستم نظرات تمیز.
Version: 1.1.19
Requires at least: 6.0
Tested up to: 6.5
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: webha
Tags: rtl-language-support, blog, news, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. متغیرها / Design Tokens
   ========================================================================== */
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

:root {
  /* رنگ برند — تمیز و روشن */
  --primary:        #0ea5e9;   /* sky-500 */
  --primary-600:    #0284c7;
  --primary-700:    #0369a1;
  --primary-50:     #f0f9ff;
  --primary-100:    #e0f2fe;
  --accent:         #f59e0b;   /* amber */
  --accent-600:     #d97706;

  /* خنثی / متن و سطوح */
  --bg:             #f5f7fa;   /* پس‌زمینه‌ی کلی صفحه */
  --surface:        #ffffff;   /* کارت‌ها و سطوح */
  --surface-2:      #fbfcfe;
  --text:           #1f2937;   /* متن اصلی */
  --text-soft:      #6b7280;   /* متن کم‌رنگ */
  --text-faint:     #9ca3af;
  --border:         #e8ecf1;
  --border-soft:    #f0f3f7;

  /* رنگ دسته‌ها (برچسب‌ها) */
  --cat-health:     #10b981;
  --cat-psychology: #8b5cf6;
  --cat-success:    #f59e0b;
  --cat-business:   #3b82f6;
  --cat-tech:       #6366f1;
  --cat-cooking:    #ef4444;
  --cat-lifestyle:  #ec4899;

  /* فرم و حالت‌ها */
  --success:        #16a34a;
  --error:          #dc2626;

  /* اندازه و شکل */
  --radius:         16px;
  --radius-sm:      10px;
  --radius-lg:      22px;
  --radius-pill:    999px;
  --shadow-sm:      0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow:         0 4px 12px rgba(16,24,40,.06), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg:      0 18px 40px rgba(16,24,40,.10), 0 6px 12px rgba(16,24,40,.05);
  --ring:           0 0 0 3px rgba(14,165,233,.18);

  --sidebar-w:      300px;
  --container:      1240px;
  --header-h:       64px;

  --ff: "Vazirmatn", "Vazir", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

/* ==========================================================================
   2. ریست و پایه
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body.menu-open { overflow: hidden; }

.preview-bar {
  background: #0f1b2d;
  color: #cbd5e1;
  font-size: .82rem;
  padding-block: 8px;
  padding-inline: max(20px, calc((100vw - var(--container)) / 2 + 20px));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 0;
}
.preview-bar a {
  color: #fff;
  text-decoration: none;
  margin: 0 6px;
  border-bottom: 1px solid transparent;
}
.preview-bar a:hover,
.preview-bar a.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}
.preview-bar .sep { color: rgba(203,213,225,.45); margin: 0 2px; }

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

a { color: var(--primary-600); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-700); }

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

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; }
/* آیکون‌های داخل دکمه کلیک‌ناپذیر شوند تا هدف رویداد همیشه خودِ دکمه باشد
   (رفع مشکل باز نشدن منوی موبایل در مرورگرهایی که closest روی SVG را درست هندل نمی‌کنند) */
button svg, .btn svg, a.btn svg { pointer-events: none; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ==========================================================================
   3. چیدمان اصلی
   ========================================================================== */
.site-inner { max-width: var(--container); margin-inline: auto; padding-inline: 20px; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding-block: 28px 56px;
}

/* در RTL ستون اول (سایدبار) سمت راست و محتوا سمت چپ قرار می‌گیرد */
.content-area { min-width: 0; }

@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-block: 18px 40px; }
}

/* ==========================================================================
   4. هدر موبایل (Top bar)
   ========================================================================== */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--container); margin-inline: auto; height: 100%;
  padding-inline: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 12px; color: var(--text);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary-600); }
.icon-btn svg { width: 22px; height: 22px; }

@media (max-width: 1023px) {
  .topbar { display: block; }
  .topbar-inner { justify-content: flex-start; direction: ltr; }
  .topbar [data-menu-toggle] { order: 1; }
  .topbar [data-search-toggle] { order: 2; }
  .topbar .logo { order: 3; margin-left: auto; direction: rtl; min-width: 0; }
}

/* ==========================================================================
   5. لوگو
   ========================================================================== */
.logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.logo-mark {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center;
  border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden;
  background: #f5f0d6;
}
.logo-mark img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: none;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-size: 1.35rem; font-weight: 900; color: var(--text); letter-spacing: 0; }
.logo-name b { color: var(--primary-600); }
.logo-tld { font-size: .72rem; color: var(--text-faint); font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.topbar .logo-mark { width: 40px; height: 40px; }
.topbar .logo-name { font-size: 1.18rem; }
.topbar .logo-tld { font-size: .64rem; }
.logo-mark * { transform-box: fill-box; transform-origin: center; }
.logo-mark--image { animation: webha-logo-breathe 5.5s ease-in-out infinite; }
.logo-mark--image img { animation: webha-logo-symbol 4.8s ease-in-out infinite; }
.logo-mark__frame { animation: webha-logo-breathe 5.5s ease-in-out infinite; }
.logo-mark__signal--outer { animation: webha-logo-signal 2.7s ease-in-out infinite; }
.logo-mark__signal--inner { animation: webha-logo-signal 2.7s ease-in-out .18s infinite; }
.logo-mark__spark { animation: webha-logo-spark 3.4s ease-in-out infinite; }
.logo-mark__page--right { animation: webha-logo-page 4.8s ease-in-out infinite; }
.logo:hover .logo-mark__frame { animation-duration: 3s; }

@keyframes webha-logo-breathe {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.025); filter: brightness(1.08); }
}
@keyframes webha-logo-signal {
  0%, 100% { opacity: .55; transform: scale(.94); }
  48% { opacity: 1; transform: scale(1.04); }
}
@keyframes webha-logo-spark {
  0%, 100% { transform: rotate(45deg) scale(.92); opacity: .78; }
  45% { transform: rotate(45deg) scale(1.12); opacity: 1; }
}
@keyframes webha-logo-page {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-.8px); }
}
@keyframes webha-logo-symbol {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-.6px) scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-mark--image,
  .logo-mark--image img,
  .logo-mark__frame,
  .logo-mark__signal--outer,
  .logo-mark__signal--inner,
  .logo-mark__spark,
  .logo-mark__page--right { animation: none; }
}

/* ==========================================================================
   6. سایدبار استیکی
   ========================================================================== */
.sidebar { position: relative; align-self: start; }
@media (min-width: 1024px) {
  /* سایدبار استیکی سمت راست در همه‌ی صفحات */
  .sidebar {
    position: sticky; top: 24px;
  }
  .sidebar-sticky {
    position: static;
  }
}

.sidebar-logo { padding: 8px 4px 18px; }
@media (min-width: 1024px) {
  .sidebar-logo { padding: 6px 4px 22px; }
  .sidebar-logo .logo { gap: 14px; align-items: center; }
  .sidebar-logo .logo-mark {
    width: 80px; height: 80px;
    border-radius: 20px;
  }
  .sidebar-logo .logo-text { line-height: 1.12; min-width: 0; }
  .sidebar-logo .logo-name {
    font-size: 2rem;
    line-height: 1.08;
  }
  .sidebar-logo .logo-tld {
    font-size: .9rem;
    line-height: 1.45;
    white-space: normal;
  }
}

.widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.widget-title {
  font-size: 1rem; font-weight: 800; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.widget-title::before {
  content: ""; width: 6px; height: 18px; border-radius: 4px;
  background: linear-gradient(var(--primary), var(--primary-700));
}

/* ناوبری دسته‌ها در سایدبار */
.cat-nav > li { border-bottom: 1px solid var(--border-soft); }
.cat-nav > li:last-child { border-bottom: 0; }
.cat-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 8px; color: var(--text); font-weight: 700; font-size: .96rem;
  border-radius: 10px;
}
.cat-nav a:hover { background: var(--primary-50); color: var(--primary-700); }
.cat-nav .cat-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--primary); }
.cat-nav .menu-item-has-children > a::after,
.cat-nav .has-sub > a::after {
  content: ""; margin-inline-start: auto; width: 8px; height: 8px;
  border-inline-end: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg); transition: transform .2s ease;
}
.cat-nav .open > a::after { transform: rotate(-135deg); }
.cat-nav .sub-menu, .cat-nav .children {
  display: none; padding: 2px 22px 8px;
}
.cat-nav .open > .sub-menu, .cat-nav .open > .children { display: block; }
.cat-nav .sub-menu a, .cat-nav .children a {
  padding: 8px; font-size: .9rem; font-weight: 600; color: var(--text-soft);
}
.cat-nav .sub-menu a::before, .cat-nav .children a::before {
  content: "›"; color: var(--primary); font-weight: 800;
}
/* در دسکتاپ زیرمنوها همیشه باز و فلش راهنما حذف می‌شود */
@media (min-width: 1024px) {
  .cat-nav .sub-menu, .cat-nav .children { display: block; }
  .cat-nav .menu-item-has-children > a::after, .cat-nav .has-sub > a::after { display: none; }
}

/* لیست مقالات کوچک در ویجت */
.mini-list li + li { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.mini-post { display: flex; gap: 11px; align-items: center; }
.mini-thumb { width: 60px; height: 60px; flex: none; border-radius: 12px; object-fit: cover; background: var(--border-soft); }
.mini-post a { font-weight: 700; font-size: .9rem; color: var(--text); line-height: 1.6; }
.mini-post a:hover { color: var(--primary-600); }
.mini-meta { font-size: .76rem; color: var(--text-faint); margin-top: 4px; }

.irandesigner-banner {
  display: block; margin-top: 18px;
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.irandesigner-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(16,24,40,.09);
}
.irandesigner-banner img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 300 / 199; object-fit: cover;
}

/* ==========================================================================
   7. جستجو
   ========================================================================== */
.search-form { position: relative; display: flex; }
.search-form input[type="search"] {
  width: 100%; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-pill); padding: 11px 44px 11px 16px;
  font-family: inherit; font-size: .92rem; color: var(--text);
}
.search-form input::placeholder { color: var(--text-faint); }
.search-form input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: var(--ring); }
.search-form button {
  position: absolute; inset-inline-end: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--primary); color: #fff; display: grid; place-items: center;
}
.search-form button:hover { background: var(--primary-600); }
.search-form button svg { width: 17px; height: 17px; }

/* ==========================================================================
   8. کارت‌های مقاله
   ========================================================================== */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 18px;
}
.section-head h2 { margin: 0; font-size: 1.35rem; position: relative; padding-inline-start: 16px; }
.section-head h2::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
  width: 6px; height: 26px; border-radius: 5px; background: linear-gradient(var(--primary), var(--primary-700));
}
.section-head .more-link { font-size: .88rem; font-weight: 700; color: var(--primary-600); }
.section-head .more-link:hover { color: var(--primary-700); }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; gap: 18px; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-100); }
.card-thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--border-soft); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.08rem; font-weight: 800; line-height: 1.6; margin: 0 0 8px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary-600); }
.card-excerpt { font-size: .9rem; color: var(--text-soft); margin: 0 0 14px; line-height: 1.85;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 14px; margin-top: auto; font-size: .8rem; color: var(--text-faint); }
.card-meta .meta { display: inline-flex; align-items: center; gap: 5px; }
.card-meta svg { width: 15px; height: 15px; opacity: .8; }

/* برچسب دسته */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 800; color: #fff;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: var(--primary); line-height: 1;
}
.card-thumb .badge { position: absolute; inset-block-start: 12px; inset-inline-start: 12px; box-shadow: var(--shadow); }
.badge--health     { background: var(--cat-health); }
.badge--psychology { background: var(--cat-psychology); }
.badge--success    { background: var(--cat-success); }
.badge--business   { background: var(--cat-business); }
.badge--tech       { background: var(--cat-tech); }
.badge--cooking    { background: var(--cat-cooking); }
.badge--lifestyle  { background: var(--cat-lifestyle); }

/* ==========================================================================
   9. Hero / مقاله شاخص
   ========================================================================== */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 34px; min-height: 360px; display: flex; align-items: flex-end;
  box-shadow: var(--shadow); background: #0b1220;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,12,22,.88) 0%, rgba(8,12,22,.45) 45%, rgba(8,12,22,.05) 100%);
}
.hero-body { position: relative; z-index: 2; padding: 30px 32px; color: #fff; max-width: 720px; }
.hero-body h2 { color: #fff; font-size: 1.9rem; line-height: 1.45; margin: 12px 0 10px; }
.hero-body h2 a { color: #fff; }
.hero-body p { color: rgba(255,255,255,.82); margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; gap: 16px; font-size: .82rem; color: rgba(255,255,255,.75); }
@media (max-width: 560px) {
  .hero { min-height: 280px; }
  .hero-body { padding: 20px; }
  .hero-body h2 { font-size: 1.4rem; }
}

/* ==========================================================================
   10. تک‌نوشته / برگه
   ========================================================================== */
.entry {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.entry-hero { aspect-ratio: 21/9; background: var(--border-soft); }
.entry-hero img { width: 100%; height: 100%; object-fit: cover; }
.entry-inner { padding: 28px 34px 36px; }
@media (max-width: 640px) { .entry-inner { padding: 22px 18px 26px; } }

.entry-header { margin-bottom: 18px; }
.entry-title { font-size: 2rem; line-height: 1.5; margin: 12px 0 14px; }
@media (max-width: 640px) { .entry-title { font-size: 1.5rem; } }
.entry-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: .85rem; color: var(--text-soft); padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.entry-meta .meta { display: inline-flex; align-items: center; gap: 6px; }
.entry-meta svg { width: 16px; height: 16px; opacity: .75; }
.entry-author-avatar { width: 26px; height: 26px; border-radius: 50%; }

/* محتوای نوشته */
.entry-content {
  max-width: 760px; margin-inline: auto;
  font-size: 1.08rem; line-height: 2.18; color: #374151;
  overflow-wrap: break-word; word-break: normal;
}
.entry-content > * { margin-block: 0; }
.entry-content > * + * { margin-top: 1.25em; }
.entry-content p {
  text-align: justify; text-justify: inter-word;
}
.entry-content > p:first-of-type {
  position: relative; margin-bottom: 1.35em; padding: 12px 18px 12px 0;
  border-inline-start: 4px solid var(--primary);
  color: var(--text); font-size: 1.13rem; font-weight: 650; line-height: 2.05;
}
.entry-content > p:nth-of-type(2n):not(:last-child)::after {
  content: ""; display: block; width: 76px; height: 3px;
  margin: 1.35em auto .1em;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, transparent, var(--primary-100), transparent);
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  position: relative; color: var(--text); line-height: 1.65; letter-spacing: 0;
}
.entry-content h2 {
  font-size: 1.48rem; margin-top: 2em; padding-inline-start: 16px;
}
.entry-content h2::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .72em;
  width: 6px; height: 24px; border-radius: var(--radius-pill);
  background: var(--primary);
}
.entry-content h3 { font-size: 1.22rem; margin-top: 1.6em; color: var(--primary-700); }
.entry-content h4 { font-size: 1.08rem; margin-top: 1.35em; }
.entry-content h2 + *,
.entry-content h3 + *,
.entry-content h4 + * { margin-top: .65em; }
.entry-content a {
  color: var(--primary-600); font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
.entry-content a:hover { color: var(--primary-700); }
.entry-content ul, .entry-content ol {
  padding-inline-start: 1.2em; margin: 1.25em 0;
}
.entry-content ul { list-style: none; }
.entry-content ul li { position: relative; padding-inline-start: 1.1em; }
.entry-content ul li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .95em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
}
.entry-content ol { list-style: decimal; }
.entry-content li { margin: .55em 0; padding-inline-start: .2em; }
.entry-content strong, .entry-content b { color: var(--text); font-weight: 850; }
.entry-content mark { background: #fef3c7; color: var(--text); padding: 1px 6px; border-radius: 6px; }
.entry-content hr,
.entry-content .wp-block-separator {
  width: 100%; max-width: 220px; height: 1px; border: 0;
  margin: 2em auto; background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.entry-content img { border-radius: var(--radius-sm); margin-inline: auto; box-shadow: var(--shadow-sm); }
.entry-content figure { margin: 1.6em auto; }
.entry-content figcaption,
.entry-content .wp-caption-text {
  margin-top: .65em; text-align: center; font-size: .82rem; color: var(--text-faint); line-height: 1.8;
}
.entry-content blockquote {
  margin: 1.7em 0; padding: 18px 22px; border-inline-start: 4px solid var(--primary);
  background: linear-gradient(180deg, var(--primary-50), #fff);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text); font-weight: 650; line-height: 2;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content code {
  background: #f1f5f9; padding: 2px 7px; border-radius: 6px; font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr;
}
.entry-content pre {
  background: #0f172a; color: #e2e8f0; padding: 18px; border-radius: var(--radius-sm);
  overflow-x: auto; direction: ltr; text-align: left;
}
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 12px; text-align: start; }
.entry-content th { background: var(--surface-2); font-weight: 800; }
@media (max-width: 640px) {
  .entry-content { max-width: none; font-size: 1rem; line-height: 2.08; }
  .entry-content > p:first-of-type {
    padding-inline-start: 12px; font-size: 1.04rem; line-height: 2;
  }
  .entry-content h2 { font-size: 1.26rem; }
  .entry-content h3 { font-size: 1.12rem; }
}

/* برچسب‌های پایان نوشته و اشتراک‌گذاری */
.entry-footer { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a { font-size: .82rem; font-weight: 700; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--border); padding: 5px 12px; border-radius: var(--radius-pill); }
.tag-list a:hover { color: var(--primary-600); border-color: var(--primary); }
.share { display: flex; gap: 8px; }
.share a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); }
.share a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.share svg { width: 18px; height: 18px; }

/* جعبه نویسنده */
.author-box { display: flex; gap: 16px; margin-top: 26px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.author-box img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author-box h4 { margin: 0 0 6px; }
.author-box p { margin: 0; font-size: .9rem; color: var(--text-soft); }

/* ==========================================================================
   11. نظرات — تمیز با ریپلای
   ========================================================================== */
.comments { margin-top: 30px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px 30px 32px; box-shadow: var(--shadow-sm); }
@media (max-width: 640px) { .comments { padding: 22px 18px; } }
.comments-title { font-size: 1.3rem; margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.comments-title .count { background: var(--primary-50); color: var(--primary-700);
  font-size: .85rem; padding: 3px 12px; border-radius: var(--radius-pill); }

.comment-list { }
.comment-list .children { margin-inline-start: 40px; padding-inline-start: 18px; border-inline-start: 2px dashed var(--border); }
@media (max-width: 640px) { .comment-list .children { margin-inline-start: 16px; padding-inline-start: 10px; } }

.comment-body { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.comment-avatar img { width: 48px; height: 48px; border-radius: 50%; flex: none; background: var(--border-soft); }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-author { font-weight: 800; color: var(--text); }
.comment-author.is-author { color: var(--primary-700); }
.comment-author.is-author::after { content: "نویسنده"; font-size: .68rem; background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: var(--radius-pill); margin-inline-start: 6px; font-weight: 700; }
.comment-date { font-size: .78rem; color: var(--text-faint); }
.comment-text { font-size: .95rem; color: #374151; }
.comment-text p:last-child { margin-bottom: 0; }
.comment-actions { margin-top: 6px; }
.comment-reply-link, .comment-actions a {
  font-size: .82rem; font-weight: 700; color: var(--primary-600);
  display: inline-flex; align-items: center; gap: 5px;
}
.comment-reply-link::before { content: "↩"; }
.comment-reply-link:hover { color: var(--primary-700); }
.comment-awaiting-moderation { font-size: .82rem; color: var(--accent-600); }
.bypostauthor > .comment-body { background: var(--primary-50); border-radius: var(--radius); padding-inline: 16px; }

/* فرم نظر و فرم‌های قالب */
.comment-respond, .webha-form { margin-top: 26px; }
.comment-respond .comment-reply-title { font-size: 1.15rem; margin-bottom: 6px; }
.comment-notes, .form-intro { font-size: .85rem; color: var(--text-soft); margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: .88rem; font-weight: 700; margin-bottom: 7px; color: var(--text); }
.form-field label .req { color: var(--error); }
.form-control,
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"],
.comment-form textarea {
  width: 100%; font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.form-control, .comment-form textarea { min-height: 130px; resize: vertical; line-height: 1.9; }
.form-control:focus, .comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: var(--primary); background: #fff; box-shadow: var(--ring);
}
select.form-control { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; padding-inline-start: 38px; }
.form-hint { font-size: .78rem; color: var(--text-faint); margin-top: 6px; }

/* دکمه‌ها */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 800; font-size: .95rem;
  padding: 13px 26px; border: 0; border-radius: var(--radius-pill);
  background: var(--primary); color: #fff; transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(14,165,233,.28);
}
.btn:hover { background: var(--primary-600); color: #fff; box-shadow: 0 8px 22px rgba(14,165,233,.36); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--primary-700); border: 1.5px solid var(--border); box-shadow: none; }
.btn--ghost:hover { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); }
.btn--block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* پیام‌های فرم */
.notice { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 22px; font-weight: 600; font-size: .92rem;
  display: flex; align-items: center; gap: 10px; }
.notice--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.notice--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ==========================================================================
   12. صفحه آرشیو / عنوان صفحه
   ========================================================================== */
.page-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 32px; margin-bottom: 26px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset-block-start: -40px; inset-inline-start: -40px;
  width: 180px; height: 180px; border-radius: 50%; background: var(--primary-50); }
.page-hero > * { position: relative; }
.page-hero h1 { margin: 0 0 8px; font-size: 1.8rem; }
.page-hero .desc { color: var(--text-soft); margin: 0; max-width: 70ch; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; color: var(--text-faint); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--primary-600); }
.breadcrumb .sep { color: var(--text-faint); }

/* صفحه‌بندی */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 34px; flex-wrap: wrap; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.pagination .screen-reader-text { display: none; }
.pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  font-weight: 700; color: var(--text); font-size: .92rem;
}
.pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary-600); }
.pagination .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .dots { border: 0; background: none; }

/* ==========================================================================
   13. فوتر
   ========================================================================== */
.site-footer { background: #0f1b2d; color: #cbd5e1; margin-top: 30px; }
.footer-top { max-width: var(--container); margin-inline: auto; padding: 48px 20px 30px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; } }
/* موبایل: بخش «درباره» تمام‌عرض بالا، و سه ستونِ دسترسی سریع/دسته‌بندی‌ها/تماس کنار هم */
@media (max-width: 600px) {
  .footer-top { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .footer-about { grid-column: 1 / -1; }
  .footer-col h4 { font-size: .9rem; margin-bottom: 12px; }
  .footer-col ul a, .footer-contact .row, .footer-contact p { font-size: .8rem; }
  .footer-contact .row { gap: 6px; align-items: flex-start; }
}
.footer-col h4 { color: #fff; font-size: 1.02rem; margin-bottom: 16px; }
.footer-about .logo-name { color: #fff; }
.footer-about .logo-name b { color: var(--primary); }
.footer-about .logo-tld { color: #94a3b8; }
.footer-about p { color: #94a3b8; font-size: .9rem; line-height: 1.95; margin: 14px 0 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { color: #94a3b8; font-size: .9rem; }
.footer-col ul a:hover { color: #fff; }
.footer-contact .row { display: flex; align-items: center; gap: 10px; color: #94a3b8; font-size: .9rem; margin-bottom: 12px; }
.footer-contact svg { width: 18px; height: 18px; flex: none; color: var(--primary); }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a, .footer-social-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255,255,255,.06); color: #cbd5e1; }
.footer-social a:hover { background: var(--primary); color: #fff; }
.footer-social svg { width: 18px; height: 18px; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom-inner { max-width: var(--container); margin-inline: auto; padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  font-size: .85rem; color: #94a3b8; }
.footer-credit { color: #94a3b8; font-weight: 600; }
.footer-credit a { color: inherit; }
.footer-credit a:hover { color: #fff; }
.footer-credit b { color: var(--primary); font-weight: 800; }

/* ==========================================================================
   14. منوی کشویی موبایل (off-canvas)
   ========================================================================== */
.menu-overlay { position: fixed; inset: 0; background: rgba(8,12,22,.5); z-index: 70;
  opacity: 0; visibility: hidden; transition: opacity .25s; }
body.menu-open .menu-overlay { opacity: 1; visibility: visible; }

.drawer-head { display: none; }
.drawer-head h3 { margin: 0; font-size: 1rem; }

@media (max-width: 1023px) {
  .sidebar {
    position: fixed; top: 0; bottom: auto; right: 0; z-index: 80;
    height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
    width: min(86vw, 340px); background: var(--bg);
    transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
    box-shadow: var(--shadow-lg); padding: 18px 16px calc(40px + env(safe-area-inset-bottom));
  }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar .sidebar-logo { display: none; } /* لوگو در تاپ‌بار است */
  .drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
}

/* ==========================================================================
   15. متفرقه
   ========================================================================== */
.back-to-top { position: fixed; inset-block-end: 22px; inset-inline-start: 22px; z-index: 50;
  width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; border: 0;
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s; }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top svg { width: 22px; height: 22px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-soft); }
.empty-state svg { width: 64px; height: 64px; color: var(--text-faint); margin-bottom: 16px; }
.empty-state h2 { margin-bottom: 8px; }

.skip-link { position: absolute; inset-block-start: -60px; inset-inline-start: 16px; z-index: 200;
  background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 0 0 12px 12px; transition: top .2s; }
.skip-link:focus { inset-block-start: 0; color: #fff; }

/* استایل ادمین‌بار وردپرس */
@media (min-width: 1024px) {
  .admin-bar .sidebar {
    top: 56px;
  }
}
@media (max-width: 1023px) { .admin-bar .topbar { top: 46px; } }
