/* ============================================================
   Global navbar component
   Pairs with templates/core/_navbar.html and js/navbar.js.
   Self-contained (own tokens) so it can load on any page,
   regardless of whether style.css or base.css is present.
   Variants: .nav (light, homepage) / .nav--dark (inner pages).
   ============================================================ */

/* Clearance for the fixed, full-width topbar. */
body { padding-top: 88px; }
/* Homepage: the hero flows under the navbar instead. */
body.body--nav-overlay { padding-top: 0; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.nav {
  --nav-primary: #005ca7;
  --nav-ink: #414752;
  --nav-font: "Manrope", "Inter", sans-serif;
  width: 100%;
  background: #f8faf8;
  color: var(--nav-ink);
  box-shadow: 0 1px 0 rgba(15, 15, 15, 0.08);
}

.nav--dark {
  background: #0f1216;
  color: #fff;
  box-shadow: none;
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 48px;
  height: 88px;
  max-width: 1280px;
  margin-inline: auto;
  padding: 0 40px;
}

.nav__logo img { display: block; }

/* --- links --- */

.nav__links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-family: var(--nav-font);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 0.7px;
  color: inherit;
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease;
}

.nav__link:hover { color: var(--nav-primary); }
.nav__link--active {
  color: var(--nav-primary);
  border-bottom-color: var(--nav-primary);
}

.nav--dark .nav__link:hover { color: #9ec7e8; }
.nav--dark .nav__link--active {
  color: #fff;
  border-bottom-color: #fff;
}

/* --- search (hidden until toggled; replaces the links while open) --- */

.nav__search {
  display: none;
  position: relative;
  flex: 1;
  max-width: 577px;
}

.nav--search-open .nav__search { display: block; }
.nav--search-open .nav__links { display: none; }

.nav__search input {
  width: 100%;
  height: 38px;
  background: #fff;
  border: 1px solid rgba(197, 197, 216, 0.5);
  border-radius: 9999px;
  padding: 0 16px 0 33px;
  font: 400 14px/1 "Inter", system-ui, sans-serif;
  color: #374151;
}
.nav__search input::placeholder { color: #6b7280; }

.nav__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* --- actions --- */

.nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.nav__icon-btn {
  display: flex;
  padding: 8px;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* --- language dropdown --- */

.nav__lang {
  position: relative;
}

.nav__icon-btn--globe {
  align-items: center;
  gap: 4px;
}

.nav__lang-current {
  font-family: var(--nav-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.nav__lang-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 160px;
  background: #fff;
  color: var(--nav-ink);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 15, 15, 0.16);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  z-index: 1200;
}

.nav__lang.is-open .nav__lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__lang-form { margin: 0; }

.nav__lang-option {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-family: var(--nav-font);
  font-size: 14px;
  font-weight: 500;
  color: inherit;
}

.nav__lang-option:hover { background: rgba(0, 92, 167, 0.08); }
.nav__lang-option--active {
  background: rgba(0, 92, 167, 0.1);
  color: var(--nav-primary);
  font-weight: 700;
}

.nav-menu__lang {
  display: none;
  gap: 10px;
}

.nav-menu__lang-form { margin: 0; }

.nav-menu__lang-option {
  padding: 6px 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  background: none;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--nav-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-menu__lang-option--active {
  color: #0f1216;
  background: #fff;
  border-color: #fff;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-primary);
  color: #fff;
  font-family: var(--nav-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.14px;
  padding: 8px 24px;
  border-radius: 9999px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  transition: filter .15s ease;
}
.nav__cta:hover { filter: brightness(1.12); }

/* --- full-screen mobile menu --- */
/* Lives inside .topbar (NOT .nav — its backdrop-filter would trap
   position:fixed descendants) so it inherits the component tokens. */

.nav__menu-btn { display: none; }

.nav-menu {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.nav-menu.is-open {
  opacity: 1;
  visibility: visible;
}

body.nav-menu-open { overflow: hidden; }

.nav-menu__close {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 12px;
  border: 0;
  background: none;
  cursor: pointer;
  color: #fff;
}

.nav-menu__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.nav-menu__link {
  font-family: var(--nav-font);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1.3px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease;
}

.nav-menu__link:hover { color: #9ec7e8; }
.nav-menu__link--active {
  color: #fff;
  border-bottom-color: #fff;
}

/* The overlay CTA can afford to be bigger than the bar one. */
.nav-menu > .nav__cta {
  font-size: 16px;
  padding: 12px 40px;
}

/* --- responsive --- */

@media (min-width: 769px) {
  .nav-menu { display: none; }
}

@media (max-width: 1200px) {
  .nav__inner { gap: 28px; padding: 0 24px; }
}

@media (max-width: 768px) {
  body { padding-top: 64px; }
  body.body--nav-overlay { padding-top: 0; }

  .nav__inner { height: 64px; gap: 16px; padding: 0 20px; }
  .nav__links { display: none; }
  .nav__logo img { width: 40px; height: auto; }

  /* CTA moves into the full-screen menu; globe is hidden on mobile
     (its language options move into .nav-menu__lang instead) */
  .nav__lang,
  .nav > .nav__actions .nav__cta { display: none; }
  .nav__menu-btn { display: flex; }
  .nav-menu__lang { display: flex; }
}
