/**
 * @file
 * The header components.
 *
 * It includes styles for the header itself and their
 * component as the logotype or the main menu.
 */

/**
 * Global header rules
 */

.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1rem 2rem;
  box-shadow: 0px 10px 20px -10px rgba(0,0,0,0.05);
  background-color: #fff;
}
ul.menu a.is-active {
  color: var(--color-dark);
}

@media all and (min-width: 1000px) {
  .header {
    display: flex;
    flex-direction: column;
    position: relative;
    top: inherit;
    left: inherit;
    right: inherit;
    box-shadow: none;
    padding: 0;
    z-index: 5;
  }
}
@media all and (min-width: 1200px) {

}


/**
 * Site Brand
 */

.header__brand {
  position: relative;
  display: flex;
  align-items: center;
}
.header__brand .site-logo {
  display: inline-block;
  max-width: 110px;
}
@media all and (min-width: 1000px) {
  .header__brand,
  .region-header,
  .header__brand .block-system-branding-block,
  .header__brand .site-logo {
    height: 100%;
  }
  /* .header__brand .site-logo {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
  }
  .header__brand .site-logo img {
    max-height: 100%;
  } */
}
@media all and (min-width: 1200px) {
  .header__brand {
    min-width: 165px;
  }
  .header__brand .site-logo {
    max-width: 165px;
  }
}


/**
 * Header Wrapper
 */
.menu--top-menu {
  padding: 0 1.5rem;
}
.header__top-wrapper{
  display: none;
}

@media all and (min-width: 1000px) {
  .header__top-wrapper{
    display: block;
    max-width: 1700px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: flex-end
  }
  .region-header-menu .menu--top-menu {
    display: none;
  }
  .menu--top-menu {
    padding: 0;
  }

  .header__top-wrapper {
  position: relative;
}

.header__top-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1451px;
  height: 1px;
  background-color: var(--color-stroke);
  left: auto;
  right: -100px;
}

  .header__top-menu .menu{
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    font-size: 0.778rem;
    font-weight: 500;
  }

  .header__top-menu .menu > li {
    position: relative;
  }

  .header__top-menu .menu > li:not(:last-child)::after {
    content: "";
    position: absolute;
    right: calc(-1.5rem / 2);
    top: 50%;
    transform: translateY(-50%);
    height: 90%;
    width: 1px;
    background-color: var(--color-stroke);
  }

  .menu--top-menu .menu--level-0 > .menu__item > a.menu__link {
    position: relative;
    display: inline-block;
    text-decoration: none;
    transition: color 0.3s ease;
  }

  .menu--top-menu .menu--level-0 > .menu__item > a.menu__link::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
  }

  .menu--top-menu .menu--level-0 > .menu__item > a.menu__link:hover {
    text-decoration: none !important;
  }

  .menu--top-menu .menu--level-0 > .menu__item:hover > a.menu__link::after {
    width: 100%;
  }



}


/**
 * Header Wrapper
 */

@media all and (min-width: 1000px) {
  .header__wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    gap: 3rem;
  }
}

@media all and (min-width: 1400px) {
  .header__wrapper {
    gap: 5rem;
  }
}


/**
 * Menu
 */

.header__menu {
  position: fixed;
  right: 100%;
  left: 0;
  top: 67.7px;
  bottom: 0;
  transition: 0.3s ease;
  background: var(--color-neutral--4);
  z-index: 10;
  overflow-y: scroll;
}
.user-logged-in .header__menu {
  top: 113px;
}
.header.js-active .header__menu {
  right: 0;
}
.header__menu ul.menu {
  margin: 0;
}
.menu--main .menu--level-0 {
  padding: 1.5rem 1.5rem 0;
}
.header__menu .menu__link {
  color: var(--color-dark);
  width: 100%;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  font-size: 1rem;
  position: relative;
  cursor: pointer;
  margin-bottom: 0.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
  text-transform: uppercase;
  font-weight: 700;
}
.header__menu .menu__link:hover {
  text-decoration: none;
}

/* Expended */

