/* ==========================================================================
   Yum Custom Mobile Menu — styles front
   ========================================================================== */

/* --- Neutralisation du menu mobile / off-canvas natif de GeneratePress ----
   On laisse le bouton hamburger (.menu-toggle) en place : il sert de
   déclencheur. On masque uniquement le panneau/liste générés par GP.
   La classe « ycmm-active » est posée par le JS selon l'option d'activation
   (toujours, ou seulement sous le breakpoint mobile).                       */
.ycmm-active .main-navigation.toggled .main-nav > ul {
	display: none !important;
}

.ycmm-active .slideout-navigation,
.ycmm-active .slideout-overlay,
.ycmm-active #generate-slideout-menu {
	display: none !important;
}

/* Empêche le défilement de la page quand le panneau est ouvert. */
body.ycmm-open {
	overflow: hidden;
}

/* --- Off-canvas ----------------------------------------------------------- */
.ycmm-offcanvas {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	/* dvh = hauteur réellement visible sur mobile (barre d'adresse comprise). */
	height: 100vh; /* repli anciens navigateurs */
	height: 100dvh;
	z-index: 99999;
	visibility: hidden;
	pointer-events: none;
	/* Retarde le masquage pour laisser jouer l'animation de sortie. */
	transition: visibility 0s linear 0.3s;
}

.ycmm-offcanvas.is-open {
	visibility: visible;
	pointer-events: auto;
	transition: visibility 0s linear 0s;
}

.ycmm-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ycmm-offcanvas.is-open .ycmm-overlay {
	opacity: 1;
}

.ycmm-panel {
	position: absolute;
	box-sizing: border-box;
	background: #fff;
	color: inherit;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 3.5rem 1.25rem 1.5rem;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Placement : côtés (panneau pleine hauteur) --- */
.ycmm-side-right .ycmm-panel,
.ycmm-side-left .ycmm-panel {
	top: 0;
	height: 100%;
	width: min(var(--ycmm-size, 320px), 100%);
}

.ycmm-side-right .ycmm-panel {
	right: 0;
}

.ycmm-side-left .ycmm-panel {
	left: 0;
}

/* --- Placement : haut / bas (panneau pleine largeur) --- */
.ycmm-side-top .ycmm-panel,
.ycmm-side-bottom .ycmm-panel {
	left: 0;
	width: 100%;
	height: min(var(--ycmm-size, 320px), 100%);
}

.ycmm-side-top .ycmm-panel {
	top: 0;
}

.ycmm-side-bottom .ycmm-panel {
	bottom: 0;
}

/* --- Animation : glissement (direction selon le placement) --- */
.ycmm-anim-slide.ycmm-side-right .ycmm-panel {
	transform: translateX(100%);
}

.ycmm-anim-slide.ycmm-side-left .ycmm-panel {
	transform: translateX(-100%);
}

.ycmm-anim-slide.ycmm-side-top .ycmm-panel {
	transform: translateY(-100%);
}

.ycmm-anim-slide.ycmm-side-bottom .ycmm-panel {
	transform: translateY(100%);
}

.ycmm-anim-slide.is-open .ycmm-panel {
	transform: translate(0, 0);
}

/* --- Animation : fondu --- */
.ycmm-anim-fade .ycmm-panel {
	opacity: 0;
}

.ycmm-anim-fade.is-open .ycmm-panel {
	opacity: 1;
}

/* --- Bouton de fermeture -------------------------------------------------- */
.ycmm-close {
	position: absolute;
	top: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	background: transparent;
	border: 0;
	border-radius: 4px;
	color: inherit;
	cursor: pointer;
	line-height: 1;
}

.ycmm-close:hover,
.ycmm-close:focus-visible {
	background: rgba(0, 0, 0, 0.06);
}

.ycmm-close svg {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
}

.ycmm-close-top-right .ycmm-close {
	right: 0.75rem;
}

.ycmm-close-top-left .ycmm-close {
	left: 0.75rem;
}

.ycmm-close-text {
	font-size: 0.95rem;
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.ycmm-overlay,
	.ycmm-panel {
		transition: none;
	}
}
