/* ==========================================================================
   rtl.css — Dedicated RTL & Persian Typography Adjustments
   Modern Creative / Developer Portfolio Typography:
   Peyda (#1 Priority) -> Estedad (#2) -> Vazirmatn (Fallback)
   ========================================================================== */

[dir="rtl"] {
  direction: rtl;
  text-align: right;
  --font-heading: var(--font-fa-heading);
  --font-body:    var(--font-fa-body);
}

[dir="rtl"] body {
  font-family: var(--font-fa-body);
  direction: rtl;
  text-align: right;
}

/* ── Headings & Titles (Consistent 600 SemiBold weight, generous line-height) ── */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] .ed-section-title,
[dir="rtl"] .pf-detail-title,
[dir="rtl"] .pm-title {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: normal !important;
  text-align: right;
}

/* ── Hero Section Typography (Balanced with portrait image) ── */
[dir="rtl"] .hero-headline {
  font-family: var(--font-fa-heading) !important;
  font-size: clamp(2.15rem, 3.5vw, 3.1rem) !important;
  font-weight: 600 !important;
  line-height: 1.32 !important;
  letter-spacing: normal !important;
  color: var(--color-text-main);
  margin-bottom: 20px !important;
}

[dir="rtl"] .hero-subtitle {
  font-family: var(--font-fa-body) !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.95 !important;
  color: var(--color-text-muted);
  max-width: 460px !important;
  margin-bottom: 1.5rem;
}

