/* ==========================================================================
   Blocs Streaming — front-end
   1. Vitrine streaming (.bstr-showcase__copy + .bstr-wall)
   2. Galerie défilante (.bstr-gallery)
   3. Contrôles partagés (points + lecture/pause)
   ========================================================================== */

.bstr-wall,
.bstr-gallery {
	--bstr-ease: cubic-bezier(.65, 0, .35, 1);
	-webkit-font-smoothing: antialiased;
}

/* Thèmes classiques (Kadence) : enveloppe intermédiaire neutralisée avant que le JS la retire. */
[class*="bstr-"] > .wp-block-group__inner-container {
	display: contents;
}

/* Les groupes WordPress ajoutent un "block gap" entre enfants : on le neutralise. */
.bstr-wall > *,
.bstr-gallery .bstr-slide > *,
.bstr-slide__caption > *,
.bstr-slide__text > * {
	margin-block-start: 0 !important;
	margin-block-end: 0;
}

/* --------------------------------------------------------------------------
   1. Vitrine streaming
   -------------------------------------------------------------------------- */
.bstr-showcase__copy {
	max-width: 980px;
	margin-inline: auto;
	padding-inline: 22px;
	text-align: center;
}

.bstr-showcase__copy a {
	color: #2997ff;
	text-decoration: none;
}

.bstr-showcase__copy a:hover {
	text-decoration: underline;
}

.bstr-wall {
	--bstr-poster-w: clamp(132px, 15vw, 250px);
	--bstr-poster-gap: clamp(10px, 1.2vw, 18px);
	--bstr-poster-radius: 14px;
	--bstr-fade-color: #000;
	--bstr-seconds-per-poster: 5s;
	position: relative;
	margin-top: clamp(48px, 6vw, 80px) !important;
	width: 100%;
	max-width: none !important;
	overflow: hidden;
}

/* Avant l'initialisation JS : simple grille propre (et fallback sans JS). */
.bstr-wall:not(.is-ready) {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--bstr-poster-w), 1fr));
	gap: var(--bstr-poster-gap);
	padding-inline: 22px;
}

.bstr-wall .wp-block-kadence-image {
	margin: 0;
	aspect-ratio: 2 / 3;
	border-radius: var(--bstr-poster-radius);
	overflow: hidden;
	background: #1d1d1f;
}

.bstr-wall .wp-block-kadence-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bstr-wall__row {
	overflow: hidden;
}

.bstr-wall__row + .bstr-wall__row {
	margin-top: var(--bstr-poster-gap);
}

.bstr-wall__strip {
	display: flex;
	width: max-content;
	animation: bstr-marquee var(--bstr-duration, 60s) linear infinite;
	will-change: transform;
}

.bstr-wall__row:nth-child(even) .bstr-wall__strip {
	animation-direction: reverse;
}

.bstr-wall__strip > .wp-block-kadence-image {
	flex: 0 0 var(--bstr-poster-w);
	width: var(--bstr-poster-w);
	margin-right: var(--bstr-poster-gap) !important;
}

.bstr-wall.is-paused .bstr-wall__strip {
	animation-play-state: paused;
}

/* Fondus sur les bords */
.bstr-wall__rows {
	position: relative;
}

.bstr-wall__rows::before,
.bstr-wall__rows::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 8vw;
	z-index: 2;
	pointer-events: none;
}

.bstr-wall__rows::before {
	left: 0;
	background: linear-gradient(to right, var(--bstr-fade-color), transparent);
}

.bstr-wall__rows::after {
	right: 0;
	background: linear-gradient(to left, var(--bstr-fade-color), transparent);
}

.bstr-wall__controls {
	display: flex;
	justify-content: flex-end;
	max-width: 1440px;
	margin: 20px auto 0;
	padding-inline: 22px;
}

@keyframes bstr-marquee {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(-50%, 0, 0); }
}

/* --------------------------------------------------------------------------
   2. Galerie défilante
   -------------------------------------------------------------------------- */
.bstr-gallery {
	--bstr-slide-w: min(87.5vw, 1250px);
	--bstr-slide-gap: clamp(12px, 1.7vw, 24px);
	--bstr-slide-ratio: 16 / 9;
	--bstr-slide-radius: 0px;
	--bstr-speed: 1s;
	--bstr-delay: 5s;
	position: relative;
	width: 100%;
	max-width: none !important;
}

.bstr-gallery__viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	touch-action: pan-y;
}

.bstr-gallery__track {
	display: flex;
	column-gap: var(--bstr-slide-gap);
	transition: transform var(--bstr-speed) var(--bstr-ease);
	will-change: transform;
}

