/* © 2026 Nuboc IP LLC. All rights reserved. */

/* =============================================================================
   07. Context Bar — sticky chrome (breadcrumbs + optional module tabs)
   ============================================================================= */

.nax-ctx-chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  background: var(--nax-surface);
}

.nax-ctx-nav {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 20px;
  border-bottom: 1px solid var(--nax-ink-10);
  background: var(--nax-surface);
  gap: 2px;
  flex-shrink: 0;
}

.nax-ctx-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nax-ctx-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 26px;
  font-size: 0.769rem;
  font-weight: 500;
  color: var(--nax-ink-text-2);
  border-radius: var(--nax-r-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background var(--nax-t), color var(--nax-t);
  text-decoration: none;
  white-space: nowrap;
}

.nax-ctx-link:hover {
  background: var(--nax-ink-05);
  color: var(--nax-ink);
  text-decoration: none;
}

.nax-ctx-link--active {
  background: var(--nax-accent-lt);
  color: var(--nax-accent);
}

.nax-ctx-link--active:hover {
  background: var(--nax-accent-lt);
  color: var(--nax-accent-dark);
}

.nax-ctx-sep {
  width: 1px;
  height: 16px;
  background: var(--nax-ink-10);
  margin: 0 4px;
  flex-shrink: 0;
}

.nax-ctx-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* A page's buttons on the breadcrumbs row (content_for :crumb_actions),
   pushed to the right edge. Scrolls sideways rather than overflowing the
   fixed-height row when the screen is too narrow for them. */
.nax-ctx-crumb-actions:has(> .nax-btn, > .nax-guard) {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
  overflow-x: auto;
}

.nax-ctx-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 26px;
  font-size: 0.769rem;
  font-weight: 500;
  color: var(--nax-ink-text-2);
  border-radius: var(--nax-r-sm);
  border: 1px solid var(--nax-ink-20);
  background: var(--nax-surface);
  cursor: pointer;
  transition: all var(--nax-t);
  text-decoration: none;
  white-space: nowrap;
}

.nax-ctx-action:hover {
  background: var(--nax-ink-05);
  color: var(--nax-ink);
  text-decoration: none;
}

.nax-ctx-action--primary {
  background: var(--nax-accent);
  border-color: var(--nax-accent);
  color: #fff;
}

.nax-ctx-action--primary:hover {
  background: var(--nax-accent-dark);
  border-color: var(--nax-accent-dark);
  color: #fff;
}

/* GitLab-style breadcrumb trail (Nax tokens) */
.nax-crumbs {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 0.769rem;
  line-height: 1;
}

.nax-crumbs__list {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  width: 100%;
}

.nax-crumbs__item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 1;
}

/* Prefer truncating middle ancestors before the current crumb */
.nax-crumbs__item:not(.nax-crumbs__item--current) {
  flex-shrink: 2;
}

.nax-crumbs__item--current {
  flex-shrink: 0;
}

.nax-crumbs__sep {
  flex-shrink: 0;
  padding: 0 8px;
  color: var(--nax-ink-30);
  font-weight: 400;
  user-select: none;
}

.nax-crumbs__icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: inherit;
}

.nax-crumbs__link,
.nax-crumbs__current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  height: 26px;
  text-decoration: none;
  white-space: nowrap;
}

.nax-crumbs__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nax-crumbs__link {
  color: var(--nax-ink-text-2);
  font-weight: 500;
  transition: color var(--nax-t);
}

.nax-crumbs__link:hover {
  color: var(--nax-ink);
  text-decoration: none;
}

.nax-crumbs__current {
  color: var(--nax-ink);
  font-weight: 600;
}

/* Legacy alias — settings used nax-ctx-crumbs + chevron seps */
.nax-ctx-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
