/* Header unique public + portail.
   Espacements FIXES : FR / EN / NL ne doivent plus décaler ni superposer. */

:root {
  --mdp-nav-h: 76px;
  /* Plus large : logo plus à gauche, actions plus à droite, marges égales */
  --mdp-nav-pad-x: 28px;
  --mdp-nav-max: 1480px;
  --mdp-logo-w: 200px;
  --mdp-nav-gap: 20px;
  --mdp-menu-gap: 8px;
  --mdp-lang-size: 36px;
  --mdp-actions-gap: 12px;
  --mdp-link-pad-y: 8px;
  --mdp-link-pad-x: 12px;
}

#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: #ffffff;
  border-bottom: 1px solid var(--border, #e5e8ef);
  transition: box-shadow 0.3s;
  box-shadow: none;
}
#site-nav.elevated {
  box-shadow: 0 8px 24px rgba(22, 27, 38, 0.07);
  border-bottom-color: transparent;
}

.nav-inner {
  display: grid;
  grid-template-columns: var(--mdp-logo-w) minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: var(--mdp-nav-gap);
  height: var(--mdp-nav-h);
  max-width: var(--mdp-nav-max);
  margin: 0 auto;
  padding: 0 var(--mdp-nav-pad-x);
  width: 100%;
  box-sizing: border-box;
}

/* Logo: colonne fixe, image contenue, jamais de débordement */
.nav-logo {
  display: flex;
  align-items: center;
  justify-self: start;
  width: var(--mdp-logo-w);
  max-width: var(--mdp-logo-w);
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}
.nav-logo img,
.nav-logo svg {
  display: block;
  width: auto;
  height: 56px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

/* Menu central: gaps égaux, items qui ne se marchent pas dessus */
.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--mdp-menu-gap);
  min-width: 0;
  width: 100%;
  overflow: visible;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-item {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--mdp-link-pad-y) var(--mdp-link-pad-x);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text, #1a1f2e);
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
  background: transparent;
  border: 0;
}
.nav-link:hover,
.nav-link.active,
.nav-item:hover > .nav-link,
.nav-item:focus-within > .nav-link {
  color: var(--accent, #d0401a);
  background: var(--accent-light, #fff1eb);
}
.nav-link svg {
  width: 11px;
  height: 11px;
  opacity: 0.65;
  transition: transform 0.25s;
  flex-shrink: 0;
}
.nav-item:hover > .nav-link svg,
.nav-item:focus-within > .nav-link svg {
  transform: rotate(180deg);
}

/* Dropdowns: panel clair, jamais collé au bord */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border, #e5e8ef);
  box-shadow: 0 12px 36px rgba(22, 27, 38, 0.12);
  min-width: 240px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  border-radius: 12px;
  overflow: hidden;
  z-index: 700;
}
.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.25;
  color: var(--text, #1a1f2e);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border: 0;
  white-space: nowrap;
}
.nav-dropdown a:hover {
  background: var(--accent-light, #fff1eb);
  color: var(--accent, #d0401a);
}
.nav-dropdown a svg {
  width: 16px;
  height: 16px;
  opacity: 0.55;
  flex-shrink: 0;
}
.nav-dropdown a:hover svg { opacity: 1; }

/* Actions droite: largeur fixe, contenus alignés à droite sans écraser le menu */
.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mdp-actions-gap);
  width: max-content;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  justify-self: end;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  flex-shrink: 0;
  height: 36px;
  width: auto;
  box-sizing: border-box;
}
.lang-switch a,
.lang-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text, #1a1f2e);
  background: #fff;
  border: 1px solid var(--border, #e5e8ef);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body, "DM Sans", sans-serif);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lang-switch a:hover,
.lang-switch button:hover {
  border-color: var(--bg-dark, #1e2d4a);
  color: var(--bg-dark, #1e2d4a);
}
.lang-switch-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  margin: 0;
  padding: 0;
}
.lang-switch a.active,
.lang-switch button.active {
  background: var(--bg-dark, #1e2d4a);
  border-color: var(--bg-dark, #1e2d4a);
  color: #fff;
}

/* CTA: largeur plafonnée pour que EN/FR/NL ne poussent pas le layout */
.nav-cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  line-height: 1 !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  border-radius: 999px !important;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.nav-cta.btn-outline {
  max-width: none;
  padding: 0 14px !important;
}
.nav-cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 10px;
  cursor: pointer;
  border: 1px solid var(--border, #e5e8ef);
  border-radius: 10px;
  background: #fff;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text, #1a1f2e);
  transition: all 0.3s;
  border-radius: 1px;
}
.nav-burger[aria-expanded="true"] { border-color: var(--accent, #d0401a); }
body.nav-open { overflow: hidden; }

@media (max-width: 1280px) {
  :root {
    --mdp-logo-w: 180px;
    --mdp-nav-gap: 18px;
    --mdp-menu-gap: 6px;
    --mdp-link-pad-x: 10px;
  }
  .nav-link { font-size: 13px; }
  .nav-logo img,
  .nav-logo svg { height: 52px; }
}

/* Passage burger */
@media (max-width: 1100px) {
  .nav-menu { display: none; }
  .nav-actions .nav-cta { display: none !important; }
  .nav-burger { display: flex; }
  .nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    grid-template-columns: none;
  }
  .nav-actions {
    display: flex;
    width: auto;
    max-width: none;
  }
  .nav-logo {
    width: auto;
    max-width: 180px;
  }
}

@media (max-width: 720px) {
  .nav-actions .lang-switch { display: none; }
}

@media (max-width: 768px) {
  .nav-inner { height: 68px; }
  :root { --mdp-nav-h: 68px; --nav-h: 68px; }
  .nav-logo img,
  .nav-logo svg { height: 46px; }
}
