/* ============================================================
   PERSIAN RTL LAYER
   Load after main.css — only for Persian (dir="rtl") pages.
   ============================================================ */

html[dir="rtl"] {
  direction: rtl;
  scroll-behavior: smooth;
}

html[dir="rtl"] body {
  text-align: right;
  letter-spacing: 0;
}

/* Keep anchor targets clear of the sticky header */
html[dir="rtl"] section[id],
html[dir="rtl"] div[id] {
  scroll-margin-top: 96px;
}

/* ---------- Persian typography ---------- */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] .hero-title,
html[dir="rtl"] .section-title,
html[dir="rtl"] .page-hero-title,
html[dir="rtl"] .cta-title,
html[dir="rtl"] .process-step-title,
html[dir="rtl"] .service-title,
html[dir="rtl"] .blog-card-title,
html[dir="rtl"] .pricing-plan-name,
html[dir="rtl"] .counter-number {
  letter-spacing: 0;
}

html[dir="rtl"] .hero-title {
  font-size: clamp(1.9rem, 3.3vw, 3.4rem);
  line-height: 1.55;
}

html[dir="rtl"] .section-title,
html[dir="rtl"] .cta-title {
  line-height: 1.5;
}

html[dir="rtl"] p,
html[dir="rtl"] li {
  line-height: 1.9;
}

html[dir="rtl"] .section-subtitle,
html[dir="rtl"] .hero-description,
html[dir="rtl"] .service-text,
html[dir="rtl"] .blog-card-excerpt {
  line-height: 1.9;
}

