/* Language switcher — compact dropdown (site button radius, not pills) */

.ew-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 80;
  font-family: var(--ew-font-heading, "EW Heading", system-ui, sans-serif);
}

.ew-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--ew-line, #e7e4df);
  border-radius: var(--ew-radius-btn-sm, 8px);
  background: #fff;
  color: var(--ew-ink, #171717);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.03em;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: none;
}

.ew-lang__btn:hover,
.ew-lang.is-open .ew-lang__btn {
  border-color: #cfc9c2;
  background: #f7f6f4;
}

.ew-lang__icon {
  display: inline-flex;
  color: #5c5c5c;
}

.ew-lang__chev {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #666;
}

.ew-lang__menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  max-height: min(50vh, 360px);
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--ew-line, #e7e4df);
  border-radius: var(--ew-radius-btn-sm, 8px);
  box-shadow: 0 12px 28px rgba(23, 23, 23, 0.1);
  z-index: 90;
}

.ew-lang--footer .ew-lang__menu {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.ew-lang__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ew-ink, #171717);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.ew-lang__link:hover {
  background: #f3f2f1;
}

.ew-lang__item.is-on .ew-lang__link {
  background: #f3f2f1;
  font-weight: 600;
}

.ew-lang__slug {
  color: #8a8a8a;
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* Soft Accept-Language suggest */
.ew-lang-banner {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  z-index: 10020;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  max-width: min(92vw, 520px);
  padding: 10px 14px;
  border-radius: 12px;
  background: #171717;
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(23, 23, 23, 0.28);
}

.ew-lang-banner[hidden] { display: none !important; }
.ew-lang-banner__text { margin: 0; }
.ew-lang-banner__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ew-lang-banner__go {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  background: #fff;
  color: #171717 !important;
  font-weight: 600;
  text-decoration: none;
}
.ew-lang-banner__dismiss {
  border: 0;
  background: transparent;
  color: #cfcfcf;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* Sticky article language bar — full-width bottom; square control (not a pill) */
.ew-article-langs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10010;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  width: auto;
  max-width: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #f7f6f4;
  border: 0;
  border-top: 1px solid var(--ew-line, #e7e4df);
  border-radius: 0;
  box-shadow: 0 -8px 24px rgba(23, 23, 23, 0.06);
  font-family: var(--ew-font-heading, "EW Heading", system-ui, sans-serif);
  font-size: 13px;
  line-height: 1.3;
  color: #171717;
}

.ew-article-langs[hidden] { display: none !important; }

.ew-article-langs__label {
  margin: 0;
  font-weight: 500;
  color: #666;
  white-space: nowrap;
}

.ew-article-langs .ew-lang {
  z-index: 10011;
}

.ew-article-langs .ew-lang__btn {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--ew-line, #e7e4df);
  border-radius: var(--ew-radius-btn-sm, 8px);
  background: #fff;
}

.ew-article-langs__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5c5c5c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ew-article-langs__close:hover {
  background: #eceae7;
  color: #171717;
}

body.ew-has-article-langs {
  padding-bottom: 64px;
}

/* Desktop footer: small inline dropdown only — never a full-width strip */
.ew-lang-footer {
  display: none;
  justify-content: center;
  padding: 8px 16px 20px;
  background: transparent;
}

.ew-lang-footer .ew-lang {
  width: auto;
}

@media (min-width: 721px) {
  .ew-lang-footer {
    display: flex;
  }
}

/* Mobile fab after closing the article chip */
.ew-lang-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 10015;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ew-line, #e7e4df);
  border-radius: var(--ew-radius-btn-sm, 8px);
  background: #fff;
  color: #171717;
  box-shadow: 0 8px 20px rgba(23, 23, 23, 0.12);
  cursor: pointer;
}

.ew-lang-fab[hidden] { display: none !important; }

@media (min-width: 721px) {
  .ew-lang-fab { display: none !important; }
}

html[dir="rtl"] .ew-lang__menu { left: auto; right: 0; }
html[dir="rtl"] .ew-lang--footer .ew-lang__menu {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
html[dir="rtl"] .ew-lang-fab { right: auto; left: 16px; }

@media (max-width: 720px) {
  .ew-lang__menu { min-width: 180px; max-height: 45vh; }
  .ew-lang-banner {
    bottom: 78px;
    font-size: 13px;
    width: calc(100vw - 24px);
  }
  .ew-lang-footer { display: none; }
  .ew-article-langs {
    justify-content: space-between;
    padding-inline: 12px;
  }
}
