/**
 * V2 chrome (header/footer) for non-home pages — matches homepage nav language.
 * Loaded with sitewide. Does not depend on Foxiz header markup.
 *
 * FOUC note (cannot edit functions.php from this agent):
 * Prefer early inline before paint in PHP:
 *   <script>(function(){try{var m=document.cookie.match(/(?:^|;\s*)xh_skin=([^;]+)/);
 *   var s=m?decodeURIComponent(m[1]):localStorage.getItem('xh_skin');
 *   if(s==='light'||s==='dark')document.documentElement.classList.add('xh-skin-'+s);
 *   }catch(e){}})();</script>
 * Body classes still come from PHP reading cookie xh_skin.
 */

body.xh-chrome-on {
  --xh-bg: #06080f;
  --xh-text: #f4f1ea;
  --xh-muted: rgba(244, 241, 234, 0.72);
  --xh-dim: rgba(244, 241, 234, 0.58);
  --xh-line: rgba(255, 255, 255, 0.1);
  --xh-amber: #f0b429;
  --xh-amber-2: #ffc857;
  --xh-elev: rgba(255, 255, 255, 0.045);
  --xh-max: 1120px;
  --xh-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --xh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--xh-bg);
  color: var(--xh-text);
  font-family: var(--xh-font);
}

body.xh-chrome-on .xh-chrome-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 8% -8%, rgba(240, 180, 41, 0.1), transparent 58%),
    radial-gradient(900px 560px at 92% 8%, rgba(88, 140, 255, 0.12), transparent 52%),
    var(--xh-bg);
}

body.xh-chrome-on .site-outer.xh-chrome {
  background: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.xh-chrome-on .xh-chrome-main {
  flex: 1;
  width: min(100% - 2rem, var(--xh-max));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  background: transparent !important;
}

/* Kill residual Foxiz header/footer if a plugin injects them */
body.xh-chrome-on .header-wrap,
body.xh-chrome-on .navbar-outer,
body.xh-chrome-on #site-header,
body.xh-chrome-on .site-header,
body.xh-chrome-on .header-mobile-wrap,
body.xh-chrome-on .top-site-ad,
body.xh-chrome-on .footer-wrap,
body.xh-chrome-on .site-footer,
body.xh-chrome-on .footer-etemplate {
  display: none !important;
}

/* —— Nav (parity with home V2) —— */
.xh-v2-nav-shell {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 0.85rem 0 0;
  background: linear-gradient(180deg, rgba(6, 8, 15, 0.94) 40%, rgba(6, 8, 15, 0));
}
html.xh-scrolled .xh-v2-nav-shell {
  background: linear-gradient(180deg, rgba(6, 8, 15, 0.98) 55%, rgba(6, 8, 15, 0.75));
}
body.admin-bar .xh-v2-nav-shell {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .xh-v2-nav-shell {
    top: 46px;
  }
}

.xh-v2-wrap {
  width: min(100% - 2rem, var(--xh-max));
  margin-inline: auto;
}

.xh-v2-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.xh-v2-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none !important;
  color: inherit;
  min-width: 0;
}
.xh-v2-nav__mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0a0c12;
  background: linear-gradient(145deg, var(--xh-amber-2, #ffc857), var(--xh-amber, #f0b429));
  flex-shrink: 0;
}
.xh-v2-nav__text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.15;
  min-width: 0;
}
.xh-v2-nav__name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  color: var(--xh-text, #f4f1ea);
}
.xh-v2-nav__sub {
  font-size: 0.68rem;
  color: var(--xh-dim, rgba(244, 241, 234, 0.58));
}

.xh-v2-nav__links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.xh-v2-nav__links > li {
  list-style: none;
  position: relative;
  margin: 0;
}

.xh-v2-nav__links > li > a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--xh-muted, rgba(244, 241, 234, 0.72));
  text-decoration: none !important;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.xh-v2-nav__links > li > a:hover,
.xh-v2-nav__links > li.current-menu-item > a,
.xh-v2-nav__links > li.current-menu-ancestor > a {
  color: var(--xh-text, #f4f1ea);
  background: rgba(255, 255, 255, 0.06);
}

.xh-v2-nav__links > li.menu-item-has-children > a::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  margin-left: 0.15rem;
}

