/**
 * AP Scroll Fade Styles
 *
 * Content blocks that fade in from below and fade out at top on scroll.
 * Items auto-alternate left/right positioning.
 */

/* ===========================================
   WRAPPER
   =========================================== */

.ap-scroll-fade {
	position: relative;
	overflow: hidden;
}

/* ===========================================
   BACKGROUND AND OVERLAY
   =========================================== */

.ap-scroll-fade__background {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	pointer-events: none;
}

.ap-scroll-fade__overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	pointer-events: none;
}

/* ===========================================
   ITEMS CONTAINER
   =========================================== */

.ap-scroll-fade__items {
	position: relative;
	z-index: 2;
}

/* ===========================================
   INDIVIDUAL ITEM
   =========================================== */

.ap-scroll-fade__item {
	position: relative;
	min-height: 80vh;
	display: flex;
	align-items: center;
	padding: 1rem 10%;
	box-sizing: border-box;
	opacity: 0;
	transform: translateY(50px);
	transition: opacity 0.8s ease, transform 0.8s ease;
}

.ap-scroll-fade__item.visible {
	opacity: 1;
	transform: translateY(0);
}

/* Item height modifiers (default 80vh when no modifier). */
.ap-scroll-fade--item-height-80vh .ap-scroll-fade__item {
	min-height: 80vh;
}

.ap-scroll-fade--item-height-50vh .ap-scroll-fade__item {
	min-height: 50vh;
}

.ap-scroll-fade--item-height-25vh .ap-scroll-fade__item {
	min-height: 25vh;
}

.ap-scroll-fade--item-height-400px .ap-scroll-fade__item {
	min-height: 400px;
}

.ap-scroll-fade--item-height-500px .ap-scroll-fade__item {
	min-height: 500px;
}

.ap-scroll-fade--item-height-600px .ap-scroll-fade__item {
	min-height: 600px;
}

/* ===========================================
   ITEM POSITIONING
   =========================================== */

.ap-scroll-fade__item--left {
	justify-content: flex-start;
}

.ap-scroll-fade__item--right {
	justify-content: flex-end;
}

/* ===========================================
   ITEM WRAPPER - Horizontal layout
   =========================================== */

.ap-scroll-fade__item-wrapper {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 2rem;
	max-width: 700px;
}

/* Left items: image left, text right */
.ap-scroll-fade__item--left .ap-scroll-fade__item-wrapper {
	flex-direction: row;
}

/* Right items: text left, image right */
.ap-scroll-fade__item--right .ap-scroll-fade__item-wrapper {
	flex-direction: row-reverse;
}

/* ===========================================
   ITEM IMAGE
   =========================================== */

.ap-scroll-fade__item-image {
	flex-shrink: 0;
	width: 200px;
}

.ap-scroll-fade__item-img {
	display: block;
	width: 100%;
	height: auto;
}

/* Invert dark images to white */
.ap-scroll-fade__item-img--white {
	filter: brightness(0) invert(1);
}

/* ===========================================
   ITEM CONTENT
   =========================================== */

.ap-scroll-fade__item-content {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* ===========================================
   TEXT COLOUR VARIATIONS
   =========================================== */

.ap-scroll-fade--text-dark {
	color: #1a1f4b;
}

.ap-scroll-fade--text-dark .ap-scroll-fade__item-heading {
	color: #1a1f4b;
}

.ap-scroll-fade--text-light {
	color: #ffffff;
}

.ap-scroll-fade--text-light .ap-scroll-fade__item-heading {
	color: #ffffff;
}

/* ===========================================
   HEADING AND TEXT
   Matches ap-content-layout typography
   =========================================== */

.ap-scroll-fade__item-heading {
	margin: 0;
	font-weight: 700;
	font-size: clamp(2rem, 5vw, 48px);
	line-height: 1.2;
}

.ap-scroll-fade__item-text {
	margin: 0;
	font-size: clamp(1rem, 3vw, 24px);
	line-height: 1.6;
}

.ap-scroll-fade__item-text p:first-child {
	margin-top: 0;
}

.ap-scroll-fade__item-text p:last-child {
	margin-bottom: 0;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
	.ap-scroll-fade__item {
		padding: 2rem 5%;
	}

	.ap-scroll-fade--item-height-80vh .ap-scroll-fade__item {
		min-height: 50vh;
	}

	.ap-scroll-fade--item-height-50vh .ap-scroll-fade__item {
		min-height: 50vh;
	}

	.ap-scroll-fade--item-height-25vh .ap-scroll-fade__item {
		min-height: 25vh;
	}

	.ap-scroll-fade--item-height-400px .ap-scroll-fade__item {
		min-height: 400px;
	}

	.ap-scroll-fade--item-height-500px .ap-scroll-fade__item {
		min-height: 500px;
	}

	.ap-scroll-fade--item-height-600px .ap-scroll-fade__item {
		min-height: 600px;
	}

	.ap-scroll-fade__item-wrapper {
		max-width: 100%;
		flex-direction: column;
		text-align: center;
	}

	/* Stack vertically on mobile regardless of left/right */
	.ap-scroll-fade__item--left .ap-scroll-fade__item-wrapper,
	.ap-scroll-fade__item--right .ap-scroll-fade__item-wrapper {
		flex-direction: column;
	}

	.ap-scroll-fade__item-image {
		width: 150px;
	}

	.ap-scroll-fade__item-content {
		text-align: center;
	}

	/* Centre items on mobile */
	.ap-scroll-fade__item--left,
	.ap-scroll-fade__item--right {
		justify-content: center;
	}
}

/* ===========================================
   REDUCED MOTION PREFERENCE
   =========================================== */

@media (prefers-reduced-motion: reduce) {
	.ap-scroll-fade__item {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}
