/* ===========================================================
   SAZEH PEYVAND — PERSIAN (FA) LAYER
   Loaded AFTER style.css / sector.css / contact.css on the
   RTL pages only. Brand marks (SPC / SAZEH PEYVAND) stay Latin.
   Headings → Morabba · body & labels → Vazirmatn.
   =========================================================== */

/* ---- Morabba (titling) ---- */
@font-face{font-family:Morabba;font-style:normal;font-weight:400;font-display:swap;
  src:url('morabba/Morabba-Regular.woff2') format('woff2');}
@font-face{font-family:Morabba;font-style:normal;font-weight:500;font-display:swap;
  src:url('morabba/Morabba-Medium.woff2') format('woff2');}
@font-face{font-family:Morabba;font-style:normal;font-weight:600;font-display:swap;
  src:url('morabba/Morabba-SemiBold.woff2') format('woff2');}
@font-face{font-family:Morabba;font-style:normal;font-weight:700;font-display:swap;
  src:url('morabba/Morabba-Bold.woff2') format('woff2');}
@font-face{font-family:Morabba;font-style:normal;font-weight:800;font-display:swap;
  src:url('morabba/Morabba-ExtraBold.woff2') format('woff2');}
@font-face{font-family:Morabba;font-style:normal;font-weight:850;font-display:swap;
  src:url('morabba/Morabba-Black.woff2') format('woff2');}
@font-face{font-family:Morabba;font-style:normal;font-weight:900;font-display:swap;
  src:url('morabba/Morabba-Heavy.woff2') format('woff2');}

/* ---- IRANSansX (body / labels) — Farsi-numeral webfont ---- */
@font-face{font-family:IRANSansX;font-style:normal;font-weight:300;font-display:swap;
  src:url('iransansx/IRANSansXFaNum-Light.woff2') format('woff2');}
@font-face{font-family:IRANSansX;font-style:normal;font-weight:400;font-display:swap;
  src:url('iransansx/IRANSansXFaNum-Regular.woff2') format('woff2');}
@font-face{font-family:IRANSansX;font-style:normal;font-weight:500;font-display:swap;
  src:url('iransansx/IRANSansXFaNum-Medium.woff2') format('woff2');}
@font-face{font-family:IRANSansX;font-style:normal;font-weight:600;font-display:swap;
  src:url('iransansx/IRANSansXFaNum-DemiBold.woff2') format('woff2');}
@font-face{font-family:IRANSansX;font-style:normal;font-weight:700;font-display:swap;
  src:url('iransansx/IRANSansXFaNum-Bold.woff2') format('woff2');}

/* ---- base typography ---- */
html[dir="rtl"]{
  --fa:"IRANSansX","Segoe UI",system-ui,sans-serif;
  --morabba:"Morabba","IRANSansX",serif;
  /* mono labels must render Persian → IRANSansX first, Space Mono for Latin */
  --mono:"IRANSansX","Space Mono",ui-monospace,monospace;
}
html[dir="rtl"] body{font-family:var(--fa);}

/* Persian is cursive — letter-spacing breaks joining. Neutralise everywhere,
   then restore it only on the Latin brand marks. */
html[dir="rtl"] body, html[dir="rtl"] body *{letter-spacing:normal!important;}
html[dir="rtl"] .brand-text{font-family:var(--sans)!important;letter-spacing:.12em!important;direction:ltr;}
html[dir="rtl"] .foot-mark{font-family:var(--sans)!important;letter-spacing:-.03em!important;direction:ltr;}

/* line-height a touch taller for Persian readability */
html[dir="rtl"] p,html[dir="rtl"] li{line-height:1.85;}

/* ---- headings → Morabba ---- */
html[dir="rtl"] :is(
  h1,h2,h3,h4,h5,h6,
  .hero h1,.jbeat h2,.sec-title,.acts-h,.cta-h,.fcard h3,
  .nv-title,.news2-title,
  .afc-step h3,.afc-intro-lead h3,.afc-stat .n,.aft-yr,.ci-name,.afg-num,.cc-k,
  .bp-copy h1,.r-intro .lead,.proc h2,.works .head h2,.qual h4,.cta h2,.cap-h h2,.cap-h h3,.work h3,
  .ct-hero h1,.ct-form-head h2,.ct-map-head h2,.ct-success h3
){font-family:var(--morabba);font-weight:500;}
/* Morabba runs visually heavier — ease the tightest tracking back to neutral */
html[dir="rtl"] :is(.hero h1,.sec-title,.acts-h,.cta-h,.bp-copy h1,.ct-hero h1){line-height:1.12;}
html[dir="rtl"] .jbeat h2,html[dir="rtl"] .nv-title{line-height:1.3;}