html[dir="rtl"] .section-tag,
html[dir="rtl"] .hero-tag,
html[dir="rtl"] .blog-post-category,
html[dir="rtl"] .pricing-popular-badge,
html[dir="rtl"] .pricing-save-badge,
html[dir="rtl"] .bento-badge,
html[dir="rtl"] .bento-tag,
html[dir="rtl"] .clients-label {
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Bootstrap 5 LTR utilities ---------- */
html[dir="rtl"] .text-start {
  text-align: right !important;
}

html[dir="rtl"] .text-end {
  text-align: left !important;
}

html[dir="rtl"] .ms-1 { margin-right: .25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-2 { margin-right: .5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }

html[dir="rtl"] .me-1 { margin-left: .25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-2 { margin-left: .5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-auto { margin-left: auto !important; margin-right: 0 !important; }

html[dir="rtl"] .ps-1 { padding-right: .25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-2 { padding-right: .5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pe-1 { padding-left: .25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-2 { padding-left: .5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-3 { padding-left: 1rem !important; padding-right: 0 !important; }

@media (min-width: 992px) {
  html[dir="rtl"] .text-lg-end { text-align: right !important; }
  html[dir="rtl"] .text-lg-start { text-align: left !important; }
  html[dir="rtl"] .ps-lg-5 { padding-right: 3rem !important; padding-left: 0 !important; }
  html[dir="rtl"] .pe-lg-5 { padding-left: 3rem !important; padding-right: 0 !important; }
}

/* ---------- Direction-aware icons ---------- */
html[dir="rtl"] .fa-arrow-right::before { content: "\f060"; }
html[dir="rtl"] .fa-arrow-left::before { content: "\f061"; }
html[dir="rtl"] .fa-chevron-right::before { content: "\f053"; }
html[dir="rtl"] .fa-chevron-left::before { content: "\f054"; }

html[dir="rtl"] .fa-reply::before {
  display: inline-block;
  transform: scaleX(-1);
}

/* Hover movement follows reading direction */
html[dir="rtl"] .service-link:hover i,
html[dir="rtl"] .btn-primary-custom:hover i,
html[dir="rtl"] .btn-outline-custom:hover i,
html[dir="rtl"] .btn-white-custom:hover i,
html[dir="rtl"] .btn-ghost-white:hover i,
html[dir="rtl"] .blog-read-link:hover i,
html[dir="rtl"] .sw-contact-cta-btn:hover i {
  transform: translateX(-4px);
}

/* ---------- Header / navigation ---------- */
html[dir="rtl"] .main-nav .nav-link::before {
  transform-origin: right;
}

html[dir="rtl"] .nav-chevron {
  margin-right: .15rem;
}

@media (min-width: 1200px) {
  html[dir="rtl"] .nav-dropdown {
    right: 0;
    left: auto;
  }
}

/* ---------- Hero bento ---------- */
html[dir="rtl"] .bento-photo-lg img,
html[dir="rtl"] .bento-photo-sm img {
  object-position: center;
}

/* ---------- About ---------- */
html[dir="rtl"] .about-exp-badge {
  right: -2rem;
  left: auto;
  text-align: center;
}

html[dir="rtl"] .about-image-accent {
  left: -2rem;
  right: auto;
}

html[dir="rtl"] .checkpoint-text {
  text-align: right;
}

/* ---------- Process ---------- */
@media (min-width: 992px) {
  html[dir="rtl"] .process-step-connector {
    right: 50%;
    left: auto;
  }
}

/* ---------- Pricing ---------- */
html[dir="rtl"] .pricing-feature {
  text-align: right;
}

/* ---------- Blog / education cards ---------- */
html[dir="rtl"] .blog-card-meta,
html[dir="rtl"] .blog-featured-footer {
  direction: rtl;
}

/* ---------- Contact / forms ---------- */
html[dir="rtl"] .contact-form-select {
  background-position: left 1rem center;
  padding-left: 2.5rem;
  padding-right: 1.1rem;
}

html[dir="rtl"] .contact-form-label,
html[dir="rtl"] .contact-form-input {
  text-align: right;
}

html[dir="rtl"] .contact-form-input::placeholder {
  text-align: right;
}

html[dir="rtl"] .contact-info-card,
html[dir="rtl"] .contact-hours-card {
  text-align: right;
}

html[dir="rtl"] .contact-info-icon {
  margin: 0 0 1rem auto;
}

html[dir="rtl"] .contact-hours-list li {
  direction: rtl;
}

/* ---------- Footer ---------- */
html[dir="rtl"] .footer-newsletter-input {
  text-align: right;
}

html[dir="rtl"] .footer-link,
html[dir="rtl"] .footer-bottom-link {
  text-align: right;
}

/* ---------- Info panel ---------- */
html[dir="rtl"] .info-panel {
  text-align: right;
}

html[dir="rtl"] .info-panel-contact-item {
  text-align: right;
}

/* ---------- Back to top ---------- */
html[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

@media (max-width: 1199px) {
  html[dir="rtl"] .back-to-top {
    left: 1rem;
  }
}

/* ---------- Sidebar (blog pages, when RTL is enabled) ---------- */
html[dir="rtl"] .sw-search-input,
html[dir="rtl"] .sidebar-search-input {
  border-right: 1.5px solid var(--tmv-color-border);
  border-left: none;
  border-radius: 0 var(--tmv-radius-md) var(--tmv-radius-md) 0;
}

html[dir="rtl"] .sw-search-btn,
html[dir="rtl"] .sidebar-search-btn {
  border-radius: var(--tmv-radius-md) 0 0 var(--tmv-radius-md);
}

html[dir="rtl"] .sw-cat:hover {
  padding-left: 0;
  padding-right: .25rem;
}

/* Persian digits for counters/prices keep tabular alignment */
html[dir="rtl"] .counter-number,
html[dir="rtl"] .pricing-amount,
html[dir="rtl"] .hero-stat-number {
  font-feature-settings: "tnum";
}

/* ---------- Maix additions ---------- */
html[dir="rtl"] .hero-stat-item {
  text-align: right;
}

html[dir="rtl"] .section-tag[dir="ltr"] {
  letter-spacing: 0.08em;
}

html[dir="rtl"] .hero-kicker-en {
  direction: ltr;
  unicode-bidi: isolate;
  letter-spacing: 0.08em;
}

html[dir="rtl"] .bento-badge {
  right: 0.9rem;
  left: auto;
}

html[dir="rtl"] .bento-tag {
  right: 0.9rem;
  left: auto;
}

html[dir="rtl"] .clients-label {
  margin-right: 0;
  margin-left: 2rem;
}

@keyframes marqueeScrollRtl {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(50%);
  }
}

html[dir="rtl"] .marquee-track {
  animation-name: marqueeScrollRtl;
}

html[dir="rtl"] .service-card::before {
  transform-origin: right;
}

html[dir="rtl"] .footer-link::before {
  content: '←';
}

html[dir="rtl"] .footer-link:hover::before {
  margin-right: 0;
  margin-left: 0.35rem;
}

html[dir="rtl"] .video-card-meta {
  direction: rtl;
}

html[dir="rtl"] .sprint-card .pricing-period {
  font-size: 1rem;
}
