/**
 * En-tête 2026.
 *
 * Chargée sur tout le front, jamais reportée : elle porte le haut de page.
 * Le panneau des rubriques et le tiroir mobile sont des divulgations dans le
 * flux (pas de superposition) : rien ne recouvre l'emplacement publicitaire de
 * tête, et le comportement est le même au doigt et à la souris.
 *
 * Les !important nommés ci-dessous battent des règles Divi (#main-header,
 * .et_pb_menu) qui visent large.
 */

.mh-top {
	background: var(--mh-surface);
	position: relative;
	z-index: 10;
}

.mh-top-bar {
	border-bottom: 1px solid var(--mh-line);
	background: var(--mh-surface);
}

.mh-top-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 78px;
	padding-top: 10px;
	padding-bottom: 10px;
}

/* ------------------------------------------------------------------- Logo */

.mh-logo {
	display: block;
	flex: 0 0 auto;
	line-height: 0;
}

.mh .mh-logo:hover,
.mh .mh-logo:focus {
	text-decoration: none;
}

.mh-logo-img {
	display: block;
	width: 100%;
	max-width: 240px;
	height: auto;
}

/* -------------------------------------------------------------- Navigation */

.mh-nav {
	flex: 1 1 auto;
	min-width: 0;
}

.mh-nav-list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 2px;
}

.mh-nav-item {
	margin: 0;
	padding: 0;
}

.mh .mh-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 44px;
	padding: 0 12px;
	border: 0;
	border-radius: var(--mh-r-sm);
	background: transparent;
	color: var(--mh-ink);
	font-family: var(--mh-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.mh .mh-nav-link:hover,
.mh .mh-nav-link:focus {
	background: var(--mh-tint);
	color: var(--mh-ink);
	text-decoration: none;
}

.mh .mh-nav-on {
	box-shadow: inset 0 -2px 0 0 var(--mh-red);
	border-radius: var(--mh-r-sm) var(--mh-r-sm) 0 0;
}

.mh-caret {
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--mh-muted);
	border-bottom: 2px solid var(--mh-muted);
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform .15s;
}

.mh-nav-toggle[aria-expanded="true"] {
	background: var(--mh-tint);
}

.mh-nav-toggle[aria-expanded="true"] .mh-caret {
	transform: rotate(-135deg) translate(-2px, -2px);
}

/* ------------------------------------------------------------------ Outils */

.mh-top-tools {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.mh-search {
	display: flex;
	align-items: center;
	gap: 0;
	border: 1px solid var(--mh-line-strong);
	border-radius: 999px;
	background: var(--mh-surface);
	overflow: hidden;
}

.mh-search input[type="search"] {
	width: 190px;
	min-height: 42px;
	padding: 0 6px 0 16px;
	border: 0;
	background: transparent;
	color: var(--mh-ink);
	font-family: var(--mh-text);
	font-size: 15px;
	box-shadow: none;
}

.mh-search input[type="search"]:focus {
	outline: 0;
}

.mh-search:focus-within {
	border-color: var(--mh-link);
	box-shadow: 0 0 0 2px rgba(21, 89, 159, .15);
}

.mh-search button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	min-height: 42px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

/* Loupe dessinée : pas d'icône Divi, pas de fonte d'icônes à charger. */
.mh-search-icon {
	position: relative;
	display: block;
	width: 13px;
	height: 13px;
	border: 2px solid var(--mh-ink-2);
	border-radius: 50%;
}

.mh-search-icon::after {
	content: "";
	position: absolute;
	top: 11px;
	left: 10px;
	width: 7px;
	height: 2px;
	background: var(--mh-ink-2);
	transform: rotate(45deg);
	transform-origin: left center;
}

.mh-search button:hover .mh-search-icon,
.mh-search button:focus .mh-search-icon {
	border-color: var(--mh-red);
}

.mh-search button:hover .mh-search-icon::after,
.mh-search button:focus .mh-search-icon::after {
	background: var(--mh-red);
}

/* ------------------------------------------------------------------ Langue */

.mh-lang {
	display: flex;
	align-items: center;
	border: 1px solid var(--mh-line-strong);
	border-radius: 999px;
	overflow: hidden;
}

.mh .mh-lang-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 42px;
	padding: 0 4px;
	color: var(--mh-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-decoration: none;
}

.mh .mh-lang-link:hover,
.mh .mh-lang-link:focus {
	background: var(--mh-tint);
	color: var(--mh-ink);
	text-decoration: none;
}

.mh .mh-lang-on {
	background: var(--mh-ink);
	color: #FFFFFF;
}

.mh .mh-lang-on:hover,
.mh .mh-lang-on:focus {
	background: var(--mh-ink);
	color: #FFFFFF;
}

/* ------------------------------------------------------------------ Burger */

.mh-burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid var(--mh-line-strong);
	border-radius: var(--mh-r-sm);
	background: var(--mh-surface);
	cursor: pointer;
}

