/* site-header — charte sombre LWS 2026 (portée globale marketing) */
.mod-header,
.mod-header-float__menu,
.mod-header-float__top,
.mod-header-modal {
  --mod-header-bg: #111111;
  --mod-header-ink: #F4EFE8;
  --mod-header-link: #C7BBB3;
  --mod-header-link-hover: #D88C58;
  --mod-header-bar: #C7BBB3;
  --mod-header-surface: #1C181B;
  --mod-header-surface-prune: #231A20;
  --mod-header-border: #3B3137;
  --mod-header-prune: #351425;
  --mod-header-copper: #C87846;
  --mod-header-copper-hover: #D88C58;
}

.mod-header {
  border-bottom: none;
  background: var(--mod-header-bg);
  position: relative;
  z-index: 50;
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--mod-header-ink);
}

.mod-header__inner {
  max-width: none;
  margin: 0 auto;
  padding: 20px 40px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 768px) {
  .mod-header__inner {
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
  }
}

.mod-header__brand {
  color: var(--mod-header-ink);
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
}

.mod-header__logo {
  display: block;
  width: 263px;
  height: auto;
  max-height: none;
}

@media (max-width: 768px) {
  .mod-header__logo {
    width: 192px;
  }
}

.mod-header__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mod-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-left: auto;
  border-radius: 0;
  color: var(--mod-header-bar);
}

.mod-header__toggle:focus-visible {
  outline: 2px solid var(--mod-header-copper);
  outline-offset: 2px;
}

.mod-header__bar {
  display: block;
  width: 33px;
  height: 4px;
  background: var(--mod-header-bar);
  border-radius: 3px;
}

.mod-header__nav {
  display: block;
}

.mod-header__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
}

.mod-header__link {
  outline: none;
  display: flex;
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
  color: var(--mod-header-link);
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 500;
  font-style: normal;
  text-decoration: none;
  line-height: 1.2;
  transition: color 0.1s ease-in-out, text-decoration-color 0.1s ease-in-out;
}

.mod-header__link:hover,
.mod-header__link:focus-visible {
  color: var(--mod-header-link-hover);
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 10px;
  outline: none;
}

.mod-header__link[aria-current="page"] {
  color: var(--mod-header-copper);
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 10px;
}

