/* THE public top bar — ONE bar for every logged-out page.

   2026-07-22: the owner screenshotted five public pages and got five different
   banners — different nav items, different CTAs, four pages with no signup route
   at all, three separate CSS systems. This is the agreed design, taken from
   /analyses/latest: back pill, wordmark, section nav, Sign in + Create free
   account.

   Class prefix is `pubbar-`, NOT `tpx-topbar-`, deliberately: transcript_public.css
   and review_detail_v4.css still define the old `.tpx-topbar` rules and pages load
   them in varying order. A fresh namespace means this bar cannot be half-overridden
   by whichever sheet happens to come last.

   Self-contained: every token carries a fallback, so a page with its own palette
   can link this file without dragging in a design system. */

.pubbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #fff;
  border-bottom: 1px solid var(--pubbar-line, #e7e1d3);
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
/* The bar's contents align with the PAGE CONTENT below it, not with some fixed
   width of their own. /analyses/latest is 1560px wide but most pages are 760-1180,
   and a bar pinned to 1560 left the back button and wordmark floating well outside
   the column they belong to (owner, 2026-07-22).

   Each page sets these two vars to its own wrap; the defaults match
   /analyses/latest, the widest surface. */
.pubbar-in {
  max-width: var(--pubbar-max, 1560px);
  margin: 0 auto;
  padding: 0 var(--pubbar-pad, 28px);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Back pill. Rendered only when the page passes a destination, so it never
   points somewhere the visitor has not been. */
.pubbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--pubbar-line, #e7e1d3);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pubbar-ink, #0F2A2E);
  text-decoration: none;
  white-space: nowrap;
}
.pubbar-back:hover { border-color: var(--pubbar-green, #1f7a5c); }

.pubbar-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--pubbar-ink, #0F2A2E);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.pubbar-brand em { font-style: normal; color: var(--pubbar-green, #1f7a5c); }

.pubbar-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}
.pubbar-nav a {
  color: var(--pubbar-muted, #5c6b66);
  text-decoration: none;
  display: inline-block;
  transition: color .12s, transform .12s ease;
}
.pubbar-nav a:hover { color: var(--pubbar-ink, #0F2A2E); transform: translateY(-2px); }
/* The current section reads as the anchor, not as another destination. */
.pubbar-nav a[aria-current="page"] { color: var(--pubbar-ink, #0F2A2E); font-weight: 600; }

.pubbar-cta { display: flex; align-items: center; gap: 12px; }
.pubbar-signin {
  font-size: 14px;
  color: var(--pubbar-muted, #5c6b66);
  text-decoration: none;
  white-space: nowrap;
}
.pubbar-signin:hover { color: var(--pubbar-ink, #0F2A2E); }
.pubbar-join {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--pubbar-green, #1f7a5c);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  white-space: nowrap;
}
.pubbar-join:hover { background: var(--pubbar-green-hover, #186349); }

.pubbar-back:focus-visible,
.pubbar-brand:focus-visible,
.pubbar-nav a:focus-visible,
.pubbar-signin:focus-visible,
.pubbar-join:focus-visible {
  outline: 2px solid var(--pubbar-green, #1f7a5c);
  outline-offset: 2px;
}

/* Shed in order of expendability: nav first, then the wordmark, then the muted
   Sign in link. The BACK control and the JOIN button always survive — they are
   the two things a stranded visitor actually needs. */
@media (max-width: 1040px) { .pubbar-nav { display: none; } }
@media (max-width: 620px)  { .pubbar-brand { display: none; } }
@media (max-width: 460px) {
  .pubbar-signin { display: none; }
  .pubbar-in { padding: 0 14px; gap: 10px; height: 56px; }
  .pubbar-back { padding: 8px 11px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .pubbar-nav a { transition: color .12s; }
  .pubbar-nav a:hover { transform: none; }
}
