/* ============================================================
   nav2.css — the consolidated top navigation (2026-09).

   Desktop: six menus across the top; the sidebar is hidden.
   Mobile (≤900px): the top menus hide and the sidebar keeps
   being the navigation drawer, exactly as before.

   Colour rule: tokens only — tests_cc_theme forbids raw hex, and
   that is what keeps night mode correct for free.
   ============================================================ */

/* ---------------- the menu bar ---------------- */
#topnav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 50px;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
.tn-brand {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--text-subhead);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  letter-spacing: -.01em;
  white-space: nowrap;
  padding-bottom: var(--space-xs);
}
.tn-menus {
  display: flex;
  align-items: stretch;
  gap: var(--space-2xs);
  min-width: 0;
  overflow-x: auto;             /* never widens the page on a narrow laptop */
  scrollbar-width: none;
}
.tn-menus::-webkit-scrollbar { display: none; }

.tn-menu { position: relative; display: flex; }
.tn-btn {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-md) var(--space-md);
  border: none; background: none; cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.tn-btn:hover { color: var(--text-primary); background: var(--color-surface-2); }
.tn-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tn-menu.active .tn-btn {
  color: var(--color-primary);
  box-shadow: inset 0 -2px 0 var(--color-primary);
}
.tn-caret { width: 12px; height: 12px; opacity: .55; }
.tn-menu.open .tn-caret { transform: rotate(180deg); }

/* ---------------- dropdowns ---------------- */
.tn-drop {
  position: absolute;
  top: 100%; left: 0;
  z-index: 70;
  min-width: 236px;
  padding: var(--space-xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
}
.tn-menu.open .tn-drop { display: block; }
.tn-drop a {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
}
.tn-drop a:hover { background: var(--color-surface-2); text-decoration: none; }
.tn-drop a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tn-drop a .i { color: var(--text-tertiary); }
.tn-drop a:hover .i { color: var(--color-primary); }

/* ---------------- hub pages (the tile screens) ---------------- */
.hubpage { padding-top: var(--space-lg); }
.hubgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: var(--space-2xl) var(--space-lg);
  justify-items: center;
  padding: var(--space-xl) var(--space-sm) var(--space-2xl);
}
.hubtile {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-lg) var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.hubtile:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.hubtile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* the icon sits in a soft tinted chip; hovering fills it with the accent */
.ht-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary-border);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.hubtile .i {
  width: 26px; height: 26px;
  stroke-width: 1.6;
  color: var(--color-primary);
  transition: color var(--dur-fast) var(--ease);
}
.hubtile:hover .ht-ico {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.05);
}
.hubtile:hover .i { color: var(--text-inverse); }
.hubtile b {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  text-align: center;
  line-height: var(--leading-tight);
}
.hubtile .ht-sub {
  font-size: var(--text-2xs);
  color: var(--text-tertiary);
  text-align: center;
  line-height: var(--leading-normal);
  max-width: 200px;
}
.hubhint { text-align: center; margin: 0 0 var(--space-xl); }
.hubhint kbd {
  font-family: var(--font-sans);
  font-size: 10px; font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

/* ---------------- tab strip on merged destinations ---------------- */
#subtabs {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  border-bottom: 1px solid var(--color-border);
  margin: calc(-1 * var(--space-sm)) 0 var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
}
#subtabs::-webkit-scrollbar { display: none; }
#subtabs.hidden { display: none; }
.subtabs-name {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-tertiary);
  padding-right: var(--space-md);
  white-space: nowrap;
}
.subtab {
  border: none; background: none; cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  margin-bottom: -1px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.subtab:hover { color: var(--text-primary); }
.subtab:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.subtab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: var(--weight-semibold);
}

/* ---------------- desktop / mobile split ---------------- */
@media (min-width: 901px) {
  /* the sidebar's job is done by the top menus */
  #side { display: none; }
  /* with no sidebar, the content column centres itself */
  #main { margin-inline: auto; width: 100%; }
}
@media (max-width: 900px) {
  /* the sidebar drawer takes over; the menu bar steps aside */
  #topnav { display: none; }
}

@media print {
  #topnav, #subtabs { display: none !important; }
}
