/* ==========================================================================
   Democracy Ops main navigation bar
   For the pages that do not load home.css: Privacy, Terms, Help, the 404
   page and the form error page (drawn by inc/site-nav.php).

   These rules are a copy of the navigation and "Get started" button rules in
   home.css, which the home page and the guides use. If you change the bar's
   look in one file, make the same change in the other so every page matches.

   Loads after style.css and reuses its colors (--surface, --text, --text-dim,
   --primary, --note-bg). No inline styles, no third-party files.
   ========================================================================== */

.lp-nav-wrap {
  /* The values the bar needs from the home page's token list. */
  --lp-glass: rgba(255, 255, 255, 0.66);
  --lp-line: rgba(36, 71, 214, 0.14);
  --lp-grad: linear-gradient(135deg, #1a35ad 0%, #2447d6 48%, #3a62ea 100%);
  --lp-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --lp-shadow-lg: 0 30px 80px -20px rgba(36, 71, 214, 0.28), 0 12px 30px -12px rgba(14, 22, 51, 0.18);

  position: sticky;
  top: 0;
  z-index: 60;
  padding: 12px 16px 0;
}

/* Jumping to a heading on Privacy or Terms must not hide it under the bar.
   (The Help Center sets its own scroll padding in kb.css.) */
html:has(body.legal) {
  scroll-padding-top: 96px;
}

.lp-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 9px 10px 9px 22px;
  background: var(--lp-glass);
  border: 1px solid var(--lp-line);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 8px 30px -12px rgba(14, 22, 51, 0.18);
  transition: box-shadow 0.3s var(--lp-ease);
}

.lp-nav-wrap[data-stuck] .lp-nav {
  box-shadow: 0 14px 40px -14px rgba(14, 22, 51, 0.32);
}

.lp-nav-logo {
  display: block;
  flex: none;
}

.lp-nav-logo img {
  display: block;
  width: auto;
  height: 30px;
}

.lp-nav-links {
  display: flex;
  flex: none;
  gap: 2px;
  list-style: none;
}

/* Written with two classes so the list rules for the Privacy and Terms pages
   in style.css (".legal ul" and ".legal li") cannot add space inside the bar. */
.lp-nav .lp-nav-links {
  margin: 0 auto;
  padding: 0;
}

.lp-nav .lp-nav-links li {
  margin: 0;
}

.lp-nav-links a {
  display: block;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.lp-nav-links a:hover,
.lp-nav-links a[aria-current] {
  color: var(--primary);
  background: var(--note-bg);
}

.lp-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lp-nav-links + .lp-nav-actions {
  margin-left: 0;
}

.lp-nav-signin {
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 999px;
}

.lp-nav-signin:hover {
  color: var(--primary);
  background: var(--note-bg);
}

/* ---- "Get started" button ---------------------------------------------------- */

.lp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  color: #fff;
  background: var(--lp-grad);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 10px 24px -8px rgba(36, 71, 214, 0.55);
  transition: transform 0.25s var(--lp-ease), box-shadow 0.25s var(--lp-ease);
}

.lp-btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px rgba(36, 71, 214, 0.6);
}

.lp-btn:active {
  transform: translateY(0);
}

.lp-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--lp-ease);
}

.lp-btn:hover::after {
  transform: translateX(120%);
}

.lp-btn-sm {
  padding: 9px 18px;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ---- Phone menu --------------------------------------------------------------- */

.lp-menu {
  display: none;
  position: relative;
}

.lp-menu summary {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--lp-line);
  border-radius: 50%;
}

.lp-menu summary::-webkit-details-marker {
  display: none;
}

.lp-burger,
.lp-burger::before,
.lp-burger::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s var(--lp-ease), background 0.25s;
}

.lp-burger {
  position: relative;
}

.lp-burger::before,
.lp-burger::after {
  content: "";
  position: absolute;
  left: 0;
}

.lp-burger::before { top: -5px; }
.lp-burger::after { top: 5px; }

.lp-menu[open] .lp-burger { background: transparent; }
.lp-menu[open] .lp-burger::before { transform: translateY(5px) rotate(45deg); }
.lp-menu[open] .lp-burger::after { transform: translateY(-5px) rotate(-45deg); }

.lp-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 16px);
  z-index: 5;
  display: grid;
  min-width: 230px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--lp-line);
  border-radius: 22px;
  box-shadow: var(--lp-shadow-lg);
  animation: menuIn 0.25s var(--lp-ease);
}

.lp-menu-panel a {
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-radius: 14px;
}

.lp-menu-panel a:hover,
.lp-menu-panel a[aria-current] {
  background: var(--note-bg);
  color: var(--primary);
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

/* A thin progress line along the top edge while the page scrolls (browsers that support it). */
@supports (animation-timeline: scroll()) {
  .lp-nav-wrap::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    top: 0;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #2447d6, #a855f7, #2ea2db);
    transform: scaleX(0);
    transform-origin: 0 50%;
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes progress { to { transform: scaleX(1); } }

/* ---- Small screens -------------------------------------------------------------- */

@media (max-width: 400px) {
  .lp-nav-wrap {
    padding: 10px 10px 0;
  }

  .lp-nav {
    gap: 8px;
    padding: 7px 7px 7px 14px;
  }

  .lp-nav-logo img {
    height: 25px;
  }

  .lp-nav-actions {
    gap: 6px;
  }

  .lp-btn-sm {
    padding: 9px 14px;
    font-size: 0.9rem;
  }
}

@media (max-width: 900px) {
  .lp-nav-links,
  .lp-nav-signin {
    display: none;
  }

  .lp-menu {
    display: block;
  }

  /* With the links hidden, Get started and the menu button sit at the right edge. */
  .lp-nav-actions,
  .lp-nav-links + .lp-nav-actions {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-nav,
  .lp-btn,
  .lp-btn::after,
  .lp-nav-links a,
  .lp-burger,
  .lp-burger::before,
  .lp-burger::after,
  .lp-menu-panel {
    transition: none;
    animation: none;
  }
}

@media print {
  .lp-nav-wrap {
    display: none;
  }
}
