/* ═══════════════════════════════════════════════════════════════════════
   JSI SmartLinks Pro — Global Site Header
   Rendered on every page that uses a [jsi_*] shortcode. Lives at the
   document root (via wp_body_open), so it is always full-width and is
   never affected by the active theme's content width, sidebar, or
   container padding — this is intentional and is what makes it "global".
   Brand: Deep Purple #25003E · Gold #FFC600 · White · Neutral dark.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --jh-purple:      #25003E;
  --jh-gold:        #FFC600;
  --jh-gold-2:      #FFB000;
}

.jsi-site-header {
  position: sticky; top: 0; left: 0; right: 0; z-index: 9999;
  width: 100%;
  background: rgba(5,3,8,0.7);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.09);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  transition: background .25s ease;
}
body.admin-bar .jsi-site-header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .jsi-site-header { top: 46px; }
}
.jsi-site-header * { box-sizing: border-box; }
.jsi-site-header a { text-decoration: none; }

.jsi-site-header-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  position: relative;
}

/* Logo can shrink and truncate instead of forcing the row to overflow —
   flex items refuse to shrink below their content's natural width unless
   min-width is explicitly reset, which was the root cause of the header
   overflowing (and the toggle button being pushed off-screen) on phones. */
.jsi-site-header-logo {
  flex: 1 1 auto; min-width: 0;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px;
  color: #F6F4FA;
}
.jsi-site-header-logo-mark {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--jh-gold), var(--jh-gold-2));
  color: var(--jh-purple); font-size: 13px; font-weight: 800;
  box-shadow: 0 4px 14px -4px rgba(255,198,0,0.55);
}
.jsi-site-header-logo-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.jsi-site-header-logo-pro { color: var(--jh-gold); font-weight: 700; }

.jsi-site-header-links {
  display: flex; gap: 30px; font-size: 14px; font-weight: 500;
  list-style: none; margin: 0; padding: 0;
}
.jsi-site-header-links li { list-style: none; margin: 0; padding: 0; }
.jsi-site-header-links .sub-menu { display: none; } /* nested submenus not supported in this compact header */
.jsi-site-header-links a {
  position: relative; padding: 4px 0; color: rgba(246,244,250,0.66);
  transition: color .2s;
}
.jsi-site-header-links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 1.5px;
  background: var(--jh-gold); transition: width .25s ease;
}
.jsi-site-header-links a:hover { color: #F6F4FA; }
.jsi-site-header-links a:hover::after,
.jsi-site-header-links li.current-menu-item a::after { width: 100%; }

.jsi-site-header-actions { display: flex; gap: 10px; align-items: center; flex: none; }

.jsi-site-header-toggle {
  display: none; background: none; border: 1px solid rgba(255,255,255,0.14); border-radius: 8px;
  width: 38px; height: 38px; color: #F6F4FA; cursor: pointer; position: relative; flex: none;
}
.jsi-site-header-toggle span, .jsi-site-header-toggle span::before, .jsi-site-header-toggle span::after {
  content: ''; position: absolute; left: 9px; width: 20px; height: 1.5px; background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
.jsi-site-header-toggle span { top: 18px; }
.jsi-site-header-toggle span::before { top: -6px; }
.jsi-site-header-toggle span::after { top: 6px; }
.jsi-site-header-toggle.is-open span { background: transparent; }
.jsi-site-header-toggle.is-open span::before { transform: translateY(6px) rotate(45deg); }
.jsi-site-header-toggle.is-open span::after { transform: translateY(-6px) rotate(-45deg); }

/* ─── Shared button styles (used in header + homepage + anywhere else a
       JSI CTA button appears) ──────────────────────────────────────────── */
.jsi-home-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s, background .18s, border-color .18s, color .18s;
  cursor: pointer; border: 1.5px solid transparent; font-family: inherit;
}
.jsi-home-btn-primary {
  background: linear-gradient(135deg, var(--jh-gold), var(--jh-gold-2));
  color: var(--jh-purple);
  box-shadow: 0 8px 24px -8px rgba(255,198,0,0.55);
}
.jsi-home-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -8px rgba(255,198,0,0.7); }
.jsi-home-btn-ghost { color: rgba(246,244,250,0.66); }
.jsi-home-btn-ghost:hover { color: #F6F4FA; }
.jsi-home-btn-outline { border-color: rgba(255,255,255,0.14); color: #F6F4FA; }
.jsi-home-btn-outline:hover { border-color: rgba(255,198,0,0.6); background: rgba(255,198,0,0.06); }
.jsi-home-btn-lg { padding: 15px 28px; font-size: 15px; }
.jsi-home-btn .jsi-ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.35);
  transform: scale(0); animation: jsi-ripple-anim .65s ease-out forwards; pointer-events: none;
}
.jsi-home-btn-primary .jsi-ripple { background: rgba(37,0,62,0.28); }
@keyframes jsi-ripple-anim { to { transform: scale(2.6); opacity: 0; } }

