/* ============================================================
   MARINE NGOUBAS WEDDING – HEADER
   Barre fixe · Logo · Menu · Submenu au survol · CTA rose
   ============================================================ */

/* ==============================
   1. BARRE FIXE
   ============================== */
.nav {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1240px, calc(100% - 48px));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: rgba(40, 34, 30, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  transition: background .6s cubic-bezier(.22,.61,.36,1);
}
.nav.solid {
  background: rgba(27, 22, 20, .92);
}

/* ==============================
   2. LOGO
   ============================== */
.nav .logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 24px;
  border-right: 1px solid rgba(255, 255, 255, .35);
  line-height: 0;
  text-decoration: none;
  transition: opacity .4s ease;
}
.nav .logo:hover { opacity: .85; }
.nav .logo img,
.nav .logo svg {
  display: block;
  height: 38px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

/* ==============================
   3. MENU PRINCIPAL
   ============================== */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  color: #fff;
  text-decoration: none;
  transition: color .3s ease;
}

/* Soulignement animé au survol */
.nav-menu > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s ease;
}
.nav-menu > li > a:hover::after,
.nav-menu > li > a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ==============================
   4. SUBMENU – au survol de Services
   ============================== */
.nav-menu .submenu {
  position: absolute;
  top: calc(100% + 14px);   /* petit espace sous le lien */
  left: -20px;
  min-width: 240px;
  margin: 0;
  padding: 10px 0;
  list-style: none;
  background: rgba(27, 22, 20, .98);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .4);

  /* Masqué par défaut */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity .3s ease,
    transform .3s ease,
    visibility .3s ease;
  z-index: 100;
}

/* Zone tampon invisible : évite que le sous-menu disparaisse
   quand la souris traverse l'espace entre le lien et le sous-menu */
.nav-menu .submenu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

/* Affichage au survol du parent */
.nav-menu .has-submenu:hover .submenu,
.nav-menu .has-submenu:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Liens du sous-menu */
.nav-menu .submenu li {
  margin: 0;
  padding: 0;
}
.nav-menu .submenu a {
  display: block;
  padding: 12px 22px;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  transition: background .25s ease, color .25s ease;
}
.nav-menu .submenu a:hover,
.nav-menu .submenu a[aria-current="page"] {
  background: rgba(255, 255, 255, .07);
  color: #e4b8bd;
}

/* ==============================
   5. CTA "Accéder à mon carnet" – ROSE
   Couleurs en dur pour éviter tout conflit
   ============================== */
.nav .access {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;

  background-color: #c08486;
  color: #ffffff;
  border: 1px solid #c08486;
  border-radius: 0;

  transition:
    background-color .35s ease,
    border-color .35s ease,
    color .35s ease;
}
.nav .access:hover,
.nav .access:focus-visible {
  background-color: #9a4f5b;
  border-color: #9a4f5b;
  color: #ffffff;
}

/* ==============================
   6. BOUTON "Nous contacter"
   ============================== */
.nav .contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;

  background-color: #ffffff;
  color: #1b1614;
  border: 1px solid #ffffff;

  transition:
    background-color .35s ease,
    border-color .35s ease,
    color .35s ease;
}
.nav .contact:hover,
.nav .contact:focus-visible {
  background-color: #9a7b3f;
  border-color: #9a7b3f;
  color: #ffffff;
}

/* ==============================
   7. BURGER (mobile)
   ============================== */
.burger {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 10px 8px;
  font-family: inherit;
}

/* ==============================
   8. RESPONSIVE – TABLETTE & MOBILE
   ============================== */
@media (max-width: 980px) {

  .nav {
    padding: 12px 20px;
    gap: 16px;
    transition: background .4s ease;
  }

  /* On cache le menu desktop + les CTA */
  .nav-menu,
  .nav .access,
  .nav .contact {
    display: none;
  }

  /* On affiche le burger */
  .burger {
    display: block;
  }

  .nav .logo {
    padding-right: 0;
    border-right: 0;
  }
  .nav .logo img,
  .nav .logo svg {
    height: 32px;
    max-width: 180px;
  }

  /* ---- MENU OUVERT ---- */
  .nav.open {
    flex-wrap: wrap;
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: 100vh;
    overflow-y: auto;
    padding: 22px 24px 32px;
    background: rgba(27, 22, 20, .98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    animation: menuFadeIn .35s ease forwards;
  }

  @keyframes menuFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .nav.open .logo { order: 1; }
  .nav.open .burger { order: 2; }

  /* Menu vertical */
  .nav.open .nav-menu {
    order: 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    padding-top: 20px;
    font-size: 17px;
  }

  .nav.open .nav-menu > li {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .nav.open .nav-menu > li:last-child {
    border-bottom: 0;
  }

  .nav.open .nav-menu > li > a {
    display: block;
    width: 100%;
    padding: 16px 0;
    font-family: "Plantagenet Cherokee", Georgia, serif;
    font-size: 21px;
    line-height: 1.2;
  }
  .nav.open .nav-menu > li > a::after {
    display: none;
  }

  /* ---- SUBMENU sur mobile : accordéon ---- */
  .nav.open .submenu {
    position: static;
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    /* Fermé par défaut */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
  }
  .nav.open .submenu::before { display: none; }

  /* Ouvert */
  .nav.open .has-submenu.is-open .submenu {
    max-height: 400px;
    padding-bottom: 10px;
    border-left: 1px solid rgba(154, 123, 63, .5);
    padding-left: 12px;
    margin-left: 4px;
  }

  .nav.open .submenu li {
    border: 0;
  }
  .nav.open .submenu a {
    display: block;
    padding: 11px 0;
    color: rgba(255, 255, 255, .75);
    font-family: inherit;
    font-size: 15px;
  }
  .nav.open .submenu a:hover {
    color: #e4b8bd;
    background: transparent;
  }

  /* CTA en bas du menu mobile */
  .nav.open .access,
  .nav.open .contact {
    order: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 16px 22px;
    font-size: 13px;
  }
  .nav.open .access {
    margin-top: 22px;
    background-color: #c08486;
    border-color: #c08486;
  }
  .nav.open .contact {
    margin-top: 10px;
  }
}

@media (max-width: 560px) {
  .nav { padding: 10px 16px; }
  .nav .logo img,
  .nav .logo svg { height: 28px; max-width: 160px; }
  .burger { font-size: 12.5px; padding: 8px 6px; }
  .nav.open { padding: 18px 20px 26px; }
  .nav.open .nav-menu > li > a { font-size: 19px; padding: 14px 0; }
  .nav.open .submenu a { font-size: 14px; padding: 10px 0; }
  .nav.open .access,
  .nav.open .contact { padding: 14px 18px; font-size: 12px; }
}

/* ==============================
   9. RÉDUCTION DE MOUVEMENT
   ============================== */
@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav-menu > li > a::after,
  .nav-menu .submenu,
  .nav .logo {
    transition: none !important;
  }
  .nav.open { animation: none !important; }
}