/* Shared primary navigation — ONE menu, identical on Celestial Atlas
   and Celestial Atlas. Self-contained colours (no per-site theme vars)
   so both sites render the exact same bar. Uses nsnav-* only.

   Written mobile-first: the burger and the drawer are the DEFAULT state,
   and the desktop bar is layered on with @media (min-width:861px).
   (An earlier desktop-first version had the burger start at display:none
   and the media override failed to render in some engines.) */

.nsnav{
  position:sticky;top:0;z-index:60;
  background:#f6f1e7;
  border-bottom:1px solid rgba(38,34,28,.10);
}
@supports ((backdrop-filter:blur(4px)) or (-webkit-backdrop-filter:blur(4px))){
  .nsnav{background:rgba(246,241,231,.92);
    backdrop-filter:saturate(140%) blur(10px);
    -webkit-backdrop-filter:saturate(140%) blur(10px);}
}
.nsnav-in{
  max-width:1160px;margin:0 auto;padding:12px 22px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;position:relative;
}

/* ---------- brand: shared structure, per-site name ---------- */
.nsnav-brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:#26221c;flex:none;}
.nsnav-mark{width:34px;height:34px;flex:none;display:block;}
.nsnav-btext{display:flex;flex-direction:column;line-height:1.15;}
.nsnav-bname{
  font-family:Georgia,'Times New Roman',serif;
  font-size:17px;font-weight:600;letter-spacing:.01em;white-space:nowrap;
}
.nsnav-bsub{
  font-size:9.5px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;
  color:#8b8275;white-space:nowrap;margin-top:2px;
}

