/* World Green Arabic UI: brand/contact parity with the approved English design.
   v23.3 — load LAST (after bilingual-v23 and rtl-repair-v23_2).
   Changes affect Arabic pages ONLY; no logos, page text, project/carousel logic,
   menu structure, animations, or translations are replaced. */

/* The outer shell is physical layout, not prose. Keep logo LEFT and navigation
   RIGHT on BOTH language versions. Dropdown content itself remains RTL. */
html[dir="rtl"] body .wgn11-header .wgn11-shell {
    direction: ltr;
}
html[dir="rtl"] body .wgn11-header .wgn11-brand {
    direction: ltr;
    flex-direction: row;
    text-align: left;
}
html[dir="rtl"] body .wgn11-header .wgn11-brand__emblem {
    order: 0;
    flex-shrink: 0;
}
html[dir="rtl"] body .wgn11-header .wgn11-brand__emblem img {
    transform: none;
    object-fit: contain;
}
html[dir="rtl"] body .wgn11-header .wgn11-brand__nameplate {
    order: 1;
    direction: ltr;
    text-align: left;
    align-items: flex-start;
}
html[dir="rtl"] body .wgn11-header .wgn11-brand__nameplate strong {
    direction: ltr;
    unicode-bidi: isolate;
}
/* Arabic tagline remains Arabic; its writing direction is retained. */
html[dir="rtl"] body .wgn11-header .wgn11-brand__nameplate small {
    direction: rtl;
    unicode-bidi: isolate;
    text-align: left;
}

/* The contact strip must have the same visual order and icon placement in both
   locales: language selector on the left, email and phone to the right. */
