/* ---------------------------------------------------------------------------
   The language switcher (partials/language-switcher.blade.php).

   One piece of markup, three skins, because it sits on three backgrounds:
   `--header` on the purple bar (white pill, white dropdown like the header's
   own menus), `--panel` inside the header's light slide-down menu on small
   screens, and `--footer` on the black footer. Everything above the SKINS
   line is shape and behaviour only.
--------------------------------------------------------------------------- */

.ae-lang {
  position: relative;
  display: inline-block;
  font-family: inherit;
}

.ae-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px 0 12px;
  height: 36px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ae-lang__btn::-webkit-details-marker { display: none; }
.ae-lang__btn::marker { content: ''; }

.ae-lang__globe { width: 17px; height: 17px; flex: none; }
.ae-lang__now { white-space: nowrap; }

.ae-lang__chev {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: .8;
  transition: transform .2s ease;
}

.ae-lang[open] .ae-lang__chev { transform: rotate(180deg); }

/* the menu drops below the pill */
.ae-lang__menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 60;
  min-width: 210px;
  margin: 0;
  padding: 6px;
  list-style: none;
  animation: ae-lang-in .18s ease both;
}

@keyframes ae-lang-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ae-lang__menu li + li { margin-top: 2px; }

.ae-lang__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.ae-lang__code {
  flex: none;
  min-width: 30px;
  padding: 3px 6px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-align: center;
}

.ae-lang__name { flex: 1 1 auto; }
.ae-lang__tick { width: 15px; height: 15px; flex: none; }

/* ------------------------------------------------------------------ SKINS */

/* --- on the purple header bar, next to its white pills ------------------ */
.ae-hdr .ae-lang--header { margin-right: 2px; }

.ae-lang--header > .ae-lang__btn {
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.ae-lang--header > .ae-lang__btn:hover,
.ae-lang--header > .ae-lang__btn:focus-visible {
  background: rgba(255, 255, 255, .26);
  border-color: rgba(255, 255, 255, .5);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(20, 5, 50, .25);
  outline: none;
}

.ae-lang--header[open] > .ae-lang__btn {
  background: #fff;
  border-color: #fff;
  color: #6526DE;
}

.ae-lang--header .ae-lang__globe { color: currentColor; opacity: .9; }

.ae-lang--header .ae-lang__menu {
  border: 1.5px solid #E4E2FA;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(40, 10, 80, .18);
}

.ae-lang--header .ae-lang__item { color: #111; }

.ae-lang--header .ae-lang__item:hover,
.ae-lang--header .ae-lang__item:focus-visible {
  background: #F5F1FE;
  color: #6526DE;
  outline: none;
}

.ae-lang--header .ae-lang__item.is-current { background: #F5F1FE; color: #6526DE; }

.ae-lang--header .ae-lang__code {
  background: #EDE7FC;
  color: #6526DE;
}

.ae-lang--header .ae-lang__item.is-current .ae-lang__code { background: #6526DE; color: #fff; }
.ae-lang--header .ae-lang__tick { color: #6526DE; }

/* --- inside the header's slide-down menu, which is a light panel -------- */
.ae-lang--panel { display: block; margin: 12px 0 2px; }

.ae-lang--panel > .ae-lang__btn {
  border: 1.5px solid #DDD6EA;
  background: #fff;
  color: #111;
}

.ae-lang--panel > .ae-lang__btn:hover,
.ae-lang--panel > .ae-lang__btn:focus-visible {
  border-color: #B9A6F2;
  color: #6526DE;
  outline: none;
}

.ae-lang--panel[open] > .ae-lang__btn { border-color: #6526DE; color: #6526DE; }
.ae-lang--panel .ae-lang__globe { color: #6526DE; }

.ae-lang--panel .ae-lang__menu {
  position: static;
  min-width: 0;
  margin-top: 6px;
  padding: 6px;
  border: 1.5px solid #E4E2FA;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(40, 10, 80, .12);
}

.ae-lang--panel .ae-lang__item { color: #111; }
.ae-lang--panel .ae-lang__item:hover,
.ae-lang--panel .ae-lang__item:focus-visible { background: #F5F1FE; color: #6526DE; outline: none; }
.ae-lang--panel .ae-lang__item.is-current { background: #F5F1FE; color: #6526DE; }
.ae-lang--panel .ae-lang__code { background: #EDE7FC; color: #6526DE; }
.ae-lang--panel .ae-lang__item.is-current .ae-lang__code { background: #6526DE; color: #fff; }
.ae-lang--panel .ae-lang__tick { color: #6526DE; }

/* --- on the black footer, under the brand ------------------------------- */
.ae-lang--footer { margin-top: 14px; }

.ae-lang--footer > .ae-lang__btn {
  border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
  color: #fff;
}

.ae-lang--footer > .ae-lang__btn:hover,
.ae-lang--footer > .ae-lang__btn:focus-visible {
  border-color: rgba(147, 108, 255, .75);
  background: linear-gradient(180deg, rgba(147, 108, 255, .22), rgba(147, 108, 255, .10));
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(106, 46, 214, .30);
  outline: none;
}

.ae-lang--footer[open] > .ae-lang__btn {
  border-color: rgba(147, 108, 255, .9);
  background: linear-gradient(180deg, rgba(147, 108, 255, .26), rgba(147, 108, 255, .12));
  box-shadow: 0 8px 22px rgba(106, 46, 214, .35);
}

.ae-lang--footer .ae-lang__globe { color: #b79bff; }

.ae-lang--footer .ae-lang__menu {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(24, 21, 34, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .55), 0 0 0 1px rgba(147, 108, 255, .10);
}

.ae-lang--footer .ae-lang__item { color: rgba(255, 255, 255, .80); }

.ae-lang--footer .ae-lang__item:hover,
.ae-lang--footer .ae-lang__item:focus-visible {
  background: rgba(147, 108, 255, .18);
  color: #fff;
  outline: none;
}

.ae-lang--footer .ae-lang__item.is-current { background: rgba(147, 108, 255, .14); color: #fff; }

.ae-lang--footer .ae-lang__code {
  background: rgba(255, 255, 255, .10);
  color: #cbb8ff;
}

.ae-lang--footer .ae-lang__item.is-current .ae-lang__code { background: rgba(147, 108, 255, .85); color: #fff; }
.ae-lang--footer .ae-lang__tick { color: #b79bff; }

/* --- narrow screens ----------------------------------------------------- */
@media (max-width: 1180px) {
  /* the header's own pills shrink here; keep the switcher in step */
  .ae-lang--header > .ae-lang__btn { font-size: 13px; padding: 0 12px 0 10px; }
}

@media (max-width: 767px) {
  /* the footer stacks and stays left-aligned, so the menu keeps the pill's
     edge instead of hanging off the screen */
  .ae-lang--footer { margin-top: 12px; }
  .ae-lang__menu { min-width: min(210px, calc(100vw - 48px)); }
}
