/* Shared site header for /help/ and /learn/ pages.
   Each page defines its own --max, --bg, --blue, --line, --text, --muted
   CSS variables; this file uses them through var(). Loaded after the
   page's own <style> block so it wins the cascade against any legacy
   inline header rules. */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.top-bar-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 36px;
  height: 36px;
  overflow: hidden;
  flex: none;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}
.top-links a {
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease;
}
.top-links a:hover { color: var(--text); }
.top-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: border-color 160ms ease, color 160ms ease;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--blue);
}
.theme-toggle:focus-visible { border-color: var(--blue); }

@media (max-width: 760px) {
  .top-bar-inner {
    width: min(var(--max), calc(100% - 28px));
    min-height: 64px;
    gap: 14px;
  }
  .top-links {
    gap: 14px;
    font-size: 0.92rem;
  }
  .top-links a.hide-mobile { display: none; }
}
