/**
 * V2 chrome (header/footer) for non-home pages — matches homepage nav language.
 * Loaded with sitewide. Does not depend on Foxiz header markup.
 */

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: 1rem;
  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), var(--xh-amber));
  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);
}
.xh-v2-nav__sub {
  font-size: 0.68rem;
  color: var(--xh-dim);
}

.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);
  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);
  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);
  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);
  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), var(--xh-amber)) !important;
  color: #0a0c12 !important;
  border: none !important;
  white-space: nowrap;
}
.xh-v2-btn:hover {
  filter: brightness(1.05);
  color: #0a0c12 !important;
}

/* 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);
  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: wrap;
  }
  .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;
  }
}

/* —— 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);
  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));
  margin-inline: auto;
}
.xh-v2-footer__brand {
  font-weight: 700;
  color: var(--xh-text);
  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);
  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);
}
.xh-v2-footer__links a:hover {
  color: var(--xh-amber);
}

/* 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);
}

/* Light entity pages with chrome: paper content area */
body.xh-chrome-on.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);
  background: #f7f5f1;
}
body.xh-chrome-on.xh-skin-light .xh-chrome-bg {
  background: #f7f5f1;
}
body.xh-chrome-on.xh-skin-light .xh-v2-nav-shell {
  background: linear-gradient(180deg, rgba(247, 245, 241, 0.96) 45%, rgba(247, 245, 241, 0));
}
body.xh-chrome-on.xh-skin-light .xh-v2-nav {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(11, 18, 32, 0.1);
}
body.xh-chrome-on.xh-skin-light .xh-v2-nav__name {
  color: #0b1220;
}
body.xh-chrome-on.xh-skin-light .xh-v2-nav__links > li > a {
  color: rgba(11, 18, 32, 0.7);
}
body.xh-chrome-on.xh-skin-light .xh-v2-nav__links > li > a:hover {
  color: #0b1220;
  background: rgba(11, 18, 32, 0.05);
}
body.xh-chrome-on.xh-skin-light .xh-v2-nav__links .sub-menu {
  background: #fff;
  border-color: rgba(11, 18, 32, 0.1);
}
body.xh-chrome-on.xh-skin-light .xh-v2-nav__links .sub-menu a {
  color: rgba(11, 18, 32, 0.75);
}
body.xh-chrome-on.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-chrome-on.xh-skin-light .xh-v2-footer__brand {
  color: #0b1220;
}
body.xh-chrome-on.xh-skin-light .xh-v2-footer__links a {
  color: rgba(11, 18, 32, 0.65);
}
