/* ═══════════════════════════════════════════════════════════
   FIDEOGRAPH NAVIGATION — v1.2.5
   Exact port of fideograph_mega_menu_v5.html
   Panels sit inside <li> — CSS hover triggers them.
═══════════════════════════════════════════════════════════ */

/* ── Nav links list ─────────────────────────────────────── */
.fgn-links {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0; padding: 0;
  height: 100%;
  overflow: visible;
}

/* Each li is the hover target */
.fgn-item {
  position: relative;
  display: flex;
  align-items: center;
}

/* Gold underbar */
.fgn-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 15px; right: 15px;
  height: 2px;
  background: var(--fgn-active-color, #C9A84C);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.fgn-item:hover::after,
.fgn-item.fgn-active::after { transform: scaleX(1); }

/* Nav label */
.fgn-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-serif, 'EB Garamond', Georgia, serif);
  font-size: 13.5px;
  color: var(--fgn-link-color, rgba(250,246,237,.6));
  padding: 0 15px;
  height: 100%;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
  user-select: none;
  text-decoration: none;
}
.fgn-label svg {
  width: 8px; height: 8px;
  opacity: .45;
  transition: transform .2s, opacity .2s;
  flex-shrink: 0;
}
.fgn-label--active { color: var(--fgn-active-color, #C9A84C); }
.fgn-item:hover > .fgn-label { color: var(--fgn-link-hover, rgba(250,246,237,.95)); }
.fgn-item:hover > .fgn-label svg { transform: rotate(180deg); opacity: .8; }

/* ── Mega panel ─────────────────────────────────────────── */
.fgn-mega {
  position: absolute;
  top: 100%;
  left: 0;
  background: #F6F0E4;
  border: 1px solid rgba(26,21,16,.11);
  border-top: 2.5px solid #B8922A;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 14px 48px rgba(26,21,16,.14);
  padding: 26px 26px 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .18s cubic-bezier(.4,0,.2,1), transform .18s cubic-bezier(.4,0,.2,1);
  z-index: 200;
  white-space: normal;
}
/* Right-anchor — prevents clipping on right-side items */
.fgn-mega--right {
  left: auto;
  right: 0;
}
/* Show on hover */
.fgn-item:hover > .fgn-mega {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* JS click toggle */
.fgn-item.fgn-open > .fgn-mega {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* Keep open when hovering the panel itself */
.fgn-mega:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ── Mega internals ─────────────────────────────────────── */
.fgn-mega__row { display: flex; gap: 0; }

/* Dark feat column */
.fgn-mega__feat {
  width: 210px;
  flex-shrink: 0;
  background: #1A1510;
  border-radius: 3px;
  padding: 20px;
  margin-right: 18px;
}
.fgn-mega__feat-layer {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 7.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(246,240,228,.3);
  display: block;
  margin-bottom: 12px;
}
.fgn-mega__feat-title {
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.35rem;
  font-weight: 300;
  color: rgba(246,240,228,.92);
  line-height: 1.2;
  margin-bottom: 9px;
}
.fgn-mega__feat-title em { font-style: italic; }
.fgn-mega__feat-body {
  font-family: var(--font-serif, 'EB Garamond', Georgia, serif);
  font-size: 12px;
  color: rgba(246,240,228,.42);
  line-height: 1.55;
  margin-bottom: 14px;
}
.fgn-mega__feat-link {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 7.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid;
  padding-bottom: 2px;
}

/* Link columns */
.fgn-mega__col {
  flex: 1;
  min-width: 160px;
  padding: 0 18px;
  border-left: 1px solid rgba(26,21,16,.05);
}
.fgn-mega__col:first-child { border-left: none; }
.fgn-mega__col-head {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 7.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(26,21,16,.4);
  display: block;
  margin-bottom: 12px;
}

/* Menu link rows */
.fgn-mega__ml {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 3px;
  transition: background .12s;
  margin-bottom: 4px;
}
.fgn-mega__ml:hover { background: rgba(184,146,42,.07); }
.fgn-mega__ml-ico {
  width: 30px; height: 30px; min-width: 30px;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  border: 1px solid rgba(26,21,16,.11);
  background: #EDE5D0;
  flex-shrink: 0;
  margin-top: 1px;
  color: #B8922A;
}
.fgn-mega__ml-name {
  font-family: var(--font-serif, 'EB Garamond', Georgia, serif);
  font-size: 14px;
  color: #1A1510;
  line-height: 1.25;
  display: block;
}
.fgn-mega__ml-count {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 9px;
  color: rgba(26,21,16,.4);
  font-style: normal;
}
.fgn-mega__ml-desc {
  font-family: var(--font-serif, 'EB Garamond', Georgia, serif);
  font-size: 11.5px;
  color: rgba(26,21,16,.4);
  line-height: 1.4;
  font-style: italic;
  display: block;
  margin-top: 2px;
}
.fgn-mega__ml:hover .fgn-mega__ml-name { color: #B8922A; }

/* Footer */
.fgn-mega__foot {
  border-top: 1px solid rgba(26,21,16,.05);
  margin-top: 16px;
  padding-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fgn-mega__foot-l {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 7.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(26,21,16,.4);
  white-space: nowrap;
}
.fgn-mega__foot-a {
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 7.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(26,21,16,.55);
  text-decoration: none;
  border-bottom: 1px solid rgba(26,21,16,.11);
  padding-bottom: 1px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.fgn-mega__foot-a:hover { color: #B8922A; border-color: #B8922A; }

/* ── CTA button ─────────────────────────────────────────── */
.fgn-cta {
  padding: 7px 18px;
  background: var(--fgn-cta-bg, #B8922A);
  color: var(--fgn-cta-text, #1A1510) !important;
  border-radius: 3px;
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  margin-left: 10px;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.fgn-cta:hover { background: var(--fgn-active-color, #C9A84C); }

/* ── Mobile ─────────────────────────────────────────────── */
.fgn-mobile-links {
  display: flex; flex-direction: column;
  list-style: none; margin: 0; padding: 10px 0 6px;
  background: transparent;
}
.fgn-mobile-links > li > a {
  display: block; padding: 12px 22px;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 16px; color: rgba(255,255,255,.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s, color .15s;
}
.fgn-mobile-links > li > a:hover { color: #fff; background: rgba(255,255,255,.04); }
.fgn-mob-row { position: relative; border-bottom: 1px solid rgba(255,255,255,.04); }
.fgn-mob-row > a { display: block; padding: 12px 44px 12px 22px; font-family: var(--font-serif, Georgia, serif); font-size: 16px; color: rgba(255,255,255,.7); text-decoration: none; transition: background .15s; }
.fgn-mob-toggle { position: absolute; right: 0; top: 0; bottom: 0; width: 44px; background: none; border: none; color: rgba(255,255,255,.35); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .15s; }
.fgn-mob-toggle:hover { color: rgba(255,255,255,.7); }
.fgn-mob-arrow { display: block; transition: transform .2s; }
.fgn-mob-toggle[aria-expanded="true"] .fgn-mob-arrow { transform: rotate(180deg); }
.fgn-mob-sub { display: none; background: rgba(0,0,0,.2); padding: 6px 0; }
.fgn-mob-sub li a { display: block; padding: 10px 22px 10px 38px; font-family: var(--font-serif, Georgia, serif); font-size: 14px; color: rgba(255,255,255,.45); text-decoration: none; transition: color .15s; }
.fgn-mob-sub li a:hover { color: rgba(250,246,237,.75); }
.fgn-mob-cta { padding: 14px 20px 20px; background: transparent; border-top: 1px solid rgba(201,168,76,.12); }
.fgn-mob-cta-btn { display: block; width: 100%; text-align: center; padding: 11px 0; background: #B8922A; color: #1A1510 !important; font-family: var(--font-serif, Georgia, serif); font-size: 13px; font-weight: 700; text-decoration: none; border-radius: 4px; }

/* ── Subnav system ──────────────────────────────────────── */
.fg-subnav,.fg-pillar-snav,.snav,.fg-toc { position: sticky; top: calc(var(--fgn-bar-height,62px) + var(--wp-admin--admin-bar--height,0px)); z-index: 80; background: var(--fg-ink,#1A1510); border-bottom: 1px solid rgba(201,168,76,.15); width: 100%; }
.fg-subnav__inner,.fg-pillar-snav__inner,.snav-inner,.fg-toc__inner { display: flex; align-items: center; height: 46px; max-width: 1100px; margin: 0 auto; padding: 0 24px; overflow-x: auto; overflow-y: visible; flex-wrap: nowrap; scrollbar-width: none; }
.fg-subnav__label,.fg-pillar-snav__label,.snav-label,.fg-toc__label { font-family: var(--font-mono,monospace); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-gold,#B8922A); white-space: nowrap; flex-shrink: 0; margin-right: 16px; opacity: .8; }
.fg-subnav__links,.fg-pillar-snav__links,.snav-links,.fg-toc__links { display: flex; align-items: center; gap: 3px; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; flex-shrink: 0; }
.fg-subnav__links a,.fg-pillar-snav__links a,.snav-links a,.fg-toc__links a { font-family: var(--font-serif,Georgia,serif); font-size: 11px; color: rgba(246,240,228,.42); text-decoration: none; padding: 3px 11px; border-radius: 99px; border: 1px solid rgba(246,240,228,.08); white-space: nowrap; display: inline-block; transition: color .15s,background .15s; line-height: 1.8; }
.fg-subnav__links a:hover,.fg-pillar-snav__links a:hover,.snav-links a:hover,.fg-toc__links a:hover { color: rgba(246,240,228,.82); background: rgba(246,240,228,.06); }
.fg-subnav__links a.active,.fg-pillar-snav__links a.active,.snav-links a.active,.fg-toc__links a.active,
.fg-subnav__links a.is-active,.fg-pillar-snav__links a.is-active,.snav-links a.is-active,.fg-toc__links a.is-active { background: var(--fg-gold,#B8922A); color: var(--fg-ink,#1A1510) !important; border-color: var(--fg-gold,#B8922A); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .fgn-links { display: none !important; }
  .fgn-cta   { display: none !important; }
  .fgn-mega  { display: none !important; }
}
