/* =========================================================================
 * Carousel Yolo — témoignages texte + vidéo (JS custom, zéro dépendance)
 * ========================================================================= */

.cy-carousel {
	position: relative;
	--cy-video-ratio: 9 / 16;
	--cy-stagger: 30px;
	--cy-meta-gap: 22px;
	--cy-play-size: 68px;
	--cy-play-color: #fff;
}

/* Masque le débordement horizontal sans rogner le décalage vertical des cartes
 * (clip autorise un overflow-y visible, contrairement à hidden). */
.cy__viewport {
	overflow-x: clip;
	overflow-y: visible;
}

/* Le track porte le padding vertical (= 2 × décalage) qui réserve l'espace du
 * quinconce, et c'est lui qu'on translate horizontalement en JS. */
.cy__track {
	display: flex;
	padding-block: calc(var(--cy-stagger) * 2);
	will-change: transform;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.cy__slide {
	flex: 0 0 auto;
	box-sizing: border-box;
	display: flex;
	align-items: stretch;
}

/* Décalage vertical alterné (quinconce) : une carte sur deux monte, l'autre
 * descend. Stable ici car aucun clonage de slides (pas de boucle). */
.cy__track .cy__slide:nth-child(odd)  { transform: translateY(calc(var(--cy-stagger) * -1)); }
.cy__track .cy__slide:nth-child(even) { transform: translateY(var(--cy-stagger)); }

@media (max-width: 767px) {
	.cy__track .cy__slide:nth-child(odd),
	.cy__track .cy__slide:nth-child(even) {
		transform: none;
	}
}

/* --- Carte générique --------------------------------------------------- */
.cy__card {
	position: relative;
	width: 100%;
	border-radius: 20px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* --- Carte texte ------------------------------------------------------- */
.cy__card--text {
	align-items: center;
	text-align: center;
	justify-content: flex-start;
	padding: 32px 28px 36px;
	background-color: #e2974a;
	color: #fff;
}

.cy__photo {
	width: 130px;
	height: 130px;
	border-radius: 50%;
	overflow: hidden;
	margin: 0 auto 20px;
	flex: 0 0 auto;
	background: rgba(255, 255, 255, 0.2);
}

.cy__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cy__name {
	margin: 0 0 4px;
	font-size: 1.4rem;
	font-weight: 600;
	line-height: 1.2;
	color: inherit;
}

.cy__role {
	margin: 0;
	font-size: 0.95rem;
	opacity: 0.85;
	color: inherit;
}

.cy__quote {
	margin: var(--cy-meta-gap, 22px) 0 0;
	padding: 0;
	border: 0;
	font-size: 1.05rem;
	line-height: 1.5;
	color: inherit;
	quotes: none;
}

/* --- Carte vidéo : l'iframe collé s'affiche directement en 9:16 -------- */
.cy__card--video {
	background: #000;
}

.cy__video {
	position: relative;
	width: 100%;
	aspect-ratio: var(--cy-video-ratio);
	overflow: hidden;
	line-height: 0;
}

.cy__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Façade : photo de couverture + bouton play ; l'iframe se charge au clic. */
.cy__video-facade {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: #000;
	cursor: pointer;
	display: block;
	line-height: 0;
	-webkit-appearance: none;
	appearance: none;
}

.cy__video-facade--blank {
	background: linear-gradient(160deg, #2a2a3a, #15151f);
}

.cy__video-cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cy__video-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.cy__video-play svg {
	width: var(--cy-play-size, 68px);
	height: var(--cy-play-size, 68px);
	fill: var(--cy-play-color, #fff);
	filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
	transition: transform 0.2s ease;
}

.cy__video-facade:hover .cy__video-play svg { transform: scale(1.08); }

.cy__video-facade:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.7);
	outline-offset: -3px;
}

.cy__video--empty {
	display: block;
	width: 100%;
	aspect-ratio: var(--cy-video-ratio);
	background: linear-gradient(160deg, #2a2a3a, #15151f);
}

/* --- Navigation -------------------------------------------------------- */
.cy__nav {
	display: flex;
	justify-content: center;
	gap: 14px;
	margin-top: 28px;
}

.cy__btn {
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: #1b1a4e;
	color: #fff;
	cursor: pointer;
	transition: transform 0.2s ease, opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.cy__btn svg { width: 58%; height: auto; }

.cy__btn:hover { transform: scale(1.06); }

.cy__btn:focus-visible {
	outline: 3px solid rgba(27, 26, 78, 0.4);
	outline-offset: 2px;
}

.cy__btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.cy__btn:disabled:hover { transform: none; }

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 767px) {
	.cy__photo { width: 110px; height: 110px; }
	.cy__name  { font-size: 1.25rem; }
}

/* ============================================================
   Aperçu éditeur Elementor uniquement
   Le JS qui calcule la largeur des cartes ne tourne pas dans
   l'éditeur : on affiche les cartes en grille pour toutes les
   voir d'un coup. Aucun impact sur le front (classe ajoutée par
   Elementor sur le <body> de l'aperçu).
   ============================================================ */
.elementor-editor-active .cy__viewport { overflow: visible; }

.elementor-editor-active .cy__track {
	flex-wrap: wrap;
	gap: 16px;
	transform: none !important;
	padding-block: 0;
}

.elementor-editor-active .cy__track .cy__slide {
	flex: 0 0 calc(25% - 12px);
	min-width: 0;
	transform: none !important;
}

.elementor-editor-active .cy__nav { display: none; }
