/* Global site header — transparent at top, dark pill on scroll. */
.story-navigation,
.story-navigation *,
.story-navigation *::before,
.story-navigation *::after { box-sizing: border-box; }

.story-navigation {
  --nav-ink: #fff;
  --nav-muted: #b5c6d8;
  --nav-line: rgb(255 255 255 / 14%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  pointer-events: none;
  font-family: var(--km-sans, Inter, Arial, sans-serif);
  color: var(--nav-ink);
}
/* Sit below the WP admin bar when it is fixed. */
.admin-bar .story-navigation { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .story-navigation { top: 46px; }
}
@media screen and (max-width: 600px) {
  .admin-bar .story-navigation { top: 0; }
}

.story-navigation::before {
  position: absolute;
  inset: 0 0 auto;
  height: 128px;
  background: linear-gradient(180deg, rgb(5 15 28 / 72%) 0%, rgb(5 15 28 / 50%) 64%, transparent 100%);
  opacity: 1;
  pointer-events: none;
  content: "";
  transition: opacity .4s cubic-bezier(.22,.61,.36,1);
}
.story-navigation.is-condensed::before { opacity: 0; }

/* Light Longform (cream / no photo): dark ink, no dark wash */
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) {
  --nav-ink: #21172E;
  --nav-muted: #716679;
  --nav-line: rgba(68, 49, 89, .2);
}
html[data-reading-theme="light"] .story-navigation:not(.is-condensed)::before { opacity: 0; }

/* Feature with lead photo: light text over the image, soft wash for contrast */
html[data-reading-theme="light"] body.km-lead-photo .story-navigation:not(.is-condensed) {
  --nav-ink: #fff;
  --nav-muted: rgba(247, 248, 252, .78);
  --nav-line: rgb(255 255 255 / 14%);
}
html[data-reading-theme="light"] body.km-lead-photo .story-navigation:not(.is-condensed)::before { opacity: 1; }

.story-nav-shell {
  /* Always center via left+transform so scroll morph doesn't snap from margin-auto → left:50% */
  position: relative;
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 32px);
  width: calc(100% - 96px);
  max-width: 1320px;
  height: 84px;
  margin-inline: 0;
  padding: 0;
  padding-inline: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  overflow: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition:
    width .4s cubic-bezier(.22,.61,.36,1),
    max-width .4s cubic-bezier(.22,.61,.36,1),
    height .4s cubic-bezier(.22,.61,.36,1),
    padding .4s cubic-bezier(.22,.61,.36,1),
    border-radius .4s cubic-bezier(.22,.61,.36,1),
    border-color .4s cubic-bezier(.22,.61,.36,1),
    background-color .4s cubic-bezier(.22,.61,.36,1),
    box-shadow .4s cubic-bezier(.22,.61,.36,1),
    backdrop-filter .4s cubic-bezier(.22,.61,.36,1),
    -webkit-backdrop-filter .4s cubic-bezier(.22,.61,.36,1),
    transform .4s cubic-bezier(.22,.61,.36,1);
}

/* Condensed: Hire-UA morph → UFC-style floating frosted pill */
.story-navigation.is-condensed .story-nav-shell {
  /* Final sizes/colors unchanged — only the path there is smoother */
  width: min(1190px, calc(100% - 32px));
  max-width: min(1190px, calc(100% - 32px));
  height: 60px;
  padding-inline: 28px;
  border: 1px solid rgba(183, 136, 255, .30);
  border-radius: 999px;
  background: rgba(36, 20, 64, .86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow:
    0 18px 40px rgba(12, 4, 28, .50),
    inset 0 1px 0 rgba(183, 136, 255, .18),
    0 0 28px rgba(109, 65, 164, .22);
  transform: translate(-50%, 18px); /* floating gap from top — desktop */
  color: #fff;
  --nav-ink: #fff;
  --nav-muted: #b5c6d8;
}
.story-navigation.is-condensed {
  --nav-ink: #fff;
  --nav-muted: #b5c6d8;
}

.story-navigation a { color: inherit; text-decoration: none; }
.story-navigation button { font: inherit; color: inherit; }
.story-navigation :is(a, button):focus-visible {
  outline: 2px solid #fff04a;
  outline-offset: 4px;
}
.story-wordmark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding-block: 8px;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: 1;
  white-space: nowrap;
  color: var(--nav-ink);
}
.story-wordmark span {
  display: inline-block;
  margin-inline: .04em .015em;
  color: #fff34b;
  font-weight: 750;
}
.story-desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(15px, 1.6vw, 25px);
  margin-left: auto;
  white-space: nowrap;
}
.story-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--nav-muted);
}
.story-nav-link:is(:hover, :focus-visible) { color: var(--nav-ink); }
.story-nav-link[aria-current="page"] {
  color: var(--nav-ink);
  font-weight: 750;
}
.story-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 4px;
  height: 2px;
  background: #B788FF; /* site purple */
  border-radius: 1px;
}
.story-menu-toggle { display: none; }
.story-mobile-panel { display: none; }
.story-navigation [hidden] { display: none !important; }

