/* ==========================================================================
   Persian / RTL layer.

   Loaded only when dir="rtl". Two jobs:
     1. Swap the Latin type stack for IRANSansX.
     2. Mirror the parts of style.css that were written with physical
        properties (left/right, text-align, transforms). site.css already uses
        logical properties, so it mostly needs only the direction token flipped.
   ========================================================================== */

@font-face {
    font-family: 'IRANSansX';
    src: url('../fonts/farsi/iransansx-regular.woff2') format('woff2'),
         url('../fonts/farsi/iransansx-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSansX';
    src: url('../fonts/farsi/iransansx-medium.woff2') format('woff2'),
         url('../fonts/farsi/iransansx-medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSansX';
    src: url('../fonts/farsi/iransansx-demibold.woff2') format('woff2'),
         url('../fonts/farsi/iransansx-demibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSansX';
    src: url('../fonts/farsi/iransansx-bold.woff2') format('woff2'),
         url('../fonts/farsi/iransansx-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------------- tokens ---- */

:root {
    --v2g-start: right;
    --v2g-end: left;
}

html[dir="rtl"] body,
html[dir="rtl"] .v2g-btn,
html[dir="rtl"] .v2g-input,
html[dir="rtl"] .v2g-select,
html[dir="rtl"] .v2g-textarea,
html[dir="rtl"] .newsletter-form input {
    font-family: 'IRANSansX', 'Poppins', Tahoma, sans-serif;
}

/* Persian reads more comfortably with slightly looser leading and no
   negative tracking — the Latin display settings look cramped in Arabic script. */
html[dir="rtl"] {
    line-height: 1.85;
}

html[dir="rtl"] .v2g-title,
html[dir="rtl"] .v2g-hero h1,
html[dir="rtl"] .bx_hero h1 {
    letter-spacing: 0;
    line-height: 1.35;
}

/* Latin brand words and numerals keep their Latin face inside Persian text. */
html[dir="rtl"] .ltr,
html[dir="rtl"] .v2g-table .num,
html[dir="rtl"] code,
html[dir="rtl"] .mono {
    font-family: 'Poppins', sans-serif;
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

/* ------------------------------------------- mirroring the original CSS --- */

html[dir="rtl"] .meta_header { margin-left: 0; margin-right: 42px; }

html[dir="rtl"] .meta_header a.consultation { padding-left: 0; padding-right: 30px; }
html[dir="rtl"] .meta_header a.consultation:before { left: auto; right: 15px; }

html[dir="rtl"] .bg_hero {
    background-position: center center, bottom left;
}

/* Swiper drives its own direction; tell it we are mirrored. */
html[dir="rtl"] .swiper { direction: rtl; }

/* Marquee strips are direction-agnostic — keep them running the original way
   so partner logos are not read backwards. */
html[dir="rtl"] .marquee, html[dir="rtl"] .js-marquee { direction: ltr; }

/* Arrows that point "forward" have to point the other way. */
html[dir="rtl"] .v2g-icon-arrow-right,
html[dir="rtl"] .v2g-icon-arrow-left,
html[dir="rtl"] .v2g-icon-chevron-right { transform: scaleX(-1); }

/* Bootstrap dropdowns anchor to the wrong edge under RTL. */
html[dir="rtl"] .dropdown-menu { text-align: right; }
html[dir="rtl"] .dropdown-menu-end { --bs-position: start; }

/* Bootstrap's float/offset helpers used by the original pages. */
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end { text-align: left !important; }
html[dir="rtl"] .float-start { float: right !important; }
html[dir="rtl"] .float-end { float: left !important; }
html[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir="rtl"] .me-auto { margin-right: 0 !important; margin-left: auto !important; }

/* Offcanvas slides in from the reading edge. */
html[dir="rtl"] .offcanvas-start { border-right: 0; border-left: 1px solid rgba(0, 0, 0, .08); }

/* ------------------------------------------------- component fine-tuning --- */

html[dir="rtl"] .v2g-eyebrow { letter-spacing: 0; text-transform: none; }

html[dir="rtl"] .v2g-select {
    background-position: left 16px center;
}

html[dir="rtl"] .v2g-hero::after { right: auto; left: -80px; }

html[dir="rtl"] .v2g-prose blockquote { border-inline-start: 0; border-inline-end: 3px solid var(--v2g-primary); }

/* Numerals inside tabular columns stay left-to-right so 1,250 does not
   render as 250,1. */
html[dir="rtl"] .v2g-stat__value,
html[dir="rtl"] .v2g-program__fact dd,
html[dir="rtl"] .v2g-kv__val {
    unicode-bidi: plaintext;
}

/* The progress track builds its connectors with physical offsets. */
html[dir="rtl"] .v2g-track__step::before { inset-inline-start: 0; }
html[dir="rtl"] .v2g-track__step::after { inset-inline-end: 0; }
