/* DamPhi i18n runtime — switch styling  [i18n_system 20260930]
   Deliberately template-agnostic (no assumptions about a nav's colours or font) so it
   drops into any template unchanged: a small pill, readable on light or dark chrome,
   sized to sit inline in a nav row (mobile included) or, with no [data-i18n-mount] on
   the page, float as a compact fixed pill that never blocks content. */
.dm-i18n-switch,
.dm-i18n-switch__btn {
  font: 600 12px/1 var(--font-sans, system-ui, sans-serif);
  letter-spacing: .02em;
  color: inherit;
  background: rgba(127, 127, 127, .14);
  border: 1px solid rgba(127, 127, 127, .28);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.dm-i18n-switch { position: relative; display: inline-block; }
/* The mount point a template names (or the migration leaves behind in place of an old
   toggle button) — sized to whatever the switch turns out to be (a <button> for two
   languages, a <div> for three or more), aligned like any other nav item. */
[data-i18n-mount] { display: inline-flex; align-items: center; }
.dm-i18n-switch:hover,
.dm-i18n-switch__btn:hover { background: rgba(127, 127, 127, .24); }

/* No [data-i18n-mount] on this page/template: float it, safe-area aware, never on top
   of a mobile home-indicator or notch. */
.dm-i18n-switch--floating {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 2147483000;
}

.dm-i18n-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  margin: 0; padding: 6px;
  list-style: none;
  min-width: 140px;
  background: #14161c;
  color: #e8edf5;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  z-index: 2147483001;
}
.dm-i18n-switch__item {
  display: block;
  width: 100%;
  text-align: left;
  font: 500 13px/1.5 var(--font-sans, system-ui, sans-serif);
  color: inherit;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
}
.dm-i18n-switch__item:hover,
.dm-i18n-switch__item.is-active { background: rgba(255, 255, 255, .1); }

/* RTL: the switch itself still reads left-to-right (it's UI chrome showing language
   NAMES, e.g. "English" / "Français" — not page copy), but its menu opens the natural
   direction for a right-to-left page. */
html[dir="rtl"] .dm-i18n-switch__menu { right: auto; left: 0; }
html[dir="rtl"] .dm-i18n-switch--floating { right: auto; left: max(14px, env(safe-area-inset-left, 0px)); }
