/**
 * Sophia – Carrousel de Formations (front)
 */

.sfc-carousel {
	--sfc-gold: #d4af37;
	--sfc-per-set: 4;
	--sfc-per: var(--sfc-per-set);
	--sfc-gap: 24px;
	--sfc-radius: 16px;
	--sfc-ratio: 3 / 3.4;
	--sfc-text: #ffffff;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	margin: 0 auto;
	padding: 0 8px;
}

.sfc-carousel *,
.sfc-carousel *::before,
.sfc-carousel *::after {
	box-sizing: border-box;
}

/* ---------- Piste ---------- */

.sfc-viewport {
	overflow: hidden;
	margin: -10px;
	padding: 10px;
}

.sfc-track {
	display: flex;
	gap: var(--sfc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.sfc-track::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.sfc-slide {
	flex: 0 0 calc((100% - (var(--sfc-per) - 1) * var(--sfc-gap)) / var(--sfc-per));
	max-width: calc((100% - (var(--sfc-per) - 1) * var(--sfc-gap)) / var(--sfc-per));
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

.sfc-slide::marker {
	content: "";
}

/* ---------- Carte ---------- */

.sfc-card {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--sfc-ratio);
	overflow: hidden;
	border-radius: var(--sfc-radius);
	background: #2b2b2b;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
	text-decoration: none;
	color: var(--sfc-text);
	transition: transform 0.45s ease, box-shadow 0.45s ease;
}

a.sfc-card:hover,
a.sfc-card:focus-visible {
	transform: translateY(-6px);
	box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
	color: var(--sfc-text);
	text-decoration: none;
}

a.sfc-card:focus-visible {
	outline: 2px solid var(--sfc-gold);
	outline-offset: 3px;
}

.sfc-card__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.sfc-card__bg {
	position: absolute;
	inset: 0;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	transform: scale(1.01);
	transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.sfc-card__bg--empty {
	background: linear-gradient(140deg, #3a3632, #6a5f4d);
}

a.sfc-card:hover .sfc-card__bg,
a.sfc-card:focus-visible .sfc-card__bg {
	transform: scale(1.08);
}

.sfc-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0) 30%,
		rgba(0, 0, 0, 0.18) 52%,
		rgba(0, 0, 0, 0.55) 78%,
		rgba(0, 0, 0, 0.72) 100%
	);
}

/* ---------- Prix (prestations) ---------- */

.sfc-card__price {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	padding: 7px 13px;
	border-radius: 999px;
	background: var(--sfc-gold);
	color: #1c1c1c;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.03em;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

/* ---------- Contenu ---------- */

.sfc-card__content {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 0 18px 24px;
	text-align: center;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.sfc-card__rule {
	display: block;
	width: 58px;
	height: 1px;
	margin: 0 auto 14px;
	background: rgba(255, 255, 255, 0.7);
}

.sfc-card__title {
	margin: 0;
	padding: 0;
	font-family: Georgia, "Times New Roman", "Playfair Display", serif;
	font-size: clamp(1.05rem, 1.35vw, 1.4rem);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0.01em;
	color: #fff;
}

.sfc-card__subtitle {
	margin: 6px 0 0;
	padding: 0;
	font-size: clamp(0.75rem, 0.9vw, 0.85rem);
	font-weight: 400;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.92);
}

.sfc-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 16px;
	padding: 9px 18px;
	border: 1px solid rgba(255, 255, 255, 0.85);
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.07);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #fff;
	transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.sfc-card__btn .sfc-chevron {
	color: var(--sfc-gold);
	transition: transform 0.3s ease, color 0.3s ease;
}

a.sfc-card:hover .sfc-card__btn,
a.sfc-card:focus-visible .sfc-card__btn {
	background: var(--sfc-gold);
	border-color: var(--sfc-gold);
	color: #1c1c1c;
}

a.sfc-card:hover .sfc-card__btn .sfc-chevron,
a.sfc-card:focus-visible .sfc-card__btn .sfc-chevron {
	color: #1c1c1c;
	transform: translateX(3px);
}

/* ---------- Flèches ---------- */

.sfc-arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 1px solid var(--sfc-gold);
	border-radius: 50%;
	background: #fff;
	color: var(--sfc-gold);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.sfc-arrow:hover,
.sfc-arrow:focus-visible {
	background: var(--sfc-gold);
	color: #fff;
}

.sfc-arrow:focus-visible {
	outline: 2px solid var(--sfc-gold);
	outline-offset: 3px;
}

.sfc-arrow--prev {
	left: -14px;
}

.sfc-arrow--next {
	right: -14px;
}

.sfc-arrow[disabled],
.sfc-arrow[hidden] {
	opacity: 0;
	pointer-events: none;
}

.sfc-arrow .sfc-chevron {
	width: 16px;
	height: 16px;
}

/* ---------- Points ---------- */

.sfc-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	margin-top: 22px;
}

.sfc-dots:empty {
	display: none;
}

.sfc-dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 1px solid var(--sfc-gold);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: width 0.3s ease, background-color 0.3s ease;
}

.sfc-dot.is-active {
	width: 26px;
	border-radius: 9px;
	background: var(--sfc-gold);
}

.sfc-dot:focus-visible {
	outline: 2px solid var(--sfc-gold);
	outline-offset: 2px;
}

/* ---------- État « glisser » ---------- */

.sfc-carousel.is-dragging .sfc-track {
	scroll-behavior: auto;
	scroll-snap-type: none;
	cursor: grabbing;
}

.sfc-carousel.is-dragging .sfc-card {
	pointer-events: none;
}

/* ---------- Message admin ---------- */

.sfc-empty {
	padding: 14px 18px;
	border-left: 3px solid #d4af37;
	background: #fbf7ea;
	color: #5b4c1c;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
	.sfc-carousel {
		--sfc-per: min(var(--sfc-per-set), 4);
	}
}

@media (max-width: 1100px) {
	.sfc-carousel {
		--sfc-per: min(var(--sfc-per-set), 3);
	}
}

@media (max-width: 820px) {
	.sfc-carousel {
		--sfc-per: min(var(--sfc-per-set), 2);
		--sfc-gap: 16px;
	}

	.sfc-arrow--prev {
		left: 2px;
	}

	.sfc-arrow--next {
		right: 2px;
	}
}

@media (max-width: 560px) {
	.sfc-carousel {
		--sfc-per: 1.15;
		--sfc-gap: 14px;
		padding: 0 4px;
	}

	.sfc-arrow {
		width: 38px;
		height: 38px;
	}

	.sfc-card__content {
		padding: 0 16px 22px;
	}

	.sfc-card__price {
		top: 11px;
		right: 11px;
		padding: 6px 11px;
		font-size: 0.72rem;
	}
}

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

	.sfc-card,
	.sfc-card__bg,
	.sfc-card__btn,
	.sfc-chevron {
		transition: none !important;
	}
}
