/* ==========================================================================
   consult-public.css — صفحه‌های عمومی مشاوره (فهرست، پرسش و پاسخ، پروفایل پاسخ‌دهنده)
   روی قالب عمومی سایت (home_directory) بار می‌شود که ui-core.css ندارد؛
   پس توکن‌ها همین‌جا و محدود به .cxpub تعریف شده‌اند تا روی بقیهٔ سایت اثر نگذارند.
   ========================================================================== */
.cxpub {
  --petrol: #0E3536; --petrol-700: #0B2A2B; --petrol-050: #E7EFEE;
  --mint: #4FB6A0; --mint-600: #3C9A86; --mint-050: #EAF6F3;
  --amber: #F2A65A; --amber-050: #FDF1E4;
  --violet: #8B7FD4; --violet-050: #F0EEFA;
  --ink: #12312F; --muted: #5F7674; --line: #E4ECEA; --bg: #F4F8F7; --card: #fff;
  --radius: 16px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(14,53,54,.04), 0 8px 24px -14px rgba(14,53,54,.18);
  font-family: 'Vazir', system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.95; font-size: 16px;
  padding: 24px 0 56px; min-height: 60vh;
}
.cxpub *, .cxpub *::before, .cxpub *::after { box-sizing: border-box; }
.cxpub a { color: var(--petrol); text-decoration-color: var(--mint); text-underline-offset: 3px; }
.cxpub a:hover { color: var(--mint-600); }
.cxpub a:focus-visible, .cxpub button:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 6px; }
.cxpub h1, .cxpub h2 { color: var(--petrol); font-weight: 800; line-height: 1.5; }
.cxpub-wrap { width: min(980px, 100% - 32px); margin-inline: auto; }

/* ---------- مسیر و سربرگ ---------- */
.cxpub-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.cxpub-crumbs a { color: var(--muted); text-decoration: none; }
.cxpub-crumbs a:hover { color: var(--petrol); }
.cxpub-crumbs [aria-current] { color: var(--ink); }
.cxpub-kicker { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--mint-600); margin: 0 0 6px; }
.cxpub-hero { background: var(--petrol); color: #fff; border-radius: var(--radius); padding: 28px 24px; margin-bottom: 18px;
  background-image: radial-gradient(120% 140% at 0% 0%, rgba(79,182,160,.35) 0, transparent 55%); }
