/**
 * Melanin Stories — assets/css/components/header.css
 * Dépend de base.css (variables). Ne gère QUE le header (logo + nav).
 * Le bouton recherche flottant a son propre fichier : search-button.css
 */

.site-header {
  background: var(--ms-paper);
  border-bottom: 1px solid var(--ms-line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-header__logo img {
  height: 34px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.site-header__menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header__menu a {
  font-family: var(--ms-font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ms-charcoal);
  white-space: nowrap;
}

.site-header__menu a:hover,
.site-header__menu a:focus-visible {
  color: var(--ms-red);
}

/* --- Bouton hamburger (masqué sur desktop) --- */
.site-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.site-header__burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ms-ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-header.is-menu-open .site-header__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.is-menu-open .site-header__burger span:nth-child(2) {
  opacity: 0;
}
.site-header.is-menu-open .site-header__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   TABLETTE — le menu passe en dessous du logo si trop serré, mais reste
   un menu horizontal classique tant que la place suffit.
   ========================================================================== */
@media (max-width: 1024px) {
  .site-header__menu {
    gap: 18px;
  }
  .site-header__menu a {
    font-size: 11px;
  }
}

/* ==========================================================================
   MOBILE / petite tablette — menu transformé en panneau déroulant
   sous le header, piloté par le bouton hamburger.
   ========================================================================== */
@media (max-width: 780px) {
  .site-header__burger {
    display: flex;
  }

  .site-header__logo img {
    height: 28px;
  }

  .site-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ms-paper);
    border-bottom: 1px solid var(--ms-line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-header.is-menu-open .site-header__nav {
    max-height: 400px;
  }

  .site-header__menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px var(--ms-wrap-padding) 20px;
  }

  .site-header__menu li {
    width: 100%;
    border-bottom: 1px solid var(--ms-line);
  }

  .site-header__menu a {
    display: block;
    padding: 14px 0;
    font-size: 13px;
  }

  .site-header {
    position: relative; /* le panneau se déroule sous le header sur mobile */
  }
}
