/* ==========================================================================
   MICRO EROSION - EN-TÊTE (maquette XD MICRO-26)
   Préfixe .mh- : aucune dépendance aux anciennes classes (#top-hdr, .header…)
   ========================================================================== */

/* ---------- Polices auto-hébergées (utilisées par tout le thème) ---------- */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/micro/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/micro/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/micro/roboto-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/micro/orbitron-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/micro/orbitron-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/micro/orbitron-latin-700-normal.woff2") format("woff2"); }

:root {
	--mh-black: #070c0e;
	--mh-blue: #138cbc;
	--mh-blue-light: #3bc4fa;
	--mh-grey: #ebebeb;
	--mh-top-h: 40px;
	--mh-bar-h: 80px;
	--mh-gutter: 20px;
	/* 12px à 1280px -> 15px à 1920px */
	--mh-fluid: clamp(0px, (100vw - 1280px), 640px);
	--mh-font: "Roboto", "Open Sans", Arial, sans-serif;
	--mh-cut: 10px;
}

/* ---------- Anciens éléments d'en-tête neutralisés ---------- */
#mySidenav,
.header-lang.me-top-language-bar,
#top-hdr,
.sidebar.button-right { display: none !important; }

/* ---------- Lien d'évitement ---------- */
.mh-skip {
	position: absolute; left: 12px; top: -60px; z-index: 10001;
	padding: 10px 16px; background: var(--mh-blue); color: #fff !important;
	font: 700 14px/1 var(--mh-font); text-decoration: none !important;
	transition: top .2s ease;
}
.mh-skip:focus { top: 12px; }
#mh-content { display: block; height: 0; outline: 0; }

/* ---------- Conteneur ---------- */
.mh-header {
	position: fixed; /* « sticky » impossible : inner.css impose html, body { height: 100% } */
	top: 0; left: 0; right: 0;
	z-index: 1000;
	font-family: var(--mh-font);
	-webkit-font-smoothing: antialiased;
	transition: transform .3s ease;
}
/* Au défilement, la barre noire (langues) remonte, la barre grise reste */
.mh-header.is-scrolled:not(.is-open) { transform: translateY(calc(-1 * var(--mh-top-h))); }
.mh-spacer { height: calc(var(--mh-top-h) + var(--mh-bar-h)); }
.admin-bar .mh-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .mh-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .mh-header { top: 0; } }

.mh-header *,
.mh-header *::before,
.mh-header *::after { box-sizing: border-box; }
.mh-header ul { list-style: none; margin: 0; padding: 0; }
.mh-header a { text-decoration: none; }
.mh-header a:focus-visible,
.mh-header button:focus-visible { outline: 2px solid var(--mh-blue-light); outline-offset: 2px; }

.mh-wrap {
	display: flex;
	align-items: center;
	height: 100%;
	max-width: 1680px; /* 140px de marge à 1920px (grille XD) */
	margin: 0 auto;
	padding: 0 var(--mh-gutter);
}

/* ---------- Barre noire : langues ---------- */
.mh-topbar { height: var(--mh-top-h); background: var(--mh-black); }
.mh-topbar .mh-wrap { justify-content: flex-end; }
.mh-langs ul { display: flex; height: var(--mh-top-h); }
.mh-langs li { position: relative; }
.mh-langs a {
	display: flex; align-items: center; justify-content: center;
	min-width: 44px; height: 100%; padding: 0 10px;
	color: #fff !important; font-size: 15px; font-weight: 700; letter-spacing: .02em;
	transition: background-color .2s ease;
}
.mh-langs a:hover { background: rgba(255,255,255,.08); }
.mh-langs .is-active a { background: var(--mh-blue); }
.mh-langs .is-active a::after { /* petite encoche */
	content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
	border: 5px solid transparent; border-bottom-color: var(--mh-grey); border-top-width: 0;
}

/* ---------- Barre grise ---------- */
.mh-bar { position: relative; height: var(--mh-bar-h); background: var(--mh-grey); box-shadow: 0 1px 0 rgba(7,12,14,.06); }
.mh-bar .mh-wrap { gap: calc(18px + var(--mh-fluid) * 0.016); }

.mh-logo { flex: 0 0 auto; width: calc(190px + var(--mh-fluid) * 0.109); line-height: 0; }
.mh-logo .widget { margin: 0; padding: 0; }
.mh-logo a { display: block; }
.mh-logo img { display: block; width: 100%; max-width: none !important; height: auto !important; }

