/* ------------------------------------------------------------------
   nav.css — barre de progression de lecture et navigation fixe.
   Le verre dépoli n'existe qu'ici et sur les stat boxes.
   Sous 768 px : un menu déroulant (menu.js). Sans script, les liens
   passent sur une seconde rangée, toujours visibles.
   ------------------------------------------------------------------ */

.progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 110;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid rgb(var(--white-rgb) / 0.06);
  background: rgb(var(--ink-rgb) / 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--w-page);
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  color: var(--white);
  font-family: var(--font-title);
  font-size: 1.3125rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  padding: 12px 0;
  color: rgb(var(--white-rgb) / 0.6);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 200ms ease-out;
}

.nav-links a:hover,
.nav-links a.is-current {
  color: var(--white);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Le bouton du menu : 44 × 44 px, deux traits qui se croisent à l'ouverture */
.nav-toggle {
  position: relative;
  display: none;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(var(--white-rgb) / 0.16);
  border-radius: 50%;
  background: none;
  color: var(--white);
  cursor: pointer;
}

.nav-toggle-bar {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 250ms var(--ease-out), top 250ms var(--ease-out);
}

.nav-toggle-bar:first-child {
  top: 17px;
}

.nav-toggle-bar:last-child {
  top: 24px;
}

.nav.is-open .nav-toggle-bar:first-child {
  top: 20.5px;
  transform: rotate(45deg);
}

.nav.is-open .nav-toggle-bar:last-child {
  top: 20.5px;
  transform: rotate(-45deg);
}

@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  /* Le panneau déroulant : sous la barre, masqué par visibility (donc hors de la tabulation) */
  .js .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: grid;
    gap: 0;
    padding: 6px var(--gutter) 18px;
    border-bottom: 1px solid var(--border);
    background: rgb(var(--ink-rgb) / 0.97);
    box-shadow: 0 24px 48px rgb(var(--black-rgb) / 0.5);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 220ms ease-out, transform 220ms var(--ease-out), visibility 0s linear 220ms;
  }

  .js .nav.is-open .nav-links {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 220ms ease-out, transform 220ms var(--ease-out), visibility 0s;
  }

  .js .nav-links a {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    color: rgb(var(--white-rgb) / 0.82);
    font-size: 1.0625rem;
  }

  .js .nav-links a:last-child {
    border-bottom: 0;
  }

  /* Sans script : la barre s'allonge et les quatre liens tiennent sur une seconde rangée */
  html:not(.js) {
    --nav-h: 96px;
  }

  html:not(.js) .nav-inner {
    flex-wrap: wrap;
    align-content: center;
    row-gap: 0;
  }

  html:not(.js) .nav-links {
    order: 3;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
  }

  html:not(.js) .nav-links a {
    padding: 6px 0;
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links a,
  .nav-toggle-bar,
  .js .nav-links,
  .js .nav.is-open .nav-links {
    transition: none;
  }
}