.cxpub-hero h1 { color: #fff; font-size: clamp(22px, 4vw, 30px); margin: 0 0 8px; }
.cxpub-hero p { margin: 0; color: #D7E6E3; max-width: 68ch; }
.cxpub-hero .cxpub-kicker { color: #9FE0D1; }

.cxpub-head { margin-bottom: 14px; }
.cxpub-head h1 { font-size: clamp(21px, 3.6vw, 28px); margin: 0 0 8px; text-wrap: balance; }
.cxpub-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 14px; color: var(--muted); }
.cxpub-meta span + span::before { content: '·'; margin-inline-end: 14px; color: var(--line); }

/* ---------- پیام‌ها ---------- */
.cxpub-msg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.cxpub-a { border-inline-start: 4px solid var(--mint); }
.cxpub-a.is-delegate { border-inline-start-color: var(--violet); }
.cxpub-msg-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.cxpub-msg-head h2 { font-size: 16px; margin: 0; }
.cxpub-msg-head p { margin: 0; font-size: 14px; color: var(--muted); }
.cxpub-msg-head small { color: var(--muted); }
.cxpub-avatar { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-050); color: var(--mint-600); font-size: 20px; }
.cxpub-avatar-q { background: var(--petrol-050); color: var(--petrol); }
.is-delegate .cxpub-avatar { background: var(--violet-050); color: #5E52A8; }
.cxpub-role { display: flex; gap: 8px; align-items: flex-start; background: var(--violet-050); color: #4A3F92; border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.cxpub-body { font-size: 16px; overflow-wrap: anywhere; }
.cxpub-body p { margin: 0 0 .8em; }
.cxpub-body ul, .cxpub-body ol { padding-inline-start: 1.4em; margin: 0 0 .8em; }
.cxpub-body ol { list-style-type: persian; }
.cxpub-body strong { color: var(--petrol); }

.cxpub-gallery { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cxpub-gallery li { margin: 0; }
.cxpub-gallery a { display: block; border-radius: var(--radius-sm); overflow: hidden; background: #0b1414; aspect-ratio: 4 / 3; }
.cxpub-gallery img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .2s ease; }
.cxpub-gallery a:hover img { transform: scale(1.02); }
.cxpub-gallery span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
@media (min-width: 720px) { .cxpub-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- کادر گیت‌شده ---------- */
.cxpub-gate { text-align: center; border: 1px dashed var(--mint); background: linear-gradient(180deg, var(--mint-050), #fff); border-radius: var(--radius);
  padding: 22px 18px; margin: 18px 0 12px; }
.cxpub-gate > i { font-size: 26px; color: var(--mint-600); }
.cxpub-gate h2 { font-size: 18px; margin: 6px 0; }
.cxpub-gate p { margin: 0 0 14px; color: var(--muted); }
.cxpub-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cxpub-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px; border-radius: 12px;
  background: var(--petrol); color: #fff !important; font-weight: 800; text-decoration: none; transition: background .15s ease; }
.cxpub-btn:hover { background: var(--petrol-700); }
.cxpub-btn-ghost { background: #fff; color: var(--petrol) !important; border: 1px solid var(--line); }
.cxpub-btn-ghost:hover { background: var(--petrol-050); }
.cxpub-note { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* ---------- کارت‌ها ---------- */
.cxpub-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cxpub-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cxpub-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cxpub-card a { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s ease, transform .15s ease; }
.cxpub-card a:hover { border-color: var(--mint); transform: translateY(-2px); color: var(--ink); }
.cxpub-card-media { position: relative; aspect-ratio: 16 / 10; background: var(--petrol-050); display: grid; place-items: center; color: var(--petrol); font-size: 28px; }
.cxpub-card-media img { width: 100%; height: 100%; object-fit: cover; }
.cxpub-card-count { position: absolute; inset-inline-start: 8px; bottom: 8px; background: rgba(14,53,54,.82); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 8px; }
.cxpub-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px; flex: 1; }
.cxpub-card-title { font-weight: 800; color: var(--petrol); line-height: 1.6; }
.cxpub-card-sum { font-size: 14px; color: var(--muted); line-height: 1.8; }
.cxpub-card-meta { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

/* ---------- مربیان و پروفایل ---------- */
.cxpub-experts { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: thin; }
.cxpub-experts a { flex: 0 0 auto; display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px 6px 6px; text-decoration: none; color: var(--ink); min-height: 48px; }
.cxpub-experts a:hover { border-color: var(--mint); }
.cxpub-experts img, .cxpub-experts i { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--mint-050); color: var(--mint-600); }
.cxpub-experts span { display: flex; flex-direction: column; line-height: 1.4; font-weight: 700; font-size: 14px; }
.cxpub-experts small { font-weight: 400; color: var(--muted); font-size: 12px; }

.cxpub-profile { display: flex; gap: 18px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.cxpub-profile h1 { font-size: clamp(20px, 3.4vw, 26px); margin: 0 0 4px; }
.cxpub-profile-avatar { flex: 0 0 88px; height: 88px; border-radius: 50%; overflow: hidden; background: var(--mint-050); color: var(--mint-600);
  display: grid; place-items: center; font-size: 36px; }
.cxpub-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cxpub-profile-title { color: var(--muted); margin: 0 0 6px; }
.cxpub-profile-bio { margin: 0 0 8px; white-space: pre-line; }
.cxpub-profile-stats { margin: 0; font-size: 14px; color: var(--muted); }
.cxpub-profile-stats b { color: var(--petrol); }
@media (max-width: 560px) { .cxpub-profile { flex-direction: column; align-items: center; text-align: center; } }

.cxpub-section-title, .cxpub-related h2 { font-size: 18px; margin: 22px 0 12px; }
.cxpub-empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.cxpub-empty i { font-size: 28px; color: var(--mint-600); }
.cxpub-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; font-size: 14px; color: var(--muted); }
.cxpub-pager a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; text-decoration: none; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .cxpub-card a, .cxpub-gallery img, .cxpub-btn { transition: none; }
  .cxpub-card a:hover { transform: none; }
}
