/* Language switcher button + right slide-in modal
   - No inline CSS usage
   - Uses theme variables from the site's theme CSS (e.g., --theme-color)
*/

:root {
  --lang-accent: var(--theme-color, #9370db);
  --lang-bg: var(--white, #ffffff);
  --lang-text: var(--header-color, #120036);
  --lang-muted: rgba(17, 27, 33, 0.6);
  --lang-border: rgba(17, 27, 33, 0.10);
  --lang-shadow: 0 18px 60px rgba(17, 27, 33, 0.18);

  /* Header vertical micro-alignment (tweak these yourself if needed)
     Positive values move DOWN, negative move UP.
     Example: --lang-btn-offset-y-mobile: 6px; */
  --download-btn-offset-y-desktop: 12px;
  --lang-btn-offset-y-desktop: 1px;
  --lang-btn-offset-y-mobile: 12px;
}

/* =========================
   HEADER: buttons placement
   ========================= */

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.lang-btn img {
  width: 35px;
  height: 35px;
  display: block;
}

.lang-btn:focus { outline: none; }

.lang-btn:focus-visible {
  outline: 2px solid var(--lang-accent);
  outline-offset: 4px;
  border-radius: 10px;
}

/* Desktop: right after Download, without inheriting menu-link paddings */
#header .wsmenu > .wsmenu-list > li.lang-switcher-desktop {
  margin-left: 10px;
}


/* Mobile: next to hamburger (outside menu), keep existing header layout */
@media only screen and (max-width: 991px) {
  /* On mobile: keep ONLY the outside button; hide it when the slide menu is open */
  #header .lang-switcher-desktop { display: none !important; }
  body.wsactive .lang-btn--mobile,
  .wsactive .lang-btn--mobile { display: none !important; }
  .lang-btn--mobile{
    position: absolute; /* positioned within .wsmobileheader (already fixed in menu.css) */
    top: var(--lang-btn-offset-y-mobile);
    right: 70px; /* sits left of the hamburger toggle hit-area */
    width: 54px;
    height: 54px;
    z-index: 103;
  }
  .lang-btn--mobile img{
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 380px) {
  .lang-btn--mobile{ right: 62px; }
}
/* Desktop: keep header items on one line; slight pill tweak without breaking alignment */
@media (min-width: 992px) {
  /* Keep the native header vertical rhythm; only slightly reduce the pill size */
  #header .wsmenu > .wsmenu-list > li.mobile-last-link > a.btn.last-link {
    margin-top: 0 !important;
    padding-left: 26px !important;
    padding-right: 26px !important;
    font-size: 15px !important;
    position: relative;
    top: var(--download-btn-offset-y-desktop);
  }


  /* Give the desktop lang button the same vertical rhythm as other menu items (10px + 50px + 10px) */
  #header .wsmenu > .wsmenu-list > li.lang-switcher-desktop {
    padding: 10px 0 10px 10px !important;
    margin-left: 0 !important;
  }

  #header .wsmenu > .wsmenu-list > li.lang-switcher-desktop > .lang-btn--desktop {
    width: 50px !important;
    height: 50px !important;
    position: relative;
    top: var(--lang-btn-offset-y-desktop);
  }

  
  #header .wsmenu > .wsmenu-list > li.lang-switcher-desktop > .lang-btn--desktop img {
    width: 35px !important;
    height: 35px !important;
  }
}


/* =========================
   MODAL: overlay + animation
   ========================= */

.lang-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 27, 33, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

.lang-overlay.is-open,
.lang-overlay.is-closing {
  visibility: visible;
  pointer-events: auto;
  transition: opacity 240ms ease, visibility 0s linear 0s;
}

.lang-overlay.is-open { opacity: 1; }
.lang-overlay.is-closing { opacity: 0; }

body.lang-modal-open { overflow: hidden; }

/* Panel */
.lang-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 392px;
  max-width: 92vw;
  height: 100%;
  background: var(--lang-bg);
  box-shadow: var(--lang-shadow);
  border-left: 1px solid var(--lang-border);
  transform: translateX(110%);
  transition: transform 380ms cubic-bezier(.22, 1, .36, 1);
  padding: 18px 18px 16px;
  overflow-y: auto;
}