/* Morabba renders visually larger than the Latin type — scale the major
   titles back down ~12% on the Persian pages. */
html[dir="rtl"] .hero h1{font-size:clamp(29px,4.48vw,70px);}
html[dir="rtl"] .jbeat h2{font-size:clamp(22px,2.6vw,38px);}
html[dir="rtl"] .sec-title{font-size:clamp(22px,3.04vw,45px);}
html[dir="rtl"] .acts-head .acts-h{font-size:clamp(22px,3.04vw,45px);}
html[dir="rtl"] .cta-h{font-size:clamp(31px,4.4vw,70px);}
html[dir="rtl"] .news2-title{font-size:clamp(20px,2.48vw,37px);}
html[dir="rtl"] .nv-title{font-size:clamp(22px,2.7vw,40px);}
html[dir="rtl"] .fcard h3{font-size:17px;}
html[dir="rtl"] .afc-step h3{font-size:clamp(22px,3.04vw,46px);}
html[dir="rtl"] .afc-intro-lead h3{font-size:clamp(24px,2.96vw,45px);}

/* Section titles carry a manual <br/>. The Latin ch-based max-width is too
   narrow for Persian (wider glyphs), so it re-wraps and orphans a word.
   Drop the cap and let the <br/> define the line breaks. */
html[dir="rtl"] :is(.sec-title,.acts-head .acts-h,.works .head h2,.proc h2,.cta h2){max-width:none;}

/* numerals / latin brand keep their own fonts */
html[dir="rtl"] .cc-k,html[dir="rtl"] .afg-num,html[dir="rtl"] .nv-num{font-family:var(--morabba);}

/* ===========================================================
   RTL geometry flips (physical left/right positioned elements)
   =========================================================== */

/* progress rail → right edge */
html[dir="rtl"] .rail{left:auto;right:0;}

/* journey beats → bottom-right */
html[dir="rtl"] .jbeat{left:auto;right:var(--pad);}

/* hero stays centred (no flip needed) */
html[dir="rtl"] .hero p{text-wrap:pretty;}

/* CTA drawing note → top-left */
html[dir="rtl"] .cta-dwg{right:auto;left:var(--pad);text-align:left;}

/* feature grid dividers / padding mirror */
html[dir="rtl"] .fcard{padding:38px 0 46px 30px;}
html[dir="rtl"] .fcard:last-child{padding-left:0;}
html[dir="rtl"] .fcard:not(:first-child){padding-right:30px;}

/* news chips text align */
html[dir="rtl"] .nv-chip{text-align:right;}

/* ---- about ---- */
html[dir="rtl"] .about-desc,html[dir="rtl"] .about-desc p{font-family:var(--fa);}
html[dir="rtl"] .ad-title{font-family:var(--morabba);font-weight:500;line-height:1.22;font-size:clamp(26px,2.48vw,40px);}
html[dir="rtl"] .ad-kicker,html[dir="rtl"] .ad-ch-name,html[dir="rtl"] .ad-cue{font-size:13px;}
html[dir="rtl"] .ad-chapter{--from:right;}
html[dir="rtl"] .ad-chapter i{transform:scaleX(-1);}
html[dir="rtl"] .ad-chapter:hover i,html[dir="rtl"] .ad-chapter:focus-visible i{transform:scaleX(-1) translate(2px,2px);}
html[dir="rtl"] .af-chip{padding:8px 12px 8px 14px;font-family:var(--fa);}
@media(max-width:820px){html[dir="rtl"] .ad-title{font-size:clamp(26px,7vw,36px);}}
/* over-video editorial steps → right aligned */
html[dir="rtl"] :is(.afc-step,.afc-step--intro,.afc-step--group,.afc-step--time,.afc-step--cap,.afc-step--cert){text-align:right;}
html[dir="rtl"] .afc-step .afc-no{direction:rtl;display:inline-block;}
/* stat dividers swap side */
html[dir="rtl"] .afc-stat:first-child{padding-left:clamp(20px,2.4vw,36px);padding-right:0;}
html[dir="rtl"] .afc-stat:not(:first-child){border-left:0;border-right:1px solid rgba(231,235,241,.18);}
/* subsidiary meta + cards left-aligned content → right */
html[dir="rtl"] .afc-sub,html[dir="rtl"] .cert-card,html[dir="rtl"] .cap-item{text-align:right;}
/* timeline end-cards anchor inward (mirrored) */
html[dir="rtl"] .aft-item:first-child .aft-card{left:auto;right:0;text-align:right;}
html[dir="rtl"] .aft-item:last-child .aft-card{right:auto;left:0;text-align:left;}
/* gauge index node → right */
html[dir="rtl"] .afg-node{left:50%;right:auto;}
/* capacity list mirrors translate on active */
html[dir="rtl"] .cap-item.is-active{transform:translateX(-6px);}
html[dir="rtl"] .act.is-active .act-cat{transform:translateX(-8px);}

