/* header-mobile.css : entête mobile calé sur le CHRU (05/10/2026). */
/*
 * Demande de Thomas : « cale toi sur le chru pour la version mobile du header ».
 * Structure, cotes et comportement repris de la feuille header.css du thème
 * chru-nancy (blocs .chru-mobile__* et .chru-mmenu*, relevés sur
 * www.chru-nancy.fr en 390px le 05/10/2026), avec la palette, le logo et les
 * contenus de la Maternité.
 *
 * Chargée juste après maternite.css : elle surcharge les règles mobiles de
 * maternite.css (bloc « Responsive ≤ 1024px ») sans les modifier.
 * RIEN ici ne s'applique au-dessus de 1024px, sauf le masquage du panneau
 * (qui était déjà masqué en desktop sous son ancien nom).
 */

/* Panneau : masqué par défaut (desktop), activé dans le media ci-dessous. */
.mat-mmenu { display: none; }

@media (max-width: 1024px) {

	/* ------------------------------------------------------------------
	 * Barre repliée : CHRU = 69px (8 + 52 + 8 + filet 1px), ombre douce,
	 * gouttières 20px, boutons 52×52 à pictos 34px.
	 * ------------------------------------------------------------------ */
	.mat-header {
		border-bottom: 1px solid #E9E9E9;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	}
	.mat-header__inner {
		padding: 8px 20px;
		gap: 16px;
	}
	.mat-header__logo { display: block; line-height: 0; }
	.mat-header__logo img,
	.mat-header__logo svg {
		height: 44px;
		max-height: none;
		width: auto;
	}

	.mat-mobile-actions { gap: 4px; }
	.mat-mobile-search-btn,
	.mat-nav-toggle {
		width: 52px;
		height: 52px;
		padding: 0;
		border: 0;
		border-radius: 6px;
		background: transparent;
		color: var(--mat-bleu-fonce, #14446B);
		cursor: pointer;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
	.mat-mobile-search-btn svg,
	.mat-nav-toggle svg {
		width: 34px;
		height: 34px;
		display: block;
	}
	.mat-mobile-search-btn:hover,
	.mat-nav-toggle:hover { background: var(--mat-rose-clair, #FFF5F3); }

	/* ------------------------------------------------------------------
	 * Menu plein écran (CHRU .chru-mmenu) : glisse depuis la droite,
	 * fond blanc, pas de voile.
	 * ------------------------------------------------------------------ */
	.mat-mmenu {
		display: flex;
		flex-direction: column;
		position: fixed;
		inset: 0;
		z-index: 9999;
		background: #fff;
		overflow: hidden;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform 0.3s ease, visibility 0s linear 0.3s;
	}
	.mat-mmenu.is-open {
		transform: translateX(0);
		visibility: visible;
		transition: transform 0.3s ease;
	}

	.mat-mmenu :focus-visible {
		outline: 2px solid var(--mat-rose-blush, #9E5B5C);
		outline-offset: 2px;
	}

	/* En-tête : logo + recherche + fermeture */
	.mat-mmenu__header {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20px 24px 8px;
	}
	.mat-mmenu__logo { display: block; line-height: 0; }
	.mat-mmenu__logo img {
		height: 52px;
		width: auto;
		max-width: none;
		display: block;
	}
	.mat-mmenu__header-actions {
		display: flex;
		align-items: center;
		gap: 12px;
	}
	.mat-mmenu__circle {
		width: 44px;
		height: 44px;
		border-radius: 50%;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		padding: 0;
		cursor: pointer;
		transition: background 0.2s ease, border-color 0.2s ease;
	}
	.mat-mmenu__circle svg { width: 18px; height: 18px; display: block; }
	.mat-mmenu__circle--search {
		background: var(--mat-bleu-fonce, #14446B);
		color: #fff;
		border: 1.5px solid var(--mat-bleu-fonce, #14446B);
	}
	.mat-mmenu__circle--search:hover { background: #0F3453; border-color: #0F3453; }
	.mat-mmenu__circle--close {
		background: #fff;
		color: var(--mat-bleu-fonce, #14446B);
		border: 1.5px solid var(--mat-bleu-fonce, #14446B);
	}
	.mat-mmenu__circle--close svg { width: 22px; height: 22px; }
	.mat-mmenu__circle--close:hover { background: var(--mat-rose-clair, #FFF5F3); }

	/* Scène : le corps défile, les sous-niveaux glissent par-dessus. */
	.mat-mmenu__stage {
		flex: 1 1 auto;
		min-height: 0;
		position: relative;
		overflow: hidden;
		display: flex;
	}
	.mat-mmenu__body {
		flex: 1 1 auto;
		display: flex;
		flex-direction: column;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 20px 24px 24px;
	}

	.mat-mmenu__section { margin-bottom: 30px; }

	/* Liens « La Maternité » / « Professionnels » (CHRU « Vous êtes ») */
	.mat-mmenu__profiles {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}
	.mat-mmenu__profile {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 3px 0;
		color: var(--mat-bleu-fonce, #14446B);
		font-size: 16px;
		font-weight: 600;
		line-height: 1.2;
		text-decoration: none;
	}
	.mat-mmenu__profile img {
		width: 16px;
		height: 16px;
		object-fit: contain;
		flex-shrink: 0;
	}

	/* Rubriques principales (chevron droit, pas de filet) */
	.mat-mmenu__nav,
	.mat-mmenu__sub-list {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 6px;
	}
	.mat-mmenu__nav-item,
	.mat-mmenu__sub-link {
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		padding: 8px 0;
		margin: 0;
		background: none;
		border: 0;
		border-radius: 0;
		color: var(--mat-bleu-fonce, #14446B);
		font-family: inherit;
		font-size: 16px;
		font-weight: 600;
		line-height: 1.2;
		text-align: left;
		text-decoration: none;
		cursor: pointer;
	}
	.mat-mmenu__sub-link { line-height: 1.3; }
	.mat-mmenu__nav-label,
	.mat-mmenu__sub-link > span { flex: 1 1 auto; }
	.mat-mmenu__nav-icon {
		display: inline-flex;
		width: 22px;
		height: 22px;
		flex-shrink: 0;
	}
	.mat-mmenu__nav-icon img { width: 22px; height: 22px; object-fit: contain; display: block; }
	.mat-mmenu__nav-chevron {
		width: 7px;
		height: 12px;
		flex-shrink: 0;
		color: currentColor;
		display: block;
	}
	.mat-mmenu__nav-item:hover,
	.mat-mmenu__sub-link:hover,
	.mat-mmenu__profile:hover,
	.mat-mmenu__sub-link[aria-current="page"],
	.mat-mmenu__nav-item[aria-current="page"] {
		color: var(--mat-rose-blush, #9E5B5C);
		text-decoration: none;
	}

	/* Téléphone + Urgences, calés en bas du panneau quand la place le permet */
	.mat-mmenu__foot {
		margin-top: auto;
		padding-top: 28px;
	}
	.mat-mmenu__phone {
		display: flex;
		align-items: center;
		gap: 12px;
		color: var(--mat-bleu-fonce, #14446B);
	}
	.mat-mmenu__phone > img { width: 22px; height: auto; flex-shrink: 0; }
	.mat-mmenu__phone-label {
		display: block;
		font-size: 13px;
		line-height: 1.3;
		color: #666;
	}
	.mat-mmenu__phone-number {
		font-size: 18px;
		font-weight: 700;
		color: var(--mat-rose-blush, #9E5B5C);
		text-decoration: none;
	}
	.mat-mmenu__urgences {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		margin-top: 16px;
		padding: 14px;
		border-radius: 30px;
		background: #DA1500;
		color: #fff;
		font-size: 16px;
		font-weight: 700;
		text-decoration: none;
	}
	.mat-mmenu__urgences:hover { background: #B81200; color: #fff; text-decoration: none; }
	.mat-mmenu__urgences img { width: 18px; height: 18px; filter: brightness(0) invert(1); }

	/* Sous-niveau : glisse depuis la droite par-dessus le corps */
	.mat-mmenu__sub {
		position: absolute;
		inset: 0;
		z-index: 2;
		background: #fff;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 20px 24px 24px;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform 0.3s ease, visibility 0s linear 0.3s;
	}
	.mat-mmenu__sub.is-open {
		transform: translateX(0);
		visibility: visible;
		transition: transform 0.3s ease;
	}
	/* Bouton retour : celui du panneau de recherche mobile du CHRU */
	.mat-mmenu__back {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		margin: 0 0 20px;
		padding: 4px 0;
		background: none;
		border: 0;
		color: var(--mat-bleu-fonce, #14446B);
		font-family: inherit;
		font-size: 15px;
		font-weight: 600;
		text-decoration: underline;
		cursor: pointer;
	}
	.mat-mmenu__back svg { width: 16px; height: 8px; display: block; }
	.mat-mmenu__back:hover { color: var(--mat-rose-blush, #9E5B5C); }
	.mat-mmenu__sub-title {
		display: flex;
		align-items: center;
		gap: 10px;
		margin: 0 0 16px;
		color: var(--mat-bleu-fonce, #14446B);
		font-size: 17px;
		font-weight: 700;
		line-height: 1.5;
	}
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
	.mat-mmenu,
	.mat-mmenu.is-open,
	.mat-mmenu__sub,
	.mat-mmenu__sub.is-open { transition: none; }
}
