/* THE LANGUAGE CONTROL'S LOOK (components/LangPicker.astro), one file: loaded by the picker wherever it is drawn, a page or
   a sealed header (GrowlMasterHeader.astro's shadow), so it looks the same in both. */
.lp {
  position: relative; display: inline-flex;
  --lp-tap: var(--g-touch, 44px); --lp-flag: var(--g-icon, 22px); --lp-row: 44px; --lp-rowflag: 22px; --lp-font: 15px;
  --lp-bg: #17171f; --lp-ink: #f2f2f6; --lp-line: rgba(255, 255, 255, 0.14); --lp-hover: rgba(255, 255, 255, 0.08);
  --lp-on: rgba(84, 93, 246, 0.22); --lp-accent: #8c92ff; --lp-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.lp__flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--lp-tap); height: var(--lp-tap); padding: 0; border: 0; border-radius: 999px;
  background: none; color: inherit; line-height: 1; cursor: pointer;
}
.lp__flag:hover { opacity: 0.75; }
.lp__flag:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.lp__glyph { display: inline-flex; line-height: 1; }
.lp__glyph svg { width: var(--lp-flag); height: var(--lp-flag); display: block; stroke-width: var(--g-icon-stroke, 2px); }
/* a round flag: the button's at the icon size, a row's at its flag size */
.lp__circle { display: block; flex: none; border-radius: 50%; object-fit: cover; }
img.lp__glyph { width: var(--lp-flag); height: var(--lp-flag); }
img.lp__rowflag { width: var(--lp-rowflag); height: var(--lp-rowflag); }
/* Named: the flag, its language's name and a caret, as one pill. */
.lp--named .lp__flag { width: auto; gap: 8px; padding: 0 14px; font: inherit; font-weight: 700; }
.lp--named .lp__flag:hover { opacity: 1; }
.lp__caret { display: inline-flex; opacity: 0.8; }
.lp__caret svg { width: 1em; height: 1em; }

/* Desktop: a list beside the flag, at its inline end (the right in English,
   the left in Hebrew), below it, or above it with `up`. */
.lp__menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60;
  width: max-content; min-width: 200px; padding: 6px;
  border: 1px solid var(--lp-line); border-radius: 14px;
  background: var(--lp-bg); color: var(--lp-ink); box-shadow: var(--lp-shadow);
}
.lp--up .lp__menu { top: auto; bottom: calc(100% + 8px); }
.lp__menu[hidden] { display: none; }
.lp__head { display: none; }
.lp__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lp__row {
  display: flex; align-items: center; gap: 12px; min-height: var(--lp-row); padding: 0 12px;
  border-radius: 10px; color: inherit; font-size: var(--lp-font); font-weight: 600;
  text-align: start; text-decoration: none;
}
.lp__row:hover, .lp__row:focus-visible { background: var(--lp-hover); outline: none; }
.lp__rowflag { font-size: var(--lp-rowflag); line-height: 1; }
.lp__name { flex: 1 1 auto; }
/* The tick keeps its place whether or not it shows, so names don't shift as the choice moves. */
.lp__tick { flex: 0 0 auto; color: var(--lp-accent); visibility: hidden; }
.lp__row.is-on { background: var(--lp-on); }
.lp__row.is-on .lp__tick { visibility: visible; }

/* A phone: the list is the screen. */
@media (max-width: 640px) {
  .lp__menu, .lp--up .lp__menu {
    position: fixed; inset: 0; z-index: 9000; width: auto; min-width: 0; padding: 0;
    border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column;
  }
  .lp__menu[hidden] { display: none; }
  .lp__head {
    position: sticky; top: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
    padding: 10px 14px; border-bottom: 1px solid var(--lp-line); background: var(--lp-bg);
  }
  .lp__title { margin: 0; font-size: 20px; font-weight: 800; }
  .lp__x {
    width: var(--lp-tap); height: var(--lp-tap); border: 0; border-radius: 999px;
    background: transparent; color: inherit; font-size: 30px; line-height: 1; cursor: pointer;
  }
  .lp__list { gap: 6px; padding: 12px 14px; overflow-y: auto; }
  .lp__row { min-height: calc(var(--lp-row) + 12px); border: 1px solid var(--lp-line); }
}
