/* Barre de navigation (js/navigation.js), en haut de index, mars, lune et apropos.
   Chargée après les styles de la page : elle décale vers le bas ce qui était collé en haut de l'écran
   (titre, boutons de zoom, panneaux) de la hauteur de la barre. */

:root { --nav-h: 48px; }

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--nav-h);
  display: flex; align-items: center; gap: 18px; padding: 0 14px 0 18px;
  background: rgba(8, 17, 32, 0.78);
  border-bottom: 1px solid rgba(169, 200, 238, 0.14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #E9EEF5;
}
.nav a { color: inherit; text-decoration: none; }
.nav-nom { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-stretch: 112%; font-size: 15.5px; white-space: nowrap; }
.nav-nom img { height: 26px; width: auto; display: block; flex: none; }
.nav-liens { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; }
.nav-astres, .nav-outils { display: flex; align-items: center; gap: 4px; }
.nav-astres { margin-left: 8px; }
.nav-lien {
  position: relative; padding: 6px 12px; border-radius: 8px; color: #9DAAC0 !important; white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-lien:hover { color: #E9EEF5 !important; background: rgba(255, 255, 255, 0.06); }
.nav-lien[aria-current="page"] { color: #E9EEF5 !important; }
.nav-lien[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -7px; height: 2px; border-radius: 1px; background: #A9C8EE;
}
.nav-lien.avec-zone::before {          /* une zone attend ses résultats */
  content: ""; position: absolute; top: 5px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--point); box-shadow: 0 0 0 2px rgba(8, 17, 32, 0.9);
}
.nav-menu { display: none; margin-left: auto; width: 36px; height: 36px; border: 1px solid rgba(169, 200, 238, 0.18);
  border-radius: 8px; background: rgba(255, 255, 255, 0.04); color: inherit; cursor: pointer; place-items: center; }
.nav :focus-visible { outline: 2px solid #A9C8EE; outline-offset: 2px; }

/* ------------------------------------------------------------------ ce qui était en haut de l'écran */
body.avec-nav .titre { top: calc(var(--nav-h) + 18px); }
body.avec-nav .controles,
body.avec-nav .maplibregl-ctrl-top-right { top: calc(var(--nav-h) + 14px); }
body.avec-nav .analogues,
body.avec-nav .site,
body.avec-nav .zone { top: calc(124px + var(--nav-h)); max-height: calc(100vh - 124px - var(--nav-h) - 96px); }
/* Page Terre : le nom du site est dans la barre, le titre ne garde que sa phrase (et reste lu par les lecteurs d'écran) */
body.page-index .titre h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.page-index .titre p { margin-top: 0; }
body.page-index .analogues,
body.page-index .site { top: calc(114px + var(--nav-h)); max-height: calc(100vh - 114px - var(--nav-h) - 96px); }  /* sous les boutons de zoom */
/* Pages de texte (à propos) : elles défilent sous la barre */
body.avec-nav .v-page { padding-top: calc(var(--nav-h) + 20px); }

@media (max-width: 720px) {
  :root { --nav-h: 52px; }
  .nav { gap: 8px; padding: 0 10px 0 14px; }
  .nav-menu { display: grid; }
  .nav-liens {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 10px 12px;
    background: #081120; border-bottom: 1px solid rgba(169, 200, 238, 0.14);
  }
  .nav.ouvert .nav-liens { display: flex; }
  .nav-astres, .nav-outils { flex-direction: column; align-items: stretch; margin: 0; gap: 2px; }
  .nav-outils { border-top: 1px solid rgba(169, 200, 238, 0.12); padding-top: 6px; margin-top: 6px; }
  .nav-lien { padding: 10px 12px; font-size: 15px; }
  .nav-lien[aria-current="page"] { background: rgba(169, 200, 238, 0.1); }
  .nav-lien[aria-current="page"]::after { display: none; }
  .nav-lien.avec-zone::before { top: 50%; right: 14px; margin-top: -4px; }
  body.avec-nav .titre { top: calc(var(--nav-h) + 12px); }
  body.avec-nav .analogues, body.avec-nav .site, body.avec-nav .zone { top: auto; }
  body.avec-nav .analogues { max-height: 45vh; }
  body.avec-nav .site, body.avec-nav .zone { max-height: 55vh; }
}
@media (prefers-reduced-motion: reduce) { .nav-lien { transition: none; } }
