/* ABOUTME: Horizontal inline navigation bar with transparent black background */
/* ABOUTME: Clean single-row menu with white text and modern responsive design */

/* ============================================
   1. CSS Variables - Theme System
   ============================================ */
:root {
  /* Colors */
  --menu-bg: rgba(0, 0, 0, 0.2);
  --menu-bg-scrolled: rgba(0, 0, 0, 0.3);
  --menu-text: #ffffff;
  --menu-text-hover: #ffffff;
  --menu-hover-bg: rgba(255, 255, 255, 0.1);
  --menu-active-bg: rgba(255, 255, 255, 0.15);
  --menu-border: rgba(255, 255, 255, 0.1);
  --accent-color: #ffffff;

  /* Spacing */
  --menu-height: 60px;
  --menu-padding-x: 1.5rem;
  --menu-padding-y: 1rem;

  /* Animation */
  --menu-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --menu-font-size: 0.95rem;
  --menu-font-weight: 400;
  --menu-font-weight-active: 600;

  /* Z-index */
  --menu-z-index: 1000;
}

/* ============================================
   2. Menu Container (Top Bar)
   ============================================ */
.gn-menu-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--menu-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--menu-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--menu-border);
  z-index: var(--menu-z-index);
  padding: 0 var(--menu-padding-x);
  margin: 0;
  list-style: none;
  transition: all var(--menu-transition);
}

.gn-menu-main.scrolled {
  background: var(--menu-bg-scrolled);
}

/* Ensure content doesn't hide under fixed navbar */
html, body {
  margin: 0;
  padding: 0;
}

body {
  padding-top: var(--menu-height);
}

/* ============================================
   3. Menu Items (Inline Horizontal Layout)
   ============================================ */
.gn-menu-main > li {
  position: relative;
  display: inline-block;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Hide the trigger (hamburger) on desktop - only show on mobile */
.gn-trigger {
  display: none;
}

/* Hide the dropdown menu wrapper entirely - we want inline menu */
.gn-menu-wrapper {
  display: none;
}

/* Top level menu links - these are the only visible items */
.gn-menu-main > li > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--menu-padding-y);
  color: var(--menu-text);
  text-decoration: none;
  font-size: var(--menu-font-size);
  font-weight: var(--menu-font-weight);
  transition: all var(--menu-transition);
  white-space: nowrap;
  position: relative;
}

.gn-menu-main > li > a:hover,
.gn-menu-main > li > a:focus {
  color: var(--menu-text-hover);
  background: var(--menu-hover-bg);
  outline: none;
}

/* Active indicator line */
.gn-menu-main > li > a.active {
  background: var(--menu-active-bg);
  font-weight: var(--menu-font-weight-active);
}

.gn-menu-main > li > a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: var(--accent-color);
}

/* ============================================
   4. Icons (Font Awesome)
   ============================================ */
.gn-menu-main > li > a i {
  margin-right: 0.5rem;
  font-size: 1rem;
  transition: transform var(--menu-transition);
}

.gn-menu-main > li > a:hover i {
  transform: scale(1.1);
}

/* ============================================
   5. Accessibility
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus states for keyboard navigation */
.gn-menu-main > li > a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -4px;
}

/* ============================================
   6. Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
  /* Show hamburger trigger */
  .gn-trigger {
    display: block;
    order: -1;
  }

  .gn-trigger button {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--menu-text);
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--menu-transition);
    border-radius: 4px;
  }

  .gn-trigger button:hover {
    background: var(--menu-hover-bg);
  }

  .gn-trigger span.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  /* Show dropdown menu wrapper on mobile */
  .gn-menu-wrapper {
    display: block;
    position: fixed;
    top: var(--menu-height);
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--menu-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: all var(--menu-transition);
    z-index: calc(var(--menu-z-index) - 1);
    max-height: calc(100vh - var(--menu-height));
    overflow-y: auto;
  }

  .gn-menu-wrapper.gn-open-all {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Mobile menu items */
  .gn-scroller {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .gn-menu {
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
  }

  .gn-menu li {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--menu-border);
  }

  .gn-menu li:last-child {
    border-bottom: none;
  }

  .gn-menu li a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--menu-text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: var(--menu-font-weight);
    transition: all var(--menu-transition);
    cursor: pointer;
  }

  .gn-menu li a:hover,
  .gn-menu li a:focus {
    background: var(--menu-hover-bg);
    outline: none;
  }

  .gn-menu li a i {
    width: 1.5rem;
    min-width: 1.5rem;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
  }

  /* Hide non-essential top-level menu items on mobile */
  .gn-menu-main > li:not(.gn-trigger):not(:last-child) {
    display: none;
  }

  /* Search item styling */
  .gn-search-item {
    position: relative;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--menu-border);
  }

  .gn-search {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--menu-border);
    border-radius: 6px;
    color: var(--menu-text);
    font-size: 1rem;
    outline: none;
    transition: all var(--menu-transition);
  }

  .gn-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  .gn-search:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
  }

  .gn-search-item > a {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--menu-text);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--menu-transition);
  }

  .gn-search-item > a:hover {
    background: var(--menu-hover-bg);
  }

  .gn-search-item > a span {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --menu-height: 56px;
    --menu-padding-x: 0.75rem;
  }

  body {
    padding-top: 56px;
  }

  .gn-menu-wrapper {
    top: 56px;
    max-height: calc(100vh - 56px);
  }
}

/* ============================================
   7. Print Styles
   ============================================ */
@media print {
  .gn-menu-main,
  .gn-menu-wrapper {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
  }
}

/* ============================================
   8. Legacy Icon Class Support
   ============================================ */
.gn-icon::before,
.gn-icon-menu::before {
  display: none;
}

.gn-selected {
  background: none;
}

/* ============================================
   9. Smooth Scroll Behavior
   ============================================ */
html {
  scroll-behavior: smooth;
}

html.menu-fixed {
  scroll-padding-top: var(--menu-height);
}