.bstr-gallery .bstr-slide {
	position: relative;
	flex: 0 0 var(--bstr-slide-w);
	width: var(--bstr-slide-w);
	aspect-ratio: var(--bstr-slide-ratio);
	margin: 0 !important;
	overflow: hidden;
	border-radius: var(--bstr-slide-radius);
	background: #1d1d1f;
	isolation: isolate;
}

.bstr-gallery.is-ready .bstr-slide:not(.is-active) {
	cursor: pointer;
}

.bstr-slide > .wp-block-kadence-image {
	position: absolute;
	inset: 0;
	margin: 0;
}

.bstr-slide > .wp-block-kadence-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	user-select: none;
	-webkit-user-drag: none;
}

/* Voile en bas pour la lisibilité de la légende */
.bstr-slide::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 45%;
	background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
	z-index: 1;
	pointer-events: none;
	opacity: 0;
	transition: opacity .6s ease;
}

.bstr-slide__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: clamp(20px, 3.2vw, 44px);
	color: #fff;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .6s ease, transform .6s ease;
	pointer-events: none;
}

.bstr-gallery:not(.is-ready) .bstr-slide__caption,
.bstr-gallery:not(.is-ready) .bstr-slide::after,
.bstr-slide.is-active .bstr-slide__caption,
.bstr-slide.is-active::after {
	opacity: 1;
	transform: none;
}

.bstr-slide.is-active .bstr-slide__caption {
	pointer-events: auto;
}

.bstr-slide__caption .wp-block-kadence-advancedbtn {
	flex: 0 0 auto;
}

.bstr-slide__text {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 .35em;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}

.bstr-slide__text > p:first-of-type::after {
	content: " ·";
}

/* Sans JS : défilement horizontal natif */
.bstr-gallery:not(.is-ready) {
	display: flex;
	gap: var(--bstr-slide-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-inline: calc((100% - var(--bstr-slide-w)) / 2);
}

.bstr-gallery:not(.is-ready) .bstr-slide {
	scroll-snap-align: center;
}

@media (max-width: 734px) {
	.bstr-gallery {
		--bstr-slide-w: 87.5vw;
		--bstr-slide-ratio: 4 / 5;
	}

	.bstr-slide__caption {
		flex-direction: column-reverse;
		align-items: flex-start;
		gap: 14px;
	}

	.bstr-slide::after {
		height: 60%;
	}

	.bstr-dots {
		gap: 12px;
		height: 48px;
		padding: 0 18px;
	}

	.bstr-dot[aria-current="true"] {
		width: 36px;
	}

	.bstr-toggle {
		width: 48px;
		height: 48px;
	}
}

/* --------------------------------------------------------------------------
   3. Contrôles partagés
   -------------------------------------------------------------------------- */
.bstr-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	margin-top: 26px;
}

.bstr-dots {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 56px;
	padding: 0 22px;
	border-radius: 980px;
	background: rgba(232, 232, 237, .7);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
}

.bstr-dot {
	position: relative;
	display: block;
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 980px;
	background: rgba(0, 0, 0, .42);
	cursor: pointer;
	overflow: hidden;
	transition: width .5s var(--bstr-ease), background-color .3s;
}

.bstr-dot::before {
	/* zone de clic élargie */
	content: "";
	position: absolute;
	inset: -12px -8px;
}

.bstr-dot:hover {
	background: rgba(0, 0, 0, .6);
}

.bstr-dot[aria-current="true"] {
	width: 48px;
	background: rgba(0, 0, 0, .2);
}

.bstr-dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: rgba(0, 0, 0, .56);
	transform: scaleX(0);
	transform-origin: left center;
}

.bstr-dot[aria-current="true"]::after {
	animation: bstr-progress var(--bstr-delay) linear forwards;
}

.bstr-gallery.is-paused .bstr-dot[aria-current="true"]::after {
	animation-play-state: paused;
}

.bstr-gallery.is-static .bstr-dot[aria-current="true"]::after {
	animation: none;
	transform: none;
}

@keyframes bstr-progress {
	to { transform: scaleX(1); }
}

.bstr-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(232, 232, 237, .7);
	color: rgba(0, 0, 0, .56);
	cursor: pointer;
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	transition: background-color .3s, color .3s;
}

.bstr-toggle:hover {
	background: rgba(223, 223, 227, .85);
	color: rgba(0, 0, 0, .7);
}

.bstr-toggle svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.bstr-toggle .bstr-icon-play,
.bstr-toggle.is-paused .bstr-icon-pause {
	display: none;
}

.bstr-toggle.is-paused .bstr-icon-play {
	display: block;
}

