/* ==========================================================================
   سوئیچر زبان
   ==========================================================================
   با ویژگی‌های منطقی (inset-inline-*) نوشته شده و نه left/right، تا در
   صفحه‌ی راست‌به‌چپ و چپ‌به‌راست خودش جا عوض کند و لازم نباشد دو بار
   نوشته شود.

   کنارِ دکمه‌ی منو می‌نشیند و نه رویش: منو سمتِ آغازِ خط است، این سمتِ
   پایان.
   ========================================================================== */

.lang-switch {
  position: fixed;
  top: 18px;
  inset-inline-end: 18px;
  z-index: 1999;
  font-family: inherit;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  transition: background .2s, border-color .2s;
}

.lang-switch-btn:hover,
.lang-switch-btn[aria-expanded="true"] {
  background: rgba(0, 0, 0, .8);
  border-color: rgba(255, 255, 255, .5);
}

.lang-switch-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 150px;
  border-radius: 12px;
  background: rgba(15, 15, 15, .96);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

.lang-switch-menu[hidden] { display: none; }

.lang-switch-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: #eee;
  text-decoration: none;
  font-size: .9rem;
  /* هر نام به خطِ خودش خوانده می‌شود، پس جهتش را از خودِ عنصر می‌گیرد */
  text-align: start;
}

.lang-switch-menu a:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.lang-switch-menu a[aria-current="true"] {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 640px) {
  .lang-switch { top: 12px; inset-inline-end: 12px; }
  .lang-switch-btn { padding: 7px 11px; font-size: .8rem; }
}

@media print { .lang-switch { display: none; } }

/* ==========================================================================
   نوارِ پیش‌نمایشِ زبانِ خاموش — فقط برای مدیر
   ========================================================================== */

.locale-preview-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 2000;
  padding: 10px 16px;
  background: #b26a00;
  color: #fff;
  font-size: .86rem;
  text-align: center;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .25);
}

.locale-preview-bar a {
  color: #fff;
  text-decoration: underline;
  margin-inline-start: 8px;
}

@media print { .locale-preview-bar { display: none; } }
