/* ==========================================================================
   VARIABLES
   ========================================================================== */

:root {
	--color-text-dark: #000;
	--color-text-light: #fff;

	--color-primary: #ffcb05;           /* Fond : layerZero + layerTitle + layerOne  */
	--color-primary-dark: #ffae00; /* icône mobile + fond layerOne mobile */
	--color-primary-selected: #FFE066; /* hover / selected */

	--color-panel-bg: #f2f2f2;          /* fond du panneau layerOne */
	--color-layerChild-bg: rgba(247, 218, 118, 0.8);  /* fond du layerChild  */

	--color-slider-bg: #000;            /* bandeau de fermeture du layerChild */

	--color-tick-outline: #000;
	--color-tick-outline-selected: var(--color-text-light);

	--color-shadow: rgba(0, 0, 0, 0.25); /* ombre sous layerZero en paysage */
	--color-divider-shadow: rgba(0, 0, 0, 0.5);   /* liseré vertical inset sur layerTitle */
}


/* ==========================================================================
   LAYER ZERO — icônes niveau 0
   ========================================================================== */

#leftMenu.is-mobile #layerZero {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px 16px;
	justify-items: center;
	padding: 8px;
	background-color: var(--color-primary);
}

/* Largeurs des titres selon le nombre de colonnes forcé en JS */
.title1 { width: 100%;  padding-bottom: 75%; }
.title2 { width: 50%;   padding-bottom: 50%; }
.title3 { width: 33.3%; padding-bottom: 33.3%; }

.title1 img { width: 50%;  height: auto; margin-top: 5%; }
.title2 img { width: 65%;  height: auto; /* margin-top:10%; */ }
.title3 img { width: 100%; height: auto; /* margin-top:5%; */ }

.layerTitle {
	display: inline-block;
	position: relative;
	height: 0;
	background-color: var(--color-primary);
	box-shadow: 1px 0 0 var(--color-divider-shadow) inset;
	text-align: center;
	cursor: pointer;
}
#leftMenu.is-desktop .layerTitle.selected {
	background-color: var(--color-primary-selected);
}
#leftMenu.is-desktop .layerTitle:hover{
	background-color: var(--color-primary-selected);
}
#leftMenu.is-mobile .layerTitle.selected{
	background-color: transparent;
	border-bottom: 4px solid var(--color-primary-selected);
}
.layerTitle img {
	opacity: 0.6;
}

.layerTitle.selected img {
	opacity: 1;
}



.layerTitle div {
	position: absolute;
	width: 100%;
	font-size: 0.9em;
	color: var(--color-text-dark);
}

.title1 div { bottom: 0.5em; }
.title2 div { bottom: 0.5em; }
.title3 div { bottom: 0; }

/* Layout mobile : icône + label empilés verticalement */
#leftMenu.is-mobile .layerTitle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: inherit;
	height: inherit;
	padding: 8px 4px;
	gap: 4px;
	text-align: center;
	box-shadow: none;
}

#leftMenu.is-mobile .layerTitle img {
	width: 20px;
	height: 20px;
	padding: 5px;
	object-fit: contain;
	border-radius: 50%;
	background: var(--color-primary-dark);
}

#leftMenu.is-mobile .layerTitle div {
	position: inherit;
	width: auto;
	font-size: 11px;
}


/* ==========================================================================
   LAYER ONE — liste des sous-menus
   ========================================================================== */

#layerOne {
	padding: 0;
	color: var(--color-text-dark);
	text-align: left;
	overflow-y: auto;
	overflow-x: hidden;
}

#layerOne::-webkit-scrollbar {
	width: 6px;
}

#layerOne::-webkit-scrollbar-thumb {
	background-color: var(--color-slider-bg);
}

/* Section */

.layerSection:first-child {
	margin-top: 0;
	border-top: none;
}

.sectionLabel {
	padding: 4px 12px 5px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--color-text-light);
	background-color: var(--color-text-dark);
}

#leftMenu.is-mobile #layerOne {
	background-color: var(--color-primary);
}

#leftMenu.is-mobile #layerOne > div {
	margin: 0 15px;
	padding-top: 0;
	background: var(--color-panel-bg);
	color: var(--color-text-dark);
	/* border-radius: 15px 15px 0 0; */
}


/* ==========================================================================
   LAYER GROUP — item de menu + son sous-menu layerChild
   ========================================================================== */

.layerGroup {
	position: relative;
}

