/* nav.css */

/* Full-width container, centered with flex */
#nav-shell {
  display: flex;
  justify-content: center;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}

.nav-bar {
  display: flex;                /* Ensure it's a flex container */
  justify-content: space-between; /* Left and right groups separated */
  align-items: center;          /* Vertically centered */
  flex-wrap: nowrap;            /* Prevent wrapping */
  gap: 2rem; 

  width: min(calc(var(--card-max) + 2 * var(--card-pad)), 100vw - 2rem);
  box-sizing: border-box;
  margin-top: 0.5rem; /* adjust if needed */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-radius: 24px 24px 24px 24px;
  font-weight: 600;
  padding: 1rem 2rem;

  pointer-events: auto;
}

/* Left and right groups */
.nav-left, .nav-right{
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-bar a, .menu-button{
  color: #1c1038;
  text-decoration: none;
  font-weight: 700;
}

/* Dropdown */
.menu{
  position: relative;
}

.menu-button{
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.menu .caret{ font-size: .9em; }

.menu-list{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.18);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;

  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

/* Keep open while hovering anywhere over the trigger OR the panel */
.menu:hover .menu-list,
.menu:focus-within .menu-list{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-list a{
  padding: .55rem .7rem;
  border-radius: 10px;
}

.menu-list a:hover{
  background: rgba(0,0,0,0.06);
}

/* Small screens */
@media (max-width: 780px){
  .nav-bar{
    width: calc(100vw - 1rem);
    padding: .8rem 1rem;
  }
  .nav-left, .nav-right{ gap: .8rem; }
}