/* Shared site chrome for the self-contained wiki bundle.

   Reproduces the main portal header — brand + primary navigation + RU/EN toggle
   — from templates/base.html / static/portal/css/site.css, so /wiki/ and every
   sub-page wear the same look and carry the same menu as the rest of the site.
   The markup is built by site-chrome.js; these rules are namespaced under
   `.zh-chrome-*` (with self-contained colours, not the host page's :root vars)
   so they never clash with each wiki page's own styles. */

.zh-chrome {
  --zh-gold: #d4a574;
  --zh-gold-bright: #f4cc98;
  --zh-text: #ccd3dd;
  --zh-text-muted: #8691a0;
  --zh-text-strong: #f1f5fa;
  --zh-border: rgba(255, 255, 255, 0.08);
}

.zh-chrome-header {
  position: relative;
  z-index: 10;
  padding: 16px 0;
}

.zh-chrome-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--zh-border);
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.94), rgba(10, 14, 21, 0.92));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.zh-chrome-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.zh-chrome-mark {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--zh-gold-bright);
  font: 700 0.86rem/1 "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(212, 165, 116, 0.08));
  border: 1px solid rgba(212, 165, 116, 0.34);
}

.zh-chrome-name {
  color: var(--zh-text-strong);
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.zh-chrome-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.zh-chrome-nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--zh-text-muted);
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.95rem;
  transition: 180ms ease;
}

.zh-chrome-nav-link:hover,
.zh-chrome-nav-link.is-active {
  color: var(--zh-gold-bright);
  border-color: rgba(212, 165, 116, 0.28);
  background: rgba(212, 165, 116, 0.08);
}

.zh-chrome-lang {
  display: inline-flex;
  gap: 8px;
}

.zh-chrome-lang-pill {
  min-width: 50px;
  padding: 8px 12px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--zh-border);
  color: var(--zh-text-muted);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: 180ms ease;
}

.zh-chrome-lang-pill.is-active,
.zh-chrome-lang-pill:hover {
  color: var(--zh-gold-bright);
  border-color: rgba(212, 165, 116, 0.45);
  background: rgba(212, 165, 116, 0.1);
}

/* One visible language control per page: the shared header's RU/EN toggle
   drives each page's own switch, so hide that native switch once the header is
   injected. Gated on `zh-chrome-ready` so the native switch stays usable if the
   script never runs. */
html.zh-chrome-ready .hero > .lang-switch,
html.zh-chrome-ready .lang-bar {
  display: none !important;
}

@media (max-width: 1080px) {
  .zh-chrome-inner {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 28px;
  }

  .zh-chrome-nav {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .zh-chrome-inner {
    padding: 12px;
  }
}