/* Dropdown */
.xh-v2-nav__links .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 240px;
  max-width: min(320px, 90vw);
  margin: 0;
  padding: 0.45rem;
  list-style: none;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 18, 32, 0.97);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  z-index: 80;
}
.xh-v2-nav__links > li:hover > .sub-menu,
.xh-v2-nav__links > li:focus-within > .sub-menu,
.xh-v2-nav__links > li.is-open > .sub-menu {
  display: block;
}
.xh-v2-nav__links .sub-menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--xh-muted, rgba(244, 241, 234, 0.72));
  text-decoration: none !important;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: normal;
}
.xh-v2-nav__links .sub-menu a:hover {
  color: var(--xh-text, #f4f1ea);
  background: rgba(240, 180, 41, 0.12);
}

.xh-v2-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem !important;
  border-radius: 999px !important;
  font-size: 0.82rem !important;
  font-weight: 650 !important;
  text-decoration: none !important;
  background: linear-gradient(180deg, var(--xh-amber-2, #ffc857), var(--xh-amber, #f0b429)) !important;
  color: #0a0c12 !important;
  border: none !important;
  white-space: nowrap;
}
.xh-v2-btn:hover {
  filter: brightness(1.05);
  color: #0a0c12 !important;
}

/* End cluster: tools + hamburger (always visible on mobile) */
.xh-v2-nav__end {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}
.xh-v2-nav__end .xh-v2-nav__toggle {
  margin-left: 0;
}
.xh-v2-nav__end .xh-nav-tools {
  margin-left: 0;
}

/* Mobile */
.xh-v2-nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--xh-text, #f4f1ea);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.xh-v2-nav__toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.xh-v2-nav__toggle span::before,
.xh-v2-nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
}
.xh-v2-nav__toggle span::before { top: -5px; }
.xh-v2-nav__toggle span::after { top: 5px; }

@media (max-width: 900px) {
  .xh-v2-nav__sub { display: none; }
  .xh-v2-nav__toggle { display: inline-flex; }
  .xh-v2-nav__links {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.55rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 14, 24, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
  .xh-v2-nav.is-open .xh-v2-nav__links {
    display: flex;
  }
  .xh-v2-nav {
    position: relative;
    flex-wrap: nowrap;
  }
  .xh-v2-nav__links .sub-menu {
    position: static;
    display: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.03);
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
  }
  .xh-v2-nav__links > li.is-open > .sub-menu {
    display: block;
  }
  /* Tools stay in __end on mobile (not buried in drawer) when markup places them there */
  .xh-v2-nav__end {
    gap: 0.35rem;
  }
}

/* —— Footer —— */
.xh-v2-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding: 2rem 0 2.5rem;
  margin-top: auto;
  background: rgba(0, 0, 0, 0.25);
  color: var(--xh-dim, rgba(244, 241, 234, 0.58));
  font-size: 0.9rem;
}
.xh-v2-footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  width: min(100% - 2rem, var(--xh-max, 1120px));
  margin-inline: auto;
}
.xh-v2-footer__brand {
  font-weight: 700;
  color: var(--xh-text, #f4f1ea);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.xh-v2-footer p {
  margin: 0.25rem 0;
  line-height: 1.5;
}
.xh-v2-footer a {
  color: var(--xh-amber, #f0b429);
  text-decoration: none;
}
.xh-v2-footer a:hover {
  text-decoration: underline;
}
.xh-v2-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  align-items: flex-start;
  font-size: 0.86rem;
}
.xh-v2-footer__links a {
  color: var(--xh-muted, rgba(244, 241, 234, 0.72));
}
.xh-v2-footer__links a:hover {
  color: var(--xh-amber, #f0b429);
}

/* Content readability under chrome (dark pages) */
body.xh-chrome-on.xh-skin-dark .xh-chrome-main,
body.xh-chrome-on.xh-skin-dark .xh-chrome-main h1,
body.xh-chrome-on.xh-skin-dark .xh-chrome-main h2,
body.xh-chrome-on.xh-skin-dark .xh-chrome-main h3 {
  color: var(--xh-text);
}
body.xh-chrome-on.xh-skin-dark .xh-chrome-main a:not(.xh-v2-btn):not(.elementor-button) {
  color: var(--xh-amber);
}

/* —— Nav tools: skin switcher + GTranslate —— */
.xh-nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.35rem;
  flex-shrink: 0;
}
.xh-nav-tools__skin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.38rem 0.75rem;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f4f1ea;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  line-height: 1;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.12);
  -webkit-appearance: none;
  appearance: none;
}
.xh-nav-tools__skin:hover,
.xh-nav-tools__skin:focus-visible {
  border-color: rgba(240, 180, 41, 0.55);
  color: #ffc857;
  background: rgba(240, 180, 41, 0.14);
  outline: none;
}
.xh-nav-tools__skin-icon {
  font-size: 0.95rem;
  line-height: 1;
  min-width: 1em;
  text-align: center;
}
.xh-nav-tools__skin-txt {
  letter-spacing: 0.01em;
}
.xh-nav-tools__lang {
  display: inline-flex;
  align-items: center;
  max-width: 9.5rem;
}
.xh-nav-tools__lang .gtranslate_wrapper,
.xh-nav-tools__lang .gt_container,
.xh-nav-tools__lang .gt_selector,
.xh-nav-tools__lang select {
  font-size: 0.75rem !important;
  max-width: 100%;
}
.xh-nav-tools__lang a,
.xh-nav-tools__lang .glink {
  color: rgba(244, 241, 234, 0.85) !important;
  text-decoration: none !important;
  font-size: 0.75rem !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.25rem;
}
.xh-nav-tools__lang img {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  vertical-align: middle;
}
.xh-nav-tools__lang select,
.xh-nav-tools__lang .gt_selector {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f4f1ea !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 8px;
  padding: 0.25rem 0.35rem;
}

