/* ============================================================
   header.css — Styles du header partagé (includes/header.php)
   ------------------------------------------------------------
   Chargé PAR header.php lui-même (le <link> est émis juste avant
   le markup) : toute page qui inclut le header reçoit donc son
   style, peu importe sa feuille historique (style.css OU
   style_secret.css). Émis après les feuilles du <head>, il gagne
   les égalités de spécificité — y compris sur corp.css.

   C'est EXACTEMENT le rendu du header de l'accueil : valeurs de
   style.css figées en dur (--hpx 4px, jaune #ffd93d, vert #5cb85c)
   pour que le rebranding de corp.css (--pixel:1px, autres teintes)
   ne le fasse pas dériver d'une page à l'autre.

   Comportement : transparent en haut de page, fond sombre flouté
   dès qu'on scrolle (classe .nav-solid posée sur <body> par le JS
   embarqué dans header.php).
   ============================================================ */

.site-header {
  --hpx: 4px;            /* épaisseur "pixel" du header, figée */
  --h-accent: #ffd93d;   /* jaune des barres du hamburger */
  --h-green:  #5cb85c;   /* vert du nom + hovers */
  --h-red:    #e02828;
  --h-red-dark: #9a1515;

  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}

body.nav-solid .site-header {
  background: rgba(11, 10, 14, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

/* ===== Gauche : hamburger + logo + nom ===== */
.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-title {
  font-size: clamp(22px, 3.2vw, 30px);
  font-family: "Monocraft", ui-monospace, monospace;
  color: #ecebf1;
}

.brand-title strong {
  color: var(--h-green);
}

.logo-slot {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  overflow: visible;
}

.logo-slot::before,
.logo-slot::after {
  display: none !important; /* pas d'aura dans la barre de nav */
}

#coquelicot-img {
  width: 30px;
  height: 30px;
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(255, 217, 61, .22));
}

/* ===== Hamburger ===== */
.nav-hamburger-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: var(--hpx) solid rgba(255, 255, 255, .15);
  border-radius: 0;
  box-shadow: var(--hpx) var(--hpx) 0 0 #000;
  cursor: pointer;
  padding: 8px;
  transition: border-color .12s;
}

.hamburger-btn:hover { border-color: var(--h-green); }
.hamburger-btn[aria-expanded="true"] { border-color: var(--h-accent); }

.ham-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--h-accent);
  transition: background .12s;
}

.hamburger-btn:hover .ham-bar { background: var(--h-green); }
.hamburger-btn[aria-expanded="true"] .ham-bar { background: var(--h-accent); }

/* ===== Menu déroulant ===== */
.hamburger-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 200px;
  background: rgba(13, 13, 13, .97);
  border: var(--hpx) solid #000;
  box-shadow: var(--hpx) var(--hpx) 0 0 #000, 0 10px 30px rgba(0, 0, 0, .7);
  z-index: 200;
  flex-direction: column;
  animation: hdrDropIn .15s ease;
  white-space: nowrap;
}

.hamburger-menu.open { display: flex; }

@keyframes hdrDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hamburger-menu a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  font-family: "Monocraft", ui-monospace, monospace;
  font-size: clamp(14px, 1.7vw, 18px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: background .1s, color .1s;
}

.hamburger-menu a.nav-mc-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-mc-slot {
  width: 34px;
  height: 34px;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #000;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08) 0%, rgba(0, 0, 0, .4) 65%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 4px);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.nav-mc-icon {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  display: block;
}

.nav-mc-label { flex: 1; }

.hamburger-menu a.public-link  { color: var(--h-accent); }
.hamburger-menu a.private-link { color: var(--h-green); }
.hamburger-menu a:last-child   { border-bottom: none; }

.hamburger-menu a:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--h-green);
}

.hamburger-menu .menu-admin { color: var(--h-red); }

.hamburger-menu .menu-sep {
  display: block;
  height: 1px;
  background: rgba(255, 255, 255, .12);
  margin: 4px 0;
}

/* ===== Droite : connexion / déconnexion ===== */
.header-auth {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-header-auth {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px 4px;
  font-family: "Monocraft", ui-monospace, monospace;
  font-size: clamp(14px, 1.8vw, 18px);
  text-decoration: none;
  border: var(--hpx) solid #000;
  border-radius: 0;
  box-shadow: var(--hpx) var(--hpx) 0 0 #000;
  transition: filter .1s, transform .1s, box-shadow .1s;
  white-space: nowrap;
}

.btn-header-auth:hover { filter: brightness(1.1); }

.btn-header-auth:active {
  transform: translate(var(--hpx), var(--hpx));
  box-shadow: none;
}

.btn-connect {
  background: linear-gradient(180deg, var(--h-red) 0%, var(--h-red-dark) 100%);
  color: #fff;
}

.btn-deconnect {
  background: linear-gradient(180deg, #333 0%, #1a1a1a 100%);
  color: var(--h-accent);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .brand-title { font-size: clamp(18px, 5vw, 24px); }

  .btn-header-auth {
    font-size: 14px;
    padding: 6px 10px;
  }

  .hamburger-menu {
    width: 100vw;
    left: -16px;
    border-left: none;
    border-right: none;
  }
}
