/* ── Shared top navbar ─────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  background: rgba(15, 15, 15, 0.94);
  border-bottom: 1px solid #2a2a2a;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  gap: 16px;
}

.topbar__logo {
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s;
  flex-shrink: 0;
  text-decoration: none;
}
.topbar__logo:hover { opacity: 1; }
.topbar__logo img { display: block; }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topbar__nav-link {
  color: #8b8b8b;
  text-decoration: none;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  transition: color 0.15s;
  white-space: nowrap;
}
.topbar__nav-link:hover { color: #c8b89a; }
.topbar__nav-link.active { color: #c8b89a; }

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar__auth {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  color: #8b8b8b;
}

.topbar__auth-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c8b89a;
  box-shadow: 0 0 6px rgba(200,184,154,0.7);
  flex-shrink: 0;
}

.topbar__auth-email {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__auth-tier {
  display: inline-block;
  font-size: 0.58rem;
  font-family: 'Bebas Neue', 'Arial Narrow', Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0f0f0f;
  background: #c8b89a;
  padding: 2px 5px 1px;
  line-height: 1.6;
}

.topbar__signout {
  background: none;
  border: none;
  color: #8b8b8b;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  width: auto;
  transition: color 0.15s;
}
.topbar__signout:hover { color: #c8b89a; }

.topbar__signin {
  display: inline-flex;
  align-items: center;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f0f0f;
  background: #c8b89a;
  text-decoration: none;
  padding: 6px 13px;
  transition: opacity 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.topbar__signin:hover {
  opacity: 0.88;
  box-shadow: 0 0 12px rgba(200,184,154,0.3);
}

.topbar__github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d8d0c2;
  border: 1px solid #5a5448;
  padding: 5px 11px;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.topbar__github:hover { color: #c8b89a; border-color: #c8b89a; background: rgba(200,184,154,0.08); }
.topbar__github svg {
  width: 17px; height: 17px;
  fill: currentColor;
}

/* If the bar's contents are wider than the screen, scroll sideways instead of
   clipping or wrapping. Children keep their natural width. */
.topbar {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.topbar::-webkit-scrollbar { display: none; }
.topbar > * { flex-shrink: 0; }

@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar__nav-link { display: none !important; }
  .topbar__nav-link.active { display: block !important; }
  .topbar__auth-email { max-width: 90px; }
  .topbar__github-label { display: none; }
  .topbar__github { padding: 6px; }
  .topbar__right { gap: 8px; }
  .topbar__nav-link { padding: 5px 4px; }
  .topbar__live { margin-left: 5px; }
}

/* ── Share ─────────────────────────────────────────────────────────────── */
.share-wrap { position: relative; display: inline-flex; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #c8b89a;
  color: #0a0a0a;
  border: 1px solid #c8b89a;
  border-radius: 999px;
  padding: 7px 18px;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  animation: share-glow 2.8s ease-in-out infinite;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.share-btn:hover { background: #e0d2b4; border-color: #e0d2b4; transform: translateY(-1px); animation: none; box-shadow: 0 0 18px rgba(200,184,154,0.55); }
@keyframes share-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,184,154,0.0), 0 0 8px rgba(200,184,154,0.25); }
  50%      { box-shadow: 0 0 0 4px rgba(200,184,154,0.12), 0 0 16px rgba(200,184,154,0.5); }
}
@media (prefers-reduced-motion: reduce) { .share-btn { animation: none; } }
.share-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share-pop {
  /* fixed (positioned by share.js) so the scrolling topbar can't clip it */
  position: fixed;
  top: 54px;
  right: 12px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  background: #141414;
  border: 1px solid #333;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.share-pop[hidden] { display: none; }
.share-opt {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #222;
  color: #d8d0c2;
  padding: 10px 14px;
  text-align: left;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
}
.share-opt:last-child { border-bottom: 0; }
.share-opt:hover { background: #1f1f1f; color: #c8b89a; }

/* Live badge inside the "Latest Issue" nav link (shown on every page) */
.topbar__live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 7px;
  padding: 2px 6px;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: #c8b89a;
  border: 1px solid rgba(200,184,154,0.3);
  background: rgba(200,184,154,0.07);
  vertical-align: 1px;
}
.topbar__live-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #c8b89a;
  animation: topbar-live-pulse 2.2s ease-in-out infinite;
}
@keyframes topbar-live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Admin-only toggle on preview.html (published issue <-> newest run) */
.topbar__debug {
  display: none;
  font-family: 'Menlo', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c8b89a;
  background: none;
  border: 1px solid #c8b89a;
  border-radius: 3px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.topbar__debug:hover { background: rgba(200,184,154,0.12); }
.topbar__debug[aria-pressed="true"] { background: #c8b89a; color: #0f0f0f; }

@media (max-width: 600px) {
  .share-btn { padding: 6px 12px; font-size: 0.72rem; }
  .topbar__signin { padding: 6px 10px; font-size: 0.68rem; }
  .topbar__live { padding: 2px 5px; }
}