/* layerChild*/
.layerGroup > .layerChild {
	position: absolute;
	top: 0;
	left: 105%;
	width: 18em;
	background-color: var(--color-layerChild-bg);
	color: var(--color-text-dark);
	opacity: 1;
	transform: none;
	transition: all 0.3s;
}

.layerGroup > .layerChild.hidden {
	opacity: 0;
	transform: translate(-30%, 0);
}

.layerGroup > .layerChild:not(.hidden) {
	position: relative;
	top: 0;
	left: 0;
	width: 100%;
	margin-top: 0 !important;
}

#leftMenu.is-mobile .layerGroup > .layerChild {
	background-color: var(--color-layerChild-bg);
}


/* ==========================================================================
   LAYER / LAYER NC — item standard
   ========================================================================== */

.layer,
.layerNC {
	position: relative;
	padding: 0.3em 1.5em 0.3em 0.9em;
	font-size: 0.8rem;
	text-align: left;
	cursor: pointer;
}

.layerChild > .layerGroup > .layerNC {
	font-size: 0.8rem;
}

.layer:hover,
.layerNC:hover,
.layer.selected,
.layerNC.selected {
	color: var(--color-text-dark);
	background-color: var(--color-primary-selected);
}
/* ==========================================================================
   ICÔNES — plus / tick
   ========================================================================== */

.plusIcon,
.tickIcon {
	position: absolute;
	top: 0.3em;
	right: 0.1em;
	width: 1.2em;
	height: 1.2em;
	margin-right: 0.3em;
	background-size: 100%;
	float: right;
}

.plusIcon {
	background-image: url("image/plusLayer.png");
}

.selected .plusIcon,
.selected.plusIcon {
	background-image: url("image/minusLayer.png");
}

.tickIcon {
	outline: 1px solid var(--color-tick-outline);
	outline-offset: -0.25em;
}

.selected .tickIcon {
	outline: 1px solid var(--color-tick-outline-selected);
	background-image: url("image/tickYes.png");
}


/* ==========================================================================
   SLIDER — bandeau de fermeture en haut du layerChild
   ========================================================================== */

.layerSlider {
	width: 100%;
	height: 1.5em;
	margin-bottom: 0.5em;
	background-color: var(--color-slider-bg);
}

.sliderClose {
	width: 1.4em;
	height: 1.4em;
	margin-right: 0.2em;
	background-image: url("image/close.png");
	background-size: 100%;
	float: right;
	cursor: pointer;
}

.sliderClose:hover {
	background-image: url("image/closeHover.png");
}


/* ==========================================================================
   MODE PAYSAGE MOBILE — bascule en panneau latéral bas
   ========================================================================== */
/* Dans layer.css — @media (orientation: landscape) */

@media (orientation: landscape) {

	/* layerMenu : flex colonne, prend toute la hauteur */
	#leftMenu.is-mobile #layerMenu {
		display: flex;
		flex-direction: column;
		position: relative;
		flex: 1;
		min-width: 0;
		height: 100%;
		max-height: none;
		overflow: hidden;
	}

	/* Ombre de transition sous le bandeau layerZero */
	#leftMenu.is-mobile #layerMenu::after {
		content: '';
		position: absolute;
		top: 165px; /* max-height de layerZero (170px) - hauteur de l'ombre (24px) */
		left: 0;
		right: 0;
		height: 24px;
		background: linear-gradient(to bottom, transparent, var(--color-shadow));
		pointer-events: none;
		z-index: 2;
	}

	/* layerZero : 1 colonne, items en ligne */
	#leftMenu.is-mobile #layerZero {
		grid-template-columns: 1fr;
		gap: 2px;
		padding: 4px;
		flex-shrink: 0;
		max-height: 170px; /* ~3 items visibles (≈ 40px chacun) */
		overflow-y: auto;
	}

	#leftMenu.is-mobile #layerZero .layerTitle {
		flex-direction: row;
		justify-content: flex-start;
		gap: 8px;
		width: 95%;
		padding: 5px 8px;
	}

	#leftMenu.is-mobile #layerZero .layerTitle.selected {
		background-color: var(--color-primary-selected);
		border: none;
	}

	#leftMenu.is-mobile #layerZero .layerTitle img {
		width: 35px;
		height: 35px;
		padding: 5px;
		flex-shrink: 0;
	}

	#leftMenu.is-mobile #layerOne {
		flex: 1;
		min-height: 0;
		overflow-y: auto;
	}

	#leftMenu.is-mobile #layerOne > div {
		margin: 0;
		padding-bottom: 20px;
		border-radius: 0;
	}

	#leftMenu.is-mobile .layerGroup > .layerChild {
		left: 0;
	}

}
