/* ===================================
   VirtueNetz — RTL / Arabic Overrides
   Loaded only when Arabic mode is on (Gulf sub-sites, /sa/ar/).

   ⚠ RTL PRINCIPLE — DO NOT add `flex-direction: row-reverse`.
   <html dir="rtl"> ALREADY reverses every flex row automatically. Adding
   row-reverse on top double-reverses it back to LTR (icons/items land on the
   wrong side). For mirroring, rely on dir=rtl alone; here we only fix
   text-align, direction, logical margins/paddings and the arrow flip.
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800&display=swap');

/* ── Base ── */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body,
html[dir="rtl"] p,
html[dir="rtl"] span,
html[dir="rtl"] li,
html[dir="rtl"] a,
html[dir="rtl"] label,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] button,
html[dir="rtl"] .btn,
html[dir="rtl"] .section__label,
html[dir="rtl"] .section__subtitle,
html[dir="rtl"] .section__title,
html[dir="rtl"] .vn-hero__title,
html[dir="rtl"] .vn-hero__subtitle,
html[dir="rtl"] .vn-hero__badge,
html[dir="rtl"] h1, html[dir="rtl"] h2,
html[dir="rtl"] h3, html[dir="rtl"] h4,
html[dir="rtl"] h5, html[dir="rtl"] h6 {
    font-family: 'Tajawal', sans-serif;
    letter-spacing: 0;
}

/* ── Bidi: let each text block take direction from its OWN content (like
   dir="auto"). While content is still English it reads LTR so trailing
   punctuation / numbers (".", "?", "+14") sit correctly; once a block is
   translated to Arabic it reads RTL. The block stays right-aligned either way.
   This fixes the "?that actually works" / ".timeline" type artifacts site-wide. */
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"] p,
html[dir="rtl"] li,
html[dir="rtl"] blockquote,
html[dir="rtl"] figcaption,
html[dir="rtl"] .section__subtitle,
html[dir="rtl"] .vn-hero__subtitle {
    unicode-bidi: plaintext;
}

/* ── Line-height: Arabic script carries diacritics above and glyph tails below
   the baseline, so it needs MORE vertical room than Latin — otherwise the lines
   look cramped/overlapping. Boost it for RTL only (English is untouched).
   !important so component inline styles don't shrink it back on the Arabic site. */
html[dir="rtl"] body,
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] a,
html[dir="rtl"] blockquote,
html[dir="rtl"] figcaption,
html[dir="rtl"] td, html[dir="rtl"] th,
html[dir="rtl"] .section__subtitle,
html[dir="rtl"] .vn-hero__subtitle,
html[dir="rtl"] [class*="__desc"],
html[dir="rtl"] [class*="__text"] {
    line-height: 1.8 !important;
}
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"] .section__title,
html[dir="rtl"] .vn-hero__title,
html[dir="rtl"] [class*="__title"],
html[dir="rtl"] [class*="__heading"] {
    line-height: 1.5 !important;
}

