/* ══ FLOATING PILL NAVBAR — Basilique Saint-Epvre ══════════════════
   Glassmorphism neutre (gris Apple), jamais invisible.
   Deux états : ÉTENDU (défaut) ↔ COMPACT (scroll down).
   ─────────────────────────────────────────────────────────────────── */

:root {
  --nav-h:      80px;   /* espace body sur pages sans hero */
  --pill-h:     52px;   /* hauteur étendue */
  --pill-h-sm:  36px;   /* hauteur compacte */
  --nav-font:   -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;

  /* Palette neutre — gris Apple */
  --glass-dark:      rgba(14, 14, 14, 0.52);
  --glass-dark-bdr:  rgba(255, 255, 255, 0.14);
  --glass-light:     rgba(250, 250, 250, 0.82);
  --glass-light-bdr: rgba(0, 0, 0, 0.07);

  /* Texte */
  --txt-on-dark:        rgba(255, 255, 255, 0.86);
  --txt-on-dark-active: rgba(255, 255, 255, 0.98);
  --txt-on-light:       rgba(20, 20, 20, 0.55);
  --txt-on-light-active:rgba(10, 10, 10, 0.92);
}

/* ── Entrée animée ────────────────────────────────────────────────── */
@keyframes pillAppear {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ── Pilule principale ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  height: var(--pill-h);
  z-index: 200;

  display: flex;
  align-items: center;
  padding: 0 10px 0 22px;

  border-radius: 999px;
  overflow: hidden; /* empêche les enfants de dépasser pendant la transition height */

  /* Glassmorphism neutre sombre (sur hero) */
  background: var(--glass-dark);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-dark-bdr);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.20),
    0 2px 8px  rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  animation: pillAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;

  /* Toutes les propriétés qui animent entre états */
  transition:
    height      0.38s cubic-bezier(0.4, 0, 0.2, 1),
    padding     0.38s cubic-bezier(0.4, 0, 0.2, 1),
    background  0.5s  cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.5s  cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow  0.5s  cubic-bezier(0.4, 0, 0.2, 1);
}

/* État compact — scroll down */
.nav.compact {
  height: var(--pill-h-sm);
  padding: 0 8px 0 16px;
}

/* Glassmorphism clair (pages sans hero / après scroll) */
.nav.scrolled {
  background: var(--glass-light);
  border-color: var(--glass-light-bdr);
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.09),
    0 2px 6px  rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ── Logo ─────────────────────────────────────────────────────────── */
.nav-logo {
  font-family: var(--font-display, var(--font-titre, 'Young Serif', Georgia, serif));
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--txt-on-dark-active);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  transition:
    color     0.5s ease,
    font-size 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity   0.2s ease;
}
.nav-logo:hover { opacity: 0.58; }
.nav.scrolled   .nav-logo { color: var(--txt-on-light-active); }
.nav.compact    .nav-logo { font-size: 0.76rem; }

/* ── Séparateur ───────────────────────────────────────────────────── */
.nav-sep {
  width: 1px;
  height: 15px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 8px;
  flex-shrink: 0;
  transition:
    background 0.5s ease,
    height     0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav.scrolled .nav-sep { background: rgba(0, 0, 0, 0.10); }
.nav.compact  .nav-sep { height: 11px; }

/* ── Liens desktop ────────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0; padding: 0;
  height: 100%;
}

.nav-links li {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.nav-links li a {
  display: inline-flex;
  align-items: center;
  font-family: var(--nav-font);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--txt-on-dark);
  padding: 0 10px;
  position: relative;
  white-space: nowrap;
  transition:
    color     0.22s ease,
    font-size 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    padding   0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity   0.2s ease;
}
.nav-links li a:hover        { color: var(--txt-on-dark-active); }
.nav-links li a.active       { color: var(--txt-on-dark-active); }
.nav.scrolled .nav-links li a        { color: var(--txt-on-light); }
.nav.scrolled .nav-links li a:hover  { color: var(--txt-on-light-active); }
.nav.scrolled .nav-links li a.active { color: var(--txt-on-light-active); }

/* État compact — liens légèrement plus petits */
.nav.compact .nav-links li a {
  font-size: 10px;
  padding: 0 7px;
}

/* Dot actif centré */
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  transition:
    transform  0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.5s  ease,
    bottom     0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav.scrolled .nav-links li a::after { background: rgba(10, 10, 10, 0.70); }
.nav.compact  .nav-links li a::after { bottom: 6px; }
.nav-links li a.active::after,
.nav-links li a:hover::after { transform: translateX(-50%) scale(1); }

/* ── Burger ───────────────────────────────────────────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4.5px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  margin-left: 8px;
  flex-shrink: 0;
  transition:
    background    0.22s ease,
    border-color  0.22s ease,
    width         0.38s cubic-bezier(0.4, 0, 0.2, 1),
    height        0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-burger:hover { background: rgba(255, 255, 255, 0.16); }
.nav.scrolled .nav-burger              { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.09); }
.nav.scrolled .nav-burger:hover        { background: rgba(0,0,0,0.10); }
.nav.compact  .nav-burger              { width: 28px; height: 28px; }

.nav-burger span {
  display: block;
  width: 15px;
  height: 1px;
  background: rgba(255, 255, 255, 0.90);
  transform-origin: center;
  transition:
    background  0.4s ease,
    transform   0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity     0.2s ease,
    width       0.25s ease;
}
.nav.scrolled .nav-burger span { background: rgba(10, 10, 10, 0.75); }
.nav.compact  .nav-burger span { width: 12px; }

.nav-burger.open span:nth-child(1) { transform: rotate(45deg) translate(3.5px, 3.5px); }
.nav-burger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(3.5px, -3.5px); }

/* ── Menu fullscreen mobile ───────────────────────────────────────── */
@keyframes menuAppear {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.nav-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 205;

  /* Neutre clair givré */
  background: rgba(248, 248, 248, 0.94);
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.nav-fullscreen.open {
  opacity: 1;
  pointer-events: auto;
  animation: menuAppear 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.nav-fullscreen-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  cursor: pointer;
  color: rgba(20, 20, 20, 0.50);
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-fullscreen-close:hover {
  background: rgba(0, 0, 0, 0.09);
  color: rgba(10, 10, 10, 0.90);
}
.nav-fullscreen-close svg { width: 14px; height: 14px; }

.nav-fullscreen-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.nav-fullscreen-links a {
  font-family: var(--nav-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(20, 20, 20, 0.45);
  padding: 1.05rem 2rem;
  text-align: center;
  transition: color 0.18s ease, transform 0.2s ease;
}
.nav-fullscreen-links a:hover        { color: rgba(10,10,10,0.90); transform: translateY(-1px); }
.nav-fullscreen-links a.active       { color: rgba(10,10,10,0.90); font-weight: 600; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-links  { display: none; }
  .nav-sep    { display: none; }
  .nav-burger { display: flex; }
  .nav { padding: 0 8px 0 16px; }
  .nav.compact { padding: 0 6px 0 12px; }
}

@media (max-width: 480px) {
  .nav { max-width: calc(100% - 24px); }
}
