/* ===== SUBNAV — état initial (flottant sur le hero) ===== */
.subnav-sticky {
  z-index: 99;
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;

  background: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0 24px;

  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    padding 0.3s ease,
    transform 0.35s ease,
    opacity 0.35s ease;
}
.subnav-sticky::-webkit-scrollbar { display: none; }

/* Liens — sur le hero, texte blanc semi-transparent */
.subnav-sticky p a {
  display: inline-block;
  padding: 14px 16px;
  outline: none;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition:
    color 0.25s,
    opacity 0.25s,
    border-color 0.25s,
    transform 0.25s ease;
}

/* Lien actif sur le hero */
.subnav-sticky p a.subnav-active {
  color: var(--wp--preset--color--primary);
  border-bottom-color: var(--wp--preset--color--primary);
  opacity: 1;
}

/* ===== ÉTAT STICKY (après dépassement du hero) ===== */
.subnav-sticky.is-stuck {
  position: fixed;
  top: var(--header-height, 60px);
  bottom: auto;
  left: 0;
  right: 0;
  width: 100%;
  padding: 0;

  background: var(--wp--preset--color--background, #fff);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);

  /* effet apparition */
  animation: subnavReveal 0.35s ease forwards;
}

/* Liens — une fois collé en haut */
.subnav-sticky.is-stuck p a {
  color: var(--wp--preset--color--contrast, #111);
  opacity: 0.35;
}

.subnav-sticky.is-stuck p a.subnav-active {
  color: var(--wp--preset--color--contrast, #111);
  border-bottom-color: currentColor;
  opacity: 1;
}

/* ===== COMPENSATION ===== */
.subnav-placeholder {
  display: none;
  height: 49px;
}
.subnav-placeholder.visible { display: block; }

/* ===== ANIMATION ===== */
@keyframes subnavReveal {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .subnav-sticky,
  .subnav-sticky.is-stuck {
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
    overflow-x: auto;
  }

  .subnav-sticky p {
    flex: 0 0 auto;
  }

  .subnav-sticky p a {
    padding: 13px 12px;
  }
}