/* ── Language Toggle Button ── */
.vn-lang-toggle {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 50px;
    border: 1.5px solid var(--orange);
    background: transparent;
    color: var(--orange);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.vn-lang-toggle:hover {
    background: var(--orange);
    color: #fff;
}
html[dir="rtl"] .vn-lang-toggle {
    font-family: 'Tajawal', sans-serif;
}

/* ── Header (dir=rtl mirrors logo→right, actions→left automatically) ── */
html[dir="rtl"] .hamburger {
    margin-left: 0;
    margin-right: auto;
}

/* ── Hero ── */
html[dir="rtl"] .vn-hero__inner {
    direction: rtl;
}
html[dir="rtl"] .vn-hero__content {
    text-align: right;
}
html[dir="rtl"] .vn-hero__actions {
    justify-content: flex-start; /* start = right in RTL */
}

/* ── Sections ── */
html[dir="rtl"] .section__header:not(.section__header--center) {
    text-align: right;
}
html[dir="rtl"] .section__header--center {
    text-align: center;
}

/* ── About ── */
html[dir="rtl"] .vn-about__grid {
    direction: rtl;
}
html[dir="rtl"] .vn-about__content {
    text-align: right;
}
html[dir="rtl"] .vn-about__feature {
    text-align: right;
}

/* ── Portfolio ── */
html[dir="rtl"] .work__card {
    text-align: right;
}
/* Home portfolio header: dir=rtl already reverses the flex row (heading right,
   button left). Just right-align the text — no row-reverse (that double-reverses). */
html[dir="rtl"] .vn-work__head > div {
    text-align: right;
}
html[dir="rtl"] .vn-work__card {
    text-align: right;
}

/* ── Testimonials slider ──
   The slider moves via transform: translateX(-X%), which assumes an LTR track.
   Under dir=rtl the flex track anchors to the right edge and the math breaks
   (only one card shows, big empty gap). Keep the slider MECHANISM in LTR
   (track + nav arrows behave normally) and flip only the card CONTENT to RTL. */
html[dir="rtl"] .vn-testi__viewport,
html[dir="rtl"] .vn-testi__track,
html[dir="rtl"] .vn-testi__controls {
    direction: ltr;
}
html[dir="rtl"] .vn-testi__card {
    direction: rtl;
    text-align: right;
}

/* ── Service Detail ── */
html[dir="rtl"] .svc-detail__grid {
    direction: rtl;
}
html[dir="rtl"] .svc-detail__title,
html[dir="rtl"] .svc-detail__desc {
    text-align: right;
}

/* ── Choose / ROI ── */
html[dir="rtl"] .sdp-choose__grid {
    direction: rtl;
}
html[dir="rtl"] .sdp-choose__content {
    text-align: right;
}
html[dir="rtl"] .sdp-choose__list {
    padding-right: 0;
    text-align: right;
}

/* ── Features / Why Cards ── */
html[dir="rtl"] .sdp-features__card,
html[dir="rtl"] .sdp-why__card,
html[dir="rtl"] .vn-about__feature {
    text-align: right;
}
html[dir="rtl"] .sdp-features__card-icon,
html[dir="rtl"] .sdp-why__icon {
    margin-right: 0;
}
html[dir="rtl"] .sdp-features__num {
    right: auto;
    left: 24px;
}
/* Web-dev Features: force right-align on desktop (children override the card rule) */
@media (min-width: 769px) {
    html[dir="rtl"] #wd-features .sdp-features__card,
    html[dir="rtl"] #wd-features .sdp-features__card h3,
    html[dir="rtl"] #wd-features .sdp-features__card p,
    html[dir="rtl"] #wd-features .sdp-features__card > div {
        text-align: right;
    }
}

/* ── CTA Section ── */
html[dir="rtl"] .cta__inner {
    direction: rtl;
    text-align: right;
}

/* CTA form variant (.cta--form): its inline <style> hard-codes text-align:left
   on the copy. Override to right for RTL (needs the dir+2-class specificity to
   beat the inline rule). */
html[dir="rtl"] .cta--form .cta__title,
html[dir="rtl"] .cta--form .cta__subtitle,
html[dir="rtl"] .cta--form .section__label--light {
    text-align: right;
    margin: 0;
}
/* Contact details (phone/email/address) read LTR in any language — keep them
   LTR but hugging the right edge so they line up under the right-aligned copy. */
html[dir="rtl"] .cta__contact-list {
    direction: ltr;
    justify-content: flex-end;
}

/* ── Vision / Mission / Story Cards (About page) ── */
html[dir="rtl"] .vm__card {
    text-align: right;
}
html[dir="rtl"] .vm__card-text {
    text-align: right;
}
html[dir="rtl"] .vm__icon {
    margin-left: auto;   /* push the 64px icon block to the RIGHT (aligned with the RTL text) */
    margin-right: 0;
}

