/* Farsi / RTL support for the rework homepage.
   Loaded on every request but scoped under [dir="rtl"], so it has no effect on the English page.
   This sets real reading direction, right alignment and a Persian font. It does not attempt to
   mirror the whole Webflow grid/flex layout (nav order, left/right-anchored columns, etc.) — that
   would mean rewriting the ported stylesheet's physical left/right declarations into logical
   properties throughout, which is a much larger job than this pass covers. */

@font-face {
  font-family: 'Vazirmatn';
  src: url('/rework/vendor/fonts/vazirmatn/Vazirmatn-variable.woff2') format('woff2-variations'),
       url('/rework/vendor/fonts/vazirmatn/Vazirmatn-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

[dir="rtl"] body {
  direction: rtl;
  font-family: 'Vazirmatn', 'Inter Variable font', Arial, sans-serif;
}

[dir="rtl"] body * {
  font-family: inherit;
}

/* Farsi type-scale calibration.
   Vazirmatn itself is kept — it's a modern, open-source, Inter-matched variable font and one of
   the best-regarded choices for Persian UI text, so the issue isn't the typeface. Two real bugs
   were found instead:
   1. Letter-spacing is lethal to Persian: it's a cursive, joined script, and the site's Latin
      heading classes carry negative/positive letter-spacing (e.g. h1 at -1.44px) meant for Inter.
      Applied to Farsi, that visually breaks letter connections mid-word. It must be reset to normal.
   2. Perso-Arabic glyphs sit larger within their em-box than Latin glyphs at the same font-size, so
      text set at the Latin scale reads oversized in Farsi. Sizes are trimmed ~8-10% across the
      scale and line-heights are opened up slightly, since Persian needs more vertical room for
      diacritics and descenders to stay readable at a smaller size. */
[dir="rtl"] {
  --_typography---h1--size: 4rem;
  --_typography---h1--line-height: 1.35;
  --_typography---h1--letter-spacing: normal;
  --_typography---h2--size: 3.375rem;
  --_typography---h2--line-height: 1.35;
  --_typography---h2--letter-spacing: normal;
  --_typography---h3--size: 2.7rem;
  --_typography---h3--line-height: 1.35;
  --_typography---h3--letter-spacing: normal;
  --_typography---h4--size: 2.25rem;
  --_typography---h4--line-height: 1.35;
  --_typography---h4--letter-spacing: normal;
  --_typography---h5--size: 2rem;
  --_typography---h5--line-height: 1.35;
  --_typography---h5--letter-spacing: normal;
  --_typography---h6--size: 1.5rem;
  --_typography---h6--line-height: 1.35;
  --_typography---h6--letter-spacing: normal;
  --_typography---text-xlarge--size: 1.4rem;
  --_typography---text-xlarge--line-height: 1.7;
  --_typography---text-xlarge--letter-spacing: normal;
  --_typography---text-large--size: 1.1875rem;
  --_typography---text-large--line-height: 1.7;
  --_typography---text-large--letter-spacing: normal;
  --_typography---text-medium--size: 1.0625rem;
  --_typography---text-medium--line-height: 1.7;
  --_typography---text-medium--letter-spacing: normal;
  --_typography---text-small--size: 0.95rem;
  --_typography---text-small--line-height: 1.7;
  --_typography---text-small--letter-spacing: normal;
  --_typography---text-xsmall--size: 0.825rem;
  --_typography---text-xsmall--line-height: 1.5;
  --_typography---text-xsmall--letter-spacing: normal;
}

[dir="rtl"] body,
[dir="rtl"] body * {
  letter-spacing: normal !important;
}

/* Right-align running text; Webflow's left/center alignment utility classes are left as authored,
   since they also carry layout meaning (e.g. centered hero copy) that shouldn't flip here. */
[dir="rtl"] p,
[dir="rtl"] .text-sm,
[dir="rtl"] .text-md,
[dir="rtl"] .text-lg,
[dir="rtl"] .text-xl,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  text-align: right;
}

[dir="rtl"] .cc-align-center,
[dir="rtl"] [data-wf--heading--variant="align-center"],
[dir="rtl"] [data-wf--paragraph--variant="align-center"] {
  text-align: center;
}

/* Numbers in the Persian copy are already Eastern Arabic numerals; keep direction neutral so
   mixed Latin fragments (e.g. an email address) don't get reversed. */
[dir="rtl"] .footer-link,
[dir="rtl"] a[href^="mailto:"],
[dir="rtl"] a[href^="tel:"] {
  unicode-bidi: plaintext;
}

/* Two physical-side (not logical) rules that stay pinned to the same physical edge regardless of
   direction, so RTL's automatic grid/flex mirroring moves their content to the other side while
   the padding/position that was supposed to track it stays put. Flip both for RTL. */

/* Contact form section: .container.cc-right-0 zeroes the physical right padding so the video
   column bleeds to the viewport edge — written for LTR, where that video column sits physically
   on the right. In RTL the video moves to the physical left, but the zeroed padding stays on the
   right, so the text column (now on the right) loses its padding and its heading clips against
   the edge instead. Only applies above the 992px breakpoint — below it the ported stylesheet
   already resets this padding back to normal for both directions. */
@media screen and (min-width: 992px) {
  [dir="rtl"] .container.cc-right-0 {
    padding-right: var(--_sections---container--padding);
    padding-left: 0;
  }
}

/* Footer newsletter button: pinned via inset + margin-right to the physical right edge of the
   email input, i.e. the "end" of the input in LTR. In RTL the end of the input is the physical
   left, so the button needs to pin there instead, or it sits over the start of the RTL text. */
[dir="rtl"] .form-button.cc-footer {
  inset: 0% auto 0% 0%;
  margin-right: 0;
  margin-left: 1.5rem;
}
@media screen and (max-width: 479px) {
  [dir="rtl"] .form-button.cc-footer {
    margin-left: .5rem;
  }
}
