/**
 * Intersections marquee — programma + icon loop
 * Clean rewrite for robust full-width behavior in Gutenverse/Core blocks.
 */

/* ==========================================================================
   1. CORE MARQUEE STYLES
   ========================================================================== */
.intersections-marquee-programma {
	width: 100%;
	max-width: 100vw;
	overflow: hidden;
	box-sizing: border-box;
	position: relative;
	/* Prevents the massive track from expanding the document width */
	contain: paint; 
}

.intersections-marquee-programma__viewport {
	width: 100%;
	overflow: hidden;
}

.intersections-marquee-programma__track {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	width: max-content;
	will-change: transform;
	animation: intersections-marquee-scroll 45s linear infinite;
}

.intersections-marquee-programma__segment {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 33px;
	padding-right: 33px;
}

.intersections-marquee-programma__unit {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 33px;
}

.intersections-marquee-programma__text {
	font-family: "Panel Sans", "Poppins", system-ui, sans-serif;
	font-weight: 700;
	font-size: clamp(2.5rem, 5.5vw + 1rem, 6.25rem);
	line-height: 1.2;
	letter-spacing: 0.08em;
	color: #221e4d;
	white-space: nowrap;
}

.intersections-marquee-programma__img {
	width: 54px;
	height: 47px;
	object-fit: contain;
	display: block;
}

/* ==========================================================================
   2. RESPONSIVE
   ========================================================================== */
@media (max-width: 600px) {
	.intersections-marquee-programma__segment,
	.intersections-marquee-programma__unit {
		gap: 20px;
	}
	.intersections-marquee-programma__segment {
		padding-right: 20px;
	}
	.intersections-marquee-programma__img {
		width: 40px;
		height: 35px;
	}
}

/* ==========================================================================
   3. ANIMATION
   ========================================================================== */
@keyframes intersections-marquee-scroll {
	0% { transform: translate3d(0, 0, 0); }
	100% { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.intersections-marquee-programma__track {
		animation-duration: 180s !important;
	}
}

/* ==========================================================================
   4. LAYOUT FIXES (GUTENVERSE & CORE FLEX BLOCKS)
   ========================================================================== */

/* Fix A: Prevent flex containers from expanding to the infinite track width */
.wp-block-group:has(.intersections-marquee-programma),
.guten-column-wrapper:has(.intersections-marquee-programma),
.guten-container:has(.intersections-marquee-programma) {
	min-width: 0 !important;
	max-width: 100% !important;
	overflow-x: clip !important;
}

/* Fix B: Force the marquee itself to shrink within flex rows */
.wp-block-group > .intersections-marquee-programma,
.guten-column-wrapper > .intersections-marquee-programma {
	min-width: 0 !important;
	flex: 1 1 100% !important;
}

/* Fix C: Override Gutenverse "Boxed" layout to allow full-width bleed */
.guten-element.layout-boxed:has(.intersections-marquee-programma) > .guten-container {
	max-width: 100% !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Fix D: Remove padding from Gutenverse section wrappers for true full-bleed */
.section-wrapper:has(.intersections-marquee-programma),
.guten-section:has(.intersections-marquee-programma),
.guten-column:has(.intersections-marquee-programma) {
	padding-left: 0 !important;
	padding-right: 0 !important;
	overflow-x: clip !important;
}

/* Fix E: Hide empty programmatic Gutenverse text editors sitting next to the marquee */
.wp-block-group:has(.intersections-marquee-programma) .gutenverse-text-editor:empty,
.wp-block-group:has(.intersections-marquee-programma) .gutenverse-text-editor:has(.text-content-inner:empty),
.wp-block-group:has(.intersections-marquee-programma) .gutenverse-text-editor:has(.text-content-inner > p:only-child:empty),
.guten-column-wrapper:has(.intersections-marquee-programma) .gutenverse-text-editor:empty,
.guten-column-wrapper:has(.intersections-marquee-programma) .gutenverse-text-editor:has(.text-content-inner:empty),
.guten-column-wrapper:has(.intersections-marquee-programma) .gutenverse-text-editor:has(.text-content-inner > p:only-child:empty) {
	display: none !important;
	width: 0 !important;
	flex: 0 0 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Fix F: If the marquee is a direct child of a flex row, ensure it can grow fully */
.wp-block-group.is-layout-flex.is-nowrap > .intersections-marquee-programma,
.wp-block-group > .intersections-marquee-programma {
	flex: 1 1 100% !important;
	min-width: 0 !important;
}
