/* GAON - left-to-right corrections. Loaded only on non-Hebrew pages.
 * ---------------------------------------------------------------------------
 * Companion to direction.css in the GAON i18n snippet, which handles the
 * arrows drawn inside our own widgets. This file covers what that one cannot
 * reach: a hover state that overwrites its own mirror, an arrow placed on the
 * page as a plain Elementor SVG widget, the typeface, and the few places where
 * English runs longer than the Hebrew the layout was drawn around.
 */

/* ---------------------------------------------------------------------------
 * Typeface
 *
 * Four separate places decide what an element is set in, and each one has to
 * be answered where it was written:
 *
 *   :root                --gaon-font                the GAON Typography snippet
 *   body                 --e-global-typography-*     the Elementor kit
 *   .gsp and seven like it  --gsp-font               each widget's stylesheet
 *   .elementor .title-lg    font-family, literal     Elementor global classes
 *
 * The first three are custom properties, and a property redeclared on a
 * descendant wins for that subtree however specific the ancestor's rule was -
 * so each is restated at the element that made it. The fourth is a plain
 * declaration at (0,2,0) and is answered on specificity.
 * ------------------------------------------------------------------------ */

html[dir="ltr"]{
  --gaon-ltr-stack: "Inter", system-ui, Arial, sans-serif;
  --gaon-he-stack: "Noto Sans Hebrew", system-ui, Arial, sans-serif;
  --gaon-font: "Inter";
  --card-font: var(--gaon-ltr-stack);
}

/* The kit's four global typography styles are declared on body, the element
 * carrying .elementor-kit-N. Overriding them here rather than chasing the
 * elements that read them means every heading, button and field Elementor
 * styles follows the English face, including any added later. */
html[dir="ltr"] body{
  --e-global-typography-primary-font-family: "Inter";
  --e-global-typography-secondary-font-family: "Inter";
  --e-global-typography-text-font-family: "Inter";
  --e-global-typography-accent-font-family: "Inter";
}

html[dir="ltr"] body,
html[dir="ltr"] :is(h1, h2, h3, h4, h5, h6),
html[dir="ltr"] :is(button, input, select, textarea, optgroup),
html[dir="ltr"] .elementor-widget-container,
html[dir="ltr"] :is(.e-con, .e-parent, .e-child),
html[dir="ltr"] :is(.elementor-button, .elementor-field, .elementor-field-label){
  font-family: var(--gaon-ltr-stack);
}

/* Each widget root, matched exactly where it declares its own variable. */
[dir="ltr"] .gsp{   --gsp-font:   var(--gaon-ltr-stack); }
[dir="ltr"] .gwc{   --gwc-font:   var(--gaon-ltr-stack); }
[dir="ltr"] .gsub{  --gsub-font:  var(--gaon-ltr-stack); }
[dir="ltr"] .gftr{  --gftr-font:  var(--gaon-ltr-stack); }
[dir="ltr"] .ghero{ --ghero-font: var(--gaon-ltr-stack); }
[dir="ltr"] .gtl{   --gtl-font:   var(--gaon-ltr-stack); }
[dir="ltr"] .glx{   --glx-font:   var(--gaon-ltr-stack); }
[dir="ltr"] :is(.gaon-form, .contact-head ~ .elementor-widget-form){
  --gform-font: var(--gaon-ltr-stack);
}

/* Elementor global classes - .section-head__title, .title-lg, .text-body,
 * .btn-primary, .stat-number and the rest - each compile to
 * `.elementor .<class>{ font-family: "Noto Sans Hebrew" }`, a literal rather
 * than a variable, so none of the overrides above reach them. Naming the ten
 * that exist today would leave the eleventh to be found by eye on a page
 * nobody is reading closely, so the rule is written to catch any of them:
 * anything with a class, inside the Elementor document, at (0,3,1).
 *
 * It only ever sets font-family, and the site is drawn in a single face per
 * language, so there is nothing here for it to trample. The day a second face
 * is introduced deliberately, this is the rule that has to learn about it. */
html[dir="ltr"] .elementor :is([class]){
  font-family: var(--gaon-ltr-stack);
}

/* The exception to the rule above, and it has to come after it.
 *
 * An English page is not entirely English: the language switcher offers the
 * word "עברית", and Polylang marks that link lang="he-IL". Inter has no Hebrew
 * glyphs, so the sweep above would drop those four letters onto whatever the
 * system happens to offer - a different face from the one the Hebrew site is
 * set in, sitting in the header where the difference is most visible.
 *
 * So anything explicitly marked as Hebrew keeps the Hebrew face. Two rules,
 * because the sweep only reaches inside .elementor and this should hold
 * everywhere. The second one ties with it at (0,3,1) and wins on order, which
 * is why it is written here and not further up the file.
 *
 * Noto Sans Hebrew is already enqueued on English pages by the Elementor kit,
 * so nothing extra is loaded for it. If the kit ever stops declaring it, this
 * rule falls back to the system stack and the word looks wrong again. */