.bstr-dot:focus-visible,
.bstr-toggle:focus-visible,
.bstr-slide a:focus-visible {
	outline: 2px solid #0071e3;
	outline-offset: 3px;
}

/* Variante sombre : à ajouter en classe sur le groupe (bstr-gallery--dark) ;
   appliquée automatiquement aux contrôles de la vitrine. */
.bstr-gallery--dark .bstr-dots,
.bstr-gallery--dark .bstr-toggle,
.bstr-wall .bstr-toggle {
	background: rgba(66, 66, 69, .72);
	color: rgba(255, 255, 255, .8);
}

.bstr-gallery--dark .bstr-dot {
	background: rgba(255, 255, 255, .42);
}

.bstr-gallery--dark .bstr-dot[aria-current="true"] {
	background: rgba(255, 255, 255, .24);
}

.bstr-gallery--dark .bstr-dot::after {
	background: rgba(255, 255, 255, .8);
}

.bstr-gallery--dark .bstr-toggle:hover,
.bstr-wall .bstr-toggle:hover {
	background: rgba(80, 80, 84, .85);
	color: #fff;
}

.screen-reader-text.bstr-live {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.bstr-gallery__track,
	.bstr-slide__caption,
	.bstr-dot {
		transition-duration: .01ms !important;
	}
}

/* ==========================================================================
   4. Vitrine streaming v1.1 — hero (.bstr-hero) + rangée de vignettes (.bstr-marquee)
   ========================================================================== */

/* ---- Hero ---- */
.bstr-hero-row {
	position: relative;
	overflow: hidden;
}

.bstr-hero-row::after {
	/* voile bas pour la lisibilité du texte */
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .15) 45%, transparent 70%);
	pointer-events: none;
	z-index: 1;
}

.bstr-hero-row > .kt-row-column-wrap {
	position: relative;
	z-index: 2;
}

.bstr-hero {
	--bstr-ease: cubic-bezier(.65, 0, .35, 1);
	width: 100%;
	max-width: 980px !important;
	margin-inline: auto !important;
	padding-inline: 22px;
	text-align: left;
	-webkit-font-smoothing: antialiased;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .6s cubic-bezier(.5, 1, .89, 1), transform .6s cubic-bezier(.5, 1, .89, 1);
}

.bstr-hero.is-visible,
.bstr-hero:not(.is-ready) {
	opacity: 1;
	transform: none;
}

.bstr-hero > *,
.bstr-hero__top > *,
.bstr-hero__badge > *,
.bstr-captions > * {
	margin-block-start: 0 !important;
}

.bstr-hero__top {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.bstr-hero__top .wp-block-kadence-image {
	margin: 0 2px 0 0;
	flex: 0 0 auto;
}

.bstr-hero__top .wp-block-kadence-image img {
	display: block;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	object-fit: cover;
}

.bstr-hero__top h2 {
	margin: 0;
	white-space: nowrap;
}

.bstr-hero__badge {
	margin-left: 4px !important;
}

.bstr-hero__badge p {
	display: inline-block;
	margin: 0;
	padding: 3px 11px;
	border: 1px solid #fff;
	border-radius: 12px;
	line-height: 1.33;
	white-space: nowrap;
}

.bstr-hero .wp-block-kadence-advancedbtn {
	justify-content: flex-start;
}

.bstr-hero .kb-button {
	font-size: 17px;
	font-weight: 500;
	line-height: 1.18;
	border: 1px solid #fff !important;
	transition: background-color .2s, opacity .2s;
}

.bstr-captions {
	position: relative;
	height: 18px;
	margin-top: 20px !important;
}

.bstr-captions p {
	position: absolute;
	left: 0;
	top: 0;
	margin: 0;
	line-height: 18px;
	letter-spacing: .25em;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	transition: opacity .5s ease;
}

.bstr-captions p.is-show,
.bstr-captions:not(.is-ready) p:first-child {
	opacity: 1;
}

.bstr-hero-toggle {
	position: absolute;
	right: 34px;
	bottom: 30px;
	z-index: 3;
	width: 34px !important;
	height: 34px !important;
	background: rgba(255, 255, 255, .14) !important;
	color: #fff !important;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
}

.bstr-hero-toggle:hover {
	background: rgba(255, 255, 255, .26) !important;
}

.bstr-hero-toggle svg {
	width: 13px !important;
	height: 13px !important;
}

/* ---- Rangée de vignettes ---- */
.bstr-marquee {
	--bstr-tile-w: 419px;
	--bstr-tile-h: 236px;
	--bstr-tile-gap: 15px;
	--bstr-tile-radius: 6px;
	--bstr-ease: cubic-bezier(.65, 0, .35, 1);
	position: relative;
	width: 100%;
	max-width: none !important;
	-webkit-font-smoothing: antialiased;
}

.bstr-marquee__viewport {
	overflow: hidden;
	width: 100%;
}

.bstr-marquee__track {
	display: flex;
	width: max-content;
	will-change: transform;
}

.bstr-marquee__list {
	display: flex;
	flex-shrink: 0;
}

.bstr-marquee:not(.is-ready) {
	display: flex;
	overflow-x: auto;
	gap: var(--bstr-tile-gap);
	padding-inline: 22px;
}

.bstr-tile {
	flex: 0 0 var(--bstr-tile-w);
	width: var(--bstr-tile-w);
	margin: 15px var(--bstr-tile-gap) 0 0 !important;
}

.bstr-marquee:not(.is-ready) .bstr-tile {
	margin-right: 0 !important;
}

.bstr-tile > *,
.bstr-tile__copy > * {
	margin-block-start: 0 !important;
}

.bstr-tile > .wp-block-kadence-image {
	position: relative;
	margin: 0;
	width: var(--bstr-tile-w);
	height: var(--bstr-tile-h);
	border-radius: var(--bstr-tile-radius);
	overflow: hidden;
	background: #f5f5f7;
	cursor: pointer;
}

.bstr-tile > .wp-block-kadence-image::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid rgba(0, 0, 0, .08);
	border-radius: inherit;
	pointer-events: none;
	z-index: 2;
}