/* ── Contact Info Section ── */
html[dir="rtl"] .contact__info-title,
html[dir="rtl"] .contact__info-desc {
    text-align: right;
}
html[dir="rtl"] .contact__card-label,
html[dir="rtl"] .contact__card-value {
    text-align: right;
}
html[dir="rtl"] .contact__socials {
    text-align: right;
}
html[dir="rtl"] .contact__socials-row {
    justify-content: flex-end;
}

/* ── Forms ── */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
    direction: rtl;
}
html[dir="rtl"] .contact__field label {
    text-align: right;
}
/* CF7 submit button — centered text in RTL */
html[dir="rtl"] .cta__form--cf7 input[type="submit"] {
    text-align: center;
}
html[dir="rtl"] .cta__contact-row {
    text-align: right;
    /* The list is forced LTR (above) so emails/phones read correctly, which puts
       the icon on the left. Reverse each row so the icon sits on the RIGHT,
       aligned with the right-hugging Arabic copy — while the text stays LTR. */
    flex-direction: row-reverse;
}
/* intl-tel-input — flag and number on the RIGHT (RTL). The +966 still prefills
   (enqueue.php unchanged); only the flag position and text alignment are flipped
   to the right so the field matches the other RTL fields. */
html[dir="rtl"] .iti {
    direction: rtl;
}
html[dir="rtl"] .iti__flag-container {
    right: 0 !important;
    left: auto !important;
}
html[dir="rtl"] .iti__selected-flag {
    direction: rtl !important;       /* arrow to the LEFT of the flag */
}
html[dir="rtl"] .iti__arrow {
    margin: 0 6px 0 0 !important;    /* gap between the arrow and the flag */
}
html[dir="rtl"] .iti input,
html[dir="rtl"] .iti__tel-input,
html[dir="rtl"] input[type="tel"] {
    direction: ltr !important;       /* keep number groups in correct order */
    text-align: right !important;    /* number on the right, like the other fields */
    padding-right: 52px !important;  /* room for the flag + arrow on the right */
    padding-left: 12px !important;
}

/* ── Footer ── */
html[dir="rtl"] .footer__top {
    direction: rtl;
}
html[dir="rtl"] .footer__brand {
    text-align: right;
}
html[dir="rtl"] .footer__socials {
    justify-content: flex-start;
}
html[dir="rtl"] .footer__links {
    direction: rtl;
}
html[dir="rtl"] .footer__col {
    text-align: right;
}
html[dir="rtl"] .footer__col ul {
    text-align: right;
}

/* ── Buttons (flip the directional arrow to point the RTL way) ── */
html[dir="rtl"] .btn svg {
    transform: scaleX(-1);
}

/* ── Dropdown / Mega Menu ──
   NOTE: the mini dropdown centers under its parent with left:50% + translateX(-50%),
   which is direction-agnostic — it stays centered in RTL too. Do NOT override its
   position with right:50%, because the .open state hard-codes translateX(-50%)
   (higher specificity) and the two combine to fling it far left. */
html[dir="rtl"] .dropdown__inner {
    direction: rtl;
}
html[dir="rtl"] .dropdown__item {
    direction: rtl;
}
html[dir="rtl"] .dropdown__title {
    text-align: right;
}
html[dir="rtl"] .mega__col {
    text-align: right;
}
/* ── Services Mega Menu (RTL) ── */
html[dir="rtl"] .mega__heading,
html[dir="rtl"] .mega__item-title,
html[dir="rtl"] .mega__item-desc,
html[dir="rtl"] .mega__solution-title,
html[dir="rtl"] .mega__solution-desc,
html[dir="rtl"] .mega__cta {
    text-align: right;
}
/* Icon sits to the right of the text; text block reads right-aligned */
html[dir="rtl"] .mega__item,
html[dir="rtl"] .mega__solution-card {
    flex-direction: row-reverse;
    text-align: right;
}
html[dir="rtl"] .mega__list-item {
    flex-direction: row-reverse;
    text-align: right;
}
/* The launch arrow on solution cards flips to point the other way */
html[dir="rtl"] .mega__solution-arrow {
    transform: scaleX(-1);
}

