/*
 * Header Elementor (modèle "Header" #282) : logo lisible sur fond clair + menu mobile/tablette
 * Le menu passe en hamburger sous 1024 px (réglage "dropdown tablet" du widget Menu de navigation).
 */

/* Le logo du site est un SVG blanc (utilisé aussi dans le pied de page sombre) :
 * on le teinte en bleu nuit (#0A0140) quand le header n'est pas transparent sur une image */
body:not(.home) .elementor-location-header header.elementor-section:not(.transparent-1) .elementor-widget-theme-site-logo img {
	filter: brightness(0) saturate(100%) invert(7%) sepia(43%) saturate(6223%) hue-rotate(245deg) brightness(84%) contrast(118%);
}

@media (max-width: 1024px) {
	/* ---------- Barre compacte : logo | nom de l'Académie | bouton menu ---------- */

	.elementor-location-header header.elementor-section {
		padding: 10px 16px !important;
	}

	.elementor-location-header .elementor-inner-section > .elementor-container {
		flex-wrap: nowrap;
		align-items: center;
	}

	.elementor-location-header .elementor-inner-section .elementor-column:first-child {
		flex: 0 0 60px;
		width: 60px !important;
		margin-right: 12px;
	}

	.elementor-location-header .elementor-inner-section .elementor-column:last-child {
		flex: 1 1 auto;
		width: auto !important;
		min-width: 0;
	}

	.elementor-location-header .elementor-inner-section .elementor-column:last-child > .elementor-widget-wrap {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 12px;
	}

	.elementor-location-header .elementor-widget-theme-site-logo {
		margin: 0 !important;
	}

	.elementor-location-header .elementor-widget-theme-site-logo img {
		width: 60px !important;
		height: auto;
	}

	.elementor-location-header .elementor-widget-theme-site-title {
		flex: 1 1 auto;
		min-width: 0;
		margin: 0 !important;
	}

	.elementor-location-header .elementor-widget-theme-site-title .elementor-widget-container {
		padding: 0 !important;
		border: 0 !important;
	}

	.elementor-location-header #motto h2.elementor-heading-title {
		padding: 0;
		font-size: 13px;
		line-height: 1.35;
		letter-spacing: .02em;
		text-align: left;
	}

	.elementor-location-header .elementor-widget-nav-menu {
		flex: 0 0 auto;
		width: auto !important;
		margin: 0 !important;
	}

	/* ---------- Bouton menu : zone tactile 44 px, visible sur fond clair ---------- */

	.elementor-location-header .elementor-menu-toggle {
		width: 44px;
		height: 44px;
		margin: 0 !important;
		padding: 0;
		border: 1px solid #E3DEE0;
		border-radius: 0;
		background: transparent !important;
		color: #0A0140 !important;
		font-size: 22px;
		transition: border-color .2s, color .2s, background .2s;
	}

	.elementor-location-header .elementor-menu-toggle:hover,
	.elementor-location-header .elementor-menu-toggle:focus-visible,
	.elementor-location-header .elementor-menu-toggle.elementor-active {
		border-color: #FF6600;
		color: #FF6600 !important;
	}

	.elementor-location-header .elementor-menu-toggle:focus {
		outline: none;
	}

	/* Sur l'accueil, le header est transparent sur l'image : bouton blanc */
	body.home .elementor-location-header .elementor-menu-toggle {
		border-color: rgba(255, 255, 255, .55);
		color: #ffffff !important;
	}

	/* ---------- Menu déroulé ---------- */

	/* Le menu déroulé est sorti du flux : sinon il élargit le widget (et écrase le titre)
	 * même replié. Il s'étend sur toute la largeur de l'écran, sous la barre. */
	.elementor-location-header .elementor-widget-nav-menu {
		position: relative;
	}

	.elementor-location-header .elementor-nav-menu--dropdown.elementor-nav-menu__container {
		position: absolute;
		top: 100%;
		right: -16px;
		z-index: 9997;
		width: 100vw !important;
		max-height: calc(100vh - 90px);
		margin-top: 10px !important;
		overflow-y: auto;
		overscroll-behavior: contain;
		box-shadow: 0 18px 30px -18px rgba(10, 1, 64, .6);
	}

	.elementor-location-header .elementor-nav-menu--dropdown li {
		width: 100% !important;
	}

	.elementor-location-header .elementor-nav-menu--dropdown .elementor-item {
		justify-content: space-between;
		padding: 15px 22px !important;
		border-bottom: 1px solid rgba(255, 255, 255, .1);
		font-size: 15px !important;
		letter-spacing: .05em;
	}

	.elementor-location-header .elementor-nav-menu--dropdown .sub-menu {
		background: rgba(255, 255, 255, .05);
		box-shadow: none !important;
	}

	.elementor-location-header .elementor-nav-menu--dropdown .elementor-sub-item {
		padding: 12px 22px 12px 38px !important;
		border-bottom: 1px solid rgba(255, 255, 255, .06);
		background: transparent !important;
		font-size: 15px !important;
		line-height: 1.35 !important;
	}

	.elementor-location-header .elementor-nav-menu--dropdown .elementor-sub-item::before {
		content: "–";
		margin-right: 10px;
		color: #FF6600;
	}

	/* Flèche des sous-menus : grande zone de clic, rotation à l'ouverture */
	.elementor-location-header .elementor-nav-menu--dropdown .sub-arrow {
		padding: 4px 0 4px 20px;
		font-size: 13px;
		transition: transform .2s;
	}

	.elementor-location-header .elementor-nav-menu--dropdown .highlighted .sub-arrow {
		transform: rotate(180deg);
	}

	/* ---------- Accueil : le header transparent ne recouvre plus le titre ---------- */

	body.home .elementor-location-header header.elementor-section {
		width: 100%;
		margin-top: 0;
	}

	body.home .elementor-location-header + * .elementor-section-wrap > .elementor-section:first-child,
	body.home [data-elementor-type="wp-page"] > .elementor-section:first-child {
		padding-top: 90px;
	}
}