.bstr-tile > .wp-block-kadence-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	-webkit-user-drag: none;
}

.bstr-tile__hover {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .4);
	opacity: 0;
	transition: opacity .3s;
}

.bstr-tile__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 22px;
	border-radius: 980px;
	background: #fff;
	color: #1d1d1f;
	font-size: 14px;
	line-height: 1.14;
	font-weight: 700;
	white-space: nowrap;
	transform: translateY(15px);
	transition: transform .4s;
}

.bstr-tile__cta svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.bstr-tile:hover .bstr-tile__hover,
.bstr-tile:focus-within .bstr-tile__hover {
	opacity: 1;
}

.bstr-tile:hover .bstr-tile__cta,
.bstr-tile:focus-within .bstr-tile__cta {
	transform: none;
}

.bstr-tile__copy {
	margin-top: 10px !important;
	font-size: 14px;
	line-height: 1.29;
	letter-spacing: -.016em;
}

.bstr-tile__copy p {
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.29;
}

.bstr-tile__copy p + p {
	margin-top: .16em !important;
}

.bstr-tile__copy a {
	color: inherit;
	text-decoration: none;
}

.bstr-tile__copy a:hover {
	text-decoration: underline;
}

.bstr-marquee__controls {
	display: none;
	justify-content: flex-end;
	padding: 18px 22px 0;
}

.bstr-marquee.has-own-toggle .bstr-marquee__controls {
	display: flex;
}

.bstr-marquee .bstr-toggle {
	width: 34px;
	height: 34px;
	background: rgba(210, 210, 215, .64);
	color: rgba(0, 0, 0, .56);
}

.bstr-marquee .bstr-toggle svg {
	width: 13px;
	height: 13px;
}

@media (max-width: 1068px) {
	.bstr-marquee {
		--bstr-tile-w: 314px;
		--bstr-tile-h: 177px;
		--bstr-tile-gap: 13px;
		--bstr-tile-radius: 5px;
	}

	.bstr-tile {
		margin-top: 13px !important;
	}

	.bstr-tile__copy {
		margin-top: 7px !important;
	}
}

@media (max-width: 734px) {
	.bstr-marquee {
		--bstr-tile-w: 241px;
		--bstr-tile-h: 136px;
		--bstr-tile-gap: 10px;
		--bstr-tile-radius: 4px;
	}

	.bstr-tile {
		margin-top: 10px !important;
	}

	.bstr-tile__copy {
		margin-top: 6px !important;
		font-size: 12px;
	}

	.bstr-tile__cta {
		padding: 8px 10px 8px 11px;
	}

	.bstr-hero .kb-button {
		font-size: 17px;
	}

	.bstr-hero-toggle {
		right: 16px;
		bottom: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bstr-hero {
		transition: none;
		opacity: 1;
		transform: none;
	}

	.bstr-tile__hover {
		opacity: 1;
		background: transparent;
	}

	.bstr-tile__cta {
		display: none;
	}
}

@media (max-width: 734px) {
	.bstr-hero h3 br {
		display: none;
	}
}