/* ── Mobile Menu (slides in from the left in RTL) ── */
html[dir="rtl"] .mobile-nav {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}
html[dir="rtl"] .mobile-nav.open {
    transform: translateX(0);
}
html[dir="rtl"] .mobile-nav__link {
    text-align: right;
}

/* ── FAQ ── */
html[dir="rtl"] .faq__question {
    text-align: right;
}
html[dir="rtl"] .faq__body {
    text-align: right;
}

/* ── Why Choose ── */
html[dir="rtl"] .vn-why__card {
    text-align: right;
}

/* ── Steps ── */
html[dir="rtl"] .wd-steps__grid {
    direction: rtl;
}
html[dir="rtl"] .wd-steps__item {
    text-align: center;
}

/* ── Stat cards ── */
html[dir="rtl"] .vn-hero__stat {
    text-align: right;
}

/* ── Process steps ── */
html[dir="rtl"] .sdp-process__step {
    text-align: right;
}

/* ── Industry cards ── */
html[dir="rtl"] .sdp-industries__card {
    text-align: right;
}

/* ── Services grid cards ── */
html[dir="rtl"] .services__card {
    direction: rtl;
    text-align: right;
}
html[dir="rtl"] .services__card h3,
html[dir="rtl"] .services__card p,
html[dir="rtl"] .services__card-desc,
html[dir="rtl"] .services__card > div {
    text-align: right;
}
html[dir="rtl"] .services__card-icon {
    margin-right: 0;
    margin-left: auto; /* icon hugs the right edge in RTL */
}
html[dir="rtl"] .services__card-tags {
    justify-content: flex-end;
}
html[dir="rtl"] .services__card-number {
    right: auto;
    left: 24px; /* decorative number mirrors to the opposite (left) corner */
}
html[dir="rtl"] .services__card-link svg {
    transform: scaleX(-1); /* arrow points left in RTL */
}
html[dir="rtl"] .services__card-link:hover svg {
    transform: scaleX(-1) translateX(4px); /* slide further left on hover */
}
/* mobile: services header follows the RTL side, not forced-left */
@media (max-width:640px) {
    html[dir="rtl"] .services .section__header--center {
        text-align: right;
    }
}

/* ── Stats marquee ──
   Infinite-scroll strip whose seamless loop (translateX 0 → -50% across two
   duplicated copies) and the "550+" number+plus unit both assume LTR. Under
   dir=rtl the order reverses, splitting "550+" into "+ 550" and breaking the
   loop. Numbers read LTR in Arabic anyway, so keep the whole strip LTR. */
html[dir="rtl"] .stats-marquee__track,
html[dir="rtl"] .tech-marquee__track {
    direction: ltr;
}
/* …but mirror each item internally: number+plus hug the RIGHT, Arabic label
   sits on the LEFT (natural RTL reading). The __val wrapper stays LTR so the
   number and plus stay glued as "550+" and never split into "+550". */
html[dir="rtl"] .stats-marquee__item {
    direction: rtl;
}
html[dir="rtl"] .stats-marquee__val {
    direction: ltr;
}

/* ═══════════════════════════════════════════════════════════════
   WEB DEVELOPMENT SERVICES TEMPLATE — RTL
   ═══════════════════════════════════════════════════════════════ */

