/*
 * H-Line Solutions: Arabic typography
 * Loaded only on Arabic (Polylang) pages.
 *
 * Swaps the typeface to Cairo and nothing else: font sizes, line heights,
 * weights, colors and spacing all come from the English design, so Arabic
 * pages keep the same proportions.
 *
 * Letter-spacing is reset to 0 because any letter-spacing breaks the joins
 * between connected Arabic letters.
 *
 * Not affected (they keep the English design font):
 *  - icon fonts (Divi ETmodules, Font Awesome)
 *  - the site header (identical to the English header)
 *  - anything with the CSS class "hl-keep-font" (Divi > Advanced > CSS ID & Classes),
 *    e.g. the H-Line wordmark under the logo
 *  - anything marked lang="en"
 */
html[lang|="ar"] body,
html[lang|="ar"] body *:not(.et-l--header *):not(.hl-keep-font):not(.hl-keep-font *):not([lang|="en"]):not([lang|="en"] *):not(.et-pb-icon):not(.et_pb_font_icon):not(.et-pb-icon-circle):not([class*="fa-"]):not([class^="et-icon"]):not([class*=" et-icon"]):not(i) {
  font-family: 'Cairo', sans-serif !important;
  letter-spacing: 0 !important;
}

/* Keep-font elements fall back to the site's English body font (Divi > Theme Options),
 * instead of inheriting Cairo from the Arabic page body. Module-specific fonts
 * set in Divi still win, because they target the inner elements directly. */
html[lang|="ar"] .hl-keep-font,
html[lang|="ar"] [lang|="en"] {
  font-family: var(--et_global_body_font, 'Open Sans'), Helvetica, Arial, Lucida, sans-serif;
}

/* Form placeholders (Name, Email Address, Message) */
html[lang|="ar"] ::placeholder {
  font-family: 'Cairo', sans-serif !important;
  letter-spacing: 0 !important;
}

/* Header: same layout as the English site (EN | AR left, WhatsApp + Get a quote right). */
html[lang|="ar"] .et-l--header .et_pb_section,
html[lang|="ar"] .et-l--header .et_pb_row,
html[lang|="ar"] .et-l--header .et_pb_column,
html[lang|="ar"] .et-l--header .et_pb_group {
  direction: ltr;
}

/* Divi swaps buttons to its Arabic fallback font (Lateef); keep the header button in Open Sans. */
html[lang|="ar"] .et-l--header .et_pb_button {
  font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
}

/* Header buttons (WhatsApp + Get a quote) hover exactly like the English site.
 * Divi's right-to-left rules flip the hover padding and push the arrow to the
 * wrong side; these restore the English values (0.3em 2em 0.3em 0.7em, arrow at
 * the right). Added 2026-11-24. */
html[lang|="ar"] .et-l--header .et_pb_button:hover,
html[lang|="ar"] .et-l--header .et_pb_module .et_pb_button:hover {
  padding: 0.3em 2em 0.3em 0.7em !important;
}
html[lang|="ar"] .et-l--header .et_pb_button::after {
  left: auto !important;
  right: -0.3em !important;
  margin-left: 0.3em !important;
  margin-right: 0 !important;
}
html[lang|="ar"] .et-l--header .et_pb_button:hover::after {
  left: auto !important;
  right: 0.7em !important;
}

/* Toggles/accordions: Divi reserves 50px on the right for the open/close icon.
 * In Arabic the icon sits on the left, so move that space to the left and let
 * titles start 21px from the right edge, mirroring the English layout. */
html[lang|="ar"] .et_pb_toggle .et_pb_toggle_title {
  padding-right: 0 !important;
  padding-left: 50px !important;
}

/* Latin wordmarks keep their own direction so punctuation such as "H-Line" never flips. */
html[lang|="ar"] .hl-keep-font {
  direction: ltr;
}