[dir="rtl"] .hero-eyebrow {
  font-family: var(--font-fa-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: normal !important;
  color: var(--color-text-muted);
}

[dir="rtl"] .hero-availability {
  font-family: var(--font-fa-body);
  font-size: 0.88rem;
  font-weight: 500;
}

[dir="rtl"] .hero-btn-primary,
[dir="rtl"] .hero-btn-secondary {
  font-family: var(--font-fa-body);
  font-weight: 500;
  font-size: 0.92rem;
}

/* ── Navigation Typography ── */
[dir="rtl"] .nav-brand-name {
  font-family: var(--font-en-heading); /* Brand name 'Pouria' keeps geometric punch */
}

[dir="rtl"] .nav-brand-role {
  font-family: var(--font-fa-body);
  font-size: 0.78rem;
  font-weight: 500;
}

[dir="rtl"] .nav-link-item,
[dir="rtl"] .mobile-nav-link {
  font-family: var(--font-fa-body);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: normal !important;
}

[dir="rtl"] .nav-cta-magnetic {
  font-family: var(--font-fa-body);
  font-weight: 500;
  font-size: 0.88rem;
}

/* ── Editorial Sections (Home / About / Services) ── */
[dir="rtl"] .ed-eyebrow {
  font-family: var(--font-fa-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: normal !important;
}

[dir="rtl"] .ed-section-title {
  font-family: var(--font-fa-heading) !important;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem) !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
}

[dir="rtl"] .ed-about-statement {
  font-family: var(--font-fa-heading) !important;
  font-size: clamp(1.3rem, 2.2vw, 1.85rem) !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
  letter-spacing: normal !important;
}

[dir="rtl"] .ed-otb-title {
  font-family: var(--font-fa-heading);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
}

[dir="rtl"] .ed-otb-intro {
  font-family: var(--font-fa-body);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.95;
}

[dir="rtl"] .ed-principle strong {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.4;
}

[dir="rtl"] .ed-principle p {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.93rem;
  line-height: 1.85;
}

[dir="rtl"] .ed-service-item h3 {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.4;
}

[dir="rtl"] .ed-service-item p {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.93rem;
  line-height: 1.85;
}

[dir="rtl"] .ed-cta-headline {
  font-family: var(--font-fa-heading) !important;
  font-size: clamp(1.85rem, 3vw, 2.45rem) !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
}

[dir="rtl"] .ed-cta-sub {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.85;
}

/* ── Project Cards & Portfolio ── */
[dir="rtl"] .ed-project-title {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.45;
}

[dir="rtl"] .ed-project-desc {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.9;
  letter-spacing: normal;
}

[dir="rtl"] .ed-tech-tag,
[dir="rtl"] .ed-pill {
  font-family: var(--font-fa-body);
  font-weight: 500;
  letter-spacing: normal;
}

/* ── Case Study Detail Page ── */
[dir="rtl"] .pf-detail-title {
  font-family: var(--font-fa-heading) !important;
  font-size: clamp(1.75rem, 2.8vw, 2.35rem) !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
}

[dir="rtl"] .pf-detail-lead {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 2;
  letter-spacing: normal;
}

[dir="rtl"] .pf-h2 {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.4;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

[dir="rtl"] .pf-prose {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: normal;
  text-align: right;
  white-space: pre-line;
}

[dir="rtl"] .pf-detail-grid {
  direction: rtl;
}

[dir="rtl"] .pf-sidebar {
  text-align: right;
}

[dir="rtl"] .pf-sidebar-row {
  text-align: right;
}

[dir="rtl"] .pf-sidebar-label {
  font-family: var(--font-fa-body);
  font-weight: 500;
}

[dir="rtl"] .pf-challenge-card {
  text-align: right;
}

[dir="rtl"] .pf-challenge-title {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.4;
}

[dir="rtl"] .pf-challenge-label {
  font-family: var(--font-fa-body);
  font-weight: 600;
}

[dir="rtl"] .pf-challenge-col p {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.85;
}

[dir="rtl"] .pf-challenge-impact {
  font-family: var(--font-fa-body);
  font-size: 0.95rem;
  line-height: 1.85;
  text-align: right;
}

/* ── Linear Architecture / Workflow Pipeline (RTL) ───────── */
[dir="rtl"] .pf-flow-item {
  text-align: right;
}

[dir="rtl"] .pf-flow-title {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
}

[dir="rtl"] .pf-flow-desc {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.65;
}

[dir="rtl"] .pf-flow-connector svg {
  transform: scaleX(-1);
}

@media (max-width: 860px) {
  [dir="rtl"] .pf-flow-connector svg {
    transform: rotate(90deg) !important;
  }
}

/* ── Directional & Arrow Adjustments ── */
[dir="rtl"] .pf-back-link svg,
[dir="rtl"] .pf-detail-btn--subtle svg {
  transform: scaleX(-1);
}

[dir="rtl"] .pf-back-link {
  flex-direction: row;
  font-family: var(--font-fa-body);
  font-weight: 500;
}

/* ── Modal Adjustments ── */
[dir="rtl"] .pm-inner {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .pm-body {
  text-align: right;
}

[dir="rtl"] .pm-desc {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.98rem;
  line-height: 1.95;
  text-align: right;
  letter-spacing: normal;
}

[dir="rtl"] .pm-subheading {
  font-family: var(--font-fa-heading);
  text-align: right;
  letter-spacing: normal;
}

[dir="rtl"] .pm-prose {
  font-family: var(--font-fa-body);
  text-align: right;
  line-height: 1.95;
  letter-spacing: normal;
}

[dir="rtl"] .pm-tags {
  justify-content: flex-start;
}

[dir="rtl"] .pm-actions {
  flex-direction: row-reverse;
}

/* ── Filter Pills ── */
[dir="rtl"] .pf-filter-bar {
  flex-direction: row;
  justify-content: flex-start;
}

[dir="rtl"] .pf-filter-pill {
  font-family: var(--font-fa-body);
  font-weight: 500;
}

/* ── About Page ── */
[dir="rtl"] .about-value-title {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 1.05rem;
}

[dir="rtl"] .about-value-desc {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.85;
}

[dir="rtl"] .about-stat-label {
  font-family: var(--font-fa-body);
  font-weight: 500;
  font-size: 0.85rem;
}

[dir="rtl"] .about-timeline-title {
  font-family: var(--font-fa-heading);
  font-weight: 600;
  font-size: 1.05rem;
}

[dir="rtl"] .about-timeline-desc {
  font-family: var(--font-fa-body);
  font-weight: 400;
  font-size: 0.93rem;
  line-height: 1.85;
}

/* ── Contact Form ── */
[dir="rtl"] .contact-label {
  font-family: var(--font-fa-body);
  font-weight: 500;
  font-size: 0.9rem;
}

[dir="rtl"] .contact-input,
[dir="rtl"] .contact-textarea {
  font-family: var(--font-fa-body);
  font-size: 0.95rem;
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .contact-input::placeholder,
[dir="rtl"] .contact-textarea::placeholder {
  font-family: var(--font-fa-body);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

[dir="rtl"] .ed-contact-label {
  font-family: var(--font-fa-body);
  font-weight: 500;
}

[dir="rtl"] .ed-contact-value {
  font-family: var(--font-fa-body);
}

/* ── Mobile Drawer ── */
[dir="rtl"] #mobile-drawer {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--color-border);
  transform: translateX(-100%);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] #mobile-drawer.open {
  transform: translateX(0);
}

/* ── Mobile drawer (RTL) ── */
[dir="rtl"] .mobile-nav-link {
  font-family: var(--font-fa-heading);
  font-size: 1.15rem;
  font-weight: 600;
}
