/* Navigation des pages internes (la home n'en a pas)
   - Ordinateur : liens texte centrés sous le grand titre
   - Mobile : barre d'onglets fixée en bas, avec pictos, comme une app */

.site-nav {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: calc(16px - var(--p, 0) * 8px);
  font-size: 14px;
  line-height: 1.35;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color .25s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

.tabbar, .tabbar-fx { display: none; }

@media (max-width: 640px) {
  .site-nav { display: none; }

  /* Barre flottante : décollée des bords, voile + flou comme l'écran de chargement, sans filet */
  .tabbar {
    position: fixed;
    left: 22px;
    right: 22px;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    z-index: 25;
    display: flex;
    justify-content: space-around;
    padding: 11px 6px;
    /* Bloc légèrement plus foncé que la page (plus clair en mode sombre) + flou, pour détacher la barre */
    background: rgba(255, 255, 255, 0.85); /* blanc, très légèrement transparent (flou derrière) */
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-radius: 10px; /* angles arrondis subtils */
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.09), 0 2px 10px rgba(0, 0, 0, 0.04); /* ombre plus diffuse */
    -webkit-tap-highlight-color: transparent;
  }
  :root[data-theme="dark"] .tabbar {
    background: rgba(0, 0, 0, 0.8); /* noir, très légèrement transparent */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.35);
  }
  .tabbar a {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    flex: 1;
    display: flex;
    justify-content: center;
    color: #555553; /* autres pages : gris foncé */
    transition: color .25s ease;
  }
  .tabbar a[aria-current="page"] { color: #000; } /* page en cours : noir */
  :root[data-theme="dark"] .tabbar a { color: #9a9a98; }
  :root[data-theme="dark"] .tabbar a[aria-current="page"] { color: #fff; }
  /* Pictos seuls : le libellé reste lisible par les lecteurs d'écran */
  .tabbar span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .tabbar svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    stroke-linecap: butt; /* traits nets, angles vifs */
    stroke-linejoin: miter;
  }
  .tabbar svg * { vector-effect: non-scaling-stroke; }

  /* Barre construite en couches, de l'arrière vers l'avant :
     1. flou progressif (fort en bas, nul en haut)
     2. dégradé léger qui fonce un peu le fond clair / éclaircit un peu le fond sombre
     3. la barre elle-même, en pilule */
  .tabbar-fx {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(140px + env(safe-area-inset-bottom, 0px));
    z-index: 23;
    pointer-events: none;
  }
  .tabbar-fx i {
    position: absolute;
    inset: 0;
    -webkit-mask-image: linear-gradient(to top, #000 var(--a), transparent var(--b));
    mask-image: linear-gradient(to top, #000 var(--a), transparent var(--b));
  }
  .tabbar-fx i:nth-child(1) { --a: 40%; --b: 100%; -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); }
  .tabbar-fx i:nth-child(2) { --a: 35%; --b: 85%;  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .tabbar-fx i:nth-child(3) { --a: 30%; --b: 70%;  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .tabbar-fx i:nth-child(4) { --a: 20%; --b: 60%;  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .tabbar-fx i:nth-child(5) { --a: 10%; --b: 50%;  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .tabbar-fx::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.07));
  }
  :root[data-theme="dark"] .tabbar-fx::after {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.07));
  }

  /* Bas de page au-dessus du flou (lisible) mais sous la barre */
  footer, .credits { position: relative; z-index: 24 !important; }

  /* Laisse la place à la barre en bas de page */
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; } /* 22 + 48 de barre + 16 d'air */
  /* Page Membres : « Devenir membre » et les crédits plus près du bas */
  main { padding-bottom: 0 !important; }
}

