/* ============================================================
   Nunki shared header — en-tête commun, UNE SEULE LIGNE.
   Chargé depuis https://nunki.org/shared/ui.css

   Disposition (gauche → droite) :
     [galaxie + Nunki (retour)] [sections] … [langues] [👤 compte]
   ============================================================ */

#nunki-header {
  --nk-bg: #070907;
  --nk-text: #f3eedf;
  --nk-muted: #a8a28a;
  --nk-line: rgba(232, 201, 124, .18);
  --nk-gold: #e8c97c;
  --nk-gold-bright: #f4e5a3;
  position: relative;
  z-index: 60;
}

.nk-hd {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 9px 20px;
  border-bottom: 1px solid var(--nk-line);
  background: linear-gradient(180deg, rgba(7, 9, 7, .94), rgba(7, 9, 7, .55));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  min-height: 54px;
}

/* ── Marque : galaxie + Nunki (retour) ── */
.nk-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Orbitron', 'Avenir Next', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--nk-text);
  text-decoration: none;
  text-shadow: 0 0 22px rgba(232, 201, 124, .25);
  white-space: nowrap;
}
.nk-brand:hover { color: var(--nk-gold-bright); }
.nk-brand .nk-logo { width: 30px; height: auto; flex: 0 0 auto; }
@media (max-width: 900px) { .nk-brand .nk-logo { width: 26px; } }

/* ── Sections ── */
.nk-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px 16px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}
.nk-nav a {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--nk-muted);
  text-decoration: none;
  padding: 2px 4px;
  white-space: nowrap;
}
.nk-nav a:hover { color: var(--nk-gold-bright); }

/* ── Langues — alignées à droite, collées au bouton compte ── */
.nk-langs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  margin-left: auto;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--nk-line);
  border-radius: 9px;
  flex: 0 0 auto;
}
.nk-langs button {
  background: transparent;
  border: 0;
  color: var(--nk-muted);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
}
.nk-langs button:hover { color: var(--nk-text); background: rgba(232, 201, 124, .14); }
.nk-langs button.active { color: #141006; background: var(--nk-gold); }

/* ── Compte utilisateur : icône + menu déroulant ── */
.nk-user-wrap { position: relative; flex: 0 0 auto; }
.nk-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--nk-line);
  border-radius: 8px;
  color: var(--nk-gold);
  cursor: pointer;
  padding: 0;
}
.nk-user-btn:hover { background: rgba(232, 201, 124, .12); border-color: rgba(232, 201, 124, .45); }
.nk-user-ico { display: block; }
.nk-user-ava {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  border: 1px solid rgba(232, 201, 124, .55);
  background: #11140f;
}
.nk-user-initial {
  font-family: 'Orbitron', ui-sans-serif, system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
  color: var(--nk-gold);
  text-transform: uppercase;
}

.nk-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: rgba(10, 13, 10, .97);
  border: 1px solid var(--nk-line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nk-drop[hidden] { display: none; }
.nk-drop-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--nk-text);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  letter-spacing: .03em;
}
.nk-drop-item:hover { background: rgba(232, 201, 124, .12); color: var(--nk-gold-bright); }
.nk-drop-user {
  padding: 9px 12px 7px;
  color: var(--nk-gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  border-bottom: 1px solid var(--nk-line);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Mobile : la nav se replie ; l'image du logo sert de bouton de menu ── */
@media (max-width: 900px) {
  .nk-hd { gap: 8px 10px; padding: 8px 14px; }
  .nk-brand .nk-logo { cursor: pointer; }
  .nk-nav {
    display: none;
    width: 100%;
    order: 20;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 0 2px;
    border-top: 1px solid var(--nk-line);
  }
  .nk-nav.open { display: flex; }
  .nk-nav a { padding: 4px 2px; }
}
