/* =====================================================
   nav.css – styles for the #jmfc-nav fixed top header
   Scoped entirely to #jmfc-nav and body state classes.
   Previously injected as a <style> string by nav.js.
   Edit here. Link BEFORE nav.js in every page.
   ===================================================== */

/* push content below fixed bar */
body { padding-top: 68px; }
body.menu-open { overflow: hidden; }

/* ── Bar ──────────────────────────────────────────── */
#jmfc-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 9000;
  background: #1a202c;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
  height: 68px;
}

/* ── Inner wrapper ────────────────────────────────── */
#jmfc-nav .jn-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 8px;
}

/* ── Logo ─────────────────────────────────────────── */
#jmfc-nav .jn-logo { flex-shrink: 0; margin-right: 16px; }
#jmfc-nav .jn-logo img { height: 42px; display: block; object-fit: contain; }

/* ── Desktop nav ──────────────────────────────────── */
#jmfc-nav .jn-nav { flex: 1; display: flex; align-items: center; }
#jmfc-nav .jn-links {
  display: flex; gap: 4px; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
#jmfc-nav .jn-links > li > a {
  display: block; padding: 8px 14px;
  font-size: 16px; font-weight: 500;
  color: rgba(255,255,255,.85); text-decoration: none;
  border-radius: 8px; white-space: nowrap;
  font-family: "DM Sans", sans-serif;
  transition: color .25s, background .25s, text-decoration-color .25s;
}
#jmfc-nav .jn-links > li > a:hover {
  color: #fff; background: rgba(59,130,246,.15);
  text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: #3b82f6;
}
#jmfc-nav .jn-links > li > a.jn-active {
  color: #3b82f6; background: rgba(59,130,246,.15);
  text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: #3b82f6;
}

/* ── Dropdown toggle arrow ────────────────────────── */
#jmfc-nav .jn-dtoggle::after { content: " ▾"; font-size: 10px; opacity: .7; }

/* ── Dropdown wrapper ─────────────────────────────── */
#jmfc-nav .jn-drop { position: relative; }
#jmfc-nav .jn-dmenu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 230px; background: #162d52;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  z-index: 10; list-style: none; margin: 0;
  opacity: 0; visibility: hidden;
  transform: translateY(8px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
/* invisible bridge over gap so cursor can reach dropdown */
#jmfc-nav .jn-nav .jn-drop::after {
  content: ""; position: absolute;
  left: 0; right: 0; top: 100%; height: 14px;
}
/* hover + focus-within open state */
#jmfc-nav .jn-nav .jn-drop:hover > .jn-dmenu,
#jmfc-nav .jn-nav .jn-drop:focus-within > .jn-dmenu {
  opacity: 1; visibility: visible;
  transform: translateY(0); pointer-events: auto;
}
#jmfc-nav .jn-dmenu li a {
  display: block; padding: 9px 14px; font-size: 13px;
  color: rgba(255,255,255,.85); border-radius: 8px;
  text-decoration: none; font-family: "DM Sans", sans-serif;
  transition: color .25s, background .25s; white-space: nowrap;
}
#jmfc-nav .jn-dmenu li a:hover,
#jmfc-nav .jn-dmenu li a.jn-active { color: #fff; background: rgba(255,255,255,.12); }
#jmfc-nav .jn-dmenu li a.jn-active { color: #3b82f6; }

/* ── Right group ──────────────────────────────────── */
#jmfc-nav .jn-right {
  display: flex; align-items: center;
  gap: 10px; flex-shrink: 0; margin-left: auto;
}

/* ── Language switcher ────────────────────────────── */
#jmfc-nav .jn-lang { display: flex; gap: 4px; }
#jmfc-nav .jn-lbtn {
  padding: 4px 10px; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px; cursor: pointer;
  font-family: "DM Sans", sans-serif;
  transition: color .25s, background .25s, border-color .25s;
}
#jmfc-nav .jn-lbtn.jn-lon,
#jmfc-nav .jn-lbtn:hover { color: #fff; background: #3b82f6; border-color: #3b82f6; }

/* ── CTA button ───────────────────────────────────── */
#jmfc-nav .jn-cta {
  display: inline-flex; align-items: center;
  padding: 9px 20px;
  background: #1a56db; color: #fff;
  font-size: 14px; font-weight: 600;
  border-radius: 6px; text-decoration: none;
  font-family: "DM Sans", sans-serif;
  transition: background .25s, transform .25s;
  white-space: nowrap;
}
#jmfc-nav .jn-cta:hover { background: #1648c0; transform: translateY(-1px); }

