/**
 * Styles for the Facilities module.
 * Applies sticky positioning with dynamic top offsets and dynamic margins based on remaining posts.
 */
.fl-facilities-module {
	position: relative; /* Ensure container supports sticky children */
	min-height: 100vh; /* Ensure container is tall enough for sticky behavior */
	overflow: visible; /* Prevent clipping of sticky elements */
	--total-items: 4; /* Default value, will be set by JavaScript */
}

.fl-facilities-module .fl-facility-item {
	color: #ffffff; /* Ensure text is readable on dark background */
	z-index: 10; /* Ensure sticky items stack correctly */
	padding-left: 20px;
	padding-right: 20px;
	display: flex;
	justify-content: center;
	align-items: center;
}

@media (min-width: 768px) {
	.fl-facilities-module .fl-facility-item {
		position: sticky;
		/* Calculate top offset: 204px for first item, then +64px for each subsequent item */
		top: calc(204px + (64px * var(--item-index, 0)));
		/* Dynamic margin-top: 64px * (total-items - item-index - 1) for items 2 and beyond */
		margin-top: calc(64px * (var(--total-items, 4) - var(--item-index, 0) - 1));
		/* Dynamic margin-bottom: 64px * (total-items - item-index - 1) */
		margin-bottom: calc(64px * (var(--total-items, 4) - var(--item-index, 0) - 1));
		padding-left: 50px;
		padding-right: 50px;
	}

	/* Set custom properties for top and margins */
	.fl-facilities-module .fl-facility-item:nth-child(1) {
		--item-index: 0; /* top: 204px */
		margin-top: 0; /* Override dynamic margin-top for first item */
	}

	.fl-facilities-module .fl-facility-item:nth-child(2) {
		--item-index: 1; /* top: 268px */
	}

	.fl-facilities-module .fl-facility-item:nth-child(3) {
		--item-index: 2; /* top: 332px */
	}

	.fl-facilities-module .fl-facility-item:nth-child(4) {
		--item-index: 3; /* top: 396px */
	}

	.fl-facilities-module .fl-facility-item:nth-child(n+5) {
		--item-index: calc(n - 1); /* top: 460px, 524px, etc. */
	}
}

.fl-facilities-module .fl-facility-item:nth-child(odd) {
	background-color: #232121;
}

.fl-facilities-module .fl-facility-item:nth-child(even) {
	background-color: #392f2b;
}

.fl-facility-item__container {
	max-width: 1280px;
	width: 100%;
}

.fl-facility-item__info {
	grid-template-columns: 1fr;
	align-items: center;
	display: grid;
	padding-bottom: 48px;
	grid-row-gap: 2rem;
}

@media (min-width: 768px) {
	.fl-facility-item__info {
		grid-template-columns: 1fr 1fr;
		align-items: center;
		padding-top: 48px;
		grid-column-gap: 5rem;
		grid-row-gap: 4rem;
	}
}

.fl-facility-item__number {
	font-weight: 600;
	padding-top: 20px;
	padding-bottom: 20px;
}

.fl-facility-number {
	color: #828282;
	margin-right: 16px;
}

.fl-facility-image img {
	object-fit: cover;
	border-radius: 12px;
	width: 100%;
	height: 30vh;
}
