/* JDE Témoignages — carrousel front v1.1.0
   Charte reprise du thème : bleu #0C71C3, corps Lato, titres Glegoo (hérités de Divi). */

.jde-tm {
	--tm-blue: #0c71c3;
	--tm-blue-dark: #0a5ea3;
	--tm-ink: #1e3a5f;
	--tm-text: rgba(0, 0, 0, .68);
	--tm-muted: rgba(0, 0, 0, .48);
	--tm-line: #e3e8ee;
	--tm-card: #ffffff;
	--tm-radius: 14px;
	--tm-gap: 24px;
	--tm-shadow: 0 6px 24px rgba(15, 35, 65, .08);
	--tm-shadow-hover: 0 14px 36px rgba(15, 35, 65, .14);

	position: relative;
	margin: 0 auto;
	max-width: 1240px;
	color: var(--tm-text);
	text-align: left;
}
.jde-tm *, .jde-tm *::before, .jde-tm *::after { box-sizing: border-box; }

/* ── En-tête ─────────────────────────────────────────────── */
.jde-tm__head { text-align: center; margin: 0 auto 26px; max-width: 720px; }
.jde-tm__title {
	margin: 0 0 10px;
	font-size: clamp(24px, 3vw, 34px);
	line-height: 1.2;
	color: var(--tm-ink);
	font-weight: 700;
}
.jde-tm__sub { margin: 0; font-size: 16px; line-height: 1.6; color: var(--tm-muted); }