.mh-burger span,
.mh-burger span::before,
.mh-burger span::after {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--mh-ink);
	border-radius: 2px;
}

.mh-burger span {
	position: relative;
}

.mh-burger span::before,
.mh-burger span::after {
	content: "";
	position: absolute;
	left: 0;
}

.mh-burger span::before { top: -6px; }
.mh-burger span::after  { top: 6px; }

.mh-burger[aria-expanded="true"] {
	background: var(--mh-ink);
	border-color: var(--mh-ink);
}

.mh-burger[aria-expanded="true"] span {
	background: transparent;
}

.mh-burger[aria-expanded="true"] span::before {
	top: 0;
	background: #FFFFFF;
	transform: rotate(45deg);
}

.mh-burger[aria-expanded="true"] span::after {
	top: 0;
	background: #FFFFFF;
	transform: rotate(-45deg);
}

/* ------------------------------------------------------- Panneau rubriques */

.mh-mega {
	border-bottom: 1px solid var(--mh-line);
	background: var(--mh-tint);
}

.mh-mega[hidden] {
	display: none;
}

.mh-mega-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
	gap: 32px;
	padding-top: 24px;
	padding-bottom: 24px;
}

.mh-mega-cols {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2px 20px;
	align-content: start;
}

.mh .mh-mega-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 40px;
	padding: 0 10px;
	border-radius: var(--mh-r-sm);
	color: var(--mh-ink);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.mh .mh-mega-link:hover,
.mh .mh-mega-link:focus {
	background: var(--mh-surface);
	color: var(--mh-ink);
	text-decoration: none;
}

.mh-mega-count {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 700;
	color: var(--mh-muted);
}

.mh-mega-rail {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 18px;
	background: var(--mh-surface);
	border: 1px solid var(--mh-line);
	border-radius: var(--mh-r);
}

.mh-mega-lead {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--mh-muted);
}

.mh .mh-mega-more {
	font-size: 14px;
	font-weight: 600;
}

/* ------------------------------------------------------------ Tiroir mobile */

.mh-drawer {
	border-bottom: 1px solid var(--mh-line);
	background: var(--mh-surface);
}

.mh-drawer[hidden] {
	display: none;
}

.mh-drawer-inner {
	max-width: var(--mh-shell);
	margin: 0 auto;
	padding: 14px 16px 20px;
	box-sizing: border-box;
}

.mh-drawer-list {
	margin-bottom: 14px;
}

.mh .mh-drawer-list a {
	display: block;
	padding: 13px 4px;
	border-bottom: 1px solid var(--mh-line);
	color: var(--mh-ink);
	font-size: 17px;
	font-weight: 700;
	text-decoration: none;
}

.mh-drawer-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.mh-drawer-cats .mh-pill {
	min-height: 40px;
	font-size: 14px;
}

/* ------------------------------------------- Emplacement publicitaire de tête */

#top-ad-container {
	max-width: var(--mh-shell);
	margin: 0 auto;
	padding: 14px 24px;
	box-sizing: border-box;
	text-align: center;
}

/* --------------------------------------------------------------- Tablette */

@media (max-width: 1023px) {
	.mh-top-inner {
		gap: 16px;
		min-height: 68px;
	}

	.mh-nav {
		display: none;
	}

	.mh-burger {
		display: inline-flex;
	}

	.mh-logo-img {
		max-width: 200px;
	}

	.mh-search input[type="search"] {
		width: 150px;
	}

	.mh-mega-inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.mh-mega-cols {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	#top-ad-container {
		padding: 12px 20px;
	}
}

/* ----------------------------------------------------------------- Mobile */

@media (max-width: 767px) {
	.mh-top-inner {
		flex-wrap: wrap;
		gap: 10px;
		min-height: 0;
		padding-top: 12px;
		padding-bottom: 12px;
	}

	.mh-logo {
		flex: 1 1 auto;
		min-width: 0;
	}

	.mh-logo-img {
		max-width: 168px;
	}

	/* La recherche passe seule en deuxième ligne, pleine largeur : elle est
	 * enfant direct de la barre, donc elle s'y déplace sans être dupliquée. */
	.mh-search {
		order: 3;
		flex: 1 0 100%;
	}

	.mh-search input[type="search"] {
		width: 100%;
		flex: 1 1 auto;
		min-width: 0;
	}

	.mh-top-tools {
		flex: 0 0 auto;
		gap: 8px;
	}

	.mh-mega-cols {
		grid-template-columns: minmax(0, 1fr);
	}

	.mh-mega-inner {
		padding-top: 16px;
		padding-bottom: 16px;
	}

	.mh .mh-mega-rail .mh-btn {
		width: 100%;
	}

	#top-ad-container {
		padding: 10px 16px;
	}
}
