/**
 * Scrolling marquee captions for Premium image creatives (scoped styles).
 */

.adf-premium-marquee {
	box-sizing: border-box;
	position: relative;
	width: 100%;
	max-width: 100%;
}

.adf-premium-marquee[class*="adf-premium-marquee--overlay"] {
	pointer-events: none;
}

.adf-premium-marquee[class*="adf-premium-marquee--overlay"] a {
	pointer-events: none;
}

.adf-premium-marquee:not([class*="adf-premium-marquee--overlay"]) a {
	position: relative;
	z-index: 1;
	pointer-events: auto;
}

.adf-premium-marquee__viewport {
	overflow: hidden;
	width: 100%;
	box-sizing: border-box;
	line-height: 1.35;
}

.adf-premium-marquee__track {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	width: max-content;
	animation-name: adf-premium-marquee-scroll;
	animation-duration: 20s;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	align-items: center;
}

@media (prefers-reduced-motion: reduce) {

	.adf-premium-marquee__track {
		animation: none;
		justify-content: center;
		flex-wrap: wrap;
		white-space: normal;
		width: auto;
		max-width: 100%;
		overflow: hidden;
		text-overflow: clip;
		flex-direction: row;
		align-items: center;
		transform: none;
	}

	.adf-premium-marquee__segment[aria-hidden="true"] {
		display: none;
	}

	.adf-premium-marquee__segment {
		padding-right: 0;
		white-space: normal;
	}
}

.adf-premium-marquee__segment {
	flex: 0 0 auto;
	padding-right: 3rem;
	white-space: nowrap;
}

@keyframes adf-premium-marquee-scroll {

	0% {
		transform: translateX(0);
	}

	100% {
		transform: translateX(-50%);
	}
}

/* Above / below: subtle band framing */
.adf-premium-marquee--above .adf-premium-marquee__viewport,
.adf-premium-marquee--below .adf-premium-marquee__viewport {
	min-height: 2.25rem;
	display: flex;
	align-items: center;
	background-color: rgba(0, 0, 0, 0.04);
	padding: 0.25rem 0;
}

/* Overlay anchor stacks creative + marquee */
.adf-premium-marquee-anchor {
	position: relative;
	display: inline-block;
	max-width: 100%;
}

.adf-premium-marquee-anchor__creative {
	position: relative;
	z-index: 1;
	max-width: 100%;
	line-height: 0;
}

.adf-premium-marquee-anchor .adf-premium-marquee {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 2;
	max-width: 100%;
	width: auto;
}

.adf-premium-marquee-anchor--overlay-bottom .adf-premium-marquee {
	bottom: 0;
}

.adf-premium-marquee-anchor--overlay-top .adf-premium-marquee {
	top: 0;
}

.adf-premium-marquee-anchor--overlay-full .adf-premium-marquee {
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
}

.adf-premium-marquee--overlay-full .adf-premium-marquee__viewport {
	flex: 1 1 auto;
	height: 100%;
	display: flex;
	align-items: center;
	background-color: rgba(0, 0, 0, 0.45);
	color: #fff;
	min-height: 100%;
	box-sizing: border-box;
}

.adf-premium-marquee--overlay-top .adf-premium-marquee__viewport,
.adf-premium-marquee--overlay-bottom .adf-premium-marquee__viewport {
	background-color: rgba(0, 0, 0, 0.55);
	color: #fff;
	padding: 0.2rem 0;
	min-height: 2rem;
	box-sizing: border-box;
	display: flex;
	align-items: center;
}
