/**
 * Asmon — Page avec sommaire (gabarit réutilisable)
 */

body.asmon-page-template--page-toc {
	overflow-x: clip;
	background-color: #0a0907;
}

body.asmon-page-template--page-toc::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(ellipse 70% 45% at 50% -5%, rgba(201, 168, 76, 0.06), transparent 58%),
		linear-gradient(180deg, #0a0907 0%, #0e0b08 40%, #0c0a08 100%);
}

body.asmon-page-template--page-toc #main-container,
body.asmon-page-template--page-toc .site-main,
body.asmon-page-template--page-toc main,
body.asmon-page-template--page-toc .entry-content,
body.asmon-page-template--page-toc .asmon-doc,
body.asmon-page-template--page-toc .asmon-doc__shell {
	position: relative;
	z-index: 1;
	overflow: visible;
}

.asmon-doc {
	--doc-measure: min(44rem, 100%);
	--doc-shell: min(76rem, 100%);
	--doc-rail-w: 15.5rem;
	--asmon-toc-stick-top: 4.5rem;
	padding-bottom: clamp(3rem, 10vh, 5rem);
}

.asmon-hero--doc {
	border-bottom-color: rgba(26, 18, 8, 0.85);
	margin-bottom: 0;
}

.asmon-hero--doc.asmon-hero--compact .asmon-hero__inner {
	padding-bottom: 0;
}

.asmon-hero--doc::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.35), transparent);
	opacity: 0.7;
}

.asmon-hero--doc .asmon-hero__title {
	font-size: clamp(1.75rem, 4.5vw, 2.75rem);
	letter-spacing: 0.04em;
}

.asmon-hero--doc .asmon-hero__meta {
	margin-top: 0.75rem;
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--asmon-text);
	opacity: 0.85;
}

.asmon-doc__shell {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(1.75rem, 4vw, 2.75rem);
	max-width: var(--doc-shell);
	margin: 0 auto;
	padding: 0 clamp(1.25rem, 5vw, 2rem) 0;
	align-items: start;
}

@media (min-width: 960px) {
	.asmon-doc__shell:has(.asmon-doc__rail) {
		grid-template-columns: 15.5rem minmax(0, 1fr);
		column-gap: clamp(2rem, 4vw, 3.5rem);
	}
}

.asmon-doc__rail {
	position: relative;
	align-self: stretch;
	min-height: 1px;
}

@media (min-width: 960px) {
	.asmon-doc__rail {
		width: var(--doc-rail-w);
	}
}

.asmon-toc--doc {
	padding: 1.35rem 1rem 1.5rem 1.15rem;
	background: rgba(22, 18, 13, 0.62);
	border: 1px solid rgba(201, 168, 76, 0.14);
	backdrop-filter: blur(8px);
	transition:
		border-color 0.45s ease,
		box-shadow 0.55s ease;
}

.asmon-toc--doc.is-visible {
	animation: asmon-doc-toc-breathe 9s ease-in-out infinite;
}

@keyframes asmon-doc-toc-breathe {
	0%, 100% {
		border-color: rgba(201, 168, 76, 0.12);
		box-shadow: 0 0 0 rgba(201, 168, 76, 0);
	}
	50% {
		border-color: rgba(201, 168, 76, 0.28);
		box-shadow: 0 0 28px rgba(201, 168, 76, 0.07);
	}
}

.asmon-toc--doc__title,
.asmon-toc--doc .asmon-toc__title {
	position: relative;
}

.asmon-toc--doc .asmon-toc__title::after {
	content: "";
	display: block;
	width: 2.5rem;
	height: 1px;
	margin-top: 0.65rem;
	background: linear-gradient(90deg, var(--asmon-accent), transparent);
	opacity: 0.55;
	animation: asmon-doc-toc-line 4s ease-in-out infinite;
}

@keyframes asmon-doc-toc-line {
	0%, 100% { opacity: 0.35; transform: scaleX(0.85); }
	50% { opacity: 0.9; transform: scaleX(1); }
}

.asmon-toc--doc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: doc-toc;
	line-height: 1.5;
}

.asmon-toc--doc li {
	display: flex;
	align-items: baseline;
	gap: 0.55rem;
	counter-increment: doc-toc;
	margin: 0;
	padding: 0.4rem 0.35rem 0.4rem 0.45rem;
	border-left: 2px solid transparent;
	opacity: 1;
	transform: none;
	transition:
		opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
		border-color 0.3s ease,
		background 0.3s ease;
	transition-delay: calc(0.05s * var(--toc-i, 0) + 0.12s);
}

.asmon-toc--doc.is-visible li {
	opacity: 1;
	transform: translateX(0);
}

.asmon-toc--doc li::before {
	content: counter(doc-toc, upper-roman) ".";
	flex: 0 0 2rem;
	font-family: var(--asmon-font-display);
	font-size: 0.8125rem;
	line-height: 1.45;
	letter-spacing: 0.06em;
	color: rgba(201, 168, 76, 0.72);
	text-align: right;
	vertical-align: baseline;
	pointer-events: none;
}

