/* nav.css — the site navigation (top bar + mobile drawer), on every page that has it.
   Kept out of styles.css so pages with their own design (YTT, Vyom Shanti, Altea, login…)
   can load the nav without the rest of the site stylesheet. The markup is generated by
   tools/build-nav.mjs; script.js marks the current page and opens the drawer. */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap");

/* ==================== SITE NAVIGATION (.site-nav + drawer) ====================
   One markup on every page with the drawer. A frosted floating bar: brand left, links
   centred, actions right. Below 960px it becomes brand · language · menu, and the rest
   lives in the drawer. script.js marks the current page with .is-active. */
.site-nav,
.nav-drawer {
  --nav-ink: #2a1046;
  --nav-text: #4b3d63;
  --nav-muted: #7a6d8c;
  --nav-brand: #481B79;
  --nav-brand-hover: #5a2890;
  --nav-gold: #806028;          /* gold darkened for text: 5.1:1 */
  --nav-gold-soft: #c7a46e;     /* decoration only */
  --nav-tint: #f2eaf9;
  --nav-line: rgba(72, 27, 121, 0.10);
  --nav-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
}

.site-nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(1180px, calc(100% - 24px));
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px var(--nav-line),
    0 12px 32px -14px rgba(42, 16, 70, 0.30);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px var(--nav-line),
    0 18px 40px -16px rgba(42, 16, 70, 0.38);
}
.site-nav ul,
.nav-drawer ul { list-style: none; margin: 0; padding: 0; }
.site-nav .hidden,
.nav-drawer .hidden { display: none !important; }

/* Brand */
.site-nav .nav-brand,
.nav-drawer .nav-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  text-decoration: none;
}
.nav-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 3px 10px -2px rgba(72, 27, 121, 0.35);
}
.nav-wordmark {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--nav-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-wordmark-accent { color: var(--nav-gold); }

/* Centre links */
.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.site-nav .nav-links a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--nav-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.site-nav .nav-links a:hover { background: rgba(72, 27, 121, 0.06); color: var(--nav-ink); }
.site-nav .nav-links a.is-active { background: var(--nav-tint); color: var(--nav-brand); font-weight: 600; }

/* Right-hand actions */
.site-nav .nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav .nav-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(72, 27, 121, 0.16);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--nav-text);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.site-nav .nav-lang i { font-size: 0.8rem; color: var(--nav-gold-soft); }
.site-nav .nav-lang:hover { border-color: var(--nav-gold-soft); background: rgba(199, 164, 110, 0.10); color: var(--nav-ink); }

.site-nav .nav-cta,
.nav-drawer .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--nav-brand);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 18px -8px rgba(72, 27, 121, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background-color 0.2s ease, transform 0.2s var(--nav-ease), box-shadow 0.2s ease;
}
.site-nav .nav-cta { height: 40px; padding: 0 18px; font-size: 0.88rem; }
.site-nav .nav-cta:hover,
.nav-drawer .nav-cta:hover {
  background: var(--nav-brand-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -10px rgba(72, 27, 121, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.site-nav .nav-cta:active,
.nav-drawer .nav-cta:active { transform: translateY(0) scale(0.98); }
.site-nav .nav-cta.is-active { box-shadow: 0 0 0 3px rgba(199, 164, 110, 0.55), 0 8px 18px -8px rgba(72, 27, 121, 0.7); }

.site-nav .nav-auth { position: relative; }
.site-nav .auth-nav-user { display: flex; align-items: center; }
.site-nav .nav-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--nav-brand);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.site-nav .nav-login i { font-size: 1.05rem; }
.site-nav .nav-login:hover { background: rgba(72, 27, 121, 0.06); color: var(--nav-brand); }

.site-nav .nav-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #c7a46e, #481B79);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(72, 27, 121, 0.55);
  transition: transform 0.2s var(--nav-ease);
}
.site-nav .nav-avatar:hover { transform: scale(1.05); }
.site-nav .nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--nav-line), 0 20px 44px -18px rgba(42, 16, 70, 0.45);
}
.site-nav .nav-dropdown-name {
  margin: 0 0 4px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--nav-line);
  font-size: 0.8rem;
  color: var(--nav-muted);
}
.site-nav .nav-dropdown-name:empty { display: none; }
.site-nav .nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--nav-ink);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.site-nav .nav-dropdown a i { width: 16px; text-align: center; color: var(--nav-muted); }
.site-nav .nav-dropdown a:hover { background: var(--nav-tint); }
.site-nav .nav-dropdown .logout-link,
.site-nav .nav-dropdown .logout-link i { color: #b42318; }

/* Menu button (mobile) */
.site-nav .nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding-left: 13px;
  border: 0;
  border-radius: 14px;
  background: rgba(72, 27, 121, 0.07);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.site-nav .nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--nav-brand); }
