/* ===========================
   Inline ToC in content
   =========================== */

.mnwb-toc--inline {
	margin: 1.5em 0 2em;
	padding: 1em 1.4em;
	border-radius: 6px;
	background-color: #f6f0e2;
	border: 1px solid #e2d4b9;
}

.mnwb-toc__list {
	list-style: disc;
	margin: 0;
	padding-left: 1.4em;
}

.mnwb-toc__list--sub {
	margin-top: 0.25em;
}

.mnwb-toc__item {
	margin: 0.1em 0;
	line-height: 1.3;
}

.mnwb-toc__item--level-3 {
	margin-left: 0.75em;
}

.mnwb-toc__item a {
	text-decoration: none;
}

.mnwb-toc__item a:hover,
.mnwb-toc__item a:focus-visible {
	text-decoration: underline;
}

/* ===========================
   Floating button
   =========================== */
[class*="__inner-container"] > .mnwb-toc-toggle:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide),
[class*="__inner-container"] > .mnwb-toc-flyout:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide) {
	width: auto;
}

.mnwb-toc-toggle {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 999;
	background-color: rgba(0, 0, 0, 0.6);
	color: #fff;
	padding: 10px 20px;
	border-radius: 999px;
	border: none;
	line-height: 1.2;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.15s ease, background-color 0.2s ease;
}

/* Visible uniquement après scroll (body.has-scrolled est déjà géré par ton script header) */
body.has-scrolled .mnwb-toc-toggle {
	opacity: 1;
	pointer-events: auto;
}

.mnwb-toc-toggle:hover,
.mnwb-toc-toggle:focus-visible {
	transform: translateY(-1px);
	background-color: rgba(0, 0, 0, 0.8);
}

/* Mobile : un peu plus haut et plus près du bord */
@media (max-width: 782px) {
	.mnwb-toc-toggle {
		left: 16px;
		bottom: 32px;
	}
}

/* ===========================
   Flyout panel
   =========================== */

.mnwb-toc-flyout {
	position: fixed;
	left: 1rem;
	bottom: 7.2rem; /* laisse la place au bouton */
	z-index: 1000;
	background-color: #ffffff;
	color: #222;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	width: min(360px, 90vw);
	overflow: hidden;
}

@media (max-width: 900px) {
	.mnwb-toc-flyout {
		left: 1rem;
		right: 1rem; /* empêche de coller au bord droit */
		width: auto; /* laisse flexiblement gérer la largeur */
		max-width: 90vw; /* garde ta limite mobile */
	}
}

/* Header (titre + bouton fermer) */
.mnwb-toc-flyout__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 14px 6px;
	border-bottom: 1px solid #eee;
	font-weight: 600;
	background-color: #000000;
}

.mnwb-toc-flyout__title {
	margin-right: 8px;
	color:#ffffff;
}

.mnwb-toc-flyout__close {
	background: none;
	border: none;
	cursor: pointer;
	line-height: 1;
	padding: 4px 6px;
}

/* Scrollable body */
.mnwb-toc-flyout__body {
	max-height: calc(520px - 40px); /* approximative header height */
	overflow-y: auto;
	padding: 8px 14px 10px;
	scrollbar-width: thin;
	overscroll-behavior: contain; /* évite que la page scrolle en même temps */
}

/* Nav inside flyout: reset margin */
.mnwb-toc-flyout .mnwb-toc {
	margin: 0;
}