/* ── Filtres ─────────────────────────────────────────────── */
.jde-tm__filters {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
	margin: 0 0 28px;
}
.jde-tm__chip {
	appearance: none; cursor: pointer;
	padding: 9px 18px; border-radius: 999px;
	border: 1.5px solid var(--tm-line); background: #fff;
	color: var(--tm-ink); font: 600 14px/1 inherit; font-family: inherit;
	transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.jde-tm__chip:hover { border-color: var(--tm-blue); color: var(--tm-blue); transform: translateY(-1px); }
.jde-tm__chip.is-active { background: var(--tm-blue); border-color: var(--tm-blue); color: #fff; }
.jde-tm__chip:focus-visible { outline: 3px solid rgba(12, 113, 195, .35); outline-offset: 2px; }

/* ── Piste ───────────────────────────────────────────────── */
.jde-tm__viewport { position: relative; }
.jde-tm__track {
	display: flex; gap: var(--tm-gap);
	margin: 0; padding: 12px 4px 20px; list-style: none;
	overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory; scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
	scrollbar-width: none;
}
.jde-tm__track::-webkit-scrollbar { display: none; }

.jde-tm__card {
	flex: 0 0 clamp(280px, calc((100% - 2 * var(--tm-gap)) / 3), 380px);
	scroll-snap-align: start;
	display: flex; flex-direction: column;
	margin: 0; padding: 0;
	background: var(--tm-card); border-radius: var(--tm-radius);
	box-shadow: var(--tm-shadow); overflow: hidden;
	transition: transform .22s, box-shadow .22s;
}
.jde-tm__card:hover { transform: translateY(-4px); box-shadow: var(--tm-shadow-hover); }
.jde-tm__card[hidden] { display: none; }

/* ── Vidéo (façade) ──────────────────────────────────────── */
.jde-tm__video {
	position: relative; aspect-ratio: 16 / 9; background: #0b1a2c; overflow: hidden;
}
.jde-tm__video > img, .jde-tm__video > iframe {
	position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.jde-tm__video > img { object-fit: cover; transition: transform .35s; }
.jde-tm__card:hover .jde-tm__video > img { transform: scale(1.04); }
.jde-tm__video::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .35));
	pointer-events: none;
}
.jde-tm__video.is-playing::after { display: none; }
.jde-tm__video.is-playing .jde-tm__logo { display: none; }
.jde-tm__play {
	position: absolute; left: 50%; top: 50%; z-index: 2;
	width: 64px; height: 64px; margin: -32px 0 0 -32px;
	border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(255, 255, 255, .94); color: var(--tm-blue);
	display: grid; place-items: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
	transition: transform .18s, background .18s;
}
.jde-tm__play svg { width: 28px; height: 28px; fill: currentColor; margin-left: 3px; }
.jde-tm__play:hover { transform: scale(1.08); background: #fff; }
.jde-tm__play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ── Carte à la une (passage média) ──────────────────────── */
.jde-tm__card--une {
	flex-basis: clamp(280px, calc((100% - var(--tm-gap)) / 3 * 2 + var(--tm-gap) / 3), 760px);
	border: 2px solid rgba(12, 113, 195, .35);
}
.jde-tm__card--une .jde-tm__video { aspect-ratio: 16 / 9; }
.jde-tm__logo {
	position: absolute; left: 14px; top: 14px; z-index: 2;
	display: inline-flex; align-items: center;
	padding: 6px 12px; border-radius: 8px;
	background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}
.jde-tm__video .jde-tm__logo img { display: block; position: static; height: 44px; width: auto; max-width: 150px; object-fit: contain; transform: none; }
.jde-tm__card--une .jde-tm__play { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
.jde-tm__card--une .jde-tm__play svg { width: 34px; height: 34px; }
.jde-tm__badge--une {
	display: inline-flex; align-items: center; gap: 6px;
	background: #111827; color: #fff;
}
.jde-tm__badge--une svg { width: 14px; height: 14px; }
.jde-tm__card--une .jde-tm__name { font-size: 22px; }
.jde-tm__card--une .jde-tm__excerpt { font-size: 15px; }

/* ── Corps de carte ──────────────────────────────────────── */
.jde-tm__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.jde-tm__badge {
	align-self: flex-start;
	padding: 4px 11px; border-radius: 999px;
	font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
	color: #fff; background: var(--tm-blue);
}
.jde-tm__badge--incendie            { background: #d9480f; }
.jde-tm__badge--inondation          { background: #1c7ed6; }
.jde-tm__badge--degat-des-eaux      { background: #0c8599; }
.jde-tm__badge--malfacons           { background: #e67700; }
.jde-tm__badge--tempete             { background: #495057; }
.jde-tm__badge--sinistre-habitation { background: #6741d9; }

.jde-tm__name {
	margin: 2px 0 0; font-size: 19px; line-height: 1.3; color: var(--tm-ink); font-weight: 700;
}
.jde-tm__excerpt { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--tm-text); flex: 1; }
.jde-tm__profil {
	margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--tm-line);
	font-size: 12.5px; color: var(--tm-muted);
}
.jde-tm__profil::before { content: "• "; color: var(--tm-blue); }

/* ── Navigation ──────────────────────────────────────────── */
.jde-tm__nav {
	position: absolute; top: 50%; z-index: 3;
	width: 46px; height: 46px; margin-top: -33px;
	border: 0; border-radius: 50%; cursor: pointer;
	background: #fff; color: var(--tm-ink);
	display: grid; place-items: center;
	box-shadow: 0 6px 18px rgba(15, 35, 65, .18);
	transition: transform .18s, color .18s, opacity .18s;
}
.jde-tm__nav svg { width: 22px; height: 22px; }
.jde-tm__nav--prev { left: -18px; }
.jde-tm__nav--next { right: -18px; }
.jde-tm__nav:hover { color: var(--tm-blue); transform: scale(1.06); }
.jde-tm__nav[disabled] { opacity: .35; cursor: default; transform: none; }
.jde-tm__nav:focus-visible { outline: 3px solid rgba(12, 113, 195, .35); outline-offset: 2px; }

.jde-tm__dots { display: flex; justify-content: center; gap: 8px; margin: 4px 0 0; min-height: 10px; }
.jde-tm__dot {
	width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	background: #cdd5de; transition: background .18s, transform .18s;
}
.jde-tm__dot.is-active { background: var(--tm-blue); transform: scale(1.25); }

/* ── Appel à l'action ────────────────────────────────────── */
.jde-tm__cta {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px;
	margin: 30px 0 0;
}
.jde-tm__btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 50px; padding: 12px 30px; border-radius: 6px;
	font-size: 16px; font-weight: 700; text-decoration: none !important;
	border: 2px solid var(--tm-blue);
	transition: background .18s, color .18s, transform .18s, box-shadow .18s;
}
.jde-tm__btn--primary { background: var(--tm-blue); color: #fff !important; box-shadow: 0 8px 22px rgba(12, 113, 195, .28); }
.jde-tm__btn--primary:hover { background: var(--tm-blue-dark); border-color: var(--tm-blue-dark); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(12, 113, 195, .34); }
.jde-tm__btn--ghost { background: transparent; color: var(--tm-blue) !important; }
.jde-tm__btn--ghost:hover { background: rgba(12, 113, 195, .08); transform: translateY(-2px); }
.jde-tm__btn:focus-visible { outline: 3px solid rgba(12, 113, 195, .35); outline-offset: 3px; }

/* ── Variante fond sombre (section hôte à fond foncé) ────── */
.jde-tm--dark .jde-tm__title { color: #fff; }
.jde-tm--dark .jde-tm__sub { color: rgba(255, 255, 255, .78); }
.jde-tm--dark .jde-tm__chip {
	background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .32); color: #fff;
}
.jde-tm--dark .jde-tm__chip:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .12); }
.jde-tm--dark .jde-tm__chip.is-active { background: var(--tm-blue); border-color: var(--tm-blue); color: #fff; }
.jde-tm--dark .jde-tm__dot { background: rgba(255, 255, 255, .28); }
.jde-tm--dark .jde-tm__dot.is-active { background: #fff; }
.jde-tm--dark .jde-tm__btn--ghost { border-color: rgba(255, 255, 255, .7); color: #fff !important; }
.jde-tm--dark .jde-tm__btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.jde-tm--dark .jde-tm__btn--primary { box-shadow: 0 8px 22px rgba(12, 113, 195, .45); }
.jde-tm--dark .jde-tm__card { box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.jde-tm--dark .jde-tm__card--une { border-color: rgba(255, 255, 255, .28); }
.jde-tm--dark .jde-tm__chip:focus-visible,
.jde-tm--dark .jde-tm__btn:focus-visible,
.jde-tm--dark .jde-tm__nav:focus-visible { outline-color: rgba(255, 255, 255, .6); }

/* ── Responsive ──────────────────────────────────────────── */
/* Sous 1180 px la row Divi n'a plus de marge latérale : on réserve une gouttière
   aux flèches pour qu'elles ne recouvrent pas le contenu de la première carte. */
@media (min-width: 768px) and (max-width: 1180px) {
	.jde-tm__viewport { padding: 0 36px; }
	.jde-tm__nav--prev { left: -4px; }
	.jde-tm__nav--next { right: -4px; }
}
@media (max-width: 980px) {
	.jde-tm__card { flex-basis: clamp(260px, calc((100% - var(--tm-gap)) / 2), 380px); }
	.jde-tm__card--une { flex-basis: 100%; }
}
@media (max-width: 767px) {
	.jde-tm__track { padding-left: 2px; padding-right: 2px; }
	.jde-tm__card, .jde-tm__card--une { flex-basis: 84%; }
	.jde-tm__video .jde-tm__logo img { height: 34px; }
	.jde-tm__card--une .jde-tm__name { font-size: 19px; }
	.jde-tm__nav { display: none; }
	.jde-tm__btn { width: 100%; max-width: 360px; }
}
@media (prefers-reduced-motion: reduce) {
	.jde-tm__track { scroll-behavior: auto; }
	.jde-tm__card, .jde-tm__video img, .jde-tm__btn, .jde-tm__nav, .jde-tm__chip { transition: none; }
}
