/* ═══════════════════════════════════════════════════════════════════
   ink-ls · Topbar
   Top bar (3 zones), brand link, language dropdown — chrome shared by
   every page that extends Topbar.html.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Topbar ───────────────────────────────────────────────────────────
   Three zones: [brand @ sidebar-width] | [middle flex] | [right]
   Brand zone aligns above the sidebar below. Middle is a per-page slot
   (e.g. Main puts its search + filter strip here). Right holds the
   language picker plus optional login/signup buttons.
   ─────────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: stretch;
  max-width: 100vw;
}

.topbarBrandZone {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: transparent;
}

.topbarBrand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.topbarBrand:hover { text-decoration: none; }

.topbarLogo { width: 30px; height: 30px; object-fit: contain; }

.topbarLabel {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.2px;
}
.topbarLabel .dot  { color: var(--fg-subtle); margin: 0 6px 0 0; }
.topbarLabel .page { color: var(--fg-muted); font-weight: 500; }

.topbarMid {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  gap: 10px;
  overflow: hidden;
}

.topbarRight {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  flex-shrink: 0;
}

.topbarBtn {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: color 0.15s;
  border-radius: 4px;
}
.topbarBtn:hover {
  color: var(--fg);
  background: var(--bg-hover);
  text-decoration: none;
}

.topbar-hamburger { display: none; }

@media (max-width: 900px) {
  .topbarBrandZone {
    width: auto;
    padding: 0 12px;
    border-right: none;
    background: transparent;
  }
  .topbarMid   { padding: 0 10px; }
  .topbarRight { padding: 0 10px; }
  .topbarLabel .page { display: none; }
}

@media (max-width: 480px) {
  .topbarLabel { font-size: 12px; }
  .topbarLogo  { width: 16px; height: 16px; }
}

/* ── Language dropdown ────────────────────────────────────────────── */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.lang-btn:hover { color: var(--fg); background: var(--bg-hover); }

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
}

/* Bridge the hover gap — invisible strip between button and menu so
   the dropdown doesn't close when the cursor crosses the gap. */
.lang-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  display: block;
  opacity: 0;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.1s;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
}
.lang-item:hover  { background: var(--bg-hover); color: var(--fg); }
.lang-item.active { color: var(--accent); background: var(--accent-dim); }

.lang-dropdown:hover .lang-menu { display: block; }
