/* ===========================================================
   Truth Computing — primary tab bar (shared across all pages)
   Loaded after each page's inline <style> so these rules win ties.
   Markup lives in every page as <nav class="tabs" id="siteTabs">.
   =========================================================== */

.tabs {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  height: var(--bar-h, 58px); z-index: 50;
  display: flex; align-items: center;
  max-width: calc(100vw - 300px);
}

/* The rail scrolls rather than colliding with the wordmark on narrow desktops. */
.tabs-rail {
  display: flex; align-items: center;
  padding: 11px 0; white-space: nowrap;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.tabs-rail::-webkit-scrollbar { display: none; }

.tab {
  position: relative; flex: none; margin: 0 8px;
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em; line-height: 1;
  color: var(--ink); opacity: 0.58;
  transition: opacity 200ms ease, color 300ms ease;
}
.tab:hover { opacity: 1; }
.tab[aria-current="page"] { opacity: 1; }
.tab[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px;
  height: 1.5px; border-radius: 1px; background: var(--accent);
}

/* Booking sits at the end of the rail as a pill — the one action, not a page. */
.tab--book {
  margin-left: 14px; padding: 7px 15px;
  border-radius: 999px; opacity: 1;
  background: var(--ink); color: var(--bg);
  transition: opacity 200ms ease, background 300ms ease, color 300ms ease;
}
.tab--book:hover { opacity: 0.82; }

/* --- Horizontal expand / collapse -------------------------------------
   nav.js measures the group and sets max-width in px, so the easing lands
   exactly on the content width instead of a guessed maximum. */
.tabs-more {
  flex: none; overflow: hidden; max-width: 0;
  transition: max-width 520ms cubic-bezier(0.16, 0.84, 0.3, 1);
}
.tabs-more-inner {
  width: max-content;
  display: flex; align-items: center;
}

/* Contents fade + slide in behind the widening edge. */
.tabs-more-inner .tab {
  opacity: 0; transform: translateX(-8px);
  transition: opacity 240ms ease, transform 380ms cubic-bezier(0.16, 0.84, 0.3, 1);
}
.tabs.is-open .tabs-more-inner .tab { opacity: 0.58; transform: none; }
.tabs.is-open .tabs-more-inner .tab:hover,
.tabs.is-open .tabs-more-inner .tab[aria-current="page"] { opacity: 1; }
.tabs.is-open .tabs-more-inner .tab:nth-child(1) { transition-delay: 90ms; }
.tabs.is-open .tabs-more-inner .tab:nth-child(2) { transition-delay: 130ms; }
.tabs.is-open .tabs-more-inner .tab:nth-child(3) { transition-delay: 170ms; }
.tabs.is-open .tabs-more-inner .tab:nth-child(4) { transition-delay: 210ms; }
.tabs.is-open .tabs-more-inner .tab:nth-child(5) { transition-delay: 250ms; }
.tabs.is-open .tabs-more-inner .tab:nth-child(6) { transition-delay: 290ms; }
.tabs.is-open .tabs-more-inner .tab:nth-child(7) { transition-delay: 330ms; }

/* --- Toggle ----------------------------------------------------------- */
.tabs-toggle {
  flex: none; margin: 0 0 0 10px;
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; line-height: 1;
  color: var(--ink); opacity: 0.42;
  transition: opacity 200ms ease, color 300ms ease;
}
.tabs-toggle:hover, .tabs.is-open .tabs-toggle { opacity: 0.85; }
.tabs-toggle-label { display: inline-block; min-width: 30px; text-align: left; }
.tabs-toggle-chev {
  display: inline-block; width: 7px; height: 7px;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: rotate(-45deg); transform-origin: 60% 60%;
  transition: transform 460ms cubic-bezier(0.16, 0.84, 0.3, 1);
}
.tabs.is-open .tabs-toggle-chev { transform: rotate(135deg); }
/* Current page is hidden inside the collapsed group — mark the toggle. */
.tabs-toggle.has-current::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); transition: opacity 240ms ease;
}
.tabs.is-open .tabs-toggle.has-current::before { opacity: 0; }

/* --- Desktop / mobile handoff (unified across every page) -------------- */
@media (min-width: 1001px) {
  .menu-btn { display: none; }
}
@media (max-width: 1000px) {
  .tabs { display: none; }
  .menu-btn { display: inline-flex; }
}

/* --- Mobile panel: 11 links need to scroll and stagger past 8 ---------- */
.nav-panel-links { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.nav-panel.open .nav-panel-link:nth-child(9)  { transition-delay: 342ms; }
.nav-panel.open .nav-panel-link:nth-child(10) { transition-delay: 376ms; }
.nav-panel.open .nav-panel-link:nth-child(11) { transition-delay: 410ms; }
.nav-panel.open .nav-panel-link:nth-child(12) { transition-delay: 444ms; }
/* Booking is the action, so it reads as one in the panel too. */
.nav-panel-link--book { color: var(--accent); }
@media (max-height: 780px) {
  .nav-panel-link { padding: 11px 0; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .tabs-more, .tabs-more-inner .tab, .tabs-toggle-chev { transition: none !important; }
  .tabs-more-inner .tab { transform: none; }
}
