/**
 * Composant  : Nav
 * Description : Barre de navigation principale avec burger, drawer mobile et toggle jour/nuit
 * Auteur      : Équipe Marketing
 * URL         : linkavie.com
 * Thème       : Linkavie terra
 * Tags        : nav, navigation, burger, drawer, toggle, dark-mode
 * Version     : 1.0
 */

/* ─────────────────────────────────────────
   lk-nav — BLOCK
   ───────────────────────────────────────── */
/* Le <header> est le parent direct de la barre : c'est lui qui doit être sticky,
   sinon la barre ne peut pas dépasser la hauteur de son propre conteneur. */
body > header {
  position: sticky;
  top: 0;
  z-index: var(--lk-z-nav);
}

.lk-nav {
  background: var(--lk-color-bg);
  border-bottom: 0.5px solid var(--lk-color-border);
  padding: 0 clamp(16px, 4vw, 48px);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: var(--lk-z-nav);
  transition: background var(--lk-transition-normal), border-color var(--lk-transition-normal);
}

/* ─────────────────────────────────────────
   lk-nav — ELEMENTS
   ───────────────────────────────────────── */
.lk-nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.lk-nav__logo-img {
  height: 32px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.lk-nav__links {
  display: none;
  gap: 28px;
  align-items: center;
}

.lk-nav__link {
  color: var(--lk-color-stone);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--lk-transition-fast);
}

.lk-nav__link:hover {
  color: var(--lk-color-text-hi);
}

.lk-nav__link:active,
.lk-nav__link[aria-current="page"] {
  color: var(--lk-color-terra-text);
}

/* ─────────────────────────────────────────
   lk-nav — MODIFIERS
   ───────────────────────────────────────── */
.lk-nav__link--cta {
  background: var(--lk-color-terra);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--lk-border-radius-full);
  font-weight: var(--lk-font-weight-medium);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.22s, color 0.22s;
}

.lk-nav__link--cta:hover {
  background: #c96a47;
  color: #fbfbfb;
}

.lk-nav__link--cta:active {
  background: #b85e3e;
  color: #fbfbfb;
}

/* ─────────────────────────────────────────
   lk-burger — BLOCK
   ───────────────────────────────────────── */
.lk-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--lk-border-radius-full);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   lk-burger — ELEMENTS
   ───────────────────────────────────────── */
.lk-burger__line {
  display: block;
  height: 1.5px;
  background: var(--lk-color-terra);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s, width 0.25s;
  transform-origin: center;
}

.lk-burger__line:nth-child(2) {
  width: 70%;
  margin-left: auto;
}

/* ─────────────────────────────────────────
   lk-burger — MODIFIERS
   ───────────────────────────────────────── */
.lk-burger:hover {
  background: var(--lk-color-terra-lo);
}

.lk-burger:focus-visible {
  outline: none;
}

.lk-burger--open .lk-burger__line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.lk-burger--open .lk-burger__line:nth-child(2) {
  opacity: 0;
  width: 100%;
}

.lk-burger--open .lk-burger__line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ─────────────────────────────────────────
   lk-nav-drawer — BLOCK
   ───────────────────────────────────────── */
.lk-nav-drawer {
  display: block;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--lk-color-bg);
  border-bottom: 0.5px solid var(--lk-color-border);
  padding: 8px 0 16px;
  z-index: var(--lk-z-drawer);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
  pointer-events: none;
}

/* ─────────────────────────────────────────
   lk-nav-drawer — ELEMENTS
   ───────────────────────────────────────── */
.lk-nav-drawer__link {
  display: block;
  padding: 13px clamp(20px, 6vw, 32px);
  font-size: 15px;
  color: var(--lk-color-text-hi);
  text-decoration: none;
  border-bottom: 0.5px solid var(--lk-color-border);
  transition: background var(--lk-transition-fast), color var(--lk-transition-fast);
}

.lk-nav-drawer__link:last-child {
  border-bottom: none;
}

.lk-nav-drawer__link:active {
  background: var(--lk-color-surface);
}

.lk-nav-drawer__link[aria-current="page"] {
  color: var(--lk-color-terra-text);
}

/* Mode nuit : liens blancs, orange au survol et à l'état actif (boutons CTA exclus) */
body.dark .lk-nav__link:not(.lk-nav__link--cta),
body.dark .lk-nav-drawer__link:not(.lk-nav-drawer__link--cta) {
  color: var(--lk-color-white);
}

body.dark .lk-nav__link:not(.lk-nav__link--cta):hover,
body.dark .lk-nav__link:not(.lk-nav__link--cta):active,
body.dark .lk-nav__link:not(.lk-nav__link--cta)[aria-current="page"],
body.dark .lk-nav-drawer__link:not(.lk-nav-drawer__link--cta):hover,
body.dark .lk-nav-drawer__link:not(.lk-nav-drawer__link--cta):active,
body.dark .lk-nav-drawer__link:not(.lk-nav-drawer__link--cta)[aria-current="page"] {
  color: var(--lk-color-terra);
}

/* ─────────────────────────────────────────
   lk-nav-drawer — MODIFIERS
   ───────────────────────────────────────── */
.lk-nav-drawer--open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.lk-nav-drawer__link--cta {
  margin: 12px clamp(20px, 6vw, 32px) 0;
  background: var(--lk-color-terra);
  color: #fbfbfb;
  padding: 13px 20px;
  border-radius: var(--lk-border-radius-full);
  font-size: 14px;
  font-weight: var(--lk-font-weight-medium);
  text-align: center;
  border-bottom: none;
  text-decoration: none;
}

.lk-nav-drawer__link--cta:active {
  background: #c96a47;
}

/* ─────────────────────────────────────────
   lk-toggle — BLOCK
   ───────────────────────────────────────── */
.lk-toggle {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   lk-toggle — ELEMENTS
   ───────────────────────────────────────── */
.lk-toggle__btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0.5px solid var(--lk-color-border);
  background: var(--lk-color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--lk-transition-fast), border-color var(--lk-transition-fast);
  color: inherit;
}

.lk-toggle__btn svg {
  width: 18px;
  height: 18px;
}

.lk-toggle__icon--moon {
  display: block;
}

.lk-toggle__icon--sun {
  display: none;
}

body.dark .lk-nav,
body.dark .lk-nav-drawer {
  background: var(--lk-color-dark-bg);
}

body.dark .lk-toggle__icon--moon {
  display: none;
}

body.dark .lk-toggle__icon--sun {
  display: block;
}

/* ─────────────────────────────────────────
   RESPONSIVE — mobile-first
   ───────────────────────────────────────── */
@media (min-width: 769px) {
  .lk-nav__links {
    display: flex;
    margin-left: auto;
  }

  .lk-toggle {
    margin-left: 0;
  }

  .lk-burger {
    display: none;
  }

  .lk-nav-drawer {
    display: none;
  }
}

/* ─────────────────────────────────────────
   ACCESSIBILITÉ — mouvement réduit
   ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lk-burger__line,
  .lk-nav-drawer,
  .lk-toggle__btn,
  .lk-nav {
    transition: none;
  }
}
