/* =========================================================
   Language picker — shared by every page (markup in each header,
   behaviour in i18n.js). Uses each page's colour variables so it
   follows light/dark mode, with fallbacks if a page lacks one.
   ========================================================= */
.mry-lang { position: relative; flex-shrink: 0; }

.mry-lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px;
  border-radius: 50px;
  background: var(--gray-100, #f4f6fc);
  border: 1.5px solid var(--gray-200, #e2e5ef);
  color: var(--gray-900, #0f1117);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.mry-lang-btn:hover, .mry-lang-btn[aria-expanded="true"] {
  background: var(--green-100, #e8f8ee);
  border-color: var(--green-600, #21a352);
}
.mry-lang-btn .mry-lang-caret { font-size: 10px; opacity: .7; }
.mry-lang-btn .mry-lang-short { display: none; }

.mry-lang-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
  min-width: 150px; margin: 0; padding: 6px; list-style: none;
  background: var(--white, #ffffff);
  border: 1.5px solid var(--gray-200, #e2e5ef);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .14);
  z-index: 2000;
}
.mry-lang-menu[hidden] { display: none; }
.mry-lang-menu button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 0; border-radius: 9px;
  background: none; color: var(--gray-900, #0f1117);
  font-family: inherit; font-size: 14px; font-weight: 600; text-align: start;
  cursor: pointer;
}
.mry-lang-menu button:hover, .mry-lang-menu button:focus-visible { background: var(--green-100, #e8f8ee); outline: none; }
.mry-lang-menu button[aria-checked="true"] { color: var(--green-700, #1a7a3e); font-weight: 800; }
.mry-lang-menu button[aria-checked="true"]::after { content: "✓"; }

/* Small screens: show the short code (ع / EN / FR) to save header space. */
@media (max-width: 600px) {
  .mry-lang-btn { padding: 0 10px; }
  .mry-lang-btn .mry-lang-name { display: none; }
  .mry-lang-btn .mry-lang-short { display: inline; }
}
