/* Répare la base sticky : Neve applique overflow:hidden à body > .wrapper, on force la visibilité verticale ici. */
body > .wrapper:not(.et-fb-iframe-ancestor) {
  overflow-x: hidden;
  overflow-y: visible;
}

/* Desktop/Tablet banner shared base. */
.vm-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--vm-header-background-color);
  color: var(--vm-header-text-color);
  border-bottom: var(--vm-header-border-bottom-width, 0px) solid var(--vm-header-border-bottom-color, transparent);
  box-sizing: border-box;
}

/* Mobile-only banner (visible under 576px). */
.vm-header-mobile {
  display: none;
  width: 100%;
  padding: 0.65rem 0.75rem;
  background-color: var(--vm-header-background-color);
  color: var(--vm-header-text-color);
  border-bottom: var(--vm-header-border-bottom-width, 0px) solid var(--vm-header-border-bottom-color, transparent);
  box-sizing: border-box;
}

.vm-header-mobile__inner {
  width: var(--vm-header-inner-width, 100%);
}

/* Trois zones (Identité / Message / Actions) alignées horizontalement. */
.vm-child-header-mobile__grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-items: stretch;
  gap: 0.75rem;
}

.vm-child-header-mobile__identity {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.vm-child-header-mobile__message {
  justify-self: center;
  text-align: center;
  white-space: normal;
}

.vm-child-header-mobile__message-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}
.vm-child-header-mobile__message-text p {
  margin: 0;
}

.vm-child-header-mobile__identity-logo {
  display: inline-flex;
}

.vm-header-mobile__logo {
  max-width: var(--vm-logo-max-width, 120px);
  max-height: calc(var(--vm-logo-max-width, 120px) * 1);
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.vm-child-header-mobile__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  gap: 0.35rem;
}

