/**
 * Gallery Marquee Block Styles
 */

.kf-gallery-marquee {
	overflow-x: clip;
    overflow-y: visible;

	width: 100%;
	/* Establish layout containment to prevent external reflows from affecting the track */
	/* contain: layout; */
}

.kf-gallery-marquee.kf-gallery-marquee {
    margin-block-start: 0px;
}

.kf-gallery-marquee + .kf-gallery-marquee {
    margin-block-start: var(--kf-gm-gap, 10px);
}

.kf-gallery-marquee__track {
	display: flex;
	gap: var(--kf-gm-gap, 10px);
	width: max-content;
	will-change: transform;
}

/* -------------------------------------------------------------------------
   Animation directions
   ------------------------------------------------------------------------- */

.kf-gallery-marquee__track.is-animated.is-direction-ltr {
	animation: kf-marquee-ltr var(--kf-gm-speed, 40s) linear infinite;
}

.kf-gallery-marquee__track.is-animated.is-direction-rtl {
	animation: kf-marquee-rtl var(--kf-gm-speed, 40s) linear infinite;
}

.kf-gallery-marquee__track.is-animated:hover,
.kf-gallery-marquee__track.is-animated:focus-within {
    animation-play-state: paused;
}

@keyframes kf-marquee-ltr {
	from {
		transform: translateX(-50%);
	}
	to {
		transform: translateX(0);
	}
}

@keyframes kf-marquee-rtl {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

/* -------------------------------------------------------------------------
   Interaction: pause track on hover / focus
   ------------------------------------------------------------------------- */

.kf-gallery-marquee__track:hover,
.kf-gallery-marquee__track:focus-within {
	animation-play-state: paused;

	position: relative;
    z-index: 1;
}

/* -------------------------------------------------------------------------
   Items & Images
   ------------------------------------------------------------------------- */

.kf-gallery-marquee__item {
	flex: 0 0 auto;
	width: auto;
	height: var(--kf-gm-height, 200px);
	border-radius: var(--kf-gm-radius, 10px);
	/* overflow: hidden; */
	position: relative;
	background-color: rgba(0, 0, 0, 0.04); /* Low-contrast placeholder to mitigate CLS */
	outline: none;
}

.kf-gallery-marquee__item:focus-visible {
	box-shadow: inset 0 0 0 3px currentColor;
}

.kf-gallery-marquee__item .kf-gallery-marquee__img {
	width: 100%;
	height: 100%;
	/* object-fit: cover; */
	display: block;
	transition: transform 0.3s ease;
	-webkit-user-drag: none;
	user-select: none;
}

.kf-gallery-marquee__item:hover,
.kf-gallery-marquee__item:focus,
.kf-gallery-marquee__item:focus-within {
    z-index: 2;
}

/* Scale the photo on hover or focus */
.kf-gallery-marquee__item:hover .kf-gallery-marquee__img,
.kf-gallery-marquee__item:focus .kf-gallery-marquee__img,
.kf-gallery-marquee__item:focus-within .kf-gallery-marquee__img {
	transform: scale(1.2);
}