html[dir="ltr"] [lang][lang|="he"],
html[dir="ltr"] [lang][lang|="he"] *,
html[dir="ltr"] .elementor [lang][lang|="he"],
html[dir="ltr"] .elementor [lang][lang|="he"] *{
  font-family: var(--gaon-he-stack);
}

/* Not reached, and deliberately left alone: the header's off-canvas menu pins
 * its own font at (0,5,0) from the Nav Menu widget's own style settings.
 * Clear the font in that widget's Style tab rather than adding a longer
 * selector here. */

/* ---------------------------------------------------------------------------
 * Length
 *
 * Hebrew is the shorter language, and the layout was measured against it.
 * "חטיבת תכנון וביצוע" is eighteen characters; "Design and Execution Division"
 * is twenty-nine, and the division bar on a subsidiary card is a fixed 27px
 * strip inside a card that clips its overflow. On a 1440 frame the English
 * label misses fitting by six pixels; between 1024 and 1280 the cards are
 * narrower still and no single-line size saves it.
 *
 * So the strip is allowed to become two lines and the card reserves the room,
 * rather than the label being cut to fit a measurement taken in another
 * language. One line still looks like one line - min-block-size holds the
 * original 27px, so "Trade Division" is unchanged.
 * ------------------------------------------------------------------------ */

[dir="ltr"] .gsub .gsub__card{
  /* 27px was exactly one line of the strip. Two lines at 14px/1.35 plus its
   * padding come to 44, and 46 keeps the arrow off the second line. */
  padding-block-end: 46px;
}

[dir="ltr"] .gsub__division{
  block-size: auto;
  min-block-size: 27px;
  padding-block: 3px;
  padding-inline: 12px;
  font-size: 14px;
  line-height: 1.35;
}

/* ---------------------------------------------------------------------------
 * Direction
 * ------------------------------------------------------------------------ */

/* The subsidiary card nudges its arrow on hover, and transform is one
 * property: writing translate() there replaces the scaleX(-1) that
 * direction.css put on the resting state, so the arrow flipped back to the
 * Hebrew diagonal under the cursor. Both parts are restated together, and the
 * nudge follows the reading direction instead of fighting it. */
[dir="ltr"] .gsub .gsub__card:hover .gsub__arrow-ico{
  transform: translate(3px, 3px) scaleX(-1);
}


/* The leadership strip's nav row.
 *
 * direction.css leaves .glx__ico unmirrored on purpose, and gives the reason:
 * the nav row is pinned direction:ltr, so its buttons never swap sides and a
 * mirrored arrow would point away from the card it moves toward.
 *
 * That reasoning holds for the timeline, whose year axis really is a number
 * line that reads left to right in both languages. It does not hold here. The
 * leadership strip itself is a flex row that reverses with the page, so in
 * English it advances leftward while its arrows still say otherwise: the left
 * button is Next and the right one is Previous, which is backwards for anyone
 * reading in English.
 *
 * So both halves turn together. The row is reversed, which puts Next on the
 * right, and the glyph inside is mirrored to match. Each arrow still points at
 * the card it moves toward, which is what the original rule was protecting. */
[dir="ltr"] .glx__nav{
  flex-direction: row-reverse;
}

[dir="ltr"] .glx__ico{
  transform: scaleX(-1);
}


/* The contact page's social buttons.
 *
 * The button reserves room for its icon with padding-inline, which follows the
 * page and moves to the left in English. The icon itself is a background image
 * pinned with background-position: calc(100% - 14px), which is physical and
 * does not move: it stays 14px from the right edge, where English leaves only
 * 14px of padding. So the icon lands on the last letters of the word.
 *
 * CSS has no logical background-position, so the mirror is written here rather
 * than fixed at the source. The 14px is the same constant the RTL rule uses,
 * measured from the start edge instead of the end. */
[dir="ltr"] .contact-social__btn{
  background-position: 14px 50%;
}


/* The drawn diagonal arrow, everywhere Elementor places it.
 *
 * One arrow was being turned by four separate rules keyed to whatever class
 * each instance happened to carry - a global class here, a generated local id
 * there - and every new placement needed a fifth. The class now lives on the
 * path inside Arrow-1.svg itself, so every instance carries it the moment it
 * is placed, in both languages, without anyone remembering to.
 *
 * transform-box keeps the flip inside the glyph. Without it the scale is taken
 * about the SVG's own origin and the arrow leaves the box.
 *
 * The five instances today: the home page call to action, the statistics card
 * on the home page and on About, the 404 button, and the contact page's
 * division cards. This rule does not know about any of them, which is the
 * point.
 *
 * The arrows drawn by our own widgets - .gsub__arrow-ico, .gsp__arrow, the
 * form's submit button - are a different shape drawn in PHP rather than this
 * file, and stay where they are in direction.css. */
html[dir="ltr"] .gaon-arrow-diagonal{
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleX(-1);
}
