/* ============================================
   HEADER + NAV PANEL
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--gutter);
}

.site-header__left {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.site-header__title {
  display: block;
  flex-shrink: 0;
}

/* font-weight / letter-spacing : via .text-display (posée dans le template) */
.site-header__title h1 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
}

.title-short {
  display: none;
}

.site-header.is-compact .title-full {
  display: none;
}

.site-header.is-compact .title-short {
  display: inline;
}

.site-header.is-compact .site-header__title h1 {
  word-spacing: normal;
}

.site-header__subtitle {
  font-size: 16px;
  color: var(--color-text);
}

/* .site-header:not(.is-compact) .site-header__subtitle {
  display: none;
} */

/* Desktop inline nav — hidden by default, visible in compact mode */
.site-header__nav {
  display: none;
}

.site-header__nav-link {
  font-size: 16px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__nav-link:hover,
.site-header__nav-link.is-active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 1024px) {
  .site-header.is-compact .site-header__nav {
    display: flex;
    align-items: flex-end;
    gap: 24px;
  }
}

.site-header__burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 16px;
  margin-bottom: 6px;
  flex-shrink: 0;
  align-self: flex-end;
}

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

.site-header__burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header__burger.is-open span:nth-child(2) {
  opacity: 0;
}

.site-header__burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- NAV PANEL (panneau latéral, thème inversé) --- */
.nav-panel {
  --color-bg: #000;
  --color-text: #fff;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(280px, 33vw, 420px);
  background: var(--color-bg);
  color: var(--color-text);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
  padding: var(--gutter);
}

.nav-panel.is-open {
  transform: translateX(0);
}

.nav-panel__close {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  z-index: 1;
  font-size: 36px;
  line-height: var(--leading-lg);
}

.nav-panel__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: 0;
}

.nav-panel__link {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  position: relative;
}

.nav-panel__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--color-text);
  transition: width 0.25s ease;
}

.nav-panel__link:hover::after,
.nav-panel__link.is-active::after {
  width: 100%;
}

.nav-panel__backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  display: none;
}

.nav-panel__backdrop.is-open {
  display: block;
}

@media (max-width: 1023px) {
  .site-header__burger {
    display: flex;
    margin-top: 2px;
  }
    .site-header:not(.is-compact) .site-header__subtitle {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .site-header__left {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .site-header__subtitle {
    display: none;
  }

  .site-header__title h1 {
    word-spacing: 100vw;
  }

  .nav-panel {
    width: 100%;
  }
}
