/* Redwood navigation — the horizontal tab bar and the vertical navigation list.
 *
 * Like redwood-cards.css this adds no color and no scale step: every value is a
 * token, read out of the JET 19.0.0 Redwood theme (oj-tab-bar and
 * oj-navigation-list, --oj-tab-bar-* and --oj-navigation-list-*) and mapped onto
 * the --rw-* names. The one raw length is the 3px selection indicator, a
 * structural width of the same kind as a card's 1px border.
 *
 * Load after redwood-tokens.css (and redwood-dark.css if you use it).
 *
 *   <nav class="rw-tabbar" role="tablist">
 *     <button class="rw-tab" role="tab" aria-selected="true">Invoices</button>
 *     <button class="rw-tab" role="tab" aria-selected="false">Bills</button>
 *   </nav>
 *
 *   <nav class="rw-navlist">
 *     <a class="rw-nav-item" aria-current="page"><svg/>Overview</a>
 *     <a class="rw-nav-item"><svg/>Customers</a>
 *   </nav>
 *
 * What people get wrong when they draw these by eye:
 *
 *   The selected tab is marked in text-primary, not brand. Redwood's selected
 *   indicator is a 3px near-black underline and the label turns primary; teal
 *   underlines and filled "pill" tabs are off-system.
 *
 *   Hover changes the label color only. A tab has no hover fill and no hover
 *   underline. A navigation-list item does take the hover overlay.
 *
 *   The selected navigation item keeps a transparent background. Selection is
 *   a 3px bar on the start edge, 2.5rem tall and centred, in text-primary.
 *
 *   Tabs are for switching views. An exclusive choice or a filter within one
 *   view is a buttonset (segmented control), not a tab bar.
 *
 *   Remove a tab or navigation item the user may not use; do not disable it.
 *
 * (c) Oracle. Internal brand asset — see NOTICE. */

/* ── Tab bar ──────────────────────────────────────────────────────────────── */

.rw-tabbar {
  display: flex;
  align-items: stretch;
  gap: var(--rw-space-8x);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--rw-divider);
}

.rw-tabbar::-webkit-scrollbar { display: none; }

.rw-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rw-space-2x);
  flex-shrink: 0;
  min-height: var(--rw-space-12x);
  min-width: 6rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--rw-text-secondary);
  font: inherit;
  font-size: var(--rw-body-md-size);
  line-height: var(--rw-body-md-lh);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rw-tab:hover { color: var(--rw-text-primary); }

.rw-tab:active,
.rw-tab[aria-selected="true"],
.rw-tab.rw-selected {
  color: var(--rw-text-primary);
  border-bottom-color: var(--rw-text-primary);
}

/* Tabs sit in a row, so the ring goes inside, as on a card. */
.rw-tab:focus-visible { outline: none; }
.rw-tab:focus-visible::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  outline: dotted 1px var(--rw-focus-ring);
}

.rw-density-compact .rw-tab { min-height: var(--rw-space-10x); }

/* ── Vertical navigation list ─────────────────────────────────────────────── */

.rw-navlist {
  display: flex;
  flex-direction: column;
}

.rw-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--rw-space-2x);
  min-height: var(--rw-space-12x);
  margin: 0;
  padding: 0 var(--rw-space-4x);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--rw-text-secondary);
  font: inherit;
  font-size: var(--rw-body-md-size);
  line-height: var(--rw-body-md-lh);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rw-nav-item > svg,
.rw-nav-item > .rw-nav-icon {
  flex-shrink: 0;
  width: var(--rw-space-6x);
  height: var(--rw-space-6x);
  color: inherit;
}

.rw-nav-item:hover {
  background-image: linear-gradient(var(--rw-bg-hover), var(--rw-bg-hover));
  color: var(--rw-text-primary);
}

.rw-nav-item:active {
  background-image: linear-gradient(var(--rw-bg-active), var(--rw-bg-active));
}

.rw-nav-item[aria-current="page"],
.rw-nav-item.rw-selected {
  color: var(--rw-text-primary);
}

.rw-nav-item[aria-current="page"]::before,
.rw-nav-item.rw-selected::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 3px;
  height: var(--rw-space-10x);
  transform: translateY(-50%);
  background: var(--rw-text-primary);
}

.rw-nav-item.rw-nav-nested { padding-inline-start: calc(var(--rw-space-4x) + var(--rw-space-5x)); }

.rw-nav-item:focus-visible { outline: none; }
.rw-nav-item:focus-visible::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  outline: dotted 1px var(--rw-focus-ring);
}

@media (forced-colors: active) {
  .rw-tab[aria-selected="true"], .rw-tab.rw-selected { border-bottom-color: Highlight; }
  .rw-nav-item[aria-current="page"]::before, .rw-nav-item.rw-selected::before { background: Highlight; }
  .rw-tab:focus-visible::after, .rw-nav-item:focus-visible::after { outline-color: Highlight; }
}