.menu__main .menu--level-1 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 0;
  overflow: hidden;
}
.menu__main .menu__item--expanded.js-active .menu--level-1 {
  gap: 0.3rem;
  height: max-content;
  overflow: unset;
}
.header__menu .menu--level-1 .menu__link {
  font-weight: 700;
  color: var(--color-primary--2);
}
.header__menu .menu--level-1 .menu__link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--color-neutral--3);
  transform: translateY(50%);
}
.menu__main .menu__item--expanded.js-active > .menu__link::after{
  transform: rotate(90deg);
}
@media all and (min-width: 975px) {
  .user-logged-in .header__menu {
    top: 168px;
  }
}
@media all and (min-width: 1000px) {
  .header__menu,
  .menu__main,
  .region-header-menu,
  .menu--main,
  .header__menu .menu--level-0 {
    height: 100%;
  }
  .header__menu {
    display: flex;
    justify-content: space-between;
    position: relative;
    right: inherit;
    left: inherit;
    bottom: inherit;
    transition: none;
    background: inherit;
    overflow-y: inherit;
    top: inherit;
    gap: 1rem;
    justify-content: space-between;
    width: calc(100% - 158px);
  }
  .region-header-menu{
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
  }
  .user-logged-in .header__menu {
    top: inherit;
  }
  .header.js-active .header__menu {
    transform: none;
  }
  .header__menu .menu--level-0 {
    display: flex;
    align-items: center;
    padding: 0;
    gap: 1rem;
  }
  .header__menu .menu__item {
    display: flex;
    position: relative;
  }
  .header__menu .menu__link {
    font-size: 0.833rem;
    margin-bottom: 0;
  }
  .menu__main .menu__link:after {
    content: none;
  }
  .header__menu .menu--level-0 > .menu__item > .menu__link {
    cursor: pointer;
  }


.header__menu .menu--level-0 > .menu__item > a.menu__link {
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.menu--main .menu--level-0 > .menu__item > a.menu__link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.menu--main .menu--level-0 > .menu__item:hover > a.menu__link::after {
  width: 100%;
}


  /* Expended */
  .menu__main .menu--level-1 {
    display: none;
    position: absolute;
    top: 100%;
    left: -2rem;
    width: 340px;
    height: max-content;
    padding: 2rem;
    background-color: var(--color-primary--4);
  }
  .menu__main .menu__item--expanded:hover .menu--level-1 {
    display: flex;
  }
  .menu__main .menu--level-1 .menu__link {
    padding: 0.5rem;
  }
  .menu__main .menu--level-1 .menu__link:after {
    content: '';
    transition: 0.2s;
  }
  .menu__main .menu--level-1 .menu__link:hover:after {
    transform: translateX(5px);
  }
  .header__menu .menu--level-1 .menu__link::before {
    bottom: -0.5rem;
  }
  .header__menu .menu--level-1 .menu__item:last-child .menu__link::before {
    content: none;
  }
}

@media all and (min-width: 1200px) {
  .header__menu {
    gap: 2rem;
    width: calc(100% - 191px);
  }
}

@media all and (min-width: 1350px) {
  .region-header-menu{
    gap: 5rem;
  }
}


/**
 * Menu Contact
 */

.menu--contact-menu .menu--level-0 {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
  padding: 0 1.5rem;
}

.menu--contact-menu .menu__link {
  display: inline-block;
  width: fit-content;
  padding: 8px 20px;
  background-color: #000;
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  font-weight: 700;
  transition: background-color 0.3s ease;
  text-align: center;
}

.menu--contact-menu .menu__link:hover {
  background-color: #333;
}
.menu--contact-menu .menu__link.is-active {
  color: white;
}


.menu--contact-menu .menu__item:nth-child(2) .menu__link::before {
  content: '';
  display: inline-block;
  width: 16.25px;
  height: 16.25px;
  background-image: url('../../images/contact-menu/icon-phone.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-right: 8px;
  vertical-align: middle;
}

@media (min-width: 1000px) {
  .menu--contact-menu .menu--level-0 {
    padding: 0;
    gap: 1rem;
    flex-direction: row;
  }
}


/**
 * Custom Element
 */

.menu__link.menu__link-cta {
  display: inline-block;
  padding: 0.5rem 1rem;
  width: fit-content;
  border: 1px solid var(--color-dark);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 40px;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}
.menu__link.menu__link-cta:hover {
  background-color: var(--color-primary--4);
}
.menu__link.menu__link-cta::after {
  content: none;
}
.header__menu .menu--level-0 > .menu__item > .menu__link.menu__link-cta {
  cursor: pointer;
}
@media all and (min-width: 1000px) {
  .menu__link.menu__link-cta {
    height: fit-content;
    margin: auto 0 auto 1rem;
  }
}


/**
 * Mobile menu button
 */


.menu-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 22px;
  height: 16px;
  transform: translateY(-50%);
  z-index: 99;
}

.menu-toggle__button {
  border: none;
  width: 22px;
  height: 16px;
  padding: 0;
  text-indent: 100px;
  background-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  position: absolute;
  left: 0;
  top: 0;
}

.menu-toggle span {
  position: absolute;
  left: 1px;
  display: block;
  width: 20px;
  height: 2px;
  background-color: #000;
  transition: all 0.25s ease;
  border-radius: 0;
}

.menu-toggle span:nth-child(1) {
  top: 1px;
}

.menu-toggle span:nth-child(2) {
  top: 7px;
}

.menu-toggle span:nth-child(3) {
  top: 13px;
}

.menu-toggle:hover span:nth-child(1),
.menu-toggle:hover span:nth-child(3) {
  width: 20px;
}

.header.js-active .menu-toggle span:nth-child(1) {
  top: 7px;
  width: 20px;
  transform: rotate(45deg);
}

.header.js-active .menu-toggle span:nth-child(2) {
  width: 0;
  left: 22px;
}

.header.js-active .menu-toggle span:nth-child(3) {
  top: 7px;
  width: 20px;
  transform: rotate(-45deg);
}

/* Burger blanc sur fond sombre */
.header--dark .menu-toggle span {
  background-color: #fff;
}

@media (min-width: 1000px) {
  .menu-toggle {
    display: none;
  }
}
