/* The Work Bench — Shared Nav Base Styles
 * Structural nav CSS shared across all site pages.
 * Each page links this file in <head>; page-specific overrides
 * (e.g. background color for Flask sub-navs) go in a small
 * inline <style> block AFTER this <link>.
 */

html { overflow-x: hidden; }

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10,10,10,0.85) !important;
  backdrop-filter: blur(12px) !important;
  border-bottom: 2px solid #333 !important;
  z-index: 100;
  font-family: system-ui, -apple-system, sans-serif !important;
}

/* ── Caret / ^ indicator on active nav link ── */
.nav-links a.active {
  position: relative;
}

.nav-links a.active::before {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #333;
  z-index: 1;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #0a0a0a;
  z-index: 2;
}

.nav-brand {
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: #e0e0e0 !important;
  font-family: system-ui, -apple-system, sans-serif !important;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: #999 !important;
  text-decoration: none;
  font-weight: 300 !important;
  letter-spacing: 0.05em !important;
  font-size: 0.875rem !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: #e0e0e0 !important;
}

.nav-links a:hover,
.nav-links a.active {
  color: #e0e0e0;
}

/* ── Nav actions (search + hamburger) ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #999;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.search-btn:hover {
  color: #e0e0e0;
}

.search-btn svg {
  width: 18px;
  height: 18px;
}



.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #e0e0e0;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid #333;
  padding: 16px 24px;
  z-index: 200;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 14px 0;
  color: #999;
  text-decoration: none;
  font-weight: 300;
  letter-spacing: 0.05em;
  font-size: 1rem;
  border-bottom: 1px solid #1a1a1a;
  transition: color 0.2s;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover {
  color: #e0e0e0;
}

.mobile-group-toggle {
  cursor: pointer;
  user-select: none;
}

.mobile-group-toggle::after {
  content: '▾';
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7em;
  transition: transform 0.25s ease;
}

.mobile-group-toggle.expanded::after {
  transform: rotate(180deg);
}

.mobile-mega-group {
  display: none;
}

.mobile-mega-group[style*="block"] {
  display: block;
}

/* ── Search overlay ── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  justify-content: center;
  padding-top: 12vh;
}

.search-overlay.open {
  display: flex;
}

.search-dialog {
  width: 100%;
  max-width: 520px;
  margin: 0 16px;
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #1a1a1a;
  gap: 12px;
}

.search-input-wrap svg {
  width: 18px;
  height: 18px;
  color: #555;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #e0e0e0;
  font-size: 1rem;
  font-family: system-ui, sans-serif;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.search-input::placeholder {
  color: #444;
}

.search-results {
  overflow-y: auto;
  padding: 8px;
}

.search-results::-webkit-scrollbar {
  width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: #e0e0e0;
  transition: background 0.15s;
}

.search-result:hover,
.search-result.active {
  background: #1a1a1a;
}

.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #555;
  flex-shrink: 0;
  border: 1px solid #222;
}

.search-result-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-name {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-parent {
  font-size: 0.65rem;
  color: #555;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.search-result-url {
  font-size: 0.7rem;
  color: #444;
  letter-spacing: 0.03em;
  margin-top: 1px;
}

.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: #555;
  font-size: 0.85rem;
  font-weight: 300;
}

.search-footer {
  padding: 10px 20px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.65rem;
  color: #444;
  letter-spacing: 0.04em;
}

.search-footer kbd {
  border: 1px solid #333;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: system-ui, sans-serif;
  font-size: 0.6rem;
  color: #555;
}

/* ── Mega-dropdown (domain nav: Finance, Real Estate, Media) ── */
.nav-links li {
  position: relative;
}

.mega-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 10px;
  z-index: 150;
}

.nav-links li:hover .mega-dropdown,
.nav-links li.mega-open .mega-dropdown {
  display: block;
}

.mega-dropdown-panel {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

.mega-dropdown-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #999 !important;
  text-decoration: none;
  font-weight: 300 !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.03em !important;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.mega-dropdown-panel a:hover {
  background: #1a1a1a;
  color: #e0e0e0 !important;
}

.mega-dropdown-panel a.active {
  color: #e0e0e0 !important;
  background: #1a1a1a;
}

.mega-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1px solid #222;
}

.mega-label {
  display: flex;
  flex-direction: column;
}

.mega-label-name {
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #e0e0e0;
}

.mega-label-sub {
  font-size: 0.65rem;
  color: #555;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 1px;
}



/* ── App Switcher Chip (in sub-nav) ── */
.app-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 8px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e0e0e0 !important;
  font-size: 0.8rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.app-switcher .switcher-diamond {
  font-size: 0.55rem;
  color: #fbbf24;
  opacity: 0.7;
}

/* ── Sub-nav bar (holds centered sub-nav container) ── */
.sub-nav {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,10,0.75) !important;
  backdrop-filter: blur(8px) !important;
  border-bottom: 1px solid #1a1a1a !important;
  z-index: 99;
  font-family: system-ui, -apple-system, sans-serif !important;
}

.sub-nav-inner {
position: absolute;
display: flex;
align-items: center;
gap: 4px;
white-space: nowrap;
}

.sub-nav a {
color: #666 !important;
text-decoration: none;
font-weight: 300 !important;
letter-spacing: 0.04em !important;
font-size: 0.8rem !important;
font-family: system-ui, -apple-system, sans-serif !important;
padding: 6px 14px;
border-radius: 999px;
transition: color 0.2s, background 0.2s;
}

.sub-nav a:hover {
color: #e0e0e0 !important;
background: #1a1a1a;
}

.sub-nav a.active {
  color: #e0e0e0 !important;
  background: rgba(224,224,224,0.06);
  border-bottom: 2px solid #e0e0e0;
}

.sub-nav .sep {
  width: 1px;
  height: 16px;
  background: #333;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* Mobile mega-dropdown: show inline in mobile menu */
  .mobile-mega-group {
    padding: 0 0 0 20px;
  }
  .mobile-mega-group a {
    padding: 10px 0;
    font-size: 0.9rem;
    color: #666 !important;
    border-bottom: 1px solid #1a1a1a;
  }
  .mobile-mega-group a:last-child {
    border-bottom: none;
  }
  .mobile-mega-group a:hover {
    color: #e0e0e0 !important;
  }
  .mobile-section-label {
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #555;
    padding: 16px 0 4px;
  }

  .sub-nav {
    justify-content: flex-start;
  }
.sub-nav-inner {
position: static;
gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 24px;
    width: 100%;
  }
  .sub-nav-inner::-webkit-scrollbar { display: none; }
  .sub-nav a {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nav-links a.active::before, .nav-links a.active::after {
    display: none;
  }
  .nav-links a.has-mega::after {
    display: none;
  }
  .mega-dropdown {
    display: none !important;
  }
  .search-dialog { margin: 0 8px; max-height: 70vh; }
.search-overlay { padding-top: 8vh; }
}