/* certificate lightbox close → left */
html[dir="rtl"] .cert-lb-close{right:auto;left:clamp(16px,3vw,34px);}

/* ===========================================================
   SECTOR pages (blueprint hero + editorial)
   =========================================================== */
html[dir="rtl"] .bp-copy{left:auto;right:clamp(28px,5vw,96px);}
html[dir="rtl"] .bp-copy p{text-align:right;}
html[dir="rtl"] .bp-drawno{right:auto;left:clamp(28px,3.6vw,46px);text-align:left;}  /* copy sits on the right in RTL — keep the drawing note clear of it */
/* the wireframe drawing + its annotation labels live on the side opposite the
   copy. In RTL the copy is on the right, so mirror the drawing to the left so it
   no longer sits under the text. Children of each label are counter-flipped so
   their text stays readable. */
html[dir="rtl"] #bp,html[dir="rtl"] .bp-labels{transform:scaleX(-1);}
html[dir="rtl"] .bp-tag i,html[dir="rtl"] .bp-tag .cal{transform:scaleX(-1);}
/* capability split divider mirror */
html[dir="rtl"] .cap:nth-child(1){border-right:0;border-left:1px solid var(--line);
  padding-left:clamp(28px,3vw,44px);padding-right:0;}
html[dir="rtl"] .cap:nth-child(2){padding-right:clamp(28px,3vw,44px);padding-left:0;}
html[dir="rtl"] .cap{padding:clamp(34px,4vw,54px) 0 clamp(40px,5vw,60px) clamp(28px,3vw,44px);}
html[dir="rtl"] .cap-h .gl{margin-left:0;}
/* process strip cards */
html[dir="rtl"] .step{padding:0 0 0 12px;}
/* works badge → top-right */
html[dir="rtl"] .work .frame .badge{left:auto;right:14px;}
/* quality marker spacing */
html[dir="rtl"] .qual h4 .gl{margin-right:0;margin-left:10px;}
/* sector back arrow points the natural RTL way */
html[dir="rtl"] .topbar.dark .back:hover i{transform:translateX(3px);}
html[dir="rtl"] .back i,html[dir="rtl"] .back-all,html[dir="rtl"] .btn i{display:inline-block;}

/* ===========================================================
   CONTACT page
   =========================================================== */
html[dir="rtl"] .ct-copy{text-align:right;}
/* select dropdown arrow → left */
html[dir="rtl"] .field.sel::after{right:auto;left:6px;}
html[dir="rtl"] .field select{padding-right:2px;padding-left:24px;}
html[dir="rtl"] .field input,html[dir="rtl"] .field textarea,html[dir="rtl"] .field select{text-align:right;}
html[dir="rtl"] .ct-success{text-align:right;}
html[dir="rtl"] .ct-ok-kicker{font-family:IRANSansX,var(--mono);letter-spacing:0;font-size:13px;font-weight:700;}
html[dir="rtl"] .ct-chip{padding:13px 16px 13px 20px;}

/* digits in mono lines read left-to-right even inside RTL flow */
html[dir="rtl"] .coord,html[dir="rtl"] .ct-sub,html[dir="rtl"] .hr span:last-child,
html[dir="rtl"] .cta-sec-num,html[dir="rtl"] .bp-drawno,html[dir="rtl"] .bp-meta .m b{unicode-bidi:plaintext;}

/* language switch: show FA as active */
html[dir="rtl"] .lang .on{color:var(--ink);}
html[dir="rtl"] .lang{white-space:nowrap;direction:ltr;}
