/* ==========================================================================
   Shared top bar: the three sites' names, and the theme toggle.

   Identical copies live in Dashboard/css and Games/css - tools/check_tokens.py fails
   when they differ. It replaced a floating theme button that sat over the content.
   ========================================================================== */

.site-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--site-bar-height);
  padding: 0 var(--space-5);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.site-brand:hover {
  color: var(--text-primary);
}

.site-mono {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--on-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-chip);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-chip);
}

.icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.site-brand:focus-visible,
.site-nav a:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid var(--highlight-color);
  outline-offset: 2px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

@media (max-width: 560px) {
  .site-bar {
    gap: 6px;
    padding: 0 12px;
  }

  .site-name {
    display: none;
  }

  .site-nav a {
    padding: 6px 10px;
  }
}
