/* ── Menu Hamburger RT — Frontend ─────────────────────────── */

/* Variables injected inline by PHP:
   --mhr-bg, --mhr-text, --mhr-accent, --mhr-hamburger */

/* ═══════════════════════════════════════════════════════════
   DESKTOP (≥ 769px) : plugin invisible, thème intact
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .mhr-toggle,
  .mhr-overlay {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE (≤ 768px) : cacher le header du thème
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  header,
  .site-header,
  #masthead,
  #site-header,
  .header-main,
  [role="banner"] {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   BOUTON HAMBURGER
   ═══════════════════════════════════════════════════════════ */
.mhr-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.mhr-toggle .mhr-bar {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--mhr-hamburger, #000);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
              opacity   0.25s ease,
              width     0.25s ease;
  will-change: transform;
}

/* Open state → X morphing */
.mhr-toggle.is-open .mhr-bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.mhr-toggle.is-open .mhr-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.mhr-toggle.is-open .mhr-bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════════════════
   OVERLAY
   ═══════════════════════════════════════════════════════════ */
.mhr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: var(--mhr-bg, rgba(10, 10, 10, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;

  /* Hidden state */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mhr-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ═══════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════ */
.mhr-nav {
  width: 100%;
  max-width: 480px;
  padding: 0 40px;
}

.mhr-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Menu items ────────────────────────────────────────────── */
.mhr-menu-item {
  overflow: hidden;
  margin: 0;

  /* Staggered reveal */
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.mhr-overlay.is-open .mhr-menu-item {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--i, 0) * 60ms + 100ms);
}

/* ── Links ─────────────────────────────────────────────────── */
.mhr-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--mhr-text, #fff);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  width: 100%;
  text-align: left;
  position: relative;
  transition: color 0.2s ease;
}

.mhr-link::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--mhr-accent, #e8e8e8);
  transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.mhr-link:hover { color: var(--mhr-accent, #e8e8e8); }
.mhr-link:hover::after { width: 100%; }

/* Arrow */
.mhr-arrow {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0.5;
  margin-left: auto;
}
.mhr-parent-link[aria-expanded="true"] .mhr-arrow {
  transform: rotate(180deg);
}

/* ── Submenu ───────────────────────────────────────────────── */
.mhr-submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}
.mhr-submenu.is-open { max-height: 400px; }

.mhr-sublink {
  display: block;
  padding: 6px 0 6px 16px;
  font-size: clamp(14px, 4vw, 17px);
  font-weight: 300;
  color: var(--mhr-text, #fff);
  text-decoration: none;
  opacity: 0.65;
  letter-spacing: 0.03em;
  transition: opacity 0.2s ease, color 0.2s ease;
  position: relative;
}

.mhr-sublink:hover { opacity: 1; color: var(--mhr-accent, #e8e8e8); }

/* ── Divider ───────────────────────────────────────────────── */
.mhr-menu-item + .mhr-menu-item {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 400px) {
  .mhr-nav { padding: 0 24px; }
  .mhr-toggle { top: 14px; left: 14px; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mhr-overlay,
  .mhr-menu-item,
  .mhr-toggle .mhr-bar,
  .mhr-link::after,
  .mhr-submenu {
    transition: none !important;
  }
}
