/**
 * Sommaire des articles (inc/sommaire.php + js/sommaire.js).
 */

/* Sommaire en haut de l'article (tous écrans)
--------------------------------------------- */
.entry-content .entry-toc {
	margin: 2rem 0 2.5rem;
	padding: 1.25rem 1.5rem;
	border: 2px solid var(--color-stone);
	border-radius: 12px;
}

.entry-toc details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	list-style: none;
	cursor: pointer;
	color: var(--color-terracotta);
	font-family: var(--font-mono);
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.entry-toc details > summary::-webkit-details-marker {
	display: none;
}

.entry-toc details > summary::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-left: 1rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.entry-toc details[open] > summary::after {
	transform: rotate(-135deg);
}

.entry-content .entry-toc ol {
	margin: 1rem 0 0;
	padding-left: 1.6em;
}

.entry-content .entry-toc li {
	margin-bottom: 0.35em;
	line-height: 1.5;
}

.entry-toc li::marker {
	color: var(--color-terracotta);
	font-family: var(--font-mono);
	font-size: 0.85em;
}

.entry-toc a,
.entry-toc a:visited {
	color: var(--color-ink);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
}

.entry-toc a:hover,
.entry-toc a:focus {
	color: var(--color-terracotta);
	text-decoration-color: currentColor;
}


/* Sous-sections (H3) dans le sommaire du haut */
.entry-content .entry-toc ul.entry-toc__sous {
	margin: 0.35em 0 0.6em;
	padding-left: 1.1em;
	list-style: none;
}

.entry-content .entry-toc ul.entry-toc__sous li {
	position: relative;
	margin-bottom: 0.25em;
	font-size: 0.92em;
}

.entry-content .entry-toc ul.entry-toc__sous li::before {
	content: "";
	position: absolute;
	top: 0.75em;
	left: -0.9em;
	width: 0.45em;
	height: 1px;
	background: var(--color-stone);
}

.entry-toc ul.entry-toc__sous a,
.entry-toc ul.entry-toc__sous a:visited {
	color: var(--color-sage);
}

.entry-toc ul.entry-toc__sous a:hover {
	color: var(--color-terracotta);
}

/* Barre latérale (ordinateur, une fois le sommaire du haut dépassé)
   Discrète : petits libellés sur une ligne, estompés ; elle se révèle au survol.
--------------------------------------------- */
.entry-toc-bar {
	position: fixed;
	top: 110px;
	z-index: 90;
	display: flex;
	flex-direction: column;
	width: 190px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s;
}

.entry-toc-bar.is-visible {
	opacity: 0.85;
	visibility: visible;
}

.entry-toc-bar.is-visible:hover {
	opacity: 1;
}

.entry-toc-bar__titre {
	flex: 0 0 auto;
	margin: 0 0 0.6rem 20px;
	color: var(--color-terracotta);
	font-family: var(--font-mono);
	font-size: 0.66rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.entry-toc-bar__defile {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	scrollbar-width: none;
	overscroll-behavior: contain;
}

.entry-toc-bar__defile::-webkit-scrollbar {
	display: none;
}

.entry-toc-bar__piste {
	position: relative;
}

.entry-toc-bar__piste::before {
	content: "";
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 5px;
	width: 1px;
	background: var(--color-stone);
}

.entry-toc-bar__progression {
	position: absolute;
	top: 0;
	left: 5px;
	z-index: 1;
	width: 1px;
	height: 0;
	background: var(--color-terracotta);
	transition: height 0.2s ease;
}

.entry-toc-bar ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.entry-toc-bar li {
	position: relative;
	margin: 0;
	padding: 0;
}

.entry-toc-bar li a,
.entry-toc-bar li a:visited {
	display: block;
	overflow: hidden;
	padding: var(--toc-pad, 4px) 0 var(--toc-pad, 4px) 20px;
	color: var(--color-sage);
	font-family: var(--font-body);
	font-size: 0.74rem;
	line-height: 14px;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0.6;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.entry-toc-bar li a::before {
	content: "";
	position: absolute;
	top: var(--toc-dot, 7.5px);
	left: 2px;
	z-index: 2;
	box-sizing: border-box;
	width: 7px;
	height: 7px;
	border: 1px solid var(--color-stone);
	border-radius: 50%;
	background: var(--color-sand);
	transition: all 0.15s ease;
}

.entry-toc-bar:hover li a {
	opacity: 0.85;
}

.entry-toc-bar li a:hover {
	color: var(--color-ink);
	opacity: 1;
}

.entry-toc-bar li a.is-past::before {
	border-color: var(--color-terracotta);
	background: var(--color-terracotta);
}

.entry-toc-bar li a.is-active {
	color: var(--color-terracotta);
	font-weight: 600;
	opacity: 1;
}

.entry-toc-bar li a.is-active::before {
	border-color: var(--color-terracotta);
	background: var(--color-sand);
	transform: scale(1.35);
}

.entry-toc-bar__haut {
	flex: 0 0 auto;
	align-self: flex-start;
	margin: 0.7rem 0 0 20px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-sage);
	font-family: var(--font-body);
	font-size: 0.7rem;
	opacity: 0.6;
	cursor: pointer;
}

.entry-toc-bar__haut:hover {
	color: var(--color-terracotta);
	opacity: 1;
}

@media (max-width: 1199px) {
	.entry-toc-bar {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.entry-toc-bar,
	.entry-toc-bar__progression,
	.entry-toc-bar li a,
	.entry-toc-bar li a::before,
	.entry-toc details > summary::after {
		transition: none;
	}
}

/* Les titres visés restent sous l'en-tête collant */
.entry-content h2[id],
.entry-content h3[id] {
	scroll-margin-top: 96px;
}
