/**
 * i18n Layout Utilities
 * Includes RTL support and text expansion handling (DE, RU).
 */

/* 1. RTL Support via Logical Properties */
/* Modern browsers support margin-inline, padding-inline which auto-flip in RTL */
:root {
  --dm-font-main: 'Pretendard', -apple-system, system-ui, sans-serif;
}

[dir="rtl"] {
  text-align: right;
}

/* Base adjustment for components using fixed logic */
[dir="rtl"] .ml-auto { margin-right: auto; margin-left: 0; }
[dir="rtl"] .mr-auto { margin-left: auto; margin-right: 0; }

/* Mirror directional icons in RTL */
[dir="rtl"] .i18n-mirror {
  transform: scaleX(-1);
}

[dir="rtl"] .topnav__left { order: 3; }
[dir="rtl"] .topnav__center { order: 2; }
[dir="rtl"] .topnav__right { order: 1; }

/* 2. Language-Specific Font Overrides */
[lang="hi"] {
  --dm-font-main: 'Noto Sans Devanagari', 'Hindi', sans-serif;
  line-height: 1.6;
}

[lang="ar"] {
  --dm-font-main: 'IBM Plex Sans Arabic', 'Segoe UI Arabic', sans-serif;
  line-height: 1.5;
}

/* Apply main font variable globally */
body {
  font-family: var(--dm-font-main) !important;
}

/* 3. Text Expansion Handling (German, Russian) */
.btn, .nav-btn, .tab-btn {
  min-width: fit-content;
  white-space: nowrap;
  padding-inline: 1.25rem; /* Logical Property: auto-adjusts for RTL */
}

.text-flexible {
  word-break: keep-all;
  white-space: normal;
  line-height: 1.5;
}