/* ---------- left cluster: brand + optional "back to main site" ---------- */
.nsnav-left{display:flex;align-items:center;gap:10px;flex:none;min-width:0;}
.nsnav-home{
  display:inline-flex;align-items:center;gap:5px;flex:none;
  font-size:11px;font-weight:600;letter-spacing:.02em;line-height:1;
  padding:6px 9px;border-radius:999px;
  border:1px solid rgba(38,34,28,.18);background:rgba(255,255,255,.72);
  color:#6b6357;text-decoration:none;white-space:nowrap;
  transition:color .12s ease,background .12s ease,border-color .12s ease;
}
.nsnav-home:hover{color:#a63a2e;border-color:rgba(166,58,46,.42);background:rgba(166,58,46,.07);}
.nsnav-home i{font-style:normal;opacity:.7;font-size:12px;line-height:1;}

/* ---------- burger (default: visible) ---------- */
.nsnav-burger{
  display:flex;width:42px;height:42px;padding:0;flex:none;
  border:1px solid rgba(38,34,28,.16);border-radius:10px;background:rgba(255,255,255,.7);
  cursor:pointer;flex-direction:column;align-items:center;justify-content:center;gap:4px;
}
.nsnav-burger span{display:block;width:18px;height:2px;background:#26221c;border-radius:2px;
  transition:transform .18s ease,opacity .18s ease;}
.nsnav-burger[aria-expanded="true"] span:nth-child(1){transform:translateY(6px) rotate(45deg);}
.nsnav-burger[aria-expanded="true"] span:nth-child(2){opacity:0;}
.nsnav-burger[aria-expanded="true"] span:nth-child(3){transform:translateY(-6px) rotate(-45deg);}

/* ---------- links: drawer by default ---------- */
.nsnav-links{
  display:none;
  position:absolute;top:100%;left:0;right:0;
  flex-direction:column;align-items:stretch;gap:0;
  padding:8px 22px 20px;background:#f6f1e7;
  border-bottom:1px solid rgba(38,34,28,.12);
  box-shadow:0 22px 34px -26px rgba(38,34,28,.6);
  max-height:calc(100vh - 66px);overflow-y:auto;z-index:70;
}
.nsnav-links.is-open{display:flex;}

.nsnav-item{position:relative;width:100%;display:block;}
.nsnav-link{
  font-family:inherit;font-size:15px;line-height:1.2;color:#3c362e;
  background:none;border:0;border-bottom:1px solid rgba(38,34,28,.08);
  text-decoration:none;padding:13px 0;border-radius:0;
  cursor:pointer;display:flex;align-items:center;gap:6px;
  width:100%;justify-content:space-between;
  transition:color .12s ease,background .12s ease;
}
.nsnav-link:hover{color:#a63a2e;}
/* no font-weight change on active — it would shift the bar width */
.nsnav-item.is-on>.nsnav-link{color:#a63a2e;background:rgba(166,58,46,.08);}
.nsnav-caret{
  width:5px;height:5px;flex:none;
  border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;
  transform:rotate(45deg) translateY(-1px);opacity:.65;
}

/* ---------- dropdowns: always open in the drawer (no hover on touch) ---------- */
.nsnav-sub{
  position:static;display:flex;flex-direction:column;
  width:100%;min-width:0;padding:4px 0 8px 12px;
  border:0;box-shadow:none;background:none;
}
.nsnav-sub.is-wide{display:grid;grid-template-columns:1fr;min-width:0;}
.nsnav-sublink{
  padding:9px 0;border-radius:7px;font-size:14px;color:#3c362e;
  text-decoration:none;white-space:normal;
}
.nsnav-sublink:hover,.nsnav-sublink.is-on{color:#a63a2e;}

/* ---------- language pill ---------- */
.nsnav-lang{
  display:flex;align-items:center;gap:2px;padding:4px;
  border:1px solid rgba(38,34,28,.14);border-radius:10px;background:rgba(255,255,255,.6);
  align-self:flex-start;margin:14px 0 0;
}
.nsnav-langbtn{
  font-size:11.5px;font-weight:600;line-height:1.2;min-width:36px;text-align:center;
  padding:5px 8px;border-radius:999px;color:#6b6357;text-decoration:none;letter-spacing:.02em;
  transition:background .12s ease,color .12s ease;
}
.nsnav-langbtn:hover{color:#a63a2e;}
.nsnav-langbtn.is-on{background:#a63a2e;color:#fff;}

/* ---------- desktop bar ---------- */
@media (min-width:861px){
  .nsnav-burger{display:none;}

  .nsnav-links{
    display:flex;position:static;flex-direction:row;align-items:center;gap:2px;
    padding:0;background:none;border:0;box-shadow:none;
    max-height:none;overflow:visible;
  }
  .nsnav-item{position:relative;width:auto;display:flex;align-items:center;}
  .nsnav-link{
    width:auto;justify-content:flex-start;white-space:nowrap;
    font-size:13px;line-height:1;padding:9px 11px;border:0;border-radius:8px;
  }
  .nsnav-link:hover{background:rgba(166,58,46,.06);}
  .nsnav-item.is-on>.nsnav-link{background:rgba(166,58,46,.08);}

  .nsnav-sub{
    position:absolute;top:100%;left:0;margin-top:10px;
    display:none;width:auto;min-width:212px;padding:7px;
    background:#fffdf8;border:1px solid rgba(38,34,28,.12);border-radius:10px;
    box-shadow:0 18px 40px -24px rgba(38,34,28,.5);z-index:70;
  }
  /* Hover bridge: the 10px offset above is dead space the pointer would
     otherwise fall through, closing the menu mid-travel. This transparent
     strip still belongs to .nsnav-sub, so :hover on the parent survives the
     crossing. Never remove while `margin-top` is > 0. */
  .nsnav-sub::before{
    content:"";position:absolute;left:0;right:0;top:-14px;height:14px;
  }
  .nsnav-sub.is-wide{display:none;grid-template-columns:repeat(2,minmax(178px,1fr));min-width:392px;}
  .nsnav-item:hover>.nsnav-sub,
  .nsnav-item:focus-within>.nsnav-sub{display:flex;}
  .nsnav-item:hover>.nsnav-sub.is-wide,
  .nsnav-item:focus-within>.nsnav-sub.is-wide{display:grid;}
  .nsnav-sublink{
    padding:9px 12px;font-size:13px;white-space:nowrap;
  }
  .nsnav-sublink:hover,.nsnav-sublink.is-on{background:rgba(166,58,46,.08);}

  .nsnav-left{gap:14px;}
  .nsnav-home{font-size:11.5px;padding:7px 12px;}

  .nsnav-lang{
    align-self:auto;margin:0 0 0 10px;padding:3px;border-radius:999px;
  }
}