/* ── Hamburger ────────────────────────────────────── */
#jmfc-nav .jn-hbg {
  display: none; flex-direction: column;
  justify-content: center; align-items: center;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 4px; gap: 5px; flex-shrink: 0;
}
#jmfc-nav .jn-hbg span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform .3s, opacity .3s, background .3s;
  transform-origin: center;
}
#jmfc-nav .jn-hbg[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg); background: #3b82f6;
}
#jmfc-nav .jn-hbg[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
#jmfc-nav .jn-hbg[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg); background: #3b82f6;
}

/* ── Mobile right cluster (lang + hamburger) ──────── */
#jmfc-nav .jn-mright { display: none; align-items: center; gap: 8px; margin-left: auto; }

/* ── Mobile panel ─────────────────────────────────── */
#jmfc-nav .jn-panel {
  position: fixed; top: 68px; left: 0; right: 0; bottom: 0;
  z-index: 9500; background: #1a202c;
  transform: translateX(100%); transition: transform .28s ease;
  overflow: hidden; display: flex; flex-direction: column;
}
#jmfc-nav .jn-panel.jn-open { transform: translateX(0); }

/* scrollable inner */
#jmfc-nav .jn-panel-scroll {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 32px;
}

/* ── Accordion group ──────────────────────────────── */
#jmfc-nav .jn-group { border-bottom: 1px solid rgba(255,255,255,.08); }
#jmfc-nav .jn-group-toggle {
  width: 100%; min-height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  border: 0; background: transparent;
  font-size: 16px; font-weight: 500;
  color: rgba(255,255,255,.85);
  padding: 14px 0; cursor: pointer;
  font-family: "DM Sans", sans-serif; text-align: left;
}
#jmfc-nav .jn-group-toggle:hover { color: #fff; }
#jmfc-nav .jn-group-toggle.jn-active { color: #3b82f6; }

/* rotating chevron */
#jmfc-nav .jn-group-toggle svg {
  width: 18px; height: 18px; flex-shrink: 0;
  color: rgba(255,255,255,.4);
  transition: transform .25s ease, color .2s;
}
#jmfc-nav .jn-group.jn-open .jn-group-toggle svg {
  transform: rotate(180deg); color: #3b82f6;
}

/* ── Grid accordion panel ─────────────────────────── */
#jmfc-nav .jn-group-panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
#jmfc-nav .jn-group-panel > ul {
  overflow: hidden; list-style: none; margin: 0; padding: 0;
}
#jmfc-nav .jn-group.jn-open .jn-group-panel { grid-template-rows: 1fr; }

/* ── Submenu link items ───────────────────────────── */
#jmfc-nav .jn-group-panel li a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0 10px 12px;
  font-size: 15px; font-family: "DM Sans", sans-serif;
  color: rgba(255,255,255,.65); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
#jmfc-nav .jn-group-panel li a:hover {
  color: #fff; border-left-color: #3b82f6;
  background: rgba(59,130,246,.08);
  border-radius: 0 6px 6px 0;
}
#jmfc-nav .jn-group-panel li a.jn-active { color: #3b82f6; border-left-color: #3b82f6; }

/* ── Plain mobile nav links ───────────────────────── */
#jmfc-nav .jn-mlink {
  display: block; padding: 14px 0;
  font-size: 16px; font-weight: 500;
  font-family: "DM Sans", sans-serif;
  color: rgba(255,255,255,.85); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: color .2s;
}
#jmfc-nav .jn-mlink:hover { color: #fff; }
#jmfc-nav .jn-mlink.jn-active { color: #3b82f6; }

/* CTA link in mobile panel */
#jmfc-nav .jn-mlink-cta {
  margin-top: 16px; background: #1a56db;
  color: #fff; border-radius: 8px;
  padding: 14px 16px; border-bottom: 0;
  text-align: center; font-weight: 600;
}
#jmfc-nav .jn-mlink-cta:hover { background: #1648c0; }

/* ── Responsive breakpoint ────────────────────────── */
@media (max-width: 768px) {
  #jmfc-nav .jn-nav    { display: none; }
  #jmfc-nav .jn-right  { display: none; }
  #jmfc-nav .jn-hbg   { display: flex; }
  #jmfc-nav .jn-mright { display: flex; }
  #jmfc-nav .jn-logo   { margin-right: 0; }
  #jmfc-nav .jn-inner  { justify-content: space-between; }
  #jmfc-nav .jn-lbtn   { padding: 3px 8px; font-size: 11px; }
}
