/**
 * Reepost Menu – Header avec logo conditionnel et menu conditionnel
 * Standards : sémantique HTML5, accessibilité, mobile-first, BEM
 */

/* === Layout principal === */
.reepost-menu {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.reepost-menu__zones {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 20px;
}

.reepost-menu__zone {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.reepost-menu__zone--left {
  justify-content: flex-start;
  justify-self: start;
}

.reepost-menu__zone--center {
  justify-content: center;
  justify-self: center;
}

.reepost-menu__zone--right {
  justify-content: flex-end;
  justify-self: end;
}

.reepost-menu__brand,
.reepost-menu__nav-wrap,
.reepost-menu__toggle-wrap,
.reepost-menu__univ-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 0;
}

.reepost-menu__nav-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.reepost-menu__zone .reepost-menu__nav {
  flex: 0 1 auto;
  justify-content: inherit;
}

.reepost-menu__zone--left .reepost-menu__nav {
  justify-content: flex-start;
}

.reepost-menu__zone--center .reepost-menu__nav {
  justify-content: center;
}

.reepost-menu__zone--right .reepost-menu__nav {
  justify-content: flex-end;
}

.reepost-menu__brand-link,
.reepost-menu__brand-img {
  display: block;
}

.reepost-menu__brand-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.reepost-menu__brand-link {
  line-height: 0;
}

/* === Navigation desktop === */
.reepost-menu__nav {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.reepost-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.reepost-menu__item {
  position: relative;
}

.reepost-menu__link {
  display: block;
  text-decoration: none;
  padding: 0.5em 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.reepost-menu__link:hover {
  opacity: 0.85;
}

.reepost-menu__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* === Hamburger (menu mobile) === */
.reepost-menu__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.reepost-menu__toggle:hover,
.reepost-menu__toggle:active {
  background-color: transparent;
}

.reepost-menu__toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.reepost-menu__toggle-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Switch d'univers (Studio | Film) === */
.reepost-menu__universe-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.reepost-menu__universe-toggle .reepost-menu__univ-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #666;
  font-size: 0.9em;
  padding: 6px 14px;
  background-color: transparent;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.reepost-menu__universe-toggle .reepost-menu__univ-btn:hover {
  color: #333;
}

.reepost-menu__universe-toggle .reepost-menu__univ-btn.is-active {
  color: #333;
  font-weight: 600;
}

.reepost-menu__universe-toggle .reepost-menu__univ-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.reepost-menu__univ-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 20px;
  flex-shrink: 0;
}

a.reepost-menu__univ-track {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.reepost-menu__univ-track::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 3px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  transition: opacity 0.2s ease;
}

.reepost-menu__universe-toggle .reepost-menu__univ-btn:hover + .reepost-menu__univ-track::before,
.reepost-menu__universe-toggle .reepost-menu__univ-track:hover::before {
  opacity: 0.6;
}

.reepost-menu__univ-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transform: translateX(-10px);
  transition: transform 0.25s ease;
}

.reepost-menu__universe-toggle--film .reepost-menu__univ-knob {
  transform: translateX(10px);
}

/* === Overlay menu mobile === */
.reepost-menu__overlay {
  position: fixed;
  inset: 0;
  z-index: var(--reepost-z-drawer, 10100);
  background: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  will-change: transform;
}

.reepost-menu__overlay.is-open {
  pointer-events: auto;
}

.reepost-menu__overlay .reepost-menu__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.reepost-menu__overlay .reepost-menu__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.reepost-menu__overlay-switcher {
  display: none;
  justify-content: center;
}

.reepost-menu__overlay-switcher--top {
  align-self: flex-start;
}

.reepost-menu__overlay-switcher--center {
  margin: auto 0;
}

.reepost-menu__overlay-switcher--bottom {
  margin-top: auto;
  align-self: flex-end;
}

.reepost-menu__overlay-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 2rem;
}

.reepost-menu__overlay .reepost-menu__list {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.reepost-menu__overlay .reepost-menu__link {
  padding: 0.75rem 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
