.diar-header-identity {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-self: start;
  gap: .95rem;
  width: max-content;
  max-width: none;
  direction: ltr !important;
  unicode-bidi: isolate;
  color: inherit;
}

.diar-header-identity > a:first-child {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  width: auto !important;
  min-width: 0 !important;
  padding: 0;
  gap: 0;
}

.diar-header-identity .diar-legal-link,
.diar-header-identity .diar-legal-link span {
  display: block !important;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font: 500 .65rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .18em !important;
  white-space: nowrap;
  text-decoration: none;
  direction: ltr;
}

.diar-header-identity > .diar-legal-link {
  flex: 0 0 auto;
  padding-block: .2rem;
  padding-left: .8rem;
  border-left: 1px solid currentColor;
}

.diar-lang-control {
  position: relative;
  z-index: 2;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  direction: ltr;
  color: inherit;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 8px;
  line-height: 1;
  letter-spacing: .16em;
  text-align: left;
  isolation: isolate;
  pointer-events: auto !important;
  touch-action: manipulation;
  unicode-bidi: isolate;
  writing-mode: horizontal-tb;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none;
}

.diar-lang-trigger {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
  mix-blend-mode: normal;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.diar-lang-trigger::after {
  position: absolute;
  right: 11px;
  bottom: 10px;
  left: 9px;
  height: 1px;
  content: "";
  background: currentColor;
  opacity: 0;
  transform: scaleX(.45);
  transition: opacity .25s ease, transform .35s ease;
}

.diar-lang-trigger:hover::after,
.diar-lang-trigger:focus-visible::after,
.diar-lang-control.is-open .diar-lang-trigger::after {
  opacity: .72;
  transform: scaleX(1);
}

.diar-lang-trigger:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -5px;
}

.diar-lang-control .diar-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 1;
  display: grid;
  min-width: 132px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #f4f1e9;
  background: rgba(16, 16, 15, .94);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  direction: ltr;
  mix-blend-mode: normal;
  unicode-bidi: isolate;
  pointer-events: auto !important;
}

.diar-lang-menu[hidden] {
  display: none !important;
}

.diar-lang-option {
  position: relative;
  display: block;
  padding: 11px 12px;
  color: inherit;
  font-size: 9px;
  letter-spacing: .1em;
  line-height: 1.2;
  text-decoration: none;
}

.diar-lang-option::after {
  position: absolute;
  right: 12px;
  bottom: 7px;
  left: 12px;
  height: 1px;
  content: "";
  background: currentColor;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: opacity .25s ease, transform .3s ease;
}

.diar-lang-option:hover::after,
.diar-lang-option:focus-visible::after,
.diar-lang-option[aria-current="page"]::after {
  opacity: .55;
  transform: scaleX(1);
}

.diar-lang-option:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -2px;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] main,
html[dir="rtl"] footer,
html[dir="rtl"] dialog {
  direction: rtl;
}

html[dir="rtl"] main :where(h1, h2, h3, h4, p, li, dt, dd, figcaption),
html[dir="rtl"] footer :where(p, li),
html[dir="rtl"] form :where(label, legend) {
  text-align: right;
}

html[dir="rtl"] :where(input, textarea, select) {
  text-align: right;
}

html[dir="rtl"] :where(input[type="email"], input[type="tel"], input[type="url"]) {
  direction: ltr;
  text-align: left;
}

html[lang="fa"] body,
html[lang="fa"] :where(button, input, textarea, select) {
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

html[lang="fa"] :where(h1, h2, h3, h4, p, a, button, label, li, dt, dd, figcaption):not(.i18n-keep-en) {
  letter-spacing: normal;
}

html[lang="fa"] :where(h1, h2, h3, h4):not(.i18n-keep-en) {
  line-height: 1.42;
}

html[lang="fa"] .i18n-keep-en {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

/* The entire opening composition intentionally remains an English/LTR visual
   island. Without this, the RTL writing mode resolves the hero's physical
   left/right offsets from the opposite edge and shifts the alliance line. */
html[lang="fa"] .hero {
  direction: ltr;
}

html[lang="fa"] :where(p, li, dd):not(.i18n-keep-en) {
  line-height: 1.85;
}

/* Keep the contact anti-spam field hidden without a -10000px RTL overflow. */
html[dir="rtl"] .ct-honeypot {
  left: 0 !important;
  right: auto;
  clip-path: inset(50%);
  overflow: hidden;
}

/* Long German headings must not widen the page beneath the fixed header. */
html[lang="de"] .hn-hero > * { min-width: 0; }
html[lang="de"] .hn-body main :is(h1, h2, h3) { overflow-wrap: anywhere; hyphens: auto; }

/* LN is a permanent, language-neutral utility. These declarations make it
   immune to the Persian typography rules and keep it visible in RTL layouts. */
html[lang="fa"] .diar-lang-control,
html[lang="fa"] .diar-lang-trigger {
  direction: ltr;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .16em;
}

html[lang="fa"] .diar-lang-control {
  display: block;
  visibility: visible !important;
}

@media (max-width: 700px) {
  .diar-header-identity {
    gap: .55rem;
  }
  .diar-header-identity .diar-legal-link,
  .diar-header-identity .diar-legal-link span {
    font-size: .6rem;
    letter-spacing: .12em !important;
  }
  .diar-lang-control .diar-lang-menu {
    min-width: 124px;
  }
}

@media print {
  .diar-lang-control { display: none !important; }
}
