/*! TPE Gallery Slider 1.0.0 — Craftech Digital */
.tpe-gs {
	--tpe-gs-accent: #D63871;
	--tpe-gs-radius: 22px;
	--tpe-gs-bg: #ECEBEE;
	--tpe-gs-mark: #15171C;
	--tpe-gs-cols: 7;
	--tpe-gs-thumb-h: 84px;
	--tpe-gs-gap: 10px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	min-width: 0;
}

/* Remise à zéro des styles de boutons imposés par le thème */
.tpe-gs button {
	margin: 0;
	padding: 0;
	border: 0;
	min-height: 0;
	font: inherit;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.tpe-gs button:focus { outline: none; }
.tpe-gs button:focus-visible { outline: 3px solid var(--tpe-gs-accent); outline-offset: 3px; }

/* ---- Cadre + traits de coupe ---- */
.tpe-gs__frame { position: relative; }
.tpe-gs--marks .tpe-gs__frame { padding: 24px; }
.tpe-gs__mark { display: none; position: absolute; width: 24px; height: 24px; pointer-events: none; }
.tpe-gs--marks .tpe-gs__mark { display: block; }
.tpe-gs__mark::before,
.tpe-gs__mark::after { content: ""; position: absolute; background: var(--tpe-gs-mark); }
.tpe-gs__mark::before { left: 0; top: 23px; width: 16px; height: 1px; }
.tpe-gs__mark::after { left: 23px; top: 0; width: 1px; height: 16px; }
.tpe-gs__mark--tl { left: 0; top: 0; }
.tpe-gs__mark--tr { right: 0; top: 0; transform: scaleX(-1); }
.tpe-gs__mark--bl { left: 0; bottom: 0; transform: scaleY(-1); }
.tpe-gs__mark--br { right: 0; bottom: 0; transform: scale(-1, -1); }

/* ---- Image principale ---- */
.tpe-gs__stage {
	position: relative;
	height: 500px;
	overflow: hidden;
	border-radius: var(--tpe-gs-radius);
	background: var(--tpe-gs-bg);
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	isolation: isolate;
}
.tpe-gs__track {
	display: flex;
	height: 100%;
	transition: transform .55s cubic-bezier(.22, 1, .36, 1);
	will-change: transform;
}
.tpe-gs__slide { flex: 0 0 100%; min-width: 0; height: 100%; }
.tpe-gs__link { display: block; height: 100%; cursor: zoom-in; }
.tpe-gs .tpe-gs__slide img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	-webkit-user-drag: none;
}

.tpe-gs__caption {
	position: absolute;
	left: 20px;
	bottom: 20px;
	z-index: 2;
	max-width: calc(100% - 40px);
	margin: 0;
	padding: 8px 14px;
	border-radius: 999px;
	background: #FFFFFF;
	color: #15171C;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}
.tpe-gs__caption[hidden] { display: none; }

.tpe-gs__counter {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 2;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(21, 23, 28, .82);
	color: #FFFFFF;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}

.tpe-gs .tpe-gs__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #FFFFFF;
	color: #15171C;
	box-shadow: 0 4px 14px rgba(21, 23, 28, .16);
	transform: translateY(-50%);
	transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.tpe-gs .tpe-gs__arrow:hover,
.tpe-gs .tpe-gs__arrow:focus { background: #FFFFFF; color: var(--tpe-gs-accent); }
.tpe-gs .tpe-gs__arrow:active { transform: translateY(-50%) scale(.94); }
.tpe-gs__arrow--prev { left: 20px; }
.tpe-gs__arrow--next { right: 20px; }
.tpe-gs__arrow svg { display: block; pointer-events: none; }

/* ---- Miniatures ---- */
.tpe-gs__thumbs {
	position: relative;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--tpe-gs-cols) - 1) * var(--tpe-gs-gap)) / var(--tpe-gs-cols));
	gap: var(--tpe-gs-gap);
	padding: 5px;
	margin: -5px 0;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}
.tpe-gs__thumbs::-webkit-scrollbar { display: none; }
.tpe-gs--marks .tpe-gs__thumbs { padding-left: 29px; padding-right: 29px; scroll-padding: 0 29px; }

.tpe-gs .tpe-gs__thumb,
.tpe-gs .tpe-gs__all {
	height: var(--tpe-gs-thumb-h);
	border-radius: 12px;
	overflow: hidden;
	scroll-snap-align: start;
}
.tpe-gs .tpe-gs__thumb {
	display: block;
	width: 100%;
	background: var(--tpe-gs-bg);
	opacity: .72;
	outline: 3px solid transparent;
	outline-offset: 2px;
	transition: opacity .2s ease, outline-color .2s ease;
}
.tpe-gs .tpe-gs__thumb:hover { opacity: 1; background: var(--tpe-gs-bg); }
.tpe-gs .tpe-gs__thumb.is-active { opacity: 1; outline-color: var(--tpe-gs-accent); }
.tpe-gs .tpe-gs__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	-webkit-user-drag: none;
}
.tpe-gs .tpe-gs__all {
	background: #15171C;
	color: #FFFFFF;
	font-size: 14px;
	font-weight: 700;
	padding: 0 8px;
}
.tpe-gs .tpe-gs__all:hover,
.tpe-gs .tpe-gs__all:focus { background: var(--tpe-gs-accent); color: #FFFFFF; }

/* ---- Points (mobile) ---- */
.tpe-gs__dots { display: none; justify-content: center; flex-wrap: wrap; }
.tpe-gs .tpe-gs__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 44px;
	padding: 0 4px;
	background: transparent;
}
.tpe-gs .tpe-gs__dot:hover,
.tpe-gs .tpe-gs__dot:focus { background: transparent; }
.tpe-gs__dot::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #C9CCD4;
	transition: width .3s ease, background-color .3s ease;
}
.tpe-gs__dot.is-active::before { width: 24px; background: var(--tpe-gs-accent); }

.tpe-gs--single .tpe-gs__thumbs,
.tpe-gs--single .tpe-gs__dots { display: none; }

@media (max-width: 767px) {
	.tpe-gs--marks .tpe-gs__frame { padding: 0; }
	.tpe-gs--marks .tpe-gs__mark { display: none; }
	.tpe-gs--marks .tpe-gs__thumbs { padding-left: 5px; padding-right: 5px; scroll-padding: 0; }
	.tpe-gs__caption { left: 12px; bottom: 12px; max-width: calc(100% - 24px); font-size: 12px; padding: 6px 12px; }
	.tpe-gs__counter { top: 12px; right: 12px; font-size: 12px; }
	.tpe-gs .tpe-gs__arrow { width: 44px; height: 44px; }
	.tpe-gs__arrow--prev { left: 10px; }
	.tpe-gs__arrow--next { right: 10px; }
	.tpe-gs--mobile-dots .tpe-gs__thumbs { display: none; }
	.tpe-gs--mobile-dots .tpe-gs__dots { display: flex; }
	.tpe-gs--mobile-dots.tpe-gs { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
	.tpe-gs__track,
	.tpe-gs__dot::before,
	.tpe-gs .tpe-gs__thumb { transition: none; }
}

.tpe-gs__empty {
	padding: 40px 20px;
	border: 2px dashed #C9CCD4;
	border-radius: 16px;
	text-align: center;
	color: #5A5F6B;
	font-size: 14px;
}
