/* Hehel-like shell chrome for Forgejo navbar */

#navbar.he-navbar {
  display: block;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.he-topbar {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--he-line, #2a2a31);
  background: linear-gradient(180deg, #16161c 0%, #121218 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.he-topbar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: nowrap;
  width: 100%;
  padding: 0.65rem 1.25rem;
}

.he-mascot {
  width: clamp(72px, 7vw, 104px);
  height: clamp(72px, 7vw, 104px);
  padding: 0;
  flex: none;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.he-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.he-mascot:hover { opacity: 0.92; }

.he-head-search {
  position: relative;
  flex: 0 1 28rem;
  width: min(36rem, 52vw);
  min-width: 10rem;
}
.he-head-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--he-cyan, #3ec6ff);
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 0 6px rgba(62, 198, 255, 0.35));
}
.he-head-search input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 40px;
  border-radius: 10px;
  background: #0c0c10;
  border: 1px solid #2a2a34;
  outline: none;
  color: var(--he-text, #ececef);
  font: inherit;
}
.he-head-search input::placeholder { color: var(--he-muted, #b4b4c0); }
.he-head-search input:focus {
  border-color: var(--he-cyan-2, #1aa3e0);
  box-shadow: 0 0 0 3px var(--he-cyan-dim, rgba(62, 198, 255, 0.12));
}
.he-head-search:focus-within .he-head-search-icon { color: #7ddcff; opacity: 1; }
.he-head-search:focus-within .he-head-search-kbd,
.he-head-search.has-value .he-head-search-kbd {
  opacity: 0;
  pointer-events: none;
}
.he-head-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.he-head-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--he-nsfw, #f07178);
  cursor: pointer;
}
.he-head-search-clear[hidden] { display: none; }
.he-head-search-clear:hover { background: rgba(240, 113, 120, 0.14); }
.he-head-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--he-line-2, #35353e);
  background: var(--he-bg-4, #1e1e23);
  color: var(--he-muted, #b4b4c0);
  font: 600 11px/1 var(--he-mono, ui-monospace, monospace);
  pointer-events: none;
}

.he-lang-switch {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid #3a3428;
  border-radius: 10px;
  background: #1a1814;
  flex: 0 0 auto;
}
.he-lang-current {
  height: 34px;
  padding: 0 10px;
  color: #e6c36a;
  font-weight: 650;
  letter-spacing: 0.04em;
  font-size: 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.he-lang-toggle {
  width: 28px;
  color: #c4a45a;
  border: 0;
  border-left: 1px solid #3a3428;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.he-lang-toggle:hover,
.he-lang-current:hover { background: #241f18; }
.he-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #1c1c22;
  border: 1px solid var(--he-line-2, #35353e);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--he-shadow, 0 8px 28px rgba(0, 0, 0, 0.35));
  z-index: 60;
}
.he-lang-menu[hidden] { display: none; }
.he-lang-menu a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--he-muted, #b4b4c0);
  text-decoration: none;
}
.he-lang-menu a:hover {
  background: var(--he-bg-5, #24242a);
  color: var(--he-text, #ececef);
}

.he-nav-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 0.25rem;
}
.he-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--he-muted, #b4b4c0) !important;
  background: transparent;
}
.he-tool-btn:hover {
  background: var(--he-cyan-dim, rgba(62, 198, 255, 0.12));
  color: var(--he-cyan, #3ec6ff) !important;
}

.he-ctx-menu {
  position: fixed;
  z-index: 10000;
  min-width: 200px;
  max-width: 280px;
  background: var(--he-bg-3, #19191d);
  border: 1px solid var(--he-line, #2a2a31);
  border-radius: 6px;
  padding: 4px;
  box-shadow: var(--he-shadow, 0 8px 28px rgba(0, 0, 0, 0.35));
}
.he-ctx-menu[hidden] { display: none; }
.he-ctx-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--he-text, #ececef);
  font-size: 13px;
  text-decoration: none;
}
.he-ctx-menu a:hover {
  background: var(--he-cyan-dim, rgba(62, 198, 255, 0.12));
  color: var(--he-cyan, #3ec6ff);
}
.he-ctx-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--he-line, #2a2a31);
}

.he-navbar-legacy[hidden] { display: none !important; }

/* Homepage hero uses Lilithveil mascot */
.page-content.home .logo,
.home img.logo {
  width: min(220px, 42vw);
  height: auto;
  object-fit: contain;
}

@media (max-width: 760px) {
  .he-topbar-toolbar {
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
  }
  .he-mascot {
    width: 64px;
    height: 64px;
  }
  .he-head-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  .he-lang-switch { display: none; }
}
