.elementor-widget-treethemes-scroll-cube-gallery,
.elementor-widget-treethemes-scroll-cube-gallery > .elementor-widget-container,
.elementor-element:has(.tt-scroll-cube-gallery),
.e-con:has(.tt-scroll-cube-gallery),
.e-con-boxed:has(.tt-scroll-cube-gallery) > .e-con-inner {
	overflow: visible !important;
}

/* Break out of Elementor boxed .e-con-inner so the stage is 100vw (Codrops / Webflow). */
.elementor-element.elementor-widget-treethemes-scroll-cube-gallery {
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	position: relative;
}

/*
 * 100vw on iPhone is wider than the layout viewport (scrollbar / dvw gap)
 * and is the white strip on the right. Mobile sections are already full-bleed.
 */
@media (max-width: 1024px) {
	.elementor-element.elementor-widget-treethemes-scroll-cube-gallery {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	/*
	 * Wrap is translate3d(-24%, -18%). Clip on __inner (not __pin / gallery):
	 * overflow:hidden on those kills position:sticky and froze the cube.
	 */
	.tt-scroll-cube-gallery__inner {
		overflow: hidden;
	}
}

.elementor-widget-treethemes-scroll-cube-gallery > .elementor-widget-container {
	width: 100%;
	max-width: none;
}

.tt-scroll-cube-gallery {
	--tt-scg-section-height: 750vh;
	--tt-scg-cube-size: 14vw;
	--tt-scg-text-size: clamp(2.5rem, 12vw, 9rem);
	--tt-scg-overlay-color: #000000;
	--tt-scg-overlay-opacity: 0.6;
	position: relative;
	width: 100%;
	max-width: none;
}

.tt-scroll-cube-gallery__pin,
.tt-scroll-cube-gallery__sticky {
	width: 100%;
	max-width: 100%;
}

/* Tall track for native scroll (no ScrollSmoother wrapper on page). */
.tt-scroll-cube-gallery__pin {
	position: relative;
	height: var(--tt-scg-section-height);
}

.tt-scroll-cube-gallery__sticky {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100svh;
	max-width: none;
	width: 100%;
	/* Clip the hex-path translate; overflow-x:clip + visible Y becomes a 100vh scroller. */
	overflow: hidden;
	transform-style: preserve-3d;
}

/*
 * ScrollSmoother: GSAP transform pin (stage stays in the widget). Scroll track stays on __pin.
 */
.tt-scroll-cube-gallery--gsap-pin .tt-scroll-cube-gallery__pin {
	height: var(--tt-scg-section-height);
}

.tt-scroll-cube-gallery--gsap-pin .tt-scroll-cube-gallery__sticky {
	position: relative;
	top: auto;
	overflow: visible;
	transform-style: preserve-3d;
	backface-visibility: visible;
}

.tt-scroll-cube-gallery--gsap-pin.is-scg-pinned .tt-scroll-cube-gallery__sticky {
	will-change: auto;
}

/* Pinned stage: inherit title styles; Elementor typography controls size/weight. */
.tt-scroll-cube-gallery--gsap-pin .tt-scroll-cube-gallery__title,
.tt-scroll-cube-gallery.is-scg-complete .tt-scroll-cube-gallery__title {
	text-transform: uppercase;
}

.tt-scroll-cube-gallery--gsap-pin .tt-scroll-cube-gallery__cube-scene {
	width: var(--tt-scg-cube-size, min(30vw, 30vh));
	height: var(--tt-scg-cube-size, min(30vw, 30vh));
}

.tt-scroll-cube-gallery__inner {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: visible;
	transform-style: preserve-3d;
}

.tt-scroll-cube-gallery__bg-list {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translateZ(0);
	-webkit-transform: translateZ(0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.tt-scroll-cube-gallery__bg-item {
	position: absolute;
	inset: 0;
	opacity: 1;
	pointer-events: none;
}

/* Order 1 on top (matches Webflow: CMS sorted largest → smallest in DOM). */
.tt-scroll-cube-gallery__bg-item[data-scg-bg='1'] {
	z-index: 6;
}
.tt-scroll-cube-gallery__bg-item[data-scg-bg='2'] {
	z-index: 5;
}
.tt-scroll-cube-gallery__bg-item[data-scg-bg='3'] {
	z-index: 4;
}
.tt-scroll-cube-gallery__bg-item[data-scg-bg='4'] {
	z-index: 3;
}
.tt-scroll-cube-gallery__bg-item[data-scg-bg='5'] {
	z-index: 2;
}
.tt-scroll-cube-gallery__bg-item[data-scg-bg='6'] {
	z-index: 1;
}

.tt-scroll-cube-gallery__bg-item img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
}

.tt-scroll-cube-gallery__bg-overlay,
.tt-scg-intro__shade {
	position: absolute;
	pointer-events: none;
	background: linear-gradient(
		to bottom,
		var(--tt-scg-overlay-color, #000) 0%,
		transparent 50%,
		var(--tt-scg-overlay-color, #000) 100%
	);
}

.tt-scroll-cube-gallery__bg-overlay {
	inset: 0;
	z-index: 1;
	opacity: var(--tt-scg-overlay-opacity, 0.6);
}

.tt-scg-intro__shade {
	inset: 0;
	z-index: 1;
	opacity: 0;
}

.tt-scroll-cube-gallery__text-layer {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.tt-scroll-cube-gallery__text-item {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

/* Only the active slide title stacks on top (slide 1 was always z-index 6 before). */
.tt-scroll-cube-gallery__text-item {
	z-index: 1;
}

.tt-scroll-cube-gallery__text-item.is-active {
	z-index: 10;
}

.elementor-widget-treethemes-scroll-cube-gallery .tt-scroll-cube-gallery .tt-scroll-cube-gallery__title,
.tt-scroll-cube-gallery .tt-scroll-cube-gallery__title {
	margin: 0;
	padding: 0.04em 0.06em;
	font-size: var(--tt-scg-text-size, clamp(2.5rem, 12vw, 9rem));
	line-height: 0.8 !important;
	font-weight: 700;
	font-style: normal;
	text-transform: uppercase;
	letter-spacing: -0.02em;
	color: #fff;
	text-align: center;
	max-width: 70%;
	overflow: visible;
}

/* Split Text–style masked words. Mask is taller than the glyph so slide-up
   does not clip letters into dashes. Title line-height still controls wrap. */
.tt-scg-word-mask {
	display: inline-block;
	overflow: hidden;
	vertical-align: bottom;
	line-height: 1;
	padding: 0.2em 0.08em 0.14em;
	margin: -0.2em 0.05em;
}

.tt-scg-word-mask + .tt-scg-word-mask {
	margin-left: 0.1em;
}

.tt-scg-word {
	display: inline-block;
	color: inherit;
	font: inherit;
	white-space: nowrap;
	backface-visibility: hidden;
	-webkit-font-smoothing: antialiased;
	transform: translateZ(0);
}

/* Full-viewport mover (demo: pictures_cube-list-wrapper). */
.tt-scroll-cube-gallery__cube-wrap {
	position: absolute;
	inset: 0;
	z-index: 7;
	perspective: 1000px;
	perspective-origin: 50% 50%;
	pointer-events: none;
	overflow: visible;
	transform: translate3d(-38%, 0, 0);
	transform-style: preserve-3d;
}

	@media (max-width: 991px) {
		.tt-scroll-cube-gallery__cube-wrap {
			inset: 0;
			transform: none;
		}
	}

.tt-scroll-cube-gallery__cube-mover {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	transform-style: preserve-3d;
}

.tt-scroll-cube-gallery__cube-scene {
	--tt-scg-half: calc(var(--tt-scg-cube-size) * 0.5);
	position: relative;
	width: var(--tt-scg-cube-size);
	height: var(--tt-scg-cube-size);
	min-width: 120px;
	min-height: 120px;
	aspect-ratio: 1;
	container-type: size;
	transform-style: preserve-3d;
	overflow: visible;
	flex-shrink: 0;
}

/* Separate X/Y rotators — avoids Euler mid-path jumps on reverse scrub. */
.tt-scroll-cube-gallery__cube-rot-y,
.tt-scroll-cube-gallery__cube-rot-x {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transform-origin: 50% 50%;
}

.tt-scroll-cube-gallery__cube {
	position: relative;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	container-type: size;
	transform-style: preserve-3d;
	transform-origin: 50% 50%;
	overflow: visible;
}

.tt-scroll-cube-gallery__cube-face {
	position: absolute;
	inset: 0;
	pointer-events: auto;
	overflow: visible;
	backface-visibility: visible;
	-webkit-backface-visibility: visible;
	transform-style: preserve-3d;
}

.tt-scroll-cube-gallery__cube-face a {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.tt-scroll-cube-gallery__cube-image-wrap {
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	overflow: visible;
}

.tt-scroll-cube-gallery__cube-face img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	/* Webflow: 3% inset so neighboring faces show in the seams. */
	padding: 3%;
	box-sizing: border-box;
}

/* Webflow CMS cube faces: % in-plane, half cube size on Z. */
.tt-scroll-cube-gallery__cube-face:nth-child(1) {
	transform-origin: 0% 0%;
	transform: translate3d(0%, 0%, var(--tt-scg-half)) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}

.tt-scroll-cube-gallery__cube-face:nth-child(2) {
	transform-origin: 100% 0%;
	transform: translate3d(-100%, 0%, var(--tt-scg-half)) rotateX(0deg) rotateY(-90deg) rotateZ(0deg);
}

.tt-scroll-cube-gallery__cube-face:nth-child(3) {
	transform-origin: 50% 50%;
	transform: translate3d(0%, 0%, calc(var(--tt-scg-half) * -1)) rotateX(0deg) rotateY(180deg) rotateZ(0deg);
}

.tt-scroll-cube-gallery__cube-face:nth-child(4) {
	transform-origin: 50% 50%;
	transform: translate3d(0%, 50%, 0) rotateX(-90deg) rotateY(0deg) rotateZ(180deg);
}

.tt-scroll-cube-gallery__cube-face:nth-child(5) {
	transform-origin: 50% 50%;
	transform: translate3d(50%, 0%, 0) rotateX(0deg) rotateY(90deg) rotateZ(90deg);
}

.tt-scroll-cube-gallery__cube-face:nth-child(6) {
	transform-origin: 0% 100%;
	transform: translate3d(0%, -100%, var(--tt-scg-half)) rotateX(90deg) rotateY(0deg) rotateZ(0deg);
}

.elementor-widget-treethemes-scroll-cube-gallery .tt-scroll-cube-gallery__cube-wrap,
.elementor-widget-treethemes-scroll-cube-gallery .tt-scroll-cube-gallery__cube-mover,
.elementor-widget-treethemes-scroll-cube-gallery .tt-scroll-cube-gallery__cube-scene,
.elementor-widget-treethemes-scroll-cube-gallery .tt-scroll-cube-gallery__cube {
	transform-style: preserve-3d;
}

.tt-scroll-cube-gallery--no-cube .tt-scroll-cube-gallery__cube-wrap {
	display: none;
}

.tt-scroll-cube-gallery__notice {
	position: absolute;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	padding: 0.5rem 1rem;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 12px;
	border-radius: 4px;
	pointer-events: none;
}

/* Intro: stacked images rotate, then the frame zooms into the first slide. */
.tt-scroll-cube-gallery__intro {
	position: absolute;
	inset: 0;
	z-index: 40;
	overflow: hidden;
	pointer-events: none;
	background: #fff;
}

.tt-scg-intro__bleed {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.tt-scg-intro__grow {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 32vmin;
	height: 20vmin;
	overflow: hidden;
	transform: translate(-50%, -50%);
	z-index: 1;
}

.tt-scg-intro__stack {
	position: absolute;
	inset: 0;
	overflow: visible;
}

.tt-scg-intro__img {
	position: absolute;
	display: block;
	pointer-events: none;
	user-select: none;
	object-fit: cover;
	object-position: center center;
}

.tt-scg-intro__img.is-extra {
	inset: 0;
	width: 100%;
	height: 100%;
}

.tt-scg-intro__img.is-cover {
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
}

.tt-scg-intro__img.is-extra[data-scg-extra='1'] {
	z-index: 3;
}

.tt-scg-intro__img.is-extra[data-scg-extra='2'] {
	z-index: 2;
}

.tt-scg-intro__img.is-extra[data-scg-extra='3'] {
	z-index: 1;
}

.tt-scroll-cube-gallery.is-scg-intro .tt-scroll-cube-gallery__sticky {
	background: #fff;
}

.tt-scroll-cube-gallery.is-scg-intro:not(.is-scg-intro-reveal) .tt-scroll-cube-gallery__text-layer,
.tt-scroll-cube-gallery.is-scg-intro:not(.is-scg-intro-reveal) .tt-scroll-cube-gallery__cube-wrap,
.tt-scroll-cube-gallery.is-scg-intro:not(.is-scg-intro-reveal) .tt-scroll-cube-gallery__notice {
	opacity: 0;
	visibility: hidden;
}

.tt-scroll-cube-gallery.is-scg-intro-reveal .tt-scroll-cube-gallery__intro {
	z-index: 2;
	background: transparent;
}

.tt-scroll-cube-gallery.is-scg-intro-reveal .tt-scroll-cube-gallery__sticky {
	background: transparent;
}

@media (max-width: 991px) {
	.elementor-element.elementor-widget-treethemes-scroll-cube-gallery {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.tt-scroll-cube-gallery {
		--tt-scg-cube-size: 30vw;
		--tt-scg-text-size: clamp(1.6rem, 11vw, 3.4rem);
	}

	.tt-scroll-cube-gallery__cube-scene {
		min-width: 96px;
		min-height: 96px;
	}

	.tt-scroll-cube-gallery .tt-scroll-cube-gallery__title {
		max-width: 78%;
		padding: 0 0.75rem;
		line-height: 0.72 !important;
	}

	.tt-scg-word-mask {
		line-height: 1;
		padding: 0.2em 0.08em 0.12em;
		margin: -0.34em 0.04em;
		clip-path: inset(0);
	}

	.tt-scg-intro__grow {
		width: 56vmin;
		height: 34vmin;
	}
}