@media (min-width: 861px) {
  .mod-header__nav {
    width: auto;
  }
  .mod-header__list {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 860px) {
  .mod-header__nav {
    width: 100%;
  }
  .mod-header__list {
    flex-direction: column;
    align-items: flex-end;
    padding: 0.5rem 0 0.75rem;
  }
  .mod-header__link {
    font-size: 18px;
  }
}

html.js .mod-header--mounted .mod-header__toggle {
  display: flex;
}

@media (max-width: 860px) {
  html.js .mod-header--mounted .mod-header__nav {
    display: none;
  }
}

@media (min-width: 861px) {
  html.js .mod-header--mounted .mod-header__toggle {
    display: none;
  }
  html.js .mod-header--mounted .mod-header__nav {
    display: block;
    width: auto;
  }
}

/* ---------- Floating controls ---------- */
.mod-header-float__menu,
.mod-header-float__top {
  position: fixed;
  /* Chrome UI haut, mais sous les overlays plein écran (lightbox, etc.) */
  z-index: 9000;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid var(--mod-header-border);
  background: rgba(28, 24, 27, 0.92);
  color: var(--mod-header-ink);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.mod-header-float__menu {
  top: max(30px, env(safe-area-inset-top, 0px));
  right: max(30px, env(safe-area-inset-right, 0px));
  transform: translateY(-10px);
}

.mod-header-float__top {
  bottom: max(30px, env(safe-area-inset-bottom, 0px));
  right: max(30px, env(safe-area-inset-right, 0px));
}

.mod-header-float__icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.mod-header-root--mounted .mod-header-float__menu.is-float-visible,
.mod-header-root--mounted .mod-header-float__top.is-float-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mod-header-float__menu:hover,
.mod-header-float__top:hover {
  border-color: var(--mod-header-copper);
  background: var(--mod-header-surface);
  color: var(--mod-header-ink);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

.mod-header-float__menu.is-float-visible:hover,
.mod-header-float__top.is-float-visible:hover {
  transform: translateY(-3px);
}

.mod-header-float__menu:focus-visible,
.mod-header-float__top:focus-visible {
  outline: 2px solid var(--mod-header-copper);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .mod-header-float__menu,
  .mod-header-float__top {
    width: 45px;
    height: 45px;
  }
  .mod-header-float__icon {
    width: 20px;
    height: 20px;
  }
  .mod-header-float__menu {
    top: max(20px, env(safe-area-inset-top, 0px));
    right: max(20px, env(safe-area-inset-right, 0px));
  }
  .mod-header-float__top {
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    right: max(20px, env(safe-area-inset-right, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mod-header-float__menu,
  .mod-header-float__top,
  .mod-header-modal,
  .mod-header-modal__panel,
  .mod-header-modal__link,
  .mod-header-modal__close,
  .mod-header-modal__close-icon {
    transition: none;
  }

  .mod-header-modal__close:hover .mod-header-modal__close-icon,
  .mod-header-modal__close:focus-visible .mod-header-modal__close-icon {
    transform: none;
  }
}

/* ---------- Modal popup ---------- */
.mod-header-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-family: "Montserrat", system-ui, sans-serif;
}

.mod-header-root--mounted .mod-header-modal.is-modal-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/**
 * Overlay plein écran (lightbox mosaïque, etc.) :
 * le chrome flottant / modal passe derrière et ne bloque plus la vue.
 * Restauré automatiquement à la fermeture (body sans .is-site-overlay-open).
 */
body.is-site-overlay-open .mod-header-float__menu,
body.is-site-overlay-open .mod-header-float__top {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.is-site-overlay-open .mod-header-modal {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.mod-header-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mod-header-modal__panel {
  position: relative;
  z-index: 1;
  width: min(90vw, 400px);
  /* FHD : laisser la hauteur viewport (pas de plafond 640px qui forçait le scroll) */
  max-height: min(90vh, 900px);
  overflow: auto;
  background: var(--mod-header-surface);
  border: 1px solid var(--mod-header-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(53, 20, 37, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  /* Scrollbar locale du panneau (Firefox) — charte cuivre */
  scrollbar-width: thin;
  scrollbar-color: var(--mod-header-copper) var(--mod-header-surface);
}

.mod-header-modal__panel::-webkit-scrollbar {
  width: 8px;
}

.mod-header-modal__panel::-webkit-scrollbar-track {
  background: var(--mod-header-surface);
  border-radius: 14px;
}

.mod-header-modal__panel::-webkit-scrollbar-thumb {
  background: var(--mod-header-copper);
  border-radius: 8px;
  border: 2px solid var(--mod-header-surface);
}

.mod-header-modal__panel::-webkit-scrollbar-thumb:hover {
  background: var(--mod-header-copper-hover);
}

.mod-header-modal__title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mod-header-link);
  font-family: "Montserrat", system-ui, sans-serif;
}

.mod-header-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* Espacements libellés −35 % (12 → 8) pour tenir sans scroll sur FHD */
  gap: 8px;
}

.mod-header-modal__link {
  display: block;
  /* Padding vertical −35 % (16 → ~10) */
  padding: 10px 16px;
  border-radius: 12px;
  color: var(--mod-header-ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 400;
  font-family: "Montserrat", system-ui, sans-serif;
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.mod-header-modal__link:hover,
.mod-header-modal__link:focus-visible {
  background: rgba(200, 120, 70, 0.12);
  border-color: var(--mod-header-copper);
  outline: none;
  transform: none;
  box-shadow: none;
}

.mod-header-modal__link:focus-visible {
  outline: 2px solid var(--mod-header-copper);
  outline-offset: 2px;
}

.mod-header-modal__link[aria-current="page"] {
  border-color: var(--mod-header-copper);
  color: var(--mod-header-copper);
  background: rgba(200, 120, 70, 0.1);
}

.mod-header-modal__close {
  margin: 6px auto 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--mod-header-border);
  background: var(--mod-header-surface-prune);
  color: var(--mod-header-ink);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.mod-header-modal__close:hover,
.mod-header-modal__close:focus-visible {
  background: var(--mod-header-surface);
  border-color: var(--mod-header-copper);
  color: var(--mod-header-ink);
  outline: none;
}

.mod-header-modal__close:focus-visible {
  outline: 2px solid var(--mod-header-copper);
  outline-offset: 2px;
}

.mod-header-modal__close-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.3s ease;
}

.mod-header-modal__close:hover .mod-header-modal__close-icon,
.mod-header-modal__close:focus-visible .mod-header-modal__close-icon {
  transform: rotate(90deg);
}