.mh-nav { flex: 1 1 auto; display: flex; justify-content: flex-end; min-width: 0; }
.mh-menu { display: flex; align-items: center; gap: 0 calc(18px + var(--mh-fluid) * 0.034); }
.mh-menu > li { position: relative; display: flex; align-items: center; height: var(--mh-bar-h); }
.mh-menu > li > a {
	display: inline-flex; align-items: center; gap: 6px;
	color: var(--mh-black) !important;
	font-size: calc(12px + var(--mh-fluid) * 0.0047); font-weight: 700; line-height: 1.2;
	text-transform: uppercase; letter-spacing: .01em; white-space: nowrap;
	position: relative; padding: 6px 0;
	transition: color .2s ease;
}
.mh-menu > li > a::after { /* trait bleu au survol / page active */
	content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
	background: var(--mh-blue); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.mh-menu > li:hover > a,
.mh-menu > li:focus-within > a,
.mh-menu > .current-menu-item > a,
.mh-menu > .current-menu-ancestor > a,
.mh-menu > .current-menu-parent > a,
.mh-menu > .current_page_item > a,
.mh-menu > .current_page_ancestor > a { color: var(--mh-blue) !important; }
.mh-menu > li:hover > a::after,
.mh-menu > .current-menu-item > a::after,
.mh-menu > .current-menu-ancestor > a::after,
.mh-menu > .current_page_item > a::after,
.mh-menu > .current_page_ancestor > a::after { transform: scaleX(1); }

/* Chevron (icône SVG ajoutée par le thème aux éléments parents) */
.mh-menu .icon {
	display: inline-block; width: 10px; height: 10px; flex: 0 0 auto;
	fill: currentColor; transition: transform .2s ease;
}
.mh-menu > li:hover > a .icon,
.mh-menu > li.is-open > a .icon { transform: rotate(180deg); }

/* Sous-menus */
.mh-menu .sub-menu {
	position: absolute; top: 100%; left: -24px; z-index: 20;
	min-width: 280px; padding: 10px 0;
	background: #fff; border-top: 3px solid var(--mh-blue);
	box-shadow: 0 18px 40px rgba(7,12,14,.14);
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.mh-menu > li:hover > .sub-menu,
.mh-menu > li:focus-within > .sub-menu,
.mh-menu > li.is-open > .sub-menu {
	opacity: 1; visibility: visible; transform: none;
	transition: opacity .2s ease, transform .2s ease, visibility 0s;
}
.mh-menu .sub-menu a {
	display: block; padding: 10px 24px;
	color: var(--mh-black) !important; font-size: 14px; font-weight: 500; line-height: 1.35;
	text-transform: none; white-space: nowrap;
	transition: color .15s ease, background-color .15s ease, padding .15s ease;
}
.mh-menu .sub-menu a:hover,
.mh-menu .sub-menu .current-menu-item > a { color: var(--mh-blue) !important; background: #f4f6f7; padding-left: 30px; }

/* Bouton sous-menu (mobile, ajouté en JS) */
.mh-sub-toggle { display: none; }

/* ---------- Actions : LinkedIn + Contact ---------- */
.mh-actions { flex: 0 0 auto; display: flex; align-items: center; gap: calc(14px + var(--mh-fluid) * 0.0125); }
.mh-linkedin { display: inline-flex; color: var(--mh-black) !important; transition: color .2s ease, transform .2s ease; }
.mh-linkedin:hover { color: var(--mh-blue) !important; transform: translateY(-1px); }
.mh-linkedin svg { display: block; }

.mh-btn {
	display: inline-flex; align-items: center; justify-content: center;
	height: 35px; padding: 0 calc(16px + var(--mh-fluid) * 0.0125) 0 calc(14px + var(--mh-fluid) * 0.01);
	background: var(--mh-blue); color: #fff !important;
	font: 700 calc(13px + var(--mh-fluid) * 0.0031)/1 var(--mh-font); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--mh-cut)), calc(100% - var(--mh-cut)) 100%, 0 100%);
	transition: background-color .2s ease;
}
.mh-btn:hover,
.mh-btn:focus-visible { background: var(--mh-black); color: #fff !important; }

.mh-nav__extra { display: none; }

/* ---------- Burger ---------- */
.mh-burger {
	display: none; align-items: center; gap: 10px;
	height: 40px; padding: 0 4px; border: 0; background: transparent; cursor: pointer;
	color: var(--mh-black); font: 700 14px/1 var(--mh-font); text-transform: uppercase; letter-spacing: .04em;
}
.mh-burger__lines,
.mh-burger__lines::before,
.mh-burger__lines::after {
	display: block; width: 24px; height: 2px; background: currentColor;
	transition: transform .25s ease, background-color .25s ease;
}
.mh-burger__lines { position: relative; }
.mh-burger__lines::before,
.mh-burger__lines::after { content: ""; position: absolute; left: 0; }
.mh-burger__lines::before { top: -7px; }
.mh-burger__lines::after { top: 7px; }
.mh-header.is-open .mh-burger__lines { background: transparent; }
.mh-header.is-open .mh-burger__lines::before { transform: translateY(7px) rotate(45deg); }
.mh-header.is-open .mh-burger__lines::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Onglet latéral « Contactez-nous » ---------- */
.mh-sidetab {
	position: fixed; right: 0; top: clamp(180px, 26vh, 262px); z-index: 990;
	display: flex; flex-direction: column; align-items: center; gap: 14px;
	width: 42px; padding: 16px 0 22px;
	background: linear-gradient(180deg, var(--mh-blue) 0%, var(--mh-blue-light) 100%);
	color: #fff !important; text-decoration: none !important;
	font: 700 13px/1 var(--mh-font); letter-spacing: .06em; text-transform: uppercase;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px));
	box-shadow: -4px 6px 18px rgba(7,12,14,.18);
	transition: width .2s ease, background .2s ease;
}
.mh-sidetab__icon { flex: 0 0 auto; }
.mh-sidetab__label { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.mh-sidetab:hover,
.mh-sidetab:focus-visible { width: 48px; background: linear-gradient(180deg, var(--mh-black) 0%, var(--mh-blue) 100%); color: #fff !important; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablette + mobile : menu burger */
@media (max-width: 1279px) {
	:root { --mh-bar-h: 70px; --mh-top-h: 34px; --mh-fluid: 0px; }
	.mh-langs a { font-size: 13px; min-width: 40px; }
	.mh-logo { width: 210px; }
	.mh-btn { font-size: 14px; padding: 0 20px 0 16px; }
	.mh-burger { display: inline-flex; }
	.mh-actions { margin-left: auto; }

	.mh-nav {
		position: absolute; top: 100%; left: 0; right: 0;
		display: block;
		max-height: calc(100vh - var(--mh-bar-h) - var(--mh-top-h));
		overflow-y: auto; overscroll-behavior: contain;
		background: #fff; box-shadow: 0 20px 40px rgba(7,12,14,.15);
		border-top: 3px solid var(--mh-blue);
		visibility: hidden; opacity: 0; transform: translateY(-8px);
		transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
	}
	.mh-header.is-open .mh-nav { visibility: visible; opacity: 1; transform: none; transition: opacity .25s ease, transform .25s ease, visibility 0s; }

	.mh-menu { display: block; padding: 6px 0; }
	.mh-menu > li { display: flex; flex-wrap: wrap; height: auto; border-bottom: 1px solid #eee; }
	.mh-menu > li > a { flex: 1 1 auto; padding: 18px var(--mh-gutter); font-size: 15px; letter-spacing: .02em; }
	.mh-menu > li > a::after { display: none; }
	.mh-menu > li > a .icon { display: none; }
	.mh-sub-toggle {
		display: inline-flex; align-items: center; justify-content: center;
		width: 60px; border: 0; border-left: 1px solid #eee; background: transparent; color: var(--mh-blue); cursor: pointer;
	}
	.mh-sub-toggle::before {
		content: ""; width: 9px; height: 9px;
		border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
		transform: translateY(-2px) rotate(45deg); transition: transform .2s ease;
	}
	.mh-menu > li.is-open > .mh-sub-toggle::before { transform: translateY(2px) rotate(-135deg); }

	.mh-menu .sub-menu {
		position: static; flex: 0 0 100%; display: none;
		min-width: 0; padding: 0 0 10px; border: 0; box-shadow: none; background: #f6f7f8;
		opacity: 1; visibility: visible; transform: none; transition: none;
	}
	.mh-menu > li:hover > .sub-menu,
	.mh-menu > li:focus-within > .sub-menu { display: none; }
	.mh-menu > li.is-open > .sub-menu { display: block; }
	.mh-menu .sub-menu a { padding: 12px var(--mh-gutter) 12px calc(var(--mh-gutter) + 16px); white-space: normal; }

	.mh-sidetab { display: none; }
}

@media (max-width: 575px) {
	.mh-logo { width: 165px; }
	.mh-btn--header,
	.mh-linkedin { display: none; }
	.mh-burger__label { display: none; }
	.mh-nav__extra { display: flex; gap: 16px; align-items: center; padding: 20px var(--mh-gutter) 26px; }
	.mh-nav__extra .mh-btn { height: 44px; padding: 0 26px; }
}

@media (prefers-reduced-motion: reduce) {
	.mh-header *,
	.mh-sidetab { transition: none !important; }
}

/* Pas de défilement de la page derrière le menu mobile ouvert */
html.mh-menu-open { overflow: hidden; }
@media (min-width: 1280px) { html.mh-menu-open { overflow: visible; } }

/* ---------- Anciennes compensations de l'en-tête fixe ----------
   L'ancien en-tête recouvrait le haut des pages : certains gabarits
   ajoutaient 128px de marge. Le nouvel en-tête réserve sa place (.mh-spacer). */
.bandeau-head { padding-top: 56px !important; }