.lang-overlay.is-open .lang-panel { transform: translateX(0); }
.lang-overlay.is-closing .lang-panel { transform: translateX(110%); }

@media (max-width: 575px) {
  .lang-panel {
    width: 100%;
    max-width: 100%;
    padding: 16px 14px 14px;
  }
}

/* =========================
   MODAL: header
   ========================= */

.lang-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
}

.lang-panel__title-wrap {
  min-width: 0;
}

.lang-panel__logo {
  height: 22px;
  width: auto;
  display: block;
  margin: 2px 0 10px;
}

.lang-panel__title {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  color: var(--lang-text);
  margin: 0;
}

.lang-panel__underline {
  height: 3px;
  width: 148px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--lang-accent);
}

/* Close button */
.lang-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--lang-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
  color: var(--lang-text);
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 200ms ease, background-color 200ms ease, border-color 200ms ease;
}

.lang-close:hover {
  background: rgba(255,255,255,0.9);
  border-color: rgba(17, 27, 33, 0.16);
  transform: translateY(-1px);
}

/* =========================
   MODAL: list items
   ========================= */

.lang-list {
  list-style: none;
  padding: 12px 0 0;
  margin: 0;
}

.lang-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto 22px;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid var(--lang-border);
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  border-radius: 14px;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.lang-list > li + li { margin-top: 10px; }

.lang-item:hover {
  background: rgba(248, 245, 253, 0.9); /* lavender-ish */
  border-color: rgba(147, 112, 219, 0.25);
  box-shadow: 0 10px 28px rgba(17, 27, 33, 0.10);
  transform: translateY(-1px);
}

.lang-item:active { transform: translateY(0); }

.lang-flag {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  display: block;
  object-fit: cover;
  background: rgba(17, 27, 33, 0.06);
  border: 1px solid rgba(17, 27, 33, 0.08);
}

.lang-name-en {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--lang-text);
}

.lang-name-native {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--lang-muted);
  justify-self: end;
  white-space: nowrap;
}

.lang-check {
  justify-self: end;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--white, #fff);
  background: var(--lang-accent);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 180ms ease, transform 180ms ease;
}

.lang-item.is-selected {
  border-color: rgba(147, 112, 219, 0.35);
  background: rgba(248, 245, 253, 0.95);
}

.lang-item.is-selected .lang-check {
  opacity: 1;
  transform: scale(1);
}

/* Fix Q&A link spacing - override h-link styles */
@media (min-width: 992px) {
  #header .wsmenu > .wsmenu-list > li > a.h-link {
    padding-left: 24px !important;
    padding-right: 24px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Force original colors for language icon - override color inheritance */
.lang-btn,
.lang-btn--desktop,
.lang-btn--mobile {
  color: transparent !important; /* Don't pass color to child image */
}

.lang-btn img,
.lang-btn--desktop img,
.lang-btn--mobile img {
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  /* For SVG specifically */
  color: initial !important;
  fill: currentColor !important;
}

/* If it's an SVG being styled, reset fill */
.lang-btn svg,
.lang-btn--desktop svg,
.lang-btn--mobile svg {
  fill: none !important;
  color: initial !important;
}

/* Match the original "blob + icon" look (like feature #1) */
.fbox-ico.ico-60 {
  --shape-w: 187.32px;  /* 93.66 * 2 */
  --shape-h: 174.10px;  /* 87.05 * 2 */
  --icon-size: 104px;   /* 52 * 2 */
}


.fbox-ico.ico-60 .shape-ico {
  position: relative;
  width: var(--shape-w);
  height: var(--shape-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fbox-ico.ico-60 .shape-ico svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.fbox-ico.ico-60 .shape-ico .fbox-img-ico,
.fbox-ico.ico-60 .shape-ico > span[class^="flaticon-"] {
  position: relative;
  z-index: 2;
  width: var(--icon-size);
  height: var(--icon-size);
  display: block;
}

.fbox-ico.ico-60 .shape-ico .fbox-img-ico {
  object-fit: contain;
  pointer-events: none;
}

/* /css/custom.css (or the last CSS file you load) */
a.btn .flaticon-download-file {
  display: inline-block;          /* required so transform applies reliably */
  transform: translateY(3px);     /* tweak: 1px–3px */
}
