/* ============================================================
 * public/css/services/detail.css
 *
 * استایل‌های صفحه‌ی جزئیات سرویس (public).
 * تمام قوانینی که قبلاً در <style> داخل views/services/detail.ejs
 * نوشته می‌شدند اینجا منتقل شده‌اند. مقادیر داینامیک brand
 * (brand-500, brand-600, brand-glow, brand-gradient) به
 * theme.css endpoint مختص هر سرویس منتقل شده‌اند و اینجا فقط
 * fallback defaults تعریف می‌شوند.
 * ============================================================ */

/* ----- Theme tokens (defaults; override via /services/:slug/theme.css) ----- */
:root {
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-glow: rgba(59, 130, 246, 0.4);
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark {
  --bg-primary: #030712;
  --bg-secondary: #0a0f1c;
  --bg-tertiary: #111827;
  --bg-elevated: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --glass-bg: rgba(17, 24, 39, 0.8);
}
html:not(.dark) {
  --bg-primary: #fff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-elevated: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.9);
}

/* ----- Base reset ----- */
* { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--app-font-family, "IRANSansX");
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── Fix: خنثی‌سازی padding/margin که main-site CSS روی <body> اعمال می‌کند ──
   سایت اصلی برای navbar ثابت خود معمولاً یک padding-top روی body تنظیم می‌کند.
   در صفحه سرویس این فاصله اضافی بین navbar و هیرو ایجاد می‌کند و بصورت
   یک حاشیه/خط در بالای هیرو دیده می‌شود. این override آن را حذف می‌کند. */
body.service-detail {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
}
body.service-detail .hero {
  margin-top: 0 !important;
}
/* هر wrapper که main-site ممکن است inject کند نیز reset می‌شود */
body.service-detail > *:not(#navbar-container):not(header):not(.scroll-progress) {
  margin-top: 0;
}

/* ----- Tailwind-equivalent utility classes (CSP blocks Tailwind CDN) ----- */
.container { max-width: 1280px; margin: 0 auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-12 { gap: 3rem; }
.w-2 { width: .5rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-12 { width: 3rem; }
.w-full { width: 100%; }
.h-2 { height: .5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-12 { height: 3rem; }
.h-full { height: 100%; }
.max-w-lg { max-width: 32rem; }
.max-w-full { max-width: 100%; }
.max-w-none { max-width: none; }
.p-3 { padding: .75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mr-auto { margin-right: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: .75rem; }
.text-sm { font-size: .875rem; }
.text-lg { font-size: 1.125rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-semibold { font-weight: 600; }
.leading-relaxed { line-height: 1.625; }
.rounded-xl { border-radius: .75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; border-style: solid; }
.border-\[var\(--border-subtle\)\] { border-color: var(--border-subtle); }
.border-\[var\(--border-strong\)\] { border-color: var(--border-strong); }
.border-\[var\(--brand-500\)\] { border-color: var(--brand-500); }
.bg-\[var\(--bg-primary\)\] { background: var(--bg-primary); }
.bg-\[var\(--brand-500\)\] { background: var(--brand-500); }
.bg-white { background: #fff; }
.text-\[var\(--text-primary\)\] { color: var(--text-primary); }
.text-\[var\(--text-secondary\)\] { color: var(--text-secondary); }
.text-\[var\(--text-tertiary\)\] { color: var(--text-tertiary); }
.text-\[var\(--brand-500\)\] { color: var(--brand-500); }
.text-white { color: #fff; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: .5; }
.resize-y { resize: vertical; }
.animate-pulse { animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.from-black\/20 { --tw-from: rgba(0, 0, 0, .2); }
.bg-gradient-to-t { background-image: linear-gradient(to top, rgba(0, 0, 0, .2), transparent); }
.transition { transition-property: all; transition-duration: .15s; }
.transition-all { transition-property: all; transition-duration: .3s; }
.hover\:border-\[var\(--brand-500\)\]:hover { border-color: var(--brand-500); }
.hover\:text-\[var\(--brand-500\)\]:hover { color: var(--brand-500); }
.hover\:bg-\[var\(--brand-600\)\]:hover { background: var(--brand-600); }
.focus\:border-\[var\(--brand-500\)\]:focus { border-color: var(--brand-500); }
.focus\:outline-none:focus { outline: none; }
.overflow-x-auto { overflow-x: auto; }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1025px) {
  .lg\:justify-start { justify-content: flex-start; }
  .lg\:mx-0 { margin-left: 0; margin-right: 0; }
}

/* ----- Glass + gradient utilities ----- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
}
.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----- Hero -----
   Policy (Phase 1, corrected):
     ─ Hero SECTION: full viewport (100dvh). Background, grid, orbs all edge-to-edge.
       هیچ offset/navbar-subtract برای section انجام نمی‌شود.
     ─ Navbar: pure overlay (position:absolute, top:1rem) روی hero می‌نشیند.
     ─ Hero CONTENT (badge/title/description/CTA/stats): top gutter امن دارد
       تا با navbar visually تداخل نکند. این gutter فقط به padding درونی
       container اعمال می‌شود، نه به ارتفاع section.
   نتیجه:
     • .hero                       → min-height: 100dvh (full screen)
     • .hero-grid / .hero-orb-*    → position:absolute, full coverage (از .hero ارث می‌برد)
     • .hero > .container          → padding-top = content-safe gutter
     • .hero-grid-layout min-h     → 100dvh − (content gutter top+bottom) — content
                                     در inner area flex می‌کند، نه در section
*/
.service-detail {
  --service-hero-side-pad: clamp(1rem, 3vw, 1.5rem);
  /* content-top: فقط برای content داخل hero — معادل ارتفاع تقریبی navbar
     + breathing room. این مقدار روی ارتفاع section اثر نمی‌گذارد؛ فقط
     جایی که badge/title شروع می‌شود را پایین می‌برد. */
  --service-hero-content-top: clamp(3.75rem, 6vh, 4.85rem);
  --service-hero-content-bottom: clamp(1rem, 2.5vh, 1.75rem);
}

body.service-detail #navbar-container,
body.service-detail > header {
  position: absolute !important;   /* override header.top-4{position:fixed} in public-hardening.css */
  inset-inline: 0;
  top: 1rem;
  z-index: 50;
  width: 100%;
  padding-inline: var(--service-hero-side-pad);
  /* overlay — hero ارتفاع خود را از navbar نمی‌گیرد */
  pointer-events: auto;
  /* حذف هر border-bottom که main-site CSS ممکن است اضافه کرده باشد */
  border-bottom: none !important;
}
/* عناصر داخلی navbar نیز نباید border-bottom داشته باشند */
body.service-detail #navbar-container > *,
body.service-detail > header > * {
  border-bottom: none !important;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  overflow: clip;
  background: var(--bg-primary);
  padding: 0;
  box-sizing: border-box;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--brand-500) 1px, transparent 1px),
    linear-gradient(to bottom, var(--brand-500) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .03;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black, transparent);
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .15;
  animation: orbFloat 10s ease-in-out infinite;
}
.hero-orb-1 { width: 500px; height: 500px; background: var(--brand-500); top: -100px; left: -100px; }
.hero-orb-2 { width: 400px; height: 400px; background: #1d4ed8; bottom: -100px; right: -100px; animation-delay: -5s; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -30px) scale(1.1); }
  66%      { transform: translate(-20px, 20px) scale(0.9); }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--brand-500);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  margin-bottom: 24px;
  animation: badgeIn .6s var(--ease-out-back) .2s both;
}
@keyframes badgeIn {
  0%   { opacity: 0; transform: translateY(-20px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 24px;
}
.hero-title-line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: titleIn .8s var(--ease-out-expo) forwards;
}
.hero-title-line:nth-child(1) { animation-delay: .3s; }
.hero-title-line:nth-child(2) { animation-delay: .4s; color: var(--brand-500); margin-top: 14px; }
.hero-title-line:nth-child(3) {
  animation-delay: .5s;
  color: var(--text-secondary);
  font-size: .7em;
  font-weight: 500;
  margin-top: 22px;
}
@keyframes titleIn { to { opacity: 1; transform: translateY(0); } }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 600;
  border-radius: 16px;
  transition: all .4s var(--ease-out-expo);
  box-shadow: 0 10px 40px -10px var(--brand-500);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 20px 60px -15px var(--brand-500); }

.hero-image-container {
  position: relative;
  width: min(100%, 34rem);
  aspect-ratio: 16 / 9;
  max-height: min(38svh, 18rem);
  overflow: hidden;
}
.hero-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Hero 2-col layout
   padding-top = content-safe gutter (clears navbar visually)
   padding-bottom = small breathing room at bottom
   Section height خود (100dvh) دست‌نخورده می‌ماند.
*/
.hero > .container {
  width: 100%;
  min-height: inherit;
  display: flex;
  align-items: stretch;
  min-height: 0;
  padding-top: var(--service-hero-content-top);
  padding-bottom: var(--service-hero-content-bottom);
}

.hero-grid-layout {
  width: 100%;
  min-height: calc(100vh  - var(--service-hero-content-top) - var(--service-hero-content-bottom));
  min-height: calc(100svh - var(--service-hero-content-top) - var(--service-hero-content-bottom));
  min-height: calc(100dvh - var(--service-hero-content-top) - var(--service-hero-content-bottom));
  height: auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "text-top"
    "media"
    "text-bottom";
  align-items: stretch;
  justify-items: stretch;
  align-content: stretch;
  gap: clamp(.75rem, 2vw, 1.5rem);
}

.hero-col-image,
.hero-col-text {
  width: 100%;
  min-height: 0;
}

.hero-col-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-col-text-primary {
  grid-area: text-top;
  justify-content: flex-end;
}

.hero-col-text-secondary {
  grid-area: text-bottom;
  justify-content: flex-start;
}

.hero-description {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
  line-height: 1.8;
}

.hero-actions {
  margin-bottom: 1.5rem;
}

.hero-stats {
  width: 100%;
}

.hero-col-image {
  grid-area: media;
  display: flex;
  align-items: stretch;
  justify-content: center;
}


/* ----- Main layout ----- */
.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 24px;
}
@media (max-width: 1024px) {
  .main-layout { grid-template-columns: 1fr; gap: 24px; padding: 40px 16px; }
}
.content-nav { position: sticky; top: 100px; height: fit-content; }
@media (max-width: 1024px) { .content-nav { display: none; } }
.content-nav-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  padding: 0 16px;
}
.content-nav-list { display: flex; flex-direction: column; gap: 4px; }
.content-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .3s var(--ease-out-expo);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.content-nav-item::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--brand-500);
  border-radius: 0 3px 3px 0;
  transition: all .3s var(--ease-out-back);
}
.content-nav-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.content-nav-item.active { background: var(--brand-500); color: #fff; }
.content-nav-item.active::before { height: 60%; }
.content-nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 18px;
  transition: all .3s;
}
.content-nav-item:hover .content-nav-icon,
.content-nav-item.active .content-nav-icon { background: rgba(255, 255, 255, .2); transform: scale(1.1); }

.content-main { display: flex; flex-direction: column; gap: 60px; }
.content-section { scroll-margin-top: 120px; }

/* ----- Section cards ----- */
.section-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  overflow: hidden;
  transition: all .4s var(--ease-out-expo);
}
.section-card:hover { border-color: var(--brand-500); box-shadow: 0 20px 60px -20px var(--brand-glow); }
.section-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all .3s;
}
.section-header-card:hover { background: var(--bg-tertiary); }
.section-title-wrap { display: flex; align-items: center; gap: 16px; }
.section-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-500);
  color: #fff;
  font-size: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px -10px var(--brand-500);
}
.section-title-text h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.section-title-text p  { font-size: 13px; color: var(--text-tertiary); }
.section-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-secondary);
  transition: all .3s var(--ease-out-back);
}
.section-card.expanded .section-toggle { transform: rotate(180deg); background: var(--brand-500); color: #fff; }
.section-body { max-height: 0; overflow: hidden; transition: max-height .5s var(--ease-out-expo); }
.section-card.expanded .section-body { max-height: 5000px; }
.section-content {
  padding: 32px;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow: hidden;
}

/* ----- Toggle-all bar ----- */
.sections-control { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.control-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .3s;
  cursor: pointer;
  font-family: inherit;
}
.control-btn:hover { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }

/* ----- Tutorial steps ----- */
.tutorial-steps { display: flex; flex-direction: column; gap: 24px; }
.tutorial-step {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  transition: all .3s var(--ease-out-expo);
}
.tutorial-step:hover {
  border-color: var(--brand-500);
  transform: translateX(-8px);
  box-shadow: 0 10px 30px -10px var(--brand-glow);
}
.step-number-box {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px var(--brand-500);
}
.step-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.step-content p  { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 12px; }

/* Image inside tutorial step (replaces previous inline style="max-width:…") */
.tutorial-step-image {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  margin-top: .5rem;
}

/* ----- FAQ ----- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  transition: all .3s;
}
.faq-item:hover { border-color: var(--border-strong); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all .3s;
}
.faq-question:hover { color: var(--brand-500); }
.faq-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 8px;
  transition: all .3s var(--ease-out-back);
}
.faq-item.active .faq-icon { transform: rotate(45deg); background: var(--brand-500); color: #fff; }
.faq-answer { max-height: 0; overflow: hidden; transition: all .4s var(--ease-out-expo); }
.faq-item.active .faq-answer { max-height: 500px; }
.faq-answer-inner { padding: 0 24px 24px; font-size: 14px; color: var(--text-secondary); line-height: 1.9; }

/* ----- Compare table ----- */
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.compare-table th,
.compare-table td { padding: 16px 20px; text-align: right; border-bottom: 1px solid var(--border-subtle); }
.compare-table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--bg-primary);
}
.compare-table td { font-size: 14px; }
.compare-table tr:hover td { background: var(--bg-primary); }
.compare-check {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-500);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
}
.compare-dash {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border-radius: 50%;
  font-size: 12px;
}

