/* ============================================================
   ArcReady — Shared Navigation
   Used by index.html (the SPA) and every standalone content page
   (blog, store, study-guide, safety, theory, lab, reference, about,
   glossary, exam-companion). Self-contained: declares its own CSS
   variables so pages that don't load main.css still render the nav
   correctly and identically to the SPA.

   On index.html, nav items are <button data-tab="..."> elements
   driven by js/app.js (no page navigation, just tab switching).
   On every other page, the same visual markup is used but as real
   <a> links back to index.html's hash-routed tabs (e.g.
   ../index.html#study) or to the standalone page itself (Blog,
   Store) — index.html#handleHash() picks up the hash on load.
   ============================================================ */

:root {
  --red: #CC0000;
  --white: #FFFFFF;
  --charcoal: #1A1A1A;
  --gray-mid: #E0E0E0;
  --font-base: 'Inter', 'Roboto', sans-serif;
  --nav-height: 62px;
  --shadow-nav: 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-deep: 0 4px 24px rgba(0, 0, 0, 0.16);
  --transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--charcoal);
  z-index: 1000;
  box-shadow: var(--shadow-nav);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-icon {
  font-size: 22px;
  line-height: 1;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.nav-tab, .nav-tab-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.70);
  font-family: var(--font-base);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  height: 100%;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.nav-tab:hover, .nav-tab-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active, .nav-tab-link.active {
  color: var(--white);
  border-bottom-color: var(--red);
  background: rgba(204, 0, 0, 0.12);
}

.tab-icon {
  font-size: 13px;
}

/* Nav Toggle (Hamburger) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.nav-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--white);
  border-radius: 10px;
  transition: all 0.3s linear;
}

.nav-inner.nav-active .nav-toggle span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-inner.nav-active .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-inner.nav-active .nav-toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav-inner.nav-active .nav-tabs {
  display: flex !important;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-tabs {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--charcoal);
    height: auto;
    padding: 20px;
    box-shadow: var(--shadow-deep);
    border-top: 1px solid var(--gray-mid);
    z-index: 1001;
  }

  .nav-tab, .nav-tab-link {
    width: 100%;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 4px solid transparent;
  }

  .nav-tab.active, .nav-tab-link.active {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--red);
  }
}

/* Content pages only: the fixed nav needs the page pushed down by
   its height. index.html handles this via .main-content in main.css;
   standalone pages (blog, store, study-guide, etc.) use this instead. */
.content-page-body {
  margin-top: var(--nav-height);
}
