/* Shared top nav - included via templates/mapui/_navbar.html on every
   real page. navbar.css itself is loaded on every single page (confirmed:
   all 15 templates), so it's also the one safe place for a site-wide
   mobile-overflow guard: a real bug was found where an un-scrollable wide
   table on Search forced <body> wider than the viewport, which stretched
   the navbar (width:100% of body) off both edges on mobile ("white bars on
   the sides"). Fixed at the table (see search.css's .table-scroll), but
   this is a defensive backstop against the same class of bug anywhere else
   on the site - the page should scroll vertically only, any wide content
   (tables, etc.) must contain its own horizontal scroll. */
html { overflow-x: hidden; max-width: 100%; }
body { overflow-x: hidden; max-width: 100%; }

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&display=swap');

/* Nivora wordmark logotype - Syne, navy-to-gold gradient text (chosen
   directly by the user from a set of font/color proofs). Two variants:
   the default reads on light surfaces (footer, auth pages); -inverse
   swaps the dark end for a pale blue so it stays legible on the navbar's
   dark navy background, where navy-on-navy text would vanish. */
.nivora-wordmark {
  font-family: 'Syne', sans-serif; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(90deg, #12293a, #c8922e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nivora-wordmark-inverse {
  font-family: 'Syne', sans-serif; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(90deg, #bcd6ec, #d9a441);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.app-nav {
  display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 56px; flex: none;
  background: #12233b; color: #fff; position: relative; z-index: 20;
}
.app-nav-brand {
  display: flex; align-items: center; color: #fff; text-decoration: none;
  font-size: 21px; letter-spacing: -.01em;
}

/* Real bug fix, direct report: on phones the nav (brand + 6-7 links +
   language select + profile/auth buttons, all in one fixed-width flex row)
   had no breakpoint at all - it just overflowed horizontally with no way
   to reach the links past the edge of the screen. Below 860px, the links
   and profile section collapse into a hamburger-toggled dropdown panel
   instead of trying to cram everything into one 56px-tall row. */
.app-nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 32px; height: 32px; margin-left: auto; background: none; border: none;
  cursor: pointer; padding: 0;
}
.app-nav-toggle span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

.app-nav-collapse { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 0; }

.app-nav-links { display: flex; gap: 4px; margin-right: auto; }
.app-nav-links a {
  color: rgba(255,255,255,.72); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 6px; transition: background .12s, color .12s;
}
.app-nav-links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav-links a.active { background: rgba(255,255,255,.12); color: #fff; }

.app-nav-profile { position: relative; display: flex; align-items: center; gap: 10px; }
.app-nav-lang { display: flex; align-items: center; }
.app-nav-lang select {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px; padding: 6px 8px; font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .12s, color .12s;
}
.app-nav-lang select:hover { background: rgba(255,255,255,.14); color: #fff; }
.app-nav-lang select:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.app-nav-lang select option { color: #16202c; }
.app-nav-link {
  color: rgba(255,255,255,.85); text-decoration: none; font-size: 13.5px; font-weight: 500;
  background: none; border: none; padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-family: inherit; transition: background .12s, color .12s;
}
.app-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav-btn {
  background: #3d8bc4; color: #fff; text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: 6px; transition: background .12s;
}
.app-nav-btn:hover { background: #2f75a8; }

.app-nav-profile-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer;
  color: #fff; padding: 6px 8px 6px 6px; border-radius: 20px; transition: background .12s;
}
.app-nav-profile-btn:hover { background: rgba(255,255,255,.08); }
.app-nav-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: #3d8bc4; font-size: 12px; font-weight: 700;
}
.app-nav-username { font-size: 13px; font-weight: 500; }
.app-nav-caret { font-size: 9px; opacity: .7; }

.app-nav-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px;
  background: #fff; color: #16202c; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 8px; z-index: 30;
}
.app-nav-dropdown.open { display: block; }
.app-nav-dropdown-tier {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #8a94a3;
  padding: 8px 10px 6px; display: flex; align-items: center; gap: 6px;
}
.app-nav-tier-badge {
  background: #fdf1d8; color: #92650a; padding: 1px 6px; border-radius: 4px; font-size: 10px;
  text-transform: none; letter-spacing: 0; font-weight: 600;
}
.app-nav-dropdown a, .app-nav-dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 6px;
  color: #16202c; text-decoration: none; font-size: 13.5px; border: none; background: none;
  cursor: pointer; font-family: inherit;
}
.app-nav-dropdown a:hover, .app-nav-dropdown button:hover { background: #f2f5f8; }
.app-nav-dropdown form { margin: 0; }

@media (max-width: 860px) {
  .app-nav { flex-wrap: wrap; gap: 0; padding: 0 16px; }
  .app-nav-toggle { display: flex; }

  /* Collapsed by default - .open (toggled by navbar.js) reveals it as a
     full-width panel dropping down from the bar, links and profile section
     stacked vertically instead of squeezed into one row. */
  .app-nav-collapse {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #12233b; max-height: calc(100vh - 56px); overflow-y: auto;
    box-shadow: 0 12px 24px rgba(0,0,0,.25);
  }
  .app-nav.open .app-nav-collapse { display: flex; }

  .app-nav-links { flex-direction: column; gap: 0; margin-right: 0; padding: 8px 8px 4px; }
  .app-nav-links a { padding: 12px 14px; }

  .app-nav-profile {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.1);
  }
  .app-nav-lang { align-self: flex-start; }
  .app-nav-profile-btn { justify-content: flex-start; width: 100%; }
  .app-nav-dropdown { position: static; box-shadow: none; margin-top: 4px; width: 100%; }
  .app-nav-link, .app-nav-btn { text-align: center; }
}