@media (max-width: 960px) {
  .jsi-site-header-links {
    /* Hidden by default; JS toggles `.is-open`. Position/size are defined
       here (not injected inline by JS) so it always matches the current
       breakpoint's available width — this is what keeps the dropdown from
       ever spilling outside the viewport. */
    display: none;
  }
  .jsi-site-header-links.is-open {
    display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: rgba(5,3,8,0.98);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    padding: 10px 28px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    box-shadow: 0 24px 40px -20px rgba(0,0,0,0.6);
  }
  .jsi-site-header-links.is-open a {
    display: block; padding: 13px 4px; font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .jsi-site-header-links.is-open a:last-child { border-bottom: none; }
  .jsi-site-header-toggle { display: block; }
}
@media (max-width: 640px) {
  .jsi-site-header-actions .jsi-home-btn-ghost { display: none; }
  .jsi-site-header-inner { padding: 12px 16px; gap: 12px; }
  .jsi-site-header-actions { gap: 8px; }
  .jsi-site-header-actions .jsi-home-btn { padding: 9px 14px; font-size: 13px; }
}
@media (max-width: 480px) {
  .jsi-site-header-logo-label { display: none; }
  .jsi-site-header-btn-optional { display: none; }
}
@media (max-width: 360px) {
  .jsi-site-header-inner { padding: 10px 12px; gap: 8px; }
  .jsi-site-header-toggle { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .jsi-site-header *, .jsi-site-header *::before, .jsi-site-header *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
  }
}

/* ── Logged-in user avatar + dropdown menu ───────────────────────────────── */
.jsi-user-menu { position: relative; display: inline-flex; align-items: center; }
.jsi-user-menu-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 5px 12px 5px 5px;
  cursor: pointer; color: var(--jh-text, #F6F4FA);
  font-size: 13px; font-weight: 600; font-family: inherit;
  transition: background .18s, border-color .18s;
}
.jsi-user-menu-trigger:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); }
.jsi-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; display: block; flex-shrink: 0;
  background: rgba(255,255,255,.1);
}
.jsi-user-display-name {
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jsi-chevron { flex-shrink: 0; transition: transform .2s; }
.jsi-user-menu-trigger[aria-expanded="true"] .jsi-chevron { transform: rotate(180deg); }

.jsi-user-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: rgba(12,8,20,.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: 6px; min-width: 190px; z-index: 10002;
  box-shadow: 0 24px 48px -12px rgba(0,0,0,.8);
  animation: jsi-menu-in .14s cubic-bezier(.16,1,.3,1);
}
@keyframes jsi-menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.jsi-user-menu-dropdown a {
  display: block; padding: 9px 14px; border-radius: 9px;
  color: rgba(246,244,250,.82); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background .14s, color .14s;
}
.jsi-user-menu-dropdown a:hover { background: rgba(255,255,255,.09); color: #F6F4FA; }
.jsi-user-menu-divider { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 5px 0; }
.jsi-user-menu-logout { color: rgba(239,68,68,.85) !important; }
.jsi-user-menu-logout:hover { background: rgba(239,68,68,.1) !important; color: #ef4444 !important; }

@media (max-width: 640px) {
  .jsi-user-display-name { display: none; }
  .jsi-user-menu-trigger { padding: 5px 8px 5px 5px; gap: 5px; }
}
@media (max-width: 480px) {
  .jsi-user-menu-trigger .jsi-chevron { display: none; }
}
