:root {
	--delay: 8s; /* durée d'affichage de chaque image */
	--image-ratio: 800 / 410;
	--margeRuban:20px;
}
/* Base de page (simplifiée par rapport à l'ancien styles.css) */
html { background: #e4dfd2; }
body {
	max-width: 800px;
	margin: 0 auto;
	padding: 0 1rem;
	color: #777;
	font-family: Arial, Verdana, sans-serif;
}
h1 { margin: 0; padding: 1em 0; text-align: center; font-size: 2.5em; }

/* Cadre blanc + ombres courbes */
.slideshow {
	position: relative;
	box-sizing: border-box;
	width: min(100%, calc(var(--image-width) + 32px));
	margin: 0 auto 4em;
	padding: 15px;
	border: 1px solid #ddd;
	border-radius: 2px;
	background: linear-gradient(#fff, #fff 20%, #eee 80%, #ddd);
	box-shadow: 0 0 3px rgb(0 0 0 / .2);
}
.slideshow::before,
.slideshow::after {
	content: "";
	position: absolute;
	bottom: 16px;
	width: 50%;
	height: 20px;
	border-radius: 50%;
	background: rgb(0 0 0 / .1);
	box-shadow: 0 0 3px rgb(0 0 0 / .4), 0 20px 10px rgb(0 0 0 / .7);
	z-index: -10;
}
.slideshow::before { left: 0; rotate: -4deg; }
.slideshow::after { right: 0; rotate: 4deg; }

/* Défilement : scroll-snap à la place des keyframes à 400% */
.viewport { position: relative; overflow: hidden; }
.viewport::after { /* ligne de base de la timeline */
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 1px;
	background: #999;
}
.slides {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline: 2px solid #bd9b83; outline-offset: -2px; }

.slides figure {
	position: relative;
	flex: 0 0 100%;
	margin: 0;
	scroll-snap-align: center;
	overflow: hidden;
}
.slides img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--image-ratio);
	object-fit: cover;
}

/* Ombre intérieure : visible quand l'image est affichée */
.slides figure::after {
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: 0 0 65px rgb(0 0 0 / .5) inset;
	opacity: 0;
	transition: opacity .8s;
	pointer-events: none;
}
.slides figure.is-active::after { opacity: 1; }

/* Légende qui remonte */
.slides figcaption {
	position: absolute;
	inset: auto 0 3px;
	padding: calc(min(100vw, 100vh) * 0.03);
	text-align: center;
	letter-spacing: .05em;
	word-spacing: .05em;
	font-family: Georgia, Times, serif;
	background: rgb(255 255 255 / .7);
	border-top: 1px solid #e1e1e1;
	color: #555;
	text-shadow: -1px -1px 0 rgb(255 255 255 / .3);
	translate: 0 calc(100% + 5px);
	transition: translate .7s;
}
.slides figure.is-active figcaption { translate: 0 0; }

/* Timeline : sa fin déclenche l'image suivante (voir slideshow.js) */
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.timeline {
	position: absolute;
	inset: auto 0 0;
	height: 1px;
	background: rgb(214 98 13 / .8);
	transform-origin: left;
	animation: fill var(--delay) linear forwards;
	z-index: 2;
}
.slideshow.is-paused .timeline { animation-play-state: paused; }

/* Flèches rondes + infobulle */
.nav {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(#fff, #ddd);
	box-shadow: 1px 1px 2px rgb(0 0 0 / .2);
	color: #aaa;
	font: 1.3em Arial, Verdana, sans-serif;
	text-shadow: 0 0 1px #aaa;
	cursor: pointer;
}
.nav.prev { left: -48px; }
.nav.next { right: -48px; }
.nav:focus-visible { outline: 2px solid #bd9b83; outline-offset: 2px; }
.nav:active { transform: translateY(1px); }
.nav::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 4px);
	left: 50%;
	translate: -50% 0;
	width: max-content;
	max-width: 9rem;
	padding: .6rem .8rem;
	border-radius: 12px;
	background: #fff;
	box-shadow: 1px 1px 4px rgb(0 0 0 / .4);
	font: 14px Georgia, Times, serif;
	text-shadow: none;
	opacity: 0;
	pointer-events: none;
	transition: opacity .5s, bottom .5s;
}
.nav:hover::after,
.nav:focus-visible::after { bottom: calc(100% + 12px); opacity: 1; }

/* Pause / lecture */
.toggle {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	opacity: 0;
	transition: opacity .6s;
	z-index: 5;
}
.slideshow:hover .toggle,
.toggle:focus-visible { opacity: 1; }
.toggle::before,
.toggle::after {
	content: "";
	position: absolute;
	top: 0;
	width: 38%;
	height: 100%;
	background: rgb(255 255 255 / .7);
}
.toggle::before { left: 0; }
.toggle::after { right: 0; }
.toggle[aria-pressed="true"]::before { /* triangle « lecture » */
	width: 0;
	height: 0;
	background: none;
	border: solid transparent;
	border-width: 11px 0 11px 20px;
	border-left-color: rgb(255 255 255 / .7);
}
.toggle[aria-pressed="true"]::after { display: none; }

/* Pastilles */
.dots {
	position: absolute;
	inset: calc(100% + 1.4rem) 0 auto;
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.dots button {
	position: relative;
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgb(0 0 0 / .55) inset;
	cursor: pointer;
	transition: background .4s;
}
.dots button::after { content: ""; position: absolute; inset: -8px; } /* zone de clic élargie */
.dots button[aria-current="true"] { background: #bd9b83; }
.dots button:focus-visible { outline: 2px solid #bd9b83; outline-offset: 3px; }

/* États */
.slideshow.is-single .nav,
.slideshow.is-single .dots,
.slideshow.is-single .toggle,
.slideshow.is-single .timeline,
.slideshow.is-static .toggle,
.slideshow.is-static .timeline { display: none; }

/* Écrans étroits : flèches à l'intérieur du cadre */
@media (max-width: 760px) {
	.nav.prev { left: 4px;border-radius:2px; }
	.nav.next { right: 4px;border-radius:2px; }
	.nav::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.slides { scroll-behavior: auto; }
	.slides figcaption,
	.slides figure::after { transition: none; }
}
