/* Flyer d'accueil : plein écran, format A5 portrait */

.jc-flyer {
	--jc-flyer-h: min(88dvh, calc(92vw * 210 / 148));
	padding: 0;
	border: 0;
	background: transparent;
	max-width: none;
	max-height: none;
	overflow: visible;
	width: calc(var(--jc-flyer-h) * 148 / 210);
	height: var(--jc-flyer-h);
	/* Centré sur l'écran et non sur la page : l'accueil déborde en largeur sur mobile */
	right: auto;
	margin-left: calc((100vw - var(--jc-flyer-h) * 148 / 210) / 2);
}

.jc-flyer::backdrop {
	background: rgba(0, 0, 0, .85);
}

html.jc-flyer-ouvert {
	overflow: hidden;
}

.jc-flyer__piste {
	display: flex;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	border-radius: 6px;
}

.jc-flyer__piste::-webkit-scrollbar {
	display: none;
}

.jc-flyer__diapo {
	flex: 0 0 100%;
	height: 100%;
	scroll-snap-align: center;
}

.jc-flyer__lien {
	display: block;
	height: 100%;
}

.jc-flyer__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Croix : toujours visible, hors de l'image sur ordinateur */
.jc-flyer__fermer {
	position: absolute;
	top: -18px;
	right: -18px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 2px solid #000;
	border-radius: 50%;
	background: #fff;
	color: #000;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

.jc-flyer__fermer:hover,
.jc-flyer__fermer:focus-visible {
	background: #000;
	color: #fff;
	border-color: #fff;
	outline: none;
}

/* Flèches */
.jc-flyer__fleche {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: #000;
	cursor: pointer;
	transform: translateY(-50%);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.jc-flyer__fleche--prec {
	left: -64px;
}

.jc-flyer__fleche--suiv {
	right: -64px;
}

.jc-flyer__fleche:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.jc-flyer__fleche[disabled] {
	opacity: .35;
	cursor: default;
}

/* Points */
.jc-flyer__points {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -26px;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.jc-flyer__point {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .45);
}

.jc-flyer__point.est-actif {
	background: #fff;
}

/* Mobile : croix et flèches posées sur le flyer */
@media (max-width: 640px) {
	.jc-flyer {
		--jc-flyer-h: min(84dvh, calc(94vw * 210 / 148));
	}

	.jc-flyer__fermer {
		top: 8px;
		right: 8px;
	}

	.jc-flyer__fleche {
		width: 40px;
		height: 40px;
	}

	.jc-flyer__fleche--prec {
		left: 6px;
	}

	.jc-flyer__fleche--suiv {
		right: 6px;
	}

	.jc-flyer__points {
		bottom: -22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jc-flyer__piste {
		scroll-behavior: auto;
	}
}
