/* Shared before-login style mega navigation for candidate and listing pages */
.candidate-shared-nav{display:flex!important;align-items:center;gap:40px;flex-wrap:nowrap;position:relative;z-index:15010;}
.candidate-shared-nav .nav-dropdown{position:relative;height:72px;display:flex;align-items:center;}
.candidate-shared-nav .nav-dropdown>.nav-dropdown-trigger{position:relative;height:72px;display:flex;align-items:center;padding:0!important;margin:0;color:#172b4d!important;font-size:15px!important;font-weight:600!important;line-height:normal;text-decoration:none;white-space:nowrap;cursor:pointer;}
.candidate-shared-nav .nav-dropdown>.nav-dropdown-trigger:after{content:"";position:absolute;left:0;bottom:15px;width:0;height:3px;border-radius:4px;background:#ff7620;transition:width .2s ease;}
.candidate-shared-nav .nav-dropdown:hover>.nav-dropdown-trigger,.candidate-shared-nav .nav-dropdown.open>.nav-dropdown-trigger{color:#f36c21!important;}
.candidate-shared-nav .nav-dropdown:hover>.nav-dropdown-trigger:after,.candidate-shared-nav .nav-dropdown.open>.nav-dropdown-trigger:after{width:100%;}
.candidate-shared-nav .mega-menu{position:absolute;top:calc(100% - 1px);bottom:auto;left:50%;z-index:25000;display:grid;padding:25px 28px;background:#fff;border:1px solid #e4e9f1;border-radius:18px;box-shadow:0 18px 45px rgba(20,40,80,.16);opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,-8px);transition:opacity .18s ease,visibility .18s ease,transform .18s ease;}
.candidate-shared-nav .nav-dropdown:hover .mega-menu,.candidate-shared-nav .nav-dropdown.open .mega-menu,.candidate-shared-nav .nav-dropdown:focus-within .mega-menu{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0);}
.candidate-shared-nav .jobs-menu{width:650px;grid-template-columns:repeat(3,minmax(0,1fr));left:0;transform:translate(0,-8px);}
.candidate-shared-nav .nav-dropdown:hover .jobs-menu,.candidate-shared-nav .nav-dropdown.open .jobs-menu,.candidate-shared-nav .nav-dropdown:focus-within .jobs-menu{transform:translate(0,0);}
.candidate-shared-nav .companies-menu{width:710px;grid-template-columns:repeat(3,minmax(0,1fr));}
.candidate-shared-nav .services-menu{width:810px;grid-template-columns:1fr 1fr .8fr;}
.candidate-shared-nav .mega-column{min-width:0;padding:0 25px;border-right:1px solid #e2e6ee;}
.candidate-shared-nav .mega-column:first-child{padding-left:0}.candidate-shared-nav .mega-column:last-child{padding-right:0;border-right:0}
.candidate-shared-nav .mega-column h4{margin:0 0 13px;padding:0;color:#151d31;font-size:15px;font-weight:700;line-height:1.3;white-space:nowrap}
.candidate-shared-nav .mega-column a{display:flex;align-items:center;gap:7px;width:auto;height:auto;margin:0 0 10px;padding:0!important;border:0;border-radius:0;background:transparent;color:#4d5b78!important;font-size:13px!important;font-weight:400!important;line-height:1.5;text-decoration:none;white-space:nowrap;transform:none;transition:color .2s ease,transform .2s ease}
.candidate-shared-nav .mega-column a:after{display:none!important;content:none!important}.candidate-shared-nav .mega-column a:hover{color:#003366!important;transform:translateX(3px)}
/* Let menus extend outside header and stay above the banner/content. */
.dashboard-header,.site-header,.profile-page-header,.header-inner,.dashboard-header-inner{overflow:visible!important;}
.dashboard-header,.site-header,.profile-page-header{position:sticky;top:0;z-index:20000;}
@media(max-width:900px){.candidate-shared-nav{gap:20px}.candidate-shared-nav .mega-menu{max-width:calc(100vw - 24px);overflow:auto}.candidate-shared-nav .jobs-menu{left:0;width:min(650px,calc(100vw - 24px));grid-template-columns:repeat(3,minmax(140px,1fr));}.candidate-shared-nav .companies-menu{width:min(710px,calc(100vw - 24px));}.candidate-shared-nav .services-menu{width:min(810px,calc(100vw - 24px));}}
@media(max-width:650px){.candidate-shared-nav{gap:14px}.candidate-shared-nav .nav-dropdown>.nav-dropdown-trigger{font-size:13px!important}.candidate-shared-nav .jobs-menu,.candidate-shared-nav .companies-menu,.candidate-shared-nav .services-menu{grid-template-columns:1fr;width:min(340px,calc(100vw - 24px));left:auto;right:-70px;transform:translateY(-8px);max-height:70vh;overflow:auto}.candidate-shared-nav .nav-dropdown:hover .mega-menu,.candidate-shared-nav .nav-dropdown.open .mega-menu,.candidate-shared-nav .nav-dropdown:focus-within .mega-menu{transform:translateY(0)}.candidate-shared-nav .mega-column{padding:0;border-right:0;border-bottom:1px solid #e2e6ee;margin-bottom:12px}.candidate-shared-nav .mega-column:last-child{border-bottom:0;margin-bottom:0}}

/* REVEAL JOB requested navigation alignment: each dropdown starts under its own item. */
@media (min-width: 701px) {
  .candidate-shared-nav .nav-dropdown { position: relative !important; }
  .candidate-shared-nav .nav-dropdown .mega-menu,
  .candidate-shared-nav .nav-dropdown .jobs-menu,
  .candidate-shared-nav .nav-dropdown .companies-menu,
  .candidate-shared-nav .nav-dropdown .services-menu {
    position: absolute !important; top: calc(100% - 1px) !important;
    left: 0 !important; right: auto !important;
    transform: translateY(-8px) !important;
    max-width: min(90vw, 810px) !important;
    box-sizing: border-box;
  }
  .candidate-shared-nav .nav-dropdown:hover .mega-menu,
  .candidate-shared-nav .nav-dropdown.open .mega-menu,
  .candidate-shared-nav .nav-dropdown:focus-within .mega-menu { transform: translateY(0) !important; }
  .candidate-shared-nav .nav-dropdown .companies-menu { width: min(710px, 90vw) !important; }
  .candidate-shared-nav .nav-dropdown .services-menu { left: auto !important; right: 0 !important; width: min(810px, 90vw) !important; }
}


/* REVEAL JOB requested header alignment: keep the nav to the right and anchor each mega-menu to its own trigger. */
@media (min-width: 901px) {
  .site-header .header-inner { display:flex; align-items:center; gap:clamp(14px,2vw,28px); }
  .site-header .brand { flex:0 0 auto; }
  .site-header .main-nav, .site-header .candidate-shared-nav { margin-left:auto !important; justify-content:flex-end; }
  .site-header .header-actions { margin-left:clamp(14px,2vw,28px) !important; }
  .candidate-shared-nav .nav-dropdown { position:relative; }
  .candidate-shared-nav .mega-menu { left:0; right:auto; transform:translateY(-8px); }
  .candidate-shared-nav .nav-dropdown:hover .mega-menu, .candidate-shared-nav .nav-dropdown.open .mega-menu, .candidate-shared-nav .nav-dropdown:focus-within .mega-menu { transform:translateY(0); }
  .candidate-shared-nav .jobs-menu, .candidate-shared-nav .companies-menu { left:0; }
  .candidate-shared-nav .services-menu { left:auto; right:0; }
}
.site-header { background:#fff !important; }
.candidate-shared-nav .mega-menu { background:#fff; border:1px solid #e1e6ef; border-radius:18px; box-shadow:0 18px 42px rgba(11,31,58,.13); }
.candidate-shared-nav .mega-column + .mega-column { border-left:1px solid #e1e6ef; }
@media(max-width:900px) { .site-header .main-nav,.site-header .candidate-shared-nav { margin-left:0 !important; } .candidate-shared-nav .mega-menu { max-width:calc(100vw - 24px); } }


/* Each mega-menu is anchored to its own navigation item on desktop. */
@media (min-width: 701px) {
  .candidate-shared-nav .nav-dropdown { position: relative !important; }
  .candidate-shared-nav .nav-dropdown > .mega-menu { top: calc(100% - 1px) !important; left: 0 !important; right: auto !important; transform: translateY(-8px); }
  .candidate-shared-nav .nav-dropdown:hover > .mega-menu,
  .candidate-shared-nav .nav-dropdown.open > .mega-menu,
  .candidate-shared-nav .nav-dropdown:focus-within > .mega-menu { transform: translateY(0); }
  .candidate-shared-nav .services-menu { left: auto !important; right: 0 !important; }
}


/* FINAL REQUEST: candidate shared navigation dropdowns open down only. */
@media (min-width: 701px) {
  .candidate-shared-nav .nav-dropdown { position:relative !important; }
  .candidate-shared-nav .nav-dropdown > .mega-menu,
  .candidate-shared-nav .nav-dropdown > .jobs-menu,
  .candidate-shared-nav .nav-dropdown > .companies-menu,
  .candidate-shared-nav .nav-dropdown > .services-menu {
    position:absolute !important; top:calc(100% - 1px) !important; bottom:auto !important;
    transform:translateY(0) !important; margin-top:0 !important; z-index:25000 !important;
  }
}

/* FIX: keep candidate/listing mega dropdowns inside the viewport; always open below the trigger. */
@media (min-width: 701px) {
  .candidate-shared-nav .nav-dropdown { position: relative !important; }
  .candidate-shared-nav .nav-dropdown > .mega-menu,
  .candidate-shared-nav .nav-dropdown > .jobs-menu,
  .candidate-shared-nav .nav-dropdown > .companies-menu,
  .candidate-shared-nav .nav-dropdown > .services-menu {
    position: absolute !important;
    top: calc(100% - 1px) !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, 0) !important;
    width: min(var(--mega-menu-width, 810px), calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(70vh, 560px) !important;
    overflow: auto !important;
    box-sizing: border-box !important;
    z-index: 25000 !important;
  }
  .candidate-shared-nav .nav-dropdown > .jobs-menu { --mega-menu-width: 650px; }
  .candidate-shared-nav .nav-dropdown > .companies-menu { --mega-menu-width: 710px; }
  .candidate-shared-nav .nav-dropdown > .services-menu { --mega-menu-width: 810px; }
  .candidate-shared-nav .nav-dropdown:hover > .mega-menu,
  .candidate-shared-nav .nav-dropdown.open > .mega-menu,
  .candidate-shared-nav .nav-dropdown:focus-within > .mega-menu { transform: translate(-50%, 0) !important; }
}


/* REVEAL JOB unified header and mega-menu behavior (final authoritative rules). */
@media (min-width: 701px) {
  .site-header .header-inner { display:flex !important; align-items:center !important; gap:clamp(22px, 3vw, 46px) !important; }
  .site-header .brand { flex:0 0 auto !important; margin-right:clamp(12px, 1.8vw, 28px) !important; }
  .site-header .main-nav { margin-left:0 !important; margin-right:auto !important; justify-content:flex-start !important; gap:clamp(22px, 2.5vw, 38px) !important; }
  .site-header .header-actions { margin-left:auto !important; flex:0 0 auto !important; }
  .site-header .nav-dropdown { position:relative !important; }
  .site-header .nav-dropdown > .mega-menu,
  .candidate-shared-nav .nav-dropdown > .mega-menu {
    position:fixed !important; top:var(--rj-menu-top, 160px) !important; bottom:auto !important;
    left:var(--rj-menu-left, 12px) !important; right:auto !important;
    transform:none !important; margin:0 !important;
    max-width:calc(100vw - 24px) !important; max-height:min(70vh,560px) !important;
    overflow:auto !important; box-sizing:border-box !important; z-index:25000 !important;
  }
}
.site-header .mega-menu, .candidate-shared-nav .mega-menu { box-sizing:border-box !important; }
@media (max-width:700px) {
  .site-header .header-inner { flex-wrap:wrap !important; gap:10px 16px !important; }
  .site-header .brand { margin-right:0 !important; }
  .site-header .main-nav, .site-header .candidate-shared-nav { margin-left:0 !important; gap:16px !important; }
  .site-header .nav-dropdown > .mega-menu, .candidate-shared-nav .nav-dropdown > .mega-menu {
    position:fixed !important; top:var(--rj-menu-top, 130px) !important; bottom:auto !important;
    left:12px !important; right:auto !important; width:calc(100vw - 24px) !important;
    max-width:calc(100vw - 24px) !important; max-height:70vh !important; overflow:auto !important;
    grid-template-columns:1fr !important; transform:none !important; z-index:25000 !important;
  }
  .site-header .header-actions { margin-left:auto !important; }
}


/* REVEAL JOB: click-only navigation dropdowns.
   Hover/focus must not open a menu by itself; the shared JS toggles .open. */
.site-header .nav-dropdown:not(.open):hover > .mega-menu,
.site-header .nav-dropdown:not(.open):focus-within > .mega-menu,
.candidate-shared-nav .nav-dropdown:not(.open):hover > .mega-menu,
.candidate-shared-nav .nav-dropdown:not(.open):focus-within > .mega-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
.site-header .nav-dropdown.open > .mega-menu,
.candidate-shared-nav .nav-dropdown.open > .mega-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}
