.wpvid-testi-wrapper {
	overflow: hidden;
	width: 100%;
	position: relative;
}

.wpvid-testi-track {
	display: flex;
	gap: 18px;
	width: max-content;
	will-change: transform;
	touch-action: pan-y; /* laisse le scroll vertical de page passer, le drag horizontal est géré en JS */
	cursor: grab;
	user-select: none;
}

.wpvid-testi-track.is-dragging {
	cursor: grabbing;
}

.wpvid-testi-card {
	position: relative;
	flex: 0 0 220px;
	aspect-ratio: 9 / 16;
	border-radius: 18px;
	overflow: hidden;
	background: #111;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
	cursor: pointer;
}

.wpvid-testi-poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none; /* évite le drag natif de l'image */
	-webkit-user-drag: none;
}

.wpvid-testi-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(255,255,255,0.85);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform .15s ease, background .15s ease;
	pointer-events: none; /* le clic est géré par la carte entière */
}

.wpvid-testi-card:hover .wpvid-testi-play {
	transform: translate(-50%, -50%) scale(1.08);
	background: #fff;
}

.wpvid-testi-play-icon {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent #1d2327;
	margin-left: 4px;
}

.wpvid-testi-name {
	position: absolute;
	bottom: 12px;
	left: 12px;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

@media (max-width: 600px) {
	.wpvid-testi-card {
		flex-basis: 160px;
	}
}

/* ---------- Modale (pop-up de lecture) ---------- */

.wpvid-testi-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
}

.wpvid-testi-modal.is-open {
	display: flex;
}

body.wpvid-testi-modal-open {
	overflow: hidden;
}

.wpvid-testi-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
}

.wpvid-testi-modal-inner {
	position: relative;
	z-index: 1;
	width: min(92vw, 420px);
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.wpvid-testi-modal-video {
	width: 100%;
	max-height: 70vh;
	border-radius: 14px;
	background: #000;
	box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.wpvid-testi-modal-name {
	color: #fff;
	margin-top: 12px;
	font-weight: 600;
	font-size: 15px;
}

/* Position fixe à l'écran (pas relative à la modale) : reste toujours visible
   et cliquable, quelle que soit la hauteur de la vidéo ou de la modale. */
.wpvid-testi-modal-close {
	position: fixed;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.wpvid-testi-modal-close:hover {
	background: rgba(0, 0, 0, 0.75);
}

@media (max-width: 782px) {
	.wpvid-testi-modal-video {
		max-height: 80vh;
	}

	.wpvid-testi-modal-inner {
		max-height: 88vh;
	}

	.wpvid-testi-modal-close {
		top: 12px;
		right: 12px;
		width: 40px;
		height: 40px;
		font-size: 24px;
	}
}
