/**
 * Barre de navigation + menu mobile — même apparence et comportement que index.html (landing).
 * Pages dans /pages/ : <link rel="stylesheet" href="../styles/landing-navbar.css">
 */

.landing-nav-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  overflow: visible;
  flex-shrink: 0;
}

.navbar {
  position: relative;
  z-index: 2;
  background: #ffffff;
  padding-top: 8px;
}

.landing-nav-fade {
  display: none;
}

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}

.navbar-logo {
  position: absolute;
  left: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111111;
  text-decoration: none;
}

.navbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.navbar-links a {
  font-size: 14px;
  font-weight: 500;
  color: #444444;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.navbar-links a:hover {
  color: #111111;
  background: #f2f2f2;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  font-size: 14px;
  font-weight: 500;
  color: #444444;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-trigger:hover {
  color: #111111;
  background: #f2f2f2;
}

.nav-dropdown-chevron {
  display: inline-flex;
  transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 200px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-menu a {
  display: block;
  padding: 4px 8px;
  font-size: 14px;
  color: #444444;
  text-decoration: none;
  border-radius: 6px;
}

.nav-dropdown-menu a:hover {
  background: #f5f5f5;
  color: #111111;
}

.navbar-actions {
  position: absolute;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #111111;
  border-radius: 8px;
}

.menu-toggle:hover {
  background: #f2f2f2;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  z-index: 200000;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  isolation: isolate;
}

.mobile-menu-overlay.open {
  display: block;
  pointer-events: auto;
}

.mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(17, 17, 17, 0.35);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  transition: opacity 0.26s ease;
  z-index: 0;
}

.mobile-menu-overlay.mobile-menu-overlay--animate-in .mobile-menu-backdrop {
  opacity: 1;
}

.mobile-menu-backdrop:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -6px;
}

.mobile-menu.mobile-menu--inner {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  top: 72px;
  max-height: min(58vh, 420px);
  margin: 0;
  padding: 16px max(20px, env(safe-area-inset-right)) 18px max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  transform-origin: top center;
  opacity: 0;
  transform: translateY(-22px) scale(0.98);
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  z-index: 1;
}

.mobile-menu-overlay.mobile-menu-overlay--animate-in .mobile-menu.mobile-menu--inner {
  opacity: 1;
  transform: translateY(0) scale(1);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-backdrop {
    transition: none;
    opacity: 1;
  }

  .mobile-menu.mobile-menu--inner {
    transition: none;
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

@media (max-width: 640px) {
  .mobile-menu.mobile-menu--inner {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.mobile-menu-brand {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: #111111;
}

.mobile-menu-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #111111;
  border-radius: 8px;
  font-size: 28px;
  line-height: 1;
}

.mobile-menu-close:hover {
  background: #f2f2f2;
}

.mobile-menu a {
  display: block;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 500;
  color: #111111;
  text-decoration: none;
  border-radius: 10px;
}

.mobile-menu a:hover {
  background: #f2f2f2;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu-top-link {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 600;
  color: #111111;
  text-decoration: none;
  border-radius: 10px;
}

.mobile-menu-top-link:hover {
  background: #f2f2f2;
}

.mobile-menu-disclosure {
  border-radius: 10px;
  overflow: hidden;
}

.mobile-menu-disclosure-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 600;
  color: #111111;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: 10px;
}

.mobile-menu-disclosure-summary:hover {
  background: #f2f2f2;
}

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

.mobile-menu-disclosure-summary::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 1px;
  border-right: 2px solid #555555;
  border-bottom: 2px solid #555555;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.mobile-menu-disclosure[open] .mobile-menu-disclosure-summary::after {
  transform: rotate(225deg);
}

.mobile-menu-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px 12px;
}

.mobile-menu-panel a {
  padding: 12px 12px;
  font-size: 15px;
  font-weight: 500;
  color: #333333;
  border-radius: 8px;
}

.mobile-menu-panel a:hover {
  background: #f2f2f2;
}

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid #ececec;
}

.mobile-menu.mobile-menu--inner .btn-outline {
  margin-top: 0;
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.btn-outline {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid #e1e1e1;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-outline:hover {
  border-color: #111111;
  background: #fafafa;
}

.btn-primary {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: #333333;
  border-color: #333333;
}

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

  .navbar-inner {
    justify-content: space-between;
  }

  .navbar-logo {
    position: static;
  }

  .navbar-actions {
    position: static;
  }

  .navbar-links,
  .navbar-actions {
    display: none;
  }
}

@media (max-width: 640px) {
  .navbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 0;
  }
}