/* ── Page Hero (service template hero with 2-col grid) ── */
html[dir="rtl"] .wd-hero__grid {
    direction: rtl;
}
html[dir="rtl"] .wd-hero__text {
    text-align: right;
}
html[dir="rtl"] .wd-hero__badge {
    text-align: right;
}
html[dir="rtl"] .page-hero__title,
html[dir="rtl"] .page-hero__subtitle {
    text-align: right;
}
html[dir="rtl"] .wd-hero__text .page-hero__subtitle {
    text-align: right;
    margin-left: auto;
    margin-right: 0;
}
/* Breadcrumb: direction reverses order + flip chevron arrows */
html[dir="rtl"] .breadcrumb {
    direction: rtl;
}
html[dir="rtl"] .breadcrumb svg {
    transform: scaleX(-1);
}

/* ── Technology Stack ── */
html[dir="rtl"] .wd-techstack__item {
    text-align: right;
}
html[dir="rtl"] .wd-techstack__name,
html[dir="rtl"] .wd-techstack__item-desc {
    text-align: center;
}

/* ── Expertise / Industries grid ── */
html[dir="rtl"] .wd-expertise__item {
    text-align: right;
}
html[dir="rtl"] .wd-expertise__name,
html[dir="rtl"] .wd-expertise__text {
    text-align: right;
}
html[dir="rtl"] .wd-expertise__icon {
    margin: 0 0 20px;
}

/* ── Portfolio cards (wd-portfolio, not work__card) ── */
html[dir="rtl"] .wd-portfolio__header {
    text-align: center;
}
html[dir="rtl"] .wd-portfolio__title,
html[dir="rtl"] .wd-portfolio__desc {
    text-align: right;
}
html[dir="rtl"] .wd-portfolio__meta {
    direction: rtl;
}
html[dir="rtl"] .wd-portfolio__arrow svg {
    transform: scaleX(-1);
}

/* ── MVP Section ── */
html[dir="rtl"] .vnt-mvp__inner {
    direction: rtl;
}
html[dir="rtl"] .vnt-mvp__title,
html[dir="rtl"] .vnt-mvp__desc {
    text-align: right;
}
html[dir="rtl"] .vnt-mvp__bullets {
    text-align: right;
}
html[dir="rtl"] .vnt-mvp__bullets li {
    direction: rtl;
}

/* ── Image Content Block ── */
html[dir="rtl"] .vnt-ib__inner {
    direction: rtl;
}
html[dir="rtl"] .vnt-ib__title,
html[dir="rtl"] .vnt-ib__desc {
    text-align: right;
}

/* ── Cards Section ── */
html[dir="rtl"] .vnt-cards__card {
    text-align: right;
}
/* Icon to the right on RTL (drop the auto-centering so it sits at inline-start) */
html[dir="rtl"] .vnt-cards__icon {
    margin: 0 0 20px;
}
html[dir="rtl"] .vnt-cards__card-desc ul,
html[dir="rtl"] .vnt-cards__card-desc ol {
    padding-left: 0;
    padding-right: 20px;
    text-align: right;
}

/* ── Why Enterprises ── */
html[dir="rtl"] .vnt-whyent__card {
    text-align: right;
}
html[dir="rtl"] .vnt-whyent__card-desc ul {
    padding-left: 0;
    padding-right: 18px;
    text-align: right;
}

/* ── Performance section ── */
html[dir="rtl"] .vnt-perf__inner {
    direction: rtl;
}
html[dir="rtl"] .vnt-perf__title,
html[dir="rtl"] .vnt-perf__desc {
    text-align: right;
}
html[dir="rtl"] .vnt-perf__right {
    border-right: none;
    border-left: 3px solid #ff6b00;
    padding-right: 0;
    padding-left: 32px;
}
html[dir="rtl"] .vnt-perf__item-title,
html[dir="rtl"] .vnt-perf__item-desc {
    text-align: right;
}
html[dir="rtl"] .vnt-perf__item-desc ul,
html[dir="rtl"] .vnt-perf__item-desc ol {
    margin: 6px 18px 8px 0;
}

/* ── Banner CTA ── */
html[dir="rtl"] .vnt-banner__title {
    text-align: right;
}