.asmon-toc--doc li:has(a.is-active) {
	border-left-color: var(--asmon-accent);
	background: linear-gradient(90deg, rgba(201, 168, 76, 0.07), transparent 72%);
}

.asmon-toc--doc li:has(a.is-active)::before {
	color: var(--asmon-accent);
	text-shadow: 0 0 12px rgba(201, 168, 76, 0.35);
}

.asmon-toc--doc a {
	flex: 1;
	min-width: 0;
	display: block;
	padding: 0;
	margin: 0;
	border: none;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--asmon-text);
	text-decoration: none;
	transition:
		color 0.28s ease,
		transform 0.28s ease,
		text-shadow 0.28s ease;
}

.asmon-toc--doc a:hover {
	color: var(--asmon-text-bright);
	padding-left: 0;
	transform: translateX(3px);
}

.asmon-toc--doc a.is-active {
	color: var(--asmon-text-bright);
	margin-left: 0;
	padding-left: 0;
	border-left: none;
	text-shadow: 0 0 18px rgba(201, 168, 76, 0.18);
}

@media (min-width: 960px) {
	.asmon-toc--doc {
		position: sticky;
		top: var(--asmon-toc-stick-top, 4.5rem);
		width: var(--doc-rail-w);
		max-height: calc(100vh - var(--asmon-toc-stick-top, 4.5rem) - 1.5rem);
		overflow: auto;
		scrollbar-width: thin;
		scrollbar-color: rgba(201, 168, 76, 0.25) transparent;
		z-index: 40;
	}
}

.asmon-doc__toc-mobile {
	display: block;
	margin: 0 0 1.5rem;
	padding: 0;
	border: 1px solid rgba(201, 168, 76, 0.15);
	background: rgba(22, 18, 13, 0.45);
}

.asmon-doc__toc-mobile summary {
	cursor: pointer;
	list-style: none;
	padding: 0.9rem 1.1rem;
	font-family: var(--asmon-font-display);
	font-size: 0.625rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--asmon-accent);
}

.asmon-doc__toc-mobile summary::-webkit-details-marker {
	display: none;
}

.asmon-doc__toc-mobile ol {
	margin: 0;
	padding: 0 1.1rem 1rem 2.25rem;
	font-size: 0.95rem;
	line-height: 1.5;
	list-style-type: upper-roman;
}

.asmon-doc__toc-mobile a {
	color: var(--asmon-text);
	text-decoration: none;
}

.asmon-doc__toc-mobile a:hover {
	color: var(--asmon-text-bright);
}

@media (min-width: 960px) {
	.asmon-doc__toc-mobile {
		display: none;
	}

	.asmon-doc__rail {
		display: block;
	}
}

@media (max-width: 959px) {
	.asmon-doc__rail {
		display: none;
	}
}

.asmon-doc__main {
	position: relative;
	z-index: 1;
	min-width: 0;
}

/* Tooltips frise : au-dessus du sommaire sticky (z-index 40) */
@media (min-width: 960px) {
	.asmon-doc__main {
		z-index: 45;
	}
}

.asmon-prose--doc {
	max-width: var(--doc-measure);
	font-size: 1.0625rem;
	line-height: 1.78;
	letter-spacing: 0.01em;
}

.asmon-prose--doc > :first-child {
	margin-top: 0;
}

.asmon-prose--doc > h2 {
	margin-top: 2.75rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid rgba(201, 168, 76, 0.12);
	font-size: 1.2rem;
	scroll-margin-top: clamp(4.5rem, 14vh, 6rem);
}

.asmon-prose--doc h3 {
	margin-top: 1.75rem;
	font-size: 1rem;
	letter-spacing: 0.03em;
}

.asmon-prose--doc p {
	margin-bottom: 1.05rem;
}

.asmon-prose--doc li {
	margin-bottom: 0.35rem;
}

.asmon-prose--doc li::marker {
	color: rgba(201, 168, 76, 0.55);
}

.asmon-prose--doc strong,
.asmon-prose--doc b {
	font-weight: 600;
	color: var(--asmon-text-bright);
}

.asmon-prose--doc a {
	word-break: break-word;
}

.asmon-prose--doc table {
	width: 100%;
	margin: 1.5rem 0;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.asmon-prose--doc th,
.asmon-prose--doc td {
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--asmon-line);
	text-align: left;
	vertical-align: top;
}

.asmon-prose--doc th {
	font-family: var(--asmon-font-display);
	font-size: 0.6875rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--asmon-accent);
	background: rgba(22, 18, 13, 0.65);
}

.asmon-prose--doc hr {
	margin: 2.5rem 0;
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.25), transparent);
}

.asmon-prose--doc blockquote {
	margin: 1.75rem 0;
	padding: 1rem 1.25rem;
	border-left: 2px solid var(--asmon-accent);
	background: rgba(22, 18, 13, 0.4);
	font-style: normal;
	font-size: 0.98rem;
}

@media (prefers-reduced-motion: reduce) {
	body.asmon-page-template--page-toc::before {
		animation: none;
	}

	.asmon-toc--doc.is-visible {
		animation: none;
	}

	.asmon-toc--doc .asmon-toc__title::after {
		animation: none;
	}

	.asmon-toc--doc li {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