.story-navigation .km-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--nav-ink) 28%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--nav-ink) 6%, transparent);
  color: var(--nav-ink);
  cursor: pointer;
}

@media (max-width: 1260px) {
  .story-desktop-nav { gap: 18px; }
  .story-nav-shell { gap: 22px; }
}
@media (max-width: 1060px) and (min-width: 961px) {
  .story-nav-shell { gap: 18px; }
  .story-wordmark { font-size: 27px; }
  .story-desktop-nav { gap: 14px; }
}
@media (max-width: 960px) {
  .story-nav-shell { height: 76px; gap: 14px; }
  .story-navigation.is-condensed .story-nav-shell { padding-inline: 18px; }
  .story-desktop-nav { display: none; }
  .story-wordmark { font-size: 27px; }
  .story-menu-toggle {
    position: relative;
    display: inline-flex;
    flex: 0 0 38px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--nav-ink) 28%, transparent);
    border-radius: 50%;
    background: color-mix(in srgb, var(--nav-ink) 6%, transparent);
    color: var(--nav-ink);
    cursor: pointer;
  }
  .story-menu-toggle span {
    position: absolute;
    width: 15px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transition: transform .18s ease;
  }
  .story-menu-toggle span:first-child { transform: translateY(-3px); }
  .story-menu-toggle span:last-child { transform: translateY(3px); }
  /* No rotate/flip — plain two-line icon; panel fades instead */
  .story-mobile-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 8px;
    left: 8px;
    display: block;
    max-height: calc(100svh - 106px);
    padding: 17px;
    overflow-y: auto;
    border: 1px solid var(--nav-line);
    border-radius: 20px;
    background: #0c1c2d;
    color: #fff;
    box-shadow: 0 14px 40px rgb(3 12 24 / 30%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }
  .story-mobile-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .story-mobile-panel {
    background: rgba(255,253,249,.98);
    color: #21172E;
    border-color: rgba(68,49,89,.18);
  }
  .story-navigation.is-condensed .story-mobile-panel { right: 0; left: 0; max-height: calc(100svh - 92px); background: #1a1030; color: #fff; }
  /* HireUA-style plain stacked text links */
  .story-mobile-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .story-mobile-sections > .km-mobile-link,
  .story-mobile-sections > a.km-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 0 2px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
  }
  html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .story-mobile-sections > .km-mobile-link {
    color: #21172E;
    border-bottom-color: rgba(68,49,89,.16);
  }
  .story-mobile-sections > .km-mobile-link:is(:hover, :focus-visible) {
    filter: none;
    opacity: .88;
  }
  .story-mobile-sections > .km-mobile-link[aria-current="page"] {
    box-shadow: inset 0 -2px 0 #B788FF;
    color: #fff;
  }
  .km-mobile-search-row svg { flex: 0 0 auto; opacity: .85; }
}
@media (max-width: 900px) {
  .story-nav-shell { width: calc(100% - 64px); }
}
@media (max-width: 700px) {
  .story-nav-shell { width: calc(100% - 40px); height: 72px; gap: 10px; }
  .story-navigation.is-condensed .story-nav-shell {
    width: min(1190px, calc(100% - 24px));
    max-width: min(1190px, calc(100% - 24px));
    padding-inline: 14px;
  }
  .story-wordmark { font-size: 25px; }
}
@media (max-width: 420px) {
  .story-nav-shell { gap: 8px; }
  .story-navigation.is-condensed .story-nav-shell {
    width: min(1190px, calc(100% - 16px));
    max-width: min(1190px, calc(100% - 16px));
    padding-inline: 12px;
  }
  .story-wordmark { font-size: 22.5px; }
  .story-menu-toggle { flex-basis: 34px; width: 34px; height: 36px; }
  .story-mobile-panel { padding: 10px; }
}