/* Hide plugin floating selector — we host in nav */
body .gt_float_switcher:not(.xh-nav-tools .gt_float_switcher),
body > .gt_float_switcher,
body > #gt_float_wrapper,
#gt_float_wrapper {
  display: none !important;
}

/* Tools sit in menu list item */
.xh-v2-nav__links > li.menu-item-tools {
  list-style: none;
  display: flex;
  align-items: center;
  margin-left: 0.25rem;
}
.xh-v2-nav__links > li.menu-item-tools > .xh-nav-tools {
  margin-left: 0;
}

@media (max-width: 900px) {
  .xh-v2-nav__links > li.menu-item-tools {
    width: 100%;
    margin: 0.5rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  body.xh-skin-light .xh-v2-nav__links > li.menu-item-tools {
    border-top-color: rgba(11, 18, 32, 0.08);
  }
  .xh-v2-nav__links > li.menu-item-tools .xh-nav-tools {
    width: 100%;
    justify-content: space-between;
  }
}

/* Home v2-nav tools alignment */
.v2-nav__links .xh-nav-tools {
  margin-left: 0.5rem;
}

/* Compact tools on small screens — keep skin label readable */
@media (max-width: 560px) {
  .xh-nav-tools {
    gap: 0.3rem;
  }
  .xh-nav-tools__skin {
    padding: 0.36rem 0.55rem;
    min-height: 34px;
    font-size: 0.72rem;
  }
  .xh-nav-tools__lang {
    max-width: 6.5rem;
  }
}

/* GTranslate flags row after JS hydrate */
.xh-nav-tools__lang .gtranslate_wrapper a,
.xh-nav-tools__lang .gtranslate_wrapper .gt-current-lang,
.xh-nav-tools__lang .gtranslate_wrapper span {
  color: inherit !important;
}
.xh-nav-tools__lang .gtranslate_wrapper {
  display: inline-flex !important;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

/* ============================================================
   LIGHT SKIN — chrome + shared V2 nav (home + child pages)
   Selectors use body.xh-skin-light (not only .xh-chrome-on)
   so home.xh-home-v2 and chrome pages both get readable chrome.
   ============================================================ */
body.xh-skin-light.xh-chrome-on,
body.xh-home-v2.xh-skin-light {
  --xh-bg: #f7f5f1;
  --xh-text: #0b1220;
  --xh-muted: rgba(11, 18, 32, 0.72);
  --xh-dim: rgba(11, 18, 32, 0.55);
  --xh-line: rgba(11, 18, 32, 0.1);
  --xh-elev: rgba(11, 18, 32, 0.04);
}

body.xh-chrome-on.xh-skin-light {
  background: #f7f5f1;
  color: #0b1220;
}
body.xh-chrome-on.xh-skin-light .xh-chrome-bg {
  background:
    radial-gradient(900px 500px at 10% -5%, rgba(240, 180, 41, 0.08), transparent 55%),
    #f7f5f1;
}

/* Home paper base when light (shared chrome nav) */
body.xh-home-v2.xh-skin-light {
  color: #0b1220;
  background-color: #f7f5f1;
}

/* Nav shell / bar */
body.xh-skin-light .xh-v2-nav-shell {
  background: linear-gradient(180deg, rgba(247, 245, 241, 0.97) 45%, rgba(247, 245, 241, 0));
}
/* .xh-scrolled is toggled on <html> */
html.xh-scrolled body.xh-skin-light .xh-v2-nav-shell {
  background: linear-gradient(180deg, rgba(247, 245, 241, 0.99) 55%, rgba(247, 245, 241, 0.85));
}

body.xh-skin-light .xh-v2-nav {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(11, 18, 32, 0.12);
  box-shadow: 0 8px 28px rgba(11, 18, 32, 0.06);
}
body.xh-skin-light .xh-v2-nav__name {
  color: #0b1220;
}
body.xh-skin-light .xh-v2-nav__sub {
  color: rgba(11, 18, 32, 0.55);
}
body.xh-skin-light .xh-v2-nav__links > li > a {
  color: rgba(11, 18, 32, 0.72);
}
body.xh-skin-light .xh-v2-nav__links > li > a:hover,
body.xh-skin-light .xh-v2-nav__links > li.current-menu-item > a,
body.xh-skin-light .xh-v2-nav__links > li.current-menu-ancestor > a {
  color: #0b1220;
  background: rgba(11, 18, 32, 0.06);
}
body.xh-skin-light .xh-v2-nav__links .sub-menu {
  background: #fff;
  border-color: rgba(11, 18, 32, 0.1);
  box-shadow: 0 16px 40px rgba(11, 18, 32, 0.12);
}
body.xh-skin-light .xh-v2-nav__links .sub-menu a {
  color: rgba(11, 18, 32, 0.78);
}
body.xh-skin-light .xh-v2-nav__links .sub-menu a:hover {
  color: #0b1220;
  background: rgba(240, 180, 41, 0.14);
}
body.xh-skin-light .xh-v2-nav__toggle {
  border-color: rgba(11, 18, 32, 0.14);
  background: rgba(11, 18, 32, 0.04);
  color: #0b1220;
}

@media (max-width: 900px) {
  body.xh-skin-light .xh-v2-nav__links {
    background: #fff;
    border-color: rgba(11, 18, 32, 0.1);
    box-shadow: 0 20px 48px rgba(11, 18, 32, 0.12);
  }
  body.xh-skin-light .xh-v2-nav__links .sub-menu {
    background: rgba(11, 18, 32, 0.03);
  }
}

/* Footer light */
body.xh-skin-light .xh-v2-footer {
  background: #efece6;
  border-top-color: rgba(11, 18, 32, 0.08);
  color: rgba(11, 18, 32, 0.6);
}
body.xh-skin-light .xh-v2-footer__brand {
  color: #0b1220;
}
body.xh-skin-light .xh-v2-footer__links a {
  color: rgba(11, 18, 32, 0.65);
}
body.xh-skin-light .xh-v2-footer__links a:hover {
  color: #b45309;
}
body.xh-skin-light .xh-v2-footer a {
  color: #b45309;
}

/* Skin control + GTranslate in light mode */
body.xh-skin-light .xh-nav-tools__skin {
  border-color: rgba(11, 18, 32, 0.18);
  background: #fff;
  color: #0b1220;
  box-shadow: 0 1px 3px rgba(11, 18, 32, 0.08);
}
body.xh-skin-light .xh-nav-tools__skin:hover,
body.xh-skin-light .xh-nav-tools__skin:focus-visible {
  border-color: rgba(217, 119, 6, 0.5);
  color: #b45309;
  background: rgba(240, 180, 41, 0.16);
}
body.xh-skin-light .xh-nav-tools__lang a,
body.xh-skin-light .xh-nav-tools__lang .glink,
body.xh-skin-light .xh-nav-tools__lang .gtranslate_wrapper a,
body.xh-skin-light .xh-nav-tools__lang .gtranslate_wrapper span {
  color: rgba(11, 18, 32, 0.8) !important;
}
body.xh-skin-light .xh-nav-tools__lang select,
body.xh-skin-light .xh-nav-tools__lang .gt_selector,
body.xh-skin-light .xh-nav-tools__lang .gt-selected {
  background: #fff !important;
  color: #0b1220 !important;
  border-color: rgba(11, 18, 32, 0.16) !important;
}

/* Chrome main content on light pages */
body.xh-chrome-on.xh-skin-light .xh-chrome-main,
body.xh-chrome-on.xh-skin-light .xh-chrome-main h1,
body.xh-chrome-on.xh-skin-light .xh-chrome-main h2,
body.xh-chrome-on.xh-skin-light .xh-chrome-main h3 {
  color: #0b1220;
}
body.xh-chrome-on.xh-skin-light .xh-chrome-main a:not(.xh-v2-btn):not(.elementor-button) {
  color: #b45309;
}