/* ----- Video ----- */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.video-play-btn {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-500);
  color: #fff;
  border-radius: 50%;
  font-size: 24px;
  transition: all .4s var(--ease-out-back);
  box-shadow: 0 20px 60px -10px var(--brand-500);
}
.video-placeholder:hover .video-play-btn { transform: scale(1.1); }

/* Replaces JS-injected inline style on the <iframe>. */
.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ----- Info / Warning boxes ----- */
.info-box {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: var(--brand-gradient);
  color: #fff;
  border-radius: 16px;
  margin-bottom: 24px;
}
.info-box-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .2);
  border-radius: 10px;
  font-size: 20px;
  flex-shrink: 0;
}
.info-box-content h4 { font-weight: 700; margin-bottom: 4px; }
.info-box-content p  { font-size: 14px; opacity: .9; line-height: 1.7; }

.warning-box {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 16px;
  margin-bottom: 24px;
}
.dark .warning-box { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .3); }
.warning-box-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  color: #fff;
  border-radius: 10px;
  font-size: 20px;
  flex-shrink: 0;
}
.warning-box-content h4 { font-weight: 700; color: #92400e; margin-bottom: 4px; }
.dark .warning-box-content h4 { color: #fbbf24; }
.warning-box-content p { font-size: 14px; color: #a16207; line-height: 1.7; }
.dark .warning-box-content p { color: #fcd34d; }

/* ----- Scroll progress ----- */
/* قبلاً transform از طریق JS (element.style) ست می‌شد. حالا از CSS var
   --progress استفاده می‌شود که با style.setProperty ست می‌شود. این هنوز
   JS-assigned است ولی نیاز به style-src-attr 'unsafe-hashes' را ندارد
   چون مقدار فقط یک عدد در متغیر است نه declaration. */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--brand-gradient);
  z-index: 1001;
  transform-origin: right;
  transform: scaleX(var(--progress, 0));
  width: 100%;
}

/* ----- Reveal on scroll ----- */
.reveal { opacity: 0; transform: translateY(30px); transition: all .8s var(--ease-out-expo); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ----- Region card ----- */
.region-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  transition: all .3s;
}
.region-card:hover {
  border-color: var(--brand-500);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px var(--brand-glow);
}
.region-flag {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

/* ----- Comments ----- */
.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .75rem;
}
@media (max-width: 640px) { .comment-form-row { grid-template-columns: 1fr; } }
.comment-hidden { display: none; }
.comment-card { overflow-wrap: break-word; word-break: break-word; overflow: hidden; }
.comment-card p {
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

/* Admin reply box (previously inline: background + border-right). */
.admin-reply {
  margin-top: .75rem;
  padding: .75rem;
  border-radius: 12px;
  font-size: 14px;
  background: rgba(59, 130, 246, .06);
  border-right: 3px solid var(--brand-500);
}
.admin-reply-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-500);
  margin-bottom: 4px;
}
.admin-reply-text { font-size: 14px; line-height: 1.6; }

/* Ajax comment result message (replaces JS-injected inline cssText). */
.comment-result-message {
  padding: .75rem 1rem;
  border-radius: 12px;
  margin-top: .75rem;
  font-size: 14px;
}
.comment-result-success { background: rgba(16, 185, 129, .1); color: #10b981; }
.comment-result-error   { background: rgba(239, 68, 68, .1);  color: #ef4444; }

/* ----- Sidebar CTA (replaces style="display:block;text-align:center;text-decoration:none") ----- */
.sidebar-cta {
  display: block;
  text-align: center;
  text-decoration: none;
}

/* ----- Honeypot (replaces style="display:none;position:absolute;left:-9999px") ----- */
.sr-honeypot {
  display: none !important;
  position: absolute !important;
  left: -9999px !important;
}

/* ----- LTR input (replaces style="text-align:left") ----- */
.input-ltr { text-align: left; }

/* ----- Whitespace helper (replaces style="white-space:pre-line") ----- */
.whitespace-pre-line { white-space: pre-line; }

/* ----- Hero animation entrance classes
        (replace inline style="animation:…") ----- */
.anim-scale-in { animation: scaleIn 1s .5s forwards; }
.anim-fade-in  { animation: fadeIn  .8s forwards; animation-delay: var(--anim-delay, 0s); }
.anim-slide-up { animation: slideUp .8s forwards; animation-delay: var(--anim-delay, 0s); }

.anim-delay-600 { --anim-delay: .6s; }
.anim-delay-700 { --anim-delay: .7s; }
.anim-delay-900 { --anim-delay: .9s; }

@keyframes fadeIn  { to { opacity: 1; } }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { to { opacity: 1; transform: scale(1); } }

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  body.service-detail #navbar-container,
  body.service-detail > header {
    top: .75rem;
  }

  .service-detail {
    /* mobile navbar معمولاً کمی متفاوت است؛ gutter کمی کمتر */
    --service-hero-content-top: clamp(4rem, 10vh, 5rem);
    --service-hero-content-bottom: 1rem;
  }

  .hero-grid { display: none; }
  .hero-title { font-size: clamp(1.75rem, 6vw, 2.5rem); }
  .hero-grid-layout {
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "text-top"
      "media"
      "text-bottom";
    justify-items: stretch;
    align-content: stretch;
    gap: .875rem;
  }
  .hero-col-text-primary {
    justify-content: flex-end;
  }
  .hero-col-text-secondary {
    justify-content: flex-start;
  }
  .hero-actions,
  .hero-stats {
    justify-content: center;
  }
  .hero-image-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    margin-top: 0;
  }
  .content-main { gap: 40px; }
  .content-section { scroll-margin-top: 100px; }
  .section-header-card { padding: 20px 24px; }
  .section-icon { width: 40px; height: 40px; font-size: 20px; }
  .section-title-text h2 { font-size: 16px; }
  .section-content { padding: 24px; }
  .tutorial-step { flex-direction: column; gap: 16px; }
  .step-number-box { width: 48px; height: 48px; font-size: 20px; }
  .compare-table { font-size: 12px; }
  .compare-table th, .compare-table td { padding: 12px; }
}



/* ════════════════════════════════════════════════════════════════
   Hero — Desktop layout (single source of truth, ≥1025px)
   - Hero = 100dvh; navbar is absolute overlay at top:0 (no flow space)
   - No padding/margin reserving an empty band under the navbar
   - Layout: TEXT on the LEFT (col 1), IMAGE on the RIGHT (col 2),
     deterministic via direction:ltr on the grid + direction:rtl on
     each child column for Persian text
   - Image: bare media slot, 16/9, object-fit:contain, no frame/shadow,
     ~30% larger than before so it dominates the hero and the centered
     gap above shrinks naturally
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 1025px) {
  /* Defensive — neutralize legacy hero gutter vars on desktop */
  .service-detail {
    --service-hero-content-top: 0;
    --service-hero-content-bottom: 0;
  }

  /* Navbar = pure overlay; no space reserved in flow */
  body.service-detail #navbar-container,
  body.service-detail > header {
    position: absolute !important;
    top: 0;
    inset-inline: 0;
    padding-top: 12px;
    padding-bottom: 0;
    margin: 0;
    z-index: 50;
    border-bottom: none !important;
  }

  /* Hero = full viewport, flush from top */
  .hero {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
  .hero > .container {
    padding: 0;
    margin-inline: auto;
    display: flex;
    align-items: stretch;
  }

  /* Grid: direction:ltr → col 1 = LEFT, col 2 = RIGHT (deterministic).
     Image column is wider (1.5fr) so the image visually dominates and
     the RTL right-aligned text column is pulled toward the LEFT edge. */
  .hero-grid-layout {
    direction: ltr;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "media text-top"
      "media text-bottom";
    column-gap: clamp(1.5rem, 3vw, 3rem);
    row-gap: clamp(.5rem, 1vh, 1rem);
    align-items: center;
    align-content: center;
    justify-items: stretch;
    padding: 0;
    margin: 0;
  }

  /* Text column (LEFT) — RTL restored for Persian content */
  .hero-col-text {
    direction: rtl;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;        /* RTL flex-col: flex-start = visual RIGHT inside the column */
    justify-content: center;
    text-align: right;
    padding-inline-end: clamp(.5rem, 1.5vw, 1.5rem);
    padding-inline-start: clamp(2rem, 4vw, 4rem);   /* breathing room from LEFT viewport edge */
  }
  .hero-col-text-primary {
    grid-area: text-top;
    justify-content: flex-end;
  }
  .hero-col-text-secondary {
    grid-area: text-bottom;
    justify-content: flex-start;
    margin-top: .5rem;
  }
  .hero-badge,
  .hero-description,
  .hero-actions,
  .hero-stats {
    margin-inline: 0;
  }
  .hero-actions,
  .hero-stats {
    justify-content: flex-start;
  }

  /* Title — natural wrap on long content; never single-line */
  .hero-title {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.1;
  }
  .hero-title-line {
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Image column (RIGHT) */
  .hero-col-image {
    direction: rtl;
    grid-area: media;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-height: 0;
  }

  /* Bare media slot — no frame, no shadow, no border, no radius.
     ~30% larger than the previous frame: width 56rem → 72rem,
     height 38rem → 50rem (and 70vh → 88vh cap). */
  .hero-image-container {
    position: relative;
    width: 100%;
    max-width: min(72rem, 100%);
    aspect-ratio: 16 / 9;
    max-height: min(88vh, 50rem);
    height: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
  }
  .hero-image-container::before,
  .hero-image-container::after {
    display: none;
    content: none;
  }

  /* Image: contain (no crop, no force-fit), centered, no hover transform */
  .hero-image-container img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    transform: none;
  }
  .hero-image-container:hover img {
    transform: none;
  }
}
