/* ============================================
   Site Header & Navigation
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: 3.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.5rem;
  background: rgba(6, 69, 170, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

/* ---- Logo ---- */
.site-logo {
  font-family: var(--font-family-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.site-logo:hover {
  opacity: 0.85;
  color: #fff;
}

/* ---- Desktop Nav Links ---- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.nav-item {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-item__link {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-item__link:hover {
  color: #fff;
}

/* Active indicator — animated underline */
.nav-item.is-active .nav-item__link {
  color: #fff;
  font-weight: 600;
}

.nav-item.is-active .nav-item__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--highlight-color);
  animation: underline-grow 0.3s ease-out forwards;
}

@keyframes underline-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Disabled items */
.nav-item.is-disabled .nav-item__link {
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Hamburger Toggle (hidden on desktop) ---- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 102;
}

.menu-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Hamburger → X animation */
.menu-toggle.is-open .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.is-open .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   Mobile / Tablet — ≤ 768px
   ============================================ */
@media (max-width: 768px) {
  .site-header {
    height: 3rem;
  }

  .site-nav {
    padding: 0 1rem;
  }

  .site-logo {
    font-size: 1.15rem;
  }

  .menu-toggle {
    display: flex;
  }

  /* Sidebar */
  .nav-links {
    position: fixed;
    top: 3rem;
    right: 0;
    width: 20rem;
    height: calc(100vh - 3rem);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow-y: auto;
    background: #2c3e50;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
  }

  .nav-links.is-open {
    transform: translateX(0);
  }

  .nav-links.no-transition {
    transition: none !important;
  }

  .nav-item {
    height: auto;
    width: 100%;
  }

  .nav-item__link {
    height: auto;
    padding: 1rem 1.5rem;
    font-size: 1.35rem;
    color: #fff;
    border-left: none;
    justify-content: flex-start;
    transition: background 0.2s, color 0.2s;
    width: 100%;
  }

  .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .nav-item__link:hover {
    color: #fff;
  }

  /* Active state in sidebar — full width highlight */
  .nav-item.is-active {
    background: deepskyblue;
  }

  .nav-item.is-active:hover {
    background: deepskyblue;
  }

  .nav-item.is-active .nav-item__link {
    color: #000;
    font-weight: 800;
    font-size: 1.45rem;
  }

  .nav-item.is-active .nav-item__link::after {
    display: none;
  }

  /* Disabled state in sidebar */
  .nav-item.is-disabled .nav-item__link {
    color: rgba(255, 255, 255, 0.4);
  }
}

/* ---- Very small screens ---- */
@media (max-width: 360px) {
  .nav-links {
    width: 100vw;
  }
}

