/*
 * Offcanvas language switcher — horizontal centering (loads last).
 * Markup: lang-switcher.ejs inside .itoffcanvas (chrome.ejs line ~66)
 *
 * Blockers fixed:
 * - main.css .it-lang-switcher--offcanvas .it-lang-switcher__toggle { justify-content: flex-start }
 * - aramko-custom.css .it-lang-switcher__option { justify-content: flex-start; text-align: left }
 * - main.css .it-lang-switcher.is-open .it-lang-switcher__menu { transform: translateY(0) } (drops translateX)
 */

/* The switcher hugs its content and is centred by auto margins, rather than
   stretching the trigger across the whole drawer (main.css sets width:100% on
   both the block and the button). fit-content needs the padding zeroed too,
   since box-sizing:border-box folds it into the measured width. */
.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas,
.itoffcanvas .it-lang-switcher.it-lang-switcher--centered {
  width: -moz-fit-content !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}

/* Trigger: button.it-lang-switcher__toggle — flag + DE + arrow */
.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas button.it-lang-switcher__toggle[data-lang-toggle],
.itoffcanvas .it-lang-switcher.it-lang-switcher--centered button.it-lang-switcher__toggle[data-lang-toggle] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: auto !important;
  min-width: 0 !important;
}

/* The dropdown no longer inherits a full-drawer width from the block, so let it
   size to its longest label (Deutsch / English / العربية) and never be narrower
   than the trigger it hangs from. */
.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas .it-lang-switcher__menu,
.itoffcanvas .it-lang-switcher.it-lang-switcher--centered .it-lang-switcher__menu {
  width: -moz-max-content !important;
  width: max-content !important;
  min-width: 100% !important;
}

/* Dropdown rows: li > a.it-lang-switcher__option — flag + Deutsch/English */
.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas .it-lang-switcher__menu > li[role="none"],
.itoffcanvas .it-lang-switcher.it-lang-switcher--centered .it-lang-switcher__menu > li[role="none"] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas a.it-lang-switcher__option[role="menuitem"],
.itoffcanvas .it-lang-switcher.it-lang-switcher--centered a.it-lang-switcher__option[role="menuitem"] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}
