/* =============================================================
   nav.css — the top bar (navbar.html) and the command palette (nav.js).
   The bell and its panel keep their styles in wh_feed.css.
   The bar is dark in both themes; the palette follows the page theme.
   ============================================================= */

.whn {
  --whn-bg: #14171c;
  --whn-fg: rgba(255, 255, 255, .78);
  --whn-fg-strong: #fff;
  --whn-hover: rgba(255, 255, 255, .08);
  --whn-active: rgba(45, 170, 225, .16);
  --whn-line: rgba(255, 255, 255, .08);
  --whn-accent: var(--msp-blue, #2daae1);
  position: relative;
  padding: .45rem 0;
  background: var(--whn-bg) !important;
  box-shadow: 0 1px 0 var(--whn-line);
}
/* Brand ribbon along the bottom edge. */
.whn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--msp-blue, #2daae1), var(--msp-purple, #951b81), var(--msp-red, #e61873));
  opacity: .9;
}
.whn__inner { gap: .5rem; flex-wrap: wrap; }
.whn__brand { display: flex; align-items: center; margin-right: .75rem; padding: 0; }
.whn__brand img { height: 32px; width: auto; }

/* ── Sections ── */
.whn__nav { gap: .15rem; }
.whn__nav .nav-link {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem !important; border-radius: 999px;
  color: var(--whn-fg); font-weight: 500; font-size: .93rem;
  transition: background-color .15s ease, color .15s ease;
}
.whn__nav .nav-link:hover, .whn__nav .nav-link:focus-visible, .whn__nav .nav-link.show { background: var(--whn-hover); color: var(--whn-fg-strong); }
.whn__nav .nav-link.active { background: var(--whn-active); color: var(--whn-fg-strong); box-shadow: inset 0 0 0 1px rgba(45, 170, 225, .35); }
.whn__nav .nav-link.active i { color: var(--whn-accent); }
.whn__nav .dropdown-toggle::after { margin-left: .15rem; opacity: .6; }
/* styles.css paints dark-mode navbars grey and every .nav-link blue; this bar
   looks the same in both themes. */
body.dark-mode .whn { background: var(--whn-bg) !important; }
body.dark-mode .whn__nav .nav-link:not(.active):not(:hover):not(.show) { color: var(--whn-fg); }
body.dark-mode .whn__nav .nav-link.active { background: var(--whn-active); }