html[dir="rtl"] body .wgn11-header .wgn21-nav-stack {
    direction: ltr;
}
html[dir="rtl"] body .wgn11-header .wgn21-utility {
    direction: ltr;
    flex-direction: row-reverse;
    justify-content: flex-start;
}
html[dir="rtl"] body .wgn11-header .wgn21-utility a:not(.wg23-language) {
    direction: ltr;
    unicode-bidi: isolate;
    flex-direction: row-reverse;
    align-items: center;
    white-space: nowrap;
}
html[dir="rtl"] body .wgn11-header .wgn21-utility a:not(.wg23-language) svg {
    flex: 0 0 auto;
    order: 0;
    transform: none;
}
html[dir="rtl"] body .wgn11-header .wgn21-utility a:not(.wg23-language) bdi,
html[dir="rtl"] body .wgn11-header .wgn21-utility a:not(.wg23-language) span {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Only navigation words follow Arabic reading order. Do not flip brand tiles,
   phone/mail icons, or the visual position of the company logo. */
html[dir="rtl"] body .wgn11-header .wgn11-desktop,
html[dir="rtl"] body .wgn11-header .wgn11-popover__body,
html[dir="rtl"] body .wgn11-header .wgn11-drawer {
    direction: rtl;
}

/* On small screens the English and Arabic header have identical structure:
   brand on left, menu-toggle on right. Drawer text remains RTL. */
html[dir="rtl"] body .wgn11-header .wgn11-mobile-toggle {
    margin-inline-start: auto;
}
html[dir="rtl"] body .wgn11-header .wgn21-drawer-contact a {
    direction: ltr;
    unicode-bidi: isolate;
    flex-direction: row;
    align-items: center;
}
html[dir="rtl"] body .wgn11-header .wgn21-drawer-contact a svg {
    flex: 0 0 auto;
    transform: none;
}

/* Footer: English and Arabic use exactly the same column layout and the same
   logo-to-wordmark order. Individual translated lists/addresses read RTL. */
html[dir="rtl"] body .wgf15-footer .wgf15-footer__columns {
    direction: ltr;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__intro {
    direction: ltr;
    text-align: left;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__brand {
    direction: ltr;
    flex-direction: row;
    text-align: left;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__mark {
    order: 0;
    flex-shrink: 0;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__mark img {
    transform: none;
    object-fit: contain;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__wordmark {
    order: 1;
    direction: ltr;
    text-align: left;
    align-items: flex-start;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__wordmark strong {
    direction: ltr;
    unicode-bidi: isolate;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__wordmark small {
    direction: rtl;
    unicode-bidi: isolate;
    text-align: left;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__group {
    direction: rtl;
    text-align: right;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__group address {
    direction: rtl;
    text-align: right;
}
/* Telephone and email are technical data, never right-to-left strings. */
html[dir="rtl"] body .wgf15-footer .wgf15-footer__contact-link {
    direction: ltr;
    unicode-bidi: isolate;
    flex-direction: row;
    justify-content: flex-start;
    white-space: normal;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__contact-link svg {
    flex: 0 0 auto;
    transform: none;
}
html[dir="rtl"] body .wgf15-footer .wgf15-footer__contact-link bdi {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Do not touch .wg-logo-train, project scrolling, or footer copyright;
   those are already handled by RTL repair v23.2. */

/* BEGIN WG23_4_SYSTEM_COHERENCE
   World Green Arabic/English visual parity audit (2026-11-05).
   Appended to the EXISTING worldgreen-ar-brand-parity-v23_3.css.
   Only visual/physical identities remain LTR: the Arabic prose stays RTL.
*/

/* HOME / WHO WE ARE: the floating white brand card contains an English
   proper name and English tagline. Neither its wordmark nor the emblem
   should reverse with the surrounding Arabic copy. */
html[dir="rtl"] .wg-about-editorial__brand-card {
    direction: ltr !important;
    flex-direction: row !important;
    justify-content: flex-start;
    text-align: left !important;
    gap: clamp(10px, 1.2vw, 14px);
}
html[dir="rtl"] .wg-about-editorial__brand-card > .wg-about-editorial__brand-icon {
    order: 0;
    flex: 0 0 auto;
    transform: none !important;
}
html[dir="rtl"] .wg-about-editorial__brand-card > div:last-child {
    order: 1;
    min-width: 0;
    flex: 1 1 auto;
    direction: ltr !important;
    text-align: left !important;
}
html[dir="rtl"] .wg-about-editorial__brand-card strong,
html[dir="rtl"] .wg-about-editorial__brand-card span,
html[dir="rtl"] .wg-about-editorial__brand-card img {
    direction: ltr;
    unicode-bidi: isolate;
}
html[dir="rtl"] .wg-about-editorial__brand-card strong,
html[dir="rtl"] .wg-about-editorial__brand-card > div:last-child span {
    display: block;
    text-align: left !important;
    overflow-wrap: normal;
    word-break: normal;
}
html[dir="rtl"] .wg-about-editorial__brand-card > div:last-child span {
    line-height: 1.35;
}

/* English company identity inside Arabic-written sections must stay readable.
   Keep headings in position but isolate the Latin wordmark characters. */
html[dir="rtl"] .wg-about-editorial__lead,
html[dir="rtl"] .wgca-hero__lead {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: right;
}
html[dir="rtl"] .wg-about-editorial__photo-caption > strong {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: right;
}
html[dir="rtl"] .wgca-story__image-caption {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left !important;
}
html[dir="rtl"] .wgca-hero__ghost {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Branded loading sequence is a company logo, not a localized content grid.
   The Arabic homepage receives the SAME mark → divider → name order. */
html[dir="rtl"] .wg-site-loader__identity {
    direction: ltr !important; /* respect the original mobile column layout */
}
html[dir="rtl"] .wg-site-loader__wordmark,
html[dir="rtl"] .wg-site-loader__name,
html[dir="rtl"] .wg-site-loader__subline {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left !important;
}

/* Universal Latin technical strings and brand labels in Arabic layouts.
   Phone and email header/footer icon physical order is already fixed in v23.3;
   these selectors do NOT change it. */
html[dir="rtl"] .wg-site-loader__mark,
html[dir="rtl"] .wg-about-editorial__brand-icon img,
html[dir="rtl"] .wgca-story__image-caption strong,
html[dir="rtl"] .wg-about-editorial__brand-card img {
    transform: none;
}

/* Preserve the horizontal client marquee and Projects LTR movement introduced
   in v23.2; don't re-flip either using global direction rules. */
html[dir="rtl"] #clients .wg-logo-train,
html[dir="rtl"] #clients .wg-logo-train__track,
html[dir="rtl"] #projects .wg-projects__viewport,
html[dir="rtl"] #projects .wg-projects__track {
    direction: ltr !important;
}

/* Projects title proper names are the original English database values.
   Do not mirror or translate these words even when adjacent statuses are RTL. */
html[dir="rtl"] #projects .wg-project-card__details h3,
html[dir="rtl"] .wgpp-card__content h3,
html[dir="rtl"] .wgpp-hero--detail h1 {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left !important;
}

/* Arabic navigation and content remain RTL, with no blanket direction change. */
html[dir="rtl"] .wg-about-editorial__copy,
html[dir="rtl"] .wgca-story__text,
html[dir="rtl"] .wgvm-card__content {
    direction: rtl;
    text-align: right;
}

@media (max-width: 550px) {
    html[dir="rtl"] .wg-about-editorial__brand-card {
        gap: 10px;
        min-width: 0;
        width: auto;
    }
    html[dir="rtl"] .wg-about-editorial__brand-card > div:last-child {
        overflow: hidden;
    }
    html[dir="rtl"] .wg-about-editorial__brand-card strong {
        font-size: clamp(16px, 4.7vw, 19px);
    }
    html[dir="rtl"] .wg-about-editorial__brand-card > div:last-child span {
        font-size: clamp(9px, 2.65vw, 11px);
    }
}

/* END WG23_4_SYSTEM_COHERENCE */

/* BEGIN WG23_5_CONTACT_CLIENT_PARITY */
/* World Green v23.5 — shared contact and client identity parity.
   Add ONCE at the end of worldgreen-ar-brand-parity-v23_3.css.
   Applies to BOTH English and Arabic pages; branding and technical values LTR.
   Does not change translated interface text, layouts or carousel motion. */

/* Shared desktop contact utility: Language | email icon + text | phone icon + text.
   Flex order is defensive; the installer also updates HTML reading order. */
html body .wgn11-header .wgn21-utility {
    direction: ltr !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
}
html body .wgn11-header .wgn21-utility > a.wg23-language {
    order: 0 !important;
    margin-right: auto !important;
    margin-left: 0 !important;
}
html body .wgn11-header .wgn21-utility > a[href^="mailto:"] { order: 1 !important; }
html body .wgn11-header .wgn21-utility > a[href^="tel:"] { order: 2 !important; }
html body .wgn11-header .wgn21-utility > a:not(.wg23-language) {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    direction: ltr !important;
    unicode-bidi: isolate;
    gap: 8px;
    white-space: nowrap;
}
html body .wgn11-header .wgn21-utility > a:not(.wg23-language) > svg {
    display: block;
    order: 0 !important;
    flex: 0 0 16px !important;
    width: 16px;
    height: 16px;
    transform: none !important;
}
html body .wgn11-header .wgn21-utility > a:not(.wg23-language) > bdi,
html body .wgn11-header .wgn21-utility > a:not(.wg23-language) > span {
    order: 1 !important;
    direction: ltr !important;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

/* Mobile drawer also keeps icon BEFORE the phone/email values. */
html body .wgn11-header .wgn21-drawer-contact > a {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left !important;
    gap: 10px;
}
html body .wgn11-header .wgn21-drawer-contact > a svg {
    order: 0 !important;
    flex: 0 0 17px !important;
    transform: none !important;
}
html body .wgn11-header .wgn21-drawer-contact > a bdi {
    order: 1 !important;
    direction: ltr !important;
    unicode-bidi: isolate;
}

/* Shared footer phone/email: icon then technical value. */
html body .wgf15-footer .wgf15-footer__contact-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left !important;
    gap: 8px;
}
html body .wgf15-footer .wgf15-footer__contact-link svg {
    order: 0 !important;
    flex: 0 0 16px !important;
    transform: none !important;
}
html body .wgf15-footer .wgf15-footer__contact-link bdi {
    order: 1 !important;
    direction: ltr !important;
    unicode-bidi: isolate;
    overflow-wrap: anywhere;
}

/* Original client names are proper names, always English, centered under logo. */
html body #clients .wg-logo-train__name {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: center !important;
    overflow-wrap: anywhere;
    white-space: normal;
}
/* END WG23_5_CONTACT_CLIENT_PARITY */
