/** Soupi Bilingual — shared, language-scoped frontend styles. */

.sbl-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: var(--sbl-switcher-gap, 2px);
  box-sizing: border-box;
  min-height: 48px;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--sbl-switcher-border, currentColor);
  border-radius: var(--sbl-switcher-radius, 999px);
  background: var(--sbl-switcher-background, transparent);
  color: var(--sbl-switcher-color, inherit);
  font-size: var(--sbl-switcher-size, 14px);
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
  direction: ltr;
  isolation: isolate;
}

/* Each language is a real link and remains available without JavaScript. */
.sbl-switcher a,
.sbl-switcher .sbl-switcher__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--sbl-switcher-radius, 999px);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 4px;
  letter-spacing: normal;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms ease, color 160ms ease;
}

.sbl-switcher a[lang="fa"],
.sbl-switcher a[lang="fa-IR"],
.sbl-switcher a[data-sbl-target="fa"] {
  font-family: var(--sbl-fa-font, "Vazirmatn", Tahoma, sans-serif);
  direction: rtl;
  unicode-bidi: isolate;
}

.sbl-switcher a[aria-current="true"],
.sbl-switcher a[aria-current="page"],
html[data-sbl-lang="en"] .sbl-switcher a[data-sbl-target="en"],
html[data-sbl-lang="fa"] .sbl-switcher a[data-sbl-target="fa"] {
  background: var(--sbl-switcher-active-background, #17352f);
  color: var(--sbl-switcher-active-color, #fff);
}

.sbl-switcher a:hover {
  background: var(--sbl-switcher-hover-background, #e7f0ec);
  color: var(--sbl-switcher-hover-color, #17352f);
  text-decoration: none;
}

.sbl-switcher a:focus-visible {
  position: relative;
  outline: 3px solid currentColor;
  outline-offset: 3px;
  text-decoration: underline;
  z-index: 1;
}

.sbl-switcher__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 44px;
  margin-inline-start: 4px;
  color: inherit;
  pointer-events: none;
}

.sbl-switcher__icon svg,
.sbl-switcher .sbl-globe {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  flex: 0 0 auto;
  margin-inline: 7px 3px;
}

.sbl-switcher__links {
  display: inline-flex;
  align-items: center;
  gap: var(--sbl-switcher-gap, 2px);
}

.sbl-switcher--dropdown {
  position: relative;
  display: inline-block;
  overflow: visible;
  text-align: start;
}

.sbl-switcher--dropdown > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 12px 8px 4px;
  border-radius: var(--sbl-switcher-radius, 999px);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

.sbl-switcher--dropdown > summary::-webkit-details-marker { display: none; }
.sbl-switcher--dropdown > summary::marker { content: ""; }
.sbl-switcher--dropdown > summary:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.sbl-switcher--dropdown:not([open]) > .sbl-switcher__links { display: none; }
.sbl-switcher--dropdown[open] > .sbl-switcher__links {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 110px;
  padding: 5px;
  border: 1px solid var(--sbl-switcher-border, #cad8d2);
  border-radius: 12px;
  background: var(--sbl-switcher-background, #fff);
  color: var(--sbl-switcher-color, #17352f);
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
  z-index: 999;
}

.sbl-current-fa { display: none; }
html[data-sbl-lang="fa"] .sbl-current-fa { display: inline; font-family: var(--sbl-fa-font, "Vazirmatn", Tahoma, sans-serif); }
html[data-sbl-lang="fa"] .sbl-current-en { display: none; }

.sbl-widget-switcher {
  display: flex;
  align-items: center;
  justify-content: start;
  min-width: 0;
}

.sbl-header-switcher {
  --sbl-switcher-color: #fff;
  --sbl-switcher-border: rgb(255 255 255 / 35%);
  --sbl-switcher-active-background: #d9eee6;
  --sbl-switcher-active-color: #0b2634;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: center;
  max-width: 100%;
  margin-inline-start: 10px;
}

/* The existing header search containers use a column direction. Keep the
   injected control beside search without adding a second header row. */
.elementor-location-header .e-con:has(> .sbl-header-switcher) {
  --flex-direction: row;
  --align-items: center;
  --justify-content: center;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Editor switcher widgets and auto header placement share the same touch targets. */
@media (max-width: 767px) {
  .sbl-header-switcher { margin-inline-start: 4px; }
  .sbl-header-switcher .sbl-switcher { --sbl-switcher-size: 12px; --sbl-switcher-gap: 0px; }
  .sbl-header-switcher .sbl-switcher a { padding-inline: 7px; }
  .sbl-header-switcher .sbl-switcher__icon { width: 20px; margin-inline-start: 2px; }
  /* At narrow widths the opposite language is the action; retain a 44px target. */
  html[data-sbl-lang="fa"] .sbl-header-switcher a[data-sbl-target="fa"],
  html[data-sbl-lang="en"] .sbl-header-switcher a[data-sbl-target="en"] { display: none; }
  .elementor-location-header .e-con-inner:has(> .elementor-element-fc2c206 > .sbl-header-switcher) > .elementor-element-b76ea6a:not(:has(*)) { display: none; }
  .elementor-location-header .elementor-element.elementor-element-fc2c206:has(> .sbl-header-switcher) {
    --width: auto;
    --flex-wrap: nowrap;
    --justify-content: flex-end;
    width: auto;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    padding-inline: 8px;
  }
}

/* Keep hero arrow glyphs independent of bidi mirroring. The buttons retain
   their native order and handlers; only the symbols follow the language. */
html[data-sbl-lang="en"] body .ht-jhs .ht-jhs__arrow > .ht-jhs__arrow-icon,
html[data-sbl-lang="fa"] body .ht-jhs .ht-jhs__arrow > .ht-jhs__arrow-icon {
  direction: ltr;
  unicode-bidi: isolate;
  transform: scaleX(1);
  transform-origin: center;
}

html[data-sbl-lang="fa"] body .ht-jhs .ht-jhs__arrow > .ht-jhs__arrow-icon {
  transform: scaleX(-1);
}

/* Original English layout is the baseline. These rules only affect Persian. */
html[data-sbl-lang="fa"] body {
  direction: rtl;
}

html[data-sbl-lang="fa"] body :where(.elementor-heading-title, .elementor-widget-text-editor, .elementor-button-text) {
  letter-spacing: normal;
}

/* Logical direction handles flex rows without reversing nested layouts twice. */
html[data-sbl-lang="fa"] body :where(.ht-jhs, .sjv2-showcase, .seojan-cf, .sj-mm, .sj-tabs) {
  direction: rtl;
}

html[data-sbl-lang="fa"] body :where(.ht-jhs__title, .ht-jhs__text, .ht-jhs__description, .ht-jhs__subtitle, .seojan-cf-heading, .seojan-cf-item-title, .seojan-cf-description, .seojan-cf-item-description, .seojan-cf-item-text) {
  letter-spacing: normal;
  unicode-bidi: plaintext;
}

html[data-sbl-lang="fa"] body :where(.ht-jhs__text, .ht-jhs__description, .ht-jhs__subtitle, .seojan-cf-description, .seojan-cf-item-description, .seojan-cf-item-text) {
  text-align: start;
}

html[data-sbl-lang="fa"] body .sjv2-showcase :where(h1, h2, h3, h4, p, button),
html[data-sbl-lang="fa"] body .sj-mm :where(a, button),
html[data-sbl-lang="fa"] body .sj-tabs :where(h1, h2, h3, h4, p, a, button) {
  letter-spacing: normal;
}

/* Orbit coordinates and the progress/rotation math stay in their original LTR
   system. Only the content panel and textual node labels change direction. */
html[data-sbl-lang="fa"] body .hcos-orbit {
  direction: ltr;
}

html[data-sbl-lang="fa"] body .hcos-orbit :where(.hcos-panel, .hcos-panel__content, .hcos-panel__title, .hcos-panel__description, .hcos-node__label) {
  direction: rtl;
  unicode-bidi: plaintext;
  letter-spacing: normal;
}

html[data-sbl-lang="fa"] body .hcos-orbit .hcos-panel {
  text-align: start;
}

html[data-sbl-lang="fa"] body .hcos-orbit.hcos-align-center .hcos-panel {
  text-align: center;
}

/* Latin contact details remain readable inside Persian text. */
html[data-sbl-lang="fa"] body a[href^="tel:"],
html[data-sbl-lang="fa"] body a[href^="mailto:"],
html[data-sbl-lang="fa"] body .sbl-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Optional authored language variants also work outside Elementor controls. */
html[data-sbl-lang="en"] body .sbl-only-fa,
html[data-sbl-lang="fa"] body .sbl-only-en {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .sbl-switcher a { transition: none; }
}

@media (forced-colors: active) {
  .sbl-switcher { border-color: ButtonText; }
  .sbl-switcher a[aria-current="true"],
  .sbl-switcher a[aria-current="page"],
  html[data-sbl-lang="en"] .sbl-switcher a[data-sbl-target="en"],
  html[data-sbl-lang="fa"] .sbl-switcher a[data-sbl-target="fa"] {
    outline: 2px solid Highlight;
    outline-offset: -4px;
  }
}

/* Hooshi Energy Projects hard-codes LTR on its section roots. Let its existing
   flex/grid start alignment follow Persian; leave image/video and gallery
   coordinate systems (including the explicitly LTR viewport) unchanged. */
html[data-sbl-lang="fa"] body .hep-project-shell,
html[data-sbl-lang="fa"] body .hep-section {
  direction: rtl;
  text-align: start;
}

html[data-sbl-lang="fa"] body .hep-hero__subtitle {
  padding-inline: 22px 0;
}

html[data-sbl-lang="fa"] body .hep-hero__subtitle::before {
  inset-inline-start: 0;
  inset-inline-end: auto;
}

html[data-sbl-lang="fa"] body .hep-fact:not(:last-child)::after,
html[data-sbl-lang="fa"] body .hep-stat:not(:last-child)::after {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

@media (max-width: 767px) {
  html[data-sbl-lang="fa"] body .hep-hero__subtitle {
    padding-inline-start: 16px;
  }
}

/* The footer's embedded support style fixes its root to LTR. Restore logical
   RTL grid/flex placement and right-align its native Elementor text widgets. */
html[data-sbl-lang="fa"] body #page .spi-footer-native {
  direction: rtl;
  text-align: right;
}

html[data-sbl-lang="fa"] body #page .spi-footer-native :where(.elementor-heading-title, .elementor-widget-text-editor, .elementor-widget-image, .elementor-icon-list-items, .elementor-button-wrapper, p, li, address) {
  text-align: right;
}

html[data-sbl-lang="fa"] body #page .spi-footer-native :where(.spi-company-card, .spi-holding-logo) {
  --align-items: flex-start;
  align-items: flex-start;
}

html[data-sbl-lang="fa"] body #page .spi-footer-native .spi-company-title .elementor-heading-title {
  justify-content: flex-start;
}

html[data-sbl-lang="fa"] body #page .spi-footer-native :where(.spi-logo-image, .spi-embedded-logo) img {
  object-position: right center;
}

/* The holding mark sits at the RTL start of the desktop/tablet logo row.
   Move its divider inward; mobile keeps the original bottom separator. */
@media (min-width: 768px) {
  html[data-sbl-lang="fa"] body #page .spi-footer-native .spi-holding-logo {
    --border-right-width: 0px;
    --border-left-width: 1px;
    border-inline-start-width: 0;
    border-inline-end-width: 1px;
  }
}

/* Mirror only the header's actual horizontal arrow glyphs. Vertical menu
   chevrons, logos, search icons and the orbit's coordinate system stay intact. */
html[data-sbl-lang="fa"] body .elementor-location-header :is(.sj-tabs__view-more-icon, .sj-tabs__end-icon, .eti-link-icon) > svg.e-fas-arrow-right {
  transform: scaleX(-1);
  transform-origin: center;
}

/* The showcase stores a physical left alignment in its generated variables.
   Apply the Persian text defaults on the copy panel, in desktop and accordion. */
html[data-sbl-lang="fa"] body .sjv2-panel-copy {
  --sjv2-text-align: right;
  --sjv2-copy-align: flex-start;
  direction: rtl;
  text-align: right;
  align-items: flex-start;
}

html[data-sbl-lang="fa"] body .sjv2-content-title {
  text-align: right;
}

/* This long explanatory sentence is authored as H2 beside the orbit. Its
   Persian default is body-like; native per-widget Persian controls still win. */
html[data-sbl-lang="fa"] body #page .elementor-element-3d268f7 .elementor-heading-title {
  font-size: 20px !important;
  line-height: 1.8 !important;
  font-weight: 500;
}

@media (max-width: 767px) {
  html[data-sbl-lang="fa"] body #page .elementor-element-3d268f7 {
    --container-widget-width: 100%;
    width: 100%;
  }

  html[data-sbl-lang="fa"] body #page .elementor-element-3d268f7 .elementor-heading-title {
    font-size: 18px !important;
  }
}