.vm-child-header-mobile__actions-social {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.vm-child-header-mobile__actions-menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.vm-child-header-mobile__menu-toggle {
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.vm-child-header-mobile__menu-icon {
  display: inline-flex;
  width: 26px;
  height: 18px;
  align-items: center;
}

.vm-child-header-mobile__menu-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.vm-child-header-mobile__menu-toggle.is-open .vm-child-header-mobile__menu-icon svg rect {
  transform-origin: center;
}

.vm-child-header-mobile__menu-toggle .vm-child-header-mobile__menu-icon svg rect:nth-child(1),
.vm-child-header-mobile__menu-toggle .vm-child-header-mobile__menu-icon svg rect:nth-child(2),
.vm-child-header-mobile__menu-toggle .vm-child-header-mobile__menu-icon svg rect:nth-child(3) {
  transition: none;
}

.vm-header-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  pointer-events: none;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.vm-header-mobile-menu.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.vm-header-mobile-menu::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.vm-header-mobile-menu.vm-header-mobile-menu--closing::before {
  transition: none;
  opacity: 0 !important;
}

.vm-header-mobile-menu.is-open::before {
  opacity: 1;
}

.vm-header-mobile-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 80%);
  background: var(--vm-header-background-color);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
  padding: 1rem;
  pointer-events: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.vm-header-mobile-menu.is-open .vm-header-mobile-menu__panel {
  transform: translateX(0);
}

.vm-child-header-mobile__close-wrapper {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.vm-header-mobile-menu.is-open .vm-child-header-mobile__close-wrapper {
  opacity: 1;
  pointer-events: auto;
}

.vm-header-mobile-menu.is-open .vm-header-mobile-menu__close {
  opacity: 1;
  pointer-events: auto;
}

.vm-header-mobile-menu__list {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  padding-top: 3.5rem;
  height: 100%;
  position: relative;
}

.vm-header-mobile-menu__close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  /* La zone cliquable reste calée sur l’icône × */
}

.vm-header-mobile-menu.is-open .vm-header-mobile-menu__close {
  opacity: 1;
  pointer-events: auto;
}

.vm-header-mobile-menu__list {
  padding-top: 3.5rem;
}

.vm-header-mobile-menu__list a {
  color: inherit;
  font-weight: 600;
}

.vm-header-mobile-menu__list.is-open {
  display: flex;
}

.vm-header-mobile-menu.is-open .vm-header-mobile-menu__list {
  display: flex;
}

@media (max-width: 575px) {
  .vm-header-mobile__logo {
    max-width: 70%;
    height: auto;
  }

  .vm-header-mobile__inner .vm-child-header-mobile__identity {
    justify-self: start;
  }

  .vm-child-header-mobile__actions {
    gap: 0.5rem;
  }
}

/* Shared desktop header inner grid. */
.vm-header__inner {
  width: var(--vm-header-inner-width, 100%);
  max-width: 1280px;
  margin-top: var(--vm-header-inner-margin-top, 0px);
  margin-bottom: var(--vm-header-inner-margin-bottom, 0px);
  margin-left: var(--vm-header-inner-margin-left, 0px);
  margin-right: var(--vm-header-inner-margin-right, 0px);
  padding-top: var(--vm-header-inner-padding-top, 0px);
  padding-bottom: var(--vm-header-inner-padding-bottom, 0px);
  padding-left: var(--vm-header-inner-padding-left, 0px);
  padding-right: var(--vm-header-inner-padding-right, 0px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

/* Basic block styling (logo, slogan, etc.). */
.vm-header__block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.vm-header__logo {
  max-width: var(--vm-logo-max-width, 120px);
  width: 100%;
  height: auto;
  display: block;
}

.vm-header__slogan {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}
.vm-header__slogan p {
  margin: 0;
}

.vm-back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--vm-header-background-color);
  color: var(--vm-header-text-color);
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
}

.vm-back-to-top span {
  font-size: 1.3rem;
  line-height: 1;
}

.vm-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.vm-back-to-top:focus-visible {
  outline: 3px solid var(--vm-header-border-bottom-color, #702F8A);
  outline-offset: 2px;
}

.vm-header__block--menu .vm-header-menu {
  display: flex;
  justify-content: center;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.vm-header__block--menu .vm-header-menu a {
  color: inherit;
  font-weight: 600;
}

/* Align the social block in desktop header. */
.vm-header__block--social {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  align-self: flex-start;
}

.vm-header-mobile,
.vm-header {
  transition: none;
}

.vm-header--sticky,
.vm-header-mobile--sticky {
  /* Fallback en position: fixed, complété par vm-header-sticky-fallback.js pour compenser la hauteur. */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 60;
  background-color: var(--vm-header-background-color);
  border-bottom: var(--vm-header-border-bottom-width, 0px) solid var(--vm-header-border-bottom-color, transparent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

body.admin-bar .vm-header--sticky,
body.admin-bar .vm-header-mobile--sticky {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .vm-header--sticky,
  body.admin-bar .vm-header-mobile--sticky {
    top: 46px;
  }
}

@media (min-width: 960px) {
  /* Classe appliquée côté desktop par assets/js/vm-header-desktop-shrink.js pour réduire le logo et les espacements du header sticky lorsqu'on scroll. */
  .vm-header.vm-header--scrolled {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  .vm-header.vm-header--scrolled .vm-header__inner {
    gap: 0.35rem;
  }

  .vm-header.vm-header--scrolled .vm-header__logo {
    max-width: calc( var(--vm-logo-max-width, 120px) * 0.75 );
  }
}

/* Mobile breakpoint: swap templates. */
@media (max-width: 960px) {
  .vm-header {
    display: none;
  }

  .vm-header-mobile {
    display: flex;
  }

  .vm-child-header-mobile__actions {
    justify-self: end;
  }

  .vm-header-mobile__inner {
    width: 100%;
  }

}

@media (min-width: 961px) {
  .vm-header-mobile {
    display: none;
  }
}

@media (min-width: 960px) {
  .vm-header {
    display: flex;
  }

  .vm-header__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-row-gap: 0.75rem;
    gap: 0.75rem;
    text-align: center;
  }

  .vm-header__block--menu {
    order: 3;
  }
}

@media (min-width: 1024px) {
  .vm-header__inner {
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: repeat(2, minmax(0, auto));
    grid-column-gap: 1.5rem;
    grid-row-gap: 0.5rem;
  }

  .vm-header__block--logo {
    justify-self: start;
    align-self: center;
    grid-row: span 2;
  }

  .vm-header__block--slogan {
    justify-self: center;
    align-self: center;
  }

  .vm-header__block--social {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  .vm-header__block--menu {
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
    align-self: end;
  }
}
