/**
 * mod_slidemenu_j6 — bande de titre + burger + panneau glissant.
 *
 * Toutes les valeurs pilotables depuis l'admin arrivent en variables CSS
 * emises par le template, scopees sur [data-lmsm-id]. Ne rien coder en dur ici.
 */

.lmsm {
	position: relative;
}

/* ---------------------------------------------------------------- Bande */

.lmsm-band {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: var(--lmsm-z, 9000);
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--lmsm-band-h, 46px);
	padding: 0 56px;
	background: var(--lmsm-band-bg, #7703D6);
	color: var(--lmsm-band-fg, #FFFFFF);
	box-sizing: border-box;
}

.lmsm-band-static .lmsm-band {
	position: relative;
}

.lmsm-band-title {
	overflow: hidden;
	font-size: var(--lmsm-band-fs, 17px);
	line-height: 1.2;
	color: inherit;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

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

/*
 * Toujours ancre a gauche (left: calc(100% - N)), jamais a droite : passer de
 * `right` a `left` a l'ouverture changerait d'ancrage et la transition ne
 * jouerait pas. Ici seule la valeur de `left` change, donc elle s'anime.
 */
.lmsm-burger {
	position: fixed;
	top: 0;
	left: calc(100% - 52px);
	z-index: calc(var(--lmsm-z, 9000) + 2);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 52px;
	height: var(--lmsm-band-h, 46px);
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.lmsm-band-static .lmsm-burger {
	position: absolute;
}

.lmsm-burger > span {
	display: block;
	width: 28px;
	height: 2px;
	background: var(--lmsm-burger-color, #99CCFF);
	border-radius: 1px;
}

.lmsm-burger:focus-visible {
	outline: 2px solid var(--lmsm-burger-color, #99CCFF);
	outline-offset: -4px;
}

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

.lmsm-panel {
	position: fixed;
	top: 0;
	left: 0;
	z-index: calc(var(--lmsm-z, 9000) + 1);
	width: var(--lmsm-panel-w, 360px);
	max-width: 100%;
	height: 100vh;
	height: 100dvh;
	padding-bottom: 32px;
	overflow-x: hidden;
	overflow-y: auto;
	background: var(--lmsm-panel-bg, #7703D6);
	box-sizing: border-box;
	visibility: hidden;
	transform: translateX(-100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.35s;
}

.lmsm.is-open .lmsm-panel {
	visibility: visible;
	transform: translateX(0);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.lmsm-panel-label {
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--lmsm-band-h, 46px);
	margin: 0;
	font-size: var(--lmsm-band-fs, 17px);
	line-height: 1.2;
	color: var(--lmsm-item-fg, #FFFFFF);
}

.lmsm-logo {
	padding: 14px 0 18px;
	text-align: center;
}

.lmsm-logo img {
	display: inline-block;
	width: var(--lmsm-logo-w, 120px);
	height: auto;
	max-width: 80%;
}

.lmsm-items {
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.lmsm-item {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Trait de separation : part du bord gauche et s'arrete a --lmsm-line-w. */
.lmsm-item::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: var(--lmsm-line-w, 90%);
	height: 1px;
	background: var(--lmsm-line-color, #99CCFF);
	pointer-events: none;
}

.lmsm-item > a,
.lmsm-item-label {
	display: block;
	padding: 17px 20px 17px 38px;
	font-size: var(--lmsm-item-fs, 17px);
	line-height: 1.3;
	color: var(--lmsm-item-fg, #FFFFFF);
	text-decoration: none;
	transition: background-color 0.2s ease;
}

/*
 * Le degrade des exceptions vit sur le <li> (style inline), l'etat sur le <a> :
 * le survol reprend la meme couleur pleine que l'etat actif, et couvre donc
 * aussi bien le fond normal que le degrade d'une exception.
 */
.lmsm-item:not(.is-active) > a:hover,
.lmsm-item:not(.is-active) > a:focus-visible {
	background-color: var(--lmsm-item-active-bg, #8B28C0);
	color: var(--lmsm-item-active-fg, var(--lmsm-item-fg, #FFFFFF));
}

.lmsm-item.is-active > a {
	background-color: var(--lmsm-item-active-bg, #8B28C0);
	color: var(--lmsm-item-active-fg, var(--lmsm-item-fg, #FFFFFF));
}

.lmsm-item > a:focus-visible {
	outline: 2px solid var(--lmsm-line-color, #99CCFF);
	outline-offset: -3px;
}

/* Verrou de defilement pose par le JS sous le point de rupture uniquement. */
body.lmsm-locked {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.lmsm-panel,
	.lmsm-burger,
	.lmsm-item > a {
		transition: none;
	}
}

@media print {
	.lmsm-band,
	.lmsm-burger,
	.lmsm-panel {
		display: none;
	}
}