.site-nav .nav-toggle span + span { width: 12px; }
.site-nav .nav-toggle:hover { background: rgba(72, 27, 121, 0.12); }

/* Keyboard focus */
.site-nav a:focus-visible,
.site-nav button:focus-visible,
.nav-drawer a:focus-visible,
.nav-drawer button:focus-visible {
  outline: 2px solid var(--nav-gold-soft);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .site-nav {
    top: 10px;
    width: calc(100% - 20px);
    height: 60px;
    grid-template-columns: 1fr auto auto;
    gap: 6px;
    padding: 0 8px;
    border-radius: 18px;
  }
  .site-nav .nav-links,
  .site-nav .nav-cta-item,
  .site-nav .nav-auth { display: none; }
  .site-nav .nav-toggle { display: inline-flex; }
}
@media (max-width: 360px) {
  .nav-wordmark { font-size: 0.92rem; }
  .site-nav .nav-lang { padding: 0 9px; }
}

/* Drawer */
#mobile-overlay.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(26, 5, 51, 0.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#mobile-overlay.nav-overlay.active { opacity: 1; pointer-events: auto; }

#mobile-drawer.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(88vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 24px 0 0 24px;
  background: #fbf9fd;
  box-shadow: -24px 0 60px -24px rgba(42, 16, 70, 0.45);
  transform: translateX(104%);
  /* hidden once closed: its shadow would otherwise bleed onto the page edge, and its
     links would still take keyboard focus while off-screen */
  visibility: hidden;
  transition: transform 0.4s var(--nav-ease), visibility 0s linear 0.4s;
}
#mobile-drawer.nav-drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.4s var(--nav-ease);
}

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nav-line);
}
.nav-drawer .nav-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 0;
  border-radius: 14px;
  background: rgba(72, 27, 121, 0.07);
  color: var(--nav-brand);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.3s var(--nav-ease);
}
.nav-drawer .nav-close:hover { background: rgba(72, 27, 121, 0.12); transform: rotate(90deg); }

.nav-drawer-links { display: flex; flex-direction: column; gap: 2px; }
.nav-drawer-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 10px 7px 8px;
  border: 0;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--nav-ink);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-drawer-links a i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--nav-tint);
  color: var(--nav-brand);
  font-size: 0.88rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-drawer-links a:hover { background: rgba(72, 27, 121, 0.05); color: var(--nav-ink); }
.nav-drawer-links a.is-active { background: var(--nav-tint); color: var(--nav-brand); font-weight: 600; }
.nav-drawer-links a.is-active i { background: var(--nav-brand); color: #fff; }
.nav-drawer-links .nav-logout { color: #b42318; }
.nav-drawer-links .nav-logout i { background: #fdecea; color: #b42318; }
#auth-nav-mobile { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--nav-line); }

.nav-drawer-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.nav-drawer .nav-cta--block {
  justify-content: space-between;
  height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-size: 1rem;
}
.nav-drawer-lang {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--nav-brand);
  text-decoration: none;
}
.nav-drawer-lang i { color: var(--nav-gold-soft); }
.nav-social { display: flex; gap: 8px; }
.nav-social a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: var(--nav-brand);
  box-shadow: 0 0 0 1px var(--nav-line);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s var(--nav-ease);
}
.nav-social a:hover { background: var(--nav-tint); color: var(--nav-gold); transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  .site-nav, .site-nav *, .nav-drawer, .nav-drawer *, .nav-overlay { transition: none !important; }
}