@media (max-width: 700px) {
  .story-navigation.is-condensed .story-nav-shell {
    transform: translate(-50%, 10px); /* UFC mobile top gap */
  }
}
@media (prefers-reduced-motion: reduce) {
  .story-navigation::before { transition: none; }
  .story-navigation *, .story-navigation *::before, .story-navigation *::after { transition: none !important; }
}

/* Beat navigation-v9 white wordmark on light Longform */
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .story-wordmark { color: #21172E; }
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .story-nav-link { color: #716679; }
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .story-nav-link:is(:hover,:focus-visible,[aria-current="page"]) { color: #21172E; }
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .km-search-toggle,
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .story-menu-toggle { color: #21172E; border-color: rgba(68,49,89,.28); }
html[data-reading-theme="light"] body.km-lead-photo .story-navigation:not(.is-condensed) .story-wordmark { color: #fff; }
html[data-reading-theme="light"] body.km-lead-photo .story-navigation:not(.is-condensed) .story-nav-link { color: rgba(247,248,252,.78); }
html[data-reading-theme="light"] body.km-lead-photo .story-navigation:not(.is-condensed) .story-nav-link:is(:hover,:focus-visible,[aria-current="page"]) { color: #fff; }
html[data-reading-theme="light"] body.km-lead-photo .story-navigation:not(.is-condensed) .km-search-toggle,
html[data-reading-theme="light"] body.km-lead-photo .story-navigation:not(.is-condensed) .story-menu-toggle { color: #fff; border-color: rgb(255 255 255 / 28%); }
.story-navigation.is-condensed .story-wordmark { color: #fff; }

.story-mobile-sections a.km-mobile-link[aria-current="page"] {
  color: #fff;
  box-shadow: inset 0 -2px 0 #B788FF;
}


/* Companies dropdown — large cards, no CTA bars, fade open */
.story-nav-item{position:relative}
.story-navigation a.km-companies-toggle.story-nav-link,
.km-companies-toggle.story-nav-link{
  /* Match other .story-nav-link exactly — no caret, same baseline/spacing */
  cursor:pointer;
  background:none !important;
  border:0;
  -webkit-appearance:none;appearance:none;
}
.km-nav-chev{display:none !important}

.km-companies-dd{
  position:absolute;top:calc(100% + 10px);left:50%;
  /* 0.5.47: never wider than the viewport; JS also shifts left so the right edge stays in-bounds */
  width:min(50vw,760px,calc(100vw - 32px));max-width:calc(100vw - 32px);padding:16px;border-radius:16px;
  background:rgba(28,16,52,.96);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border:1px solid rgba(183,136,255,.26);box-shadow:0 22px 50px rgba(12,4,28,.55),0 0 28px rgba(109,65,164,.18),inset 0 1px 0 rgba(183,136,255,.12);
  z-index:120;
  /* Default center under trigger. Closed: 4px up + faded. Horizontal lock is instant (no transform transition) so it never paints past the edge during the fade. */
  transform:translateX(-50%) translateY(-4px);
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .2s ease-out, visibility .2s ease-out;
}
.km-companies-dd.is-open{
  opacity:1;visibility:visible;pointer-events:auto;
  transform:translateX(-50%) translateY(0);
}
/* When [hidden] is present during fade-out settle, don't force display:none mid-fade */
.story-navigation .km-companies-dd[hidden]{
  display:block !important; /* override .story-navigation [hidden] during fade */
}
.story-navigation .km-companies-dd[hidden]:not(.is-open):not(.is-fading){
  display:none !important;
}
/* Hover bridge */
.km-companies-dd::before{
  content:"";position:absolute;left:0;right:0;top:-14px;height:14px;
}
.km-companies-grid{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;
  margin:0;padding:0;list-style:none;
}
.km-companies-grid>li{min-width:0;width:100%}
.km-gate{
  position:relative;display:block;min-width:0;width:100%;overflow:hidden;border-radius:12px;
  text-decoration:none;color:#fff;box-shadow:0 10px 28px rgba(0,0,0,.35);
  transition:transform .18s ease,box-shadow .18s ease;height:100%;
}
a.km-gate:hover,a.km-gate:focus-visible{
  transform:translateY(-3px);box-shadow:0 14px 34px rgba(0,0,0,.45);outline:none;
}

.km-gate-mark{
  position:relative;display:flex;align-items:center;justify-content:center;
  aspect-ratio:16/11;padding:22px 16px;overflow:hidden;width:100%;
  box-sizing:border-box;
}
.km-gate-hire .km-gate-mark{background:radial-gradient(ellipse at 80% 100%,#174a9d 0%,#0b2247 60%,#08172f 100%)}
.km-gate-unfair .km-gate-mark{background:radial-gradient(ellipse at 80% 100%,#49141d 0%,#241118 60%,#101216 100%)}

.km-gate-hire .km-gate-mark > img,
.km-gate-unfair .km-gate-mark > img{
  display:block;position:relative;z-index:1;object-fit:contain;
  width:92%;max-width:92%;height:auto;max-height:58%;
  opacity:1 !important;filter:none !important;
}

/* Selo photo */
.km-gate-mark-photo{padding:0;background:#12160e}
.km-gate-mark-photo > img{
  display:block;position:absolute;inset:0;z-index:0;
  width:100% !important;max-width:none !important;height:100% !important;max-height:none !important;
  object-fit:cover;object-position:center 42%;
  opacity:1 !important;filter:none !important;
}
.km-gate-name{
  position:absolute;left:0;right:0;bottom:0;z-index:2;
  display:block;padding:12px 10px 11px;
  font-size:12px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  text-align:center;color:#fff !important;
  background:#0a0c08;
  opacity:1 !important;
}

/* —— Mobile Companies: plain logo rows under COMPANIES (HireUA-style) —— */
.km-mobile-companies{
  width:100%;
  margin:10px 0 0;
  padding:0;
}
.km-mobile-companies-label{
  margin:0 0 2px;
  padding:10px 2px 6px;
  font-size:10px;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:inherit;
  opacity:.55;
  border-bottom:0;
}
.km-companies-list-mobile{
  display:flex;
  flex-direction:column;
  gap:0;
  width:100%;
  margin:0;
  padding:0;
  list-style:none;
}
.km-companies-list-mobile > li{min-width:0;margin:0;padding:0}
.story-mobile-sections .km-mobile-co{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  width:100%;
  min-height:52px;
  margin:0;
  padding:0 2px;
  border:0;
  border-bottom:1px solid rgba(255,255,255,.14);
  border-radius:0;
  background:transparent !important;
  color:#fff;
  text-decoration:none;
  box-shadow:none;
  filter:none !important;
}
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .story-mobile-sections .km-mobile-co{
  background:transparent !important;
  border-bottom-color:rgba(68,49,89,.16);
  color:#21172E;
}
.story-mobile-sections .km-mobile-co:is(:hover,:focus-visible){opacity:.88;filter:none}
.km-mobile-co-main{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex:1 1 auto;
}
.km-mobile-co-logo{
  display:block;
  height:17px;
  width:auto;
  max-width:128px;
  object-fit:contain;
  flex:0 0 auto;
  opacity:1 !important;
  filter:none !important;
}
.km-mobile-co-logo-unfair{
  height:17px;
  max-width:160px;
}
.km-mobile-co-thumb{
  display:block;
  width:24px;
  height:24px;
  border-radius:5px;
  object-fit:cover;
  flex:0 0 auto;
  background:#12160e;
}
.km-mobile-co-name{
  font-size:17px;
  font-weight:750;
  letter-spacing:-.02em;
  color:#fff !important;
  opacity:1 !important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
html[data-reading-theme="light"] .story-navigation:not(.is-condensed) .km-mobile-co-name{color:#21172E !important}

/* Companies panel: keep default centering; width already viewport-clamped above */
@media (min-width:961px){
  .km-companies-dd{
    left:50%; right:auto;
  }
}

@media (max-width:960px){
  .km-companies-dd{display:none !important}
}

/* Lock page scroll while the mobile nav is open */
html.km-nav-lock, body.km-nav-lock { overflow: hidden !important; overscroll-behavior: none; }

@media (max-width: 960px) {
  .story-desktop-nav .km-search-toggle { display: none; } /* already in desktop-nav display:none */
}