/* ── Menus (sections and account) ── */
.whn-menu {
  --bs-dropdown-bg: #1b1f26;
  --bs-dropdown-border-color: rgba(255, 255, 255, .08);
  --bs-dropdown-link-color: rgba(255, 255, 255, .85);
  --bs-dropdown-link-hover-bg: rgba(255, 255, 255, .07);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-active-bg: rgba(45, 170, 225, .2);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-header-color: rgba(255, 255, 255, .45);
  --bs-dropdown-divider-bg: rgba(255, 255, 255, .08);
  min-width: 14rem; padding: .4rem; margin-top: .45rem !important;
  border-radius: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
  animation: whn-pop .14s ease-out;
  /* styles.css caps every .dropdown-menu at 300px with a scrollbar; these
     menus are short enough to show whole. */
  max-height: none; overflow: visible;
}
/* ...and dark mode repaints every .dropdown-menu grey: keep the bar's own. */
body.dark-mode .whn .whn-menu { background-color: var(--bs-dropdown-bg); color: var(--bs-dropdown-link-color); }
.whn-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; border-radius: 9px; padding: .45rem .65rem; font-size: .9rem; }
.whn-menu .dropdown-item i { width: 1.1rem; text-align: center; opacity: .75; }
.whn-menu .dropdown-item.active i { color: var(--msp-blue, #2daae1); opacity: 1; }
.whn-menu .dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: .6rem .65rem .25rem; }
.whn-menu__cta { color: var(--msp-blue, #2daae1) !important; font-weight: 600; }
.whn-menu--wide { min-width: 19rem; }
/* Categories: every one in sight, two to a row, no inner scrolling. */
.whn-menu__grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: .25rem; }
.whn-menu__grid .dropdown-item { min-width: 0; padding-top: .38rem; padding-bottom: .38rem; }
@media (min-width: 992px) { .whn-menu--wide { min-width: 26rem; } }
@keyframes whn-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Right-hand tools ── */
.whn__tools { display: flex; align-items: center; gap: .45rem; margin-left: auto; }

.whn-search {
  display: inline-flex; align-items: center; gap: .55rem;
  height: 38px; padding: 0 .55rem 0 .8rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .6); text-decoration: none; font-size: .88rem; white-space: nowrap;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.whn-search:hover, .whn-search:focus-visible { border-color: rgba(45, 170, 225, .6); background: rgba(255, 255, 255, .08); color: #fff; }
.whn-search__kbd {
  padding: .1rem .4rem; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .15);
  background: transparent; color: rgba(255, 255, 255, .55); font: 600 .7rem/1.4 Roboto, sans-serif;
}
/* Icon only on phones, and between lg and xl where the sections and the
   next-job chip need the room (Ctrl+K still opens it). */
@media (max-width: 1199.98px) {
  .whn-search { width: 38px; padding: 0; justify-content: center; }
  .whn-search__text, .whn-search__kbd { display: none; }
}
@media (min-width: 1200px) { .whn-search { min-width: 15rem; } .whn-search__kbd { margin-left: auto; } }

.whn-avatar {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .15);
  background: linear-gradient(135deg, var(--msp-blue, #2daae1), var(--msp-purple, #951b81));
  color: #fff; font: 700 .8rem/1 Roboto, sans-serif; letter-spacing: .02em;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.whn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.whn-avatar:hover, .whn-avatar[aria-expanded="true"], .whn-avatar.is-active { border-color: var(--msp-blue, #2daae1); box-shadow: 0 0 0 3px rgba(45, 170, 225, .25); }

.whn-account { min-width: 16rem; }
.whn-account__head { display: flex; flex-direction: column; padding: .5rem .65rem .65rem; margin-bottom: .3rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.whn-account__head strong { color: #fff; }
.whn-account__head span { color: rgba(255, 255, 255, .5); font-size: .8rem; }
.whn-account__row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .35rem .65rem; color: rgba(255, 255, 255, .85); font-size: .9rem; }
.whn-account__row i { width: 1.1rem; text-align: center; opacity: .75; margin-right: .6rem; }
.whn-danger:hover { color: #ff8fb8 !important; }

.whn-lang { margin: 0; }
.whn-lang__seg { display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.whn-lang__seg button {
  border: 0; background: transparent; color: rgba(255, 255, 255, .6);
  padding: .15rem .6rem; border-radius: 999px; font: 700 .72rem/1.5 Roboto, sans-serif; letter-spacing: .04em;
}
.whn-lang__seg button:hover { color: #fff; }
.whn-lang__seg button.is-on { background: #fff; color: #14171c; }
.whn-theme button { padding: .15rem .55rem; font-size: .8rem; }
.whn-theme button i { width: auto; margin: 0; opacity: 1; }
.whn-login { border-radius: 999px; font-weight: 600; }

.whn-toggler { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; color: #fff; font-size: 1.35rem; display: grid; place-items: center; }
.whn-toggler:hover { background: var(--whn-hover); }
.whn-toggler:focus { box-shadow: 0 0 0 2px rgba(45, 170, 225, .5); }

/* ── My next job ── */
.whn-job {
  display: inline-flex; align-items: center; gap: .45rem; max-width: 22rem;
  height: 38px; padding: 0 .8rem 0 .7rem; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .85); text-decoration: none; font-size: .82rem; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.whn-job:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.whn-job__what { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.whn-job__what strong { color: #fff; font-weight: 600; margin-right: .2rem; }
.whn-job__when { flex: none; color: rgba(255, 255, 255, .55); padding-left: .45rem; border-left: 1px solid rgba(255, 255, 255, .15); }
.whn-job__dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .35); flex: none; }
.whn-job.is-today { border-color: rgba(45, 170, 225, .45); }
.whn-job.is-today .whn-job__dot { background: var(--msp-blue, #2daae1); }
.whn-job.is-now { border-color: rgba(230, 24, 115, .55); background: rgba(230, 24, 115, .12); }
.whn-job.is-now .whn-job__dot { background: var(--msp-red, #e61873); animation: whn-pulse 1.6s ease-out infinite; }
.whn-job.is-now .whn-job__when { color: #ff8fb8; font-weight: 600; }
/* Between lg and xl the bar is busy: label and time only, the name is in the tooltip. */
@media (max-width: 1199.98px) { .whn__tools .whn-job__name { display: none; } }
/* Phones: a full-width strip under the bar, always in sight. */
.whn-job--strip { display: flex; flex-basis: 100%; max-width: none; height: 34px; margin-top: .35rem; padding: 0 .75rem; border-radius: 10px; }
.whn-job--strip .whn-job__what { flex: 1; min-width: 0; }
@keyframes whn-pulse { 0% { box-shadow: 0 0 0 0 rgba(230, 24, 115, .6); } 100% { box-shadow: 0 0 0 8px rgba(230, 24, 115, 0); } }

/* ── Phones: the section list opens below the bar ── */
@media (max-width: 991.98px) {
  .whn .navbar-collapse { flex-basis: 100%; }
  .whn__nav { padding: .5rem 0 .25rem; border-top: 1px solid var(--whn-line); margin-top: .45rem; }
  .whn__nav .nav-link { border-radius: 10px; }
  .whn-menu { box-shadow: none; margin-top: .15rem !important; }
}

/* ── Page-load progress bar ── */
.whn-progress {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 0; z-index: 2;
  background: #fff; box-shadow: 0 0 8px rgba(45, 170, 225, .9); opacity: 0;
}
.whn-progress.is-running { opacity: 1; animation: whn-load 8s cubic-bezier(.08, .8, .2, 1) forwards; }
@keyframes whn-load { from { width: 0; } 20% { width: 45%; } to { width: 92%; } }

/* ── Command palette ── */
.whn-palette {
  --pal-bg: #fff; --pal-fg: #0f172a; --pal-muted: #64748b; --pal-line: rgba(15, 23, 42, .08);
  --pal-hover: rgba(45, 170, 225, .1); --pal-active: rgba(45, 170, 225, .16);
  width: min(40rem, calc(100vw - 24px)); max-height: min(34rem, calc(100vh - 80px));
  margin: 10vh auto auto; padding: 0; border: 1px solid var(--pal-line); border-radius: 16px;
  background: var(--pal-bg); color: var(--pal-fg); box-shadow: 0 30px 80px rgba(2, 6, 23, .45);
  overflow: hidden;
}
body.dark-mode .whn-palette {
  --pal-bg: #181b20; --pal-fg: #e9eef5; --pal-muted: #8b95a5; --pal-line: rgba(255, 255, 255, .09);
  --pal-hover: rgba(45, 170, 225, .12); --pal-active: rgba(45, 170, 225, .22);
}
.whn-palette[open] { display: flex; flex-direction: column; animation: whn-pop .14s ease-out; }
.whn-palette::backdrop { background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px); }
.whn-palette__head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--pal-line); }
.whn-palette__head i { color: var(--pal-muted); font-size: 1.05rem; }
.whn-palette__input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--pal-fg); font-size: 1.05rem; }
.whn-palette__input::placeholder { color: var(--pal-muted); }
.whn-palette__esc { border: 1px solid var(--pal-line); border-radius: 6px; padding: .05rem .4rem; font: 600 .7rem/1.5 Roboto, sans-serif; color: var(--pal-muted); background: transparent; }
.whn-palette__list { overflow-y: auto; padding: .35rem; margin: 0; list-style: none; flex: 1; }
.whn-palette__group { padding: .6rem .7rem .25rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pal-muted); }
.whn-palette__item {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px;
  color: inherit; text-decoration: none; cursor: pointer;
}
.whn-palette__item i { width: 1.25rem; text-align: center; color: var(--pal-muted); }
.whn-palette__item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whn-palette__item small { color: var(--pal-muted); font-size: .78rem; white-space: nowrap; flex: 0 1 auto; max-width: 55%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.whn-palette__item mark { padding: 0; background: rgba(45, 170, 225, .25); color: inherit; border-radius: 3px; }
.whn-palette__item:hover { background: var(--pal-hover); color: inherit; }
.whn-palette__item[aria-selected="true"] { background: var(--pal-active); }
.whn-palette__item[aria-selected="true"] i { color: var(--msp-blue, #2daae1); }
.whn-palette__note { padding: 1.2rem .7rem; text-align: center; color: var(--pal-muted); font-size: .9rem; }
.whn-palette__foot { display: flex; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--pal-line); color: var(--pal-muted); font-size: .75rem; }
.whn-palette__foot kbd { border: 1px solid var(--pal-line); border-radius: 5px; padding: 0 .3rem; background: transparent; color: inherit; font-size: .7rem; }
@media (max-width: 575.98px) { .whn-palette__foot { display: none; } .whn-palette { margin-top: 12px; } }
/* Phones: a result's detail line (an event's date and venue) goes under its name. */
@media (max-width: 575.98px) {
  .whn-palette__item:has(small) { flex-wrap: wrap; row-gap: .1rem; }
  .whn-palette__item small { flex-basis: 100%; max-width: none; padding-left: calc(1.25rem + .7rem); }
}

@media (prefers-reduced-motion: reduce) {
  .whn-menu, .whn-palette[open] { animation: none; }
  .whn-job.is-now .whn-job__dot { animation: none; }
  .whn-progress.is-running { animation-duration: 0s; width: 92%; }
}
