.seizure-type-carousel {
	max-width: 1166px;
	width: 100%;
	margin: 0 auto;
	display: flex;
	flex-direction: column;

	.preview {
		position: relative;
		cursor: pointer;

		img {
			width: 100%;
		}

		picture {
			&::before {
				content: "";
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				background: rgba(0, 0, 0, 0.5);
				z-index: 0;
			}
		}

		&:before {
			content: "";
			position: absolute;
			top: 50%;
			left: 50%;
			width: 104px;
			height: 104px;
			background-image: url('/themes/custom/seeaseizure_bootstrap/images/icons/play-button.svg');
			background-size: contain;
			background-repeat: no-repeat;
			background-position: center;
			transform: translate(-50%, -50%);
			z-index: 1;
		}

		/* Hide play button and overlay after video has ended */
		&.video-ended {
			cursor: default;

			&:before {
				display: none;
			}

			picture::before {
				display: none;
			}
		}

		@media screen and (max-width: 575px) {
			margin-left: calc(-1 * var(--bs-gutter-x, 0.75rem));
			margin-right: calc(-1 * var(--bs-gutter-x, 0.75rem));
			width: calc(100% + (2 * var(--bs-gutter-x, 0.75rem)));
			height: 55vh;
			min-height: 320px;
			max-height: 124vw; /* Natural height for 374×464 portrait videos */
			overflow: hidden;

			img {
				display: block;
				width: 100%;
				height: 55vh;
				min-height: 320px;
				max-height: 124vw;
				object-fit: cover;
				object-position: top center;
			}

			picture {
				display: block;
				height: 55vh;
				min-height: 320px;
				max-height: 124vw;
				overflow: hidden;
			}
		}
	}

	/* Tonic Seizure page: position video from bottom to show key video elements */
	.page-node-21 & .preview {
		@media screen and (max-width: 575px) {
			img {
				object-position: bottom center;
			}
		}
	}

	.animation {
		display: none;

		.vimeo-wrapper,
		.native-video-wrapper {
			width: 100%;

			>div {
				position: relative;
				overflow: hidden;
			}

			iframe {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
			}
		}

		.native-video-wrapper {
			video.native-video-mobile {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				object-fit: cover;
			}
		}

		@media screen and (max-width: 575px) {
			margin-left: calc(-1 * var(--bs-gutter-x, 0.75rem));
			margin-right: calc(-1 * var(--bs-gutter-x, 0.75rem));
			width: calc(100% + (2 * var(--bs-gutter-x, 0.75rem)));

			.vimeo-wrapper>div,
			.native-video-wrapper>div {
				height: 55vh;
				min-height: 320px;
				max-height: 124vw;
				padding-top: 0;
				overflow: hidden;
			}

			.vimeo-wrapper iframe,
			.native-video-wrapper video.native-video-mobile {
				top: 0;
				bottom: auto;
				height: 100%;
				object-fit: cover;
				object-position: top center;
			}
		}

		@media screen and (min-width: 576px) {
			.vimeo-wrapper>div {
				padding-top: 56.25%;
			}
		}
	}

	/* Tonic Seizure page: position video from bottom */
	.page-node-21 & .animation {
		@media screen and (max-width: 575px) {
			.vimeo-wrapper iframe,
			.native-video-wrapper video.native-video-mobile {
				object-position: bottom center;
			}
		}
	}

	.btn-seizure-details {
		display: none;
		width: 325px;
		max-width: 100%;
		margin-left: auto;

		@media screen and (max-width: 991px) {
			margin: 45px auto 0;
			font-size: 14px;
			line-height: 1.4;
		}

		@media screen and (max-width: 575px) {
			margin-top: 18px;
		}
	}

	.animation-details {
		@media screen and (min-width: 992px) {
			flex-wrap: nowrap;
			column-gap: 1.25rem;
			justify-content: space-between;

			.carousel-item--title-wrapper {
				width: max-content;
				min-width: max-content;
				flex: 0 0 auto;
			}

			.carousel-item--description {
				width: 32%;
				flex: 0 0 32%;

				p {
					margin-top: 0;
				}
			}

			.carousel-nav {
				width: 25%;
				flex: 0 0 25%;
				max-width: 284px;
			}
		}

		@media screen and (min-width: 992px) {
			padding-left: 5%;
			padding-right: 5%;
			column-gap: 1.5rem;
		}

		margin: 20px 0 50px;

		@media screen and (max-width: 991px) {
			margin: 20px 0 30px;
			column-gap: 1rem;

			.carousel-item--description {
				padding-left: calc(var(--bs-gutter-x) * 0.5 + 12px + var(--icon-width-mobile, 33px));

				p {
					margin-top: 16px;
					margin-bottom: 10px;
				}
			}
		}

		h2 {
			font-size: 30px;
			line-height: 1.25;

			@media screen and (max-width: 991px) {
				font-size: 24px;
			}
		}

		h2,
		.blue {
			color: #173A61;
		}

		.subtitle {
			display: block;
			font-weight: 500;
			margin-bottom: 0;
		}

		.what-it-sounds-like {
			color: var(--navy-20);
			font-size: 20px;

			@media screen and (max-width: 991px) {
				margin-top: 10px;
				font-size: 14px;
				line-height: 1.4;
				color: var(--gray-10);
			}
		}

		.animation-details--pronunciation {
			min-width: max-content;
		}

		.pronunciation-wrapper {
			display: flex;
			gap: 24px;
			align-items: center;
			margin-top: 13px;
			white-space: nowrap;

			@media screen and (max-width: 991px) {
				margin-top: 8px;
			}
		}

		.pronunciation {
			margin-bottom: 0;
			display: flex;
			gap: 10px;
			white-space: nowrap;
			min-width: min-content;
		}

		.preview-text {
			margin: 0;
			opacity: 1;
			visibility: visible;
			transition: opacity 0.5s ease, visibility 0.5s ease;
			font-size: 20px;
			line-height: 1.5;
			color: var(--gray-10);

			@media screen and (max-width: 991px) {
				font-size: 14px;
				line-height: 1.4;
				margin-top: 20px;
			}
		}

		.carousel-item--description {
			p {
				font-size: 20px;
				line-height: 1.5;

				@media screen and (max-width: 991px) {
					font-size: 14px;
					line-height: 1.4;
				}
			}
		}

		.carousel-item--title-wrapper-content .subtitle {
			margin-top: 5px;
			font-size: 16px;
			line-height: 1.8;
			letter-spacing: -0.03em;

			@media screen and (max-width: 991px) {
				font-size: 14px;
				line-height: 1.25;
			}
		}
	}

	.carousel-nav {
		position: relative;
		max-width: 284px;
		padding-left: 0;
		padding-right: 0;

		@media screen and (max-width: 1200px) and (min-width: 992px) {
			margin: 0 auto;
		}

		@media screen and (max-width: 991px) {
			margin: 20px auto 5px;
		}
	}

	.see-summary-link-wrapper {
		margin-top: 20px;
		text-align: center;
		width: 100%;
		margin-top: 14px;

		@media screen and (min-width: 992px) {
			text-align: right;
		}
	}

	.see-summary-link {
		color: var(--gray-10);
		text-decoration: none;
		font-size: var(--bs-font-size-p-small);
		line-height: var(--bs-line-height-p-small);
		text-transform: uppercase;
		font-weight: 500;
		display: block;
	}

	.carousel-control-prev,
	.carousel-control-next {
		position: absolute;
		height: 44px;
		opacity: 1;

		&:not(:disabled) {
			background-color: #1A3E6F;
		}

		&:disabled,
		&.faded {
			cursor: not-allowed;
			pointer-events: none;
			background: var(--navy-80);
		}
	}

	.carousel-control-prev.faded .carousel-control-prev-icon {
		background-image: url('/themes/custom/seeaseizure_bootstrap/images/icons/chevron-left-navy-20.svg');
		background-size: 10px;
		opacity: 0.1;
	}

	.carousel-control-prev-icon,
	.carousel-control-next-icon {
		background-size: 20px;
	}

	.carousel-dots-inline {
		height: 44px;
		margin: 0 auto;
		background: #D1E0F2;
		display: flex;
		align-items: center;
		gap: 15px;
		flex-wrap: wrap;
		justify-content: center;

		.dot {
			width: 5px;
			height: 5px;
			background: #1A3E6F;
			border: 1px solid #1A3E6F;

			&.active {
				width: 23px;
				background: none;
				border: 1px solid #1A3E6F;
			}
		}
	}

	.carousel-item {
		.vimeo-wrapper,
		.native-video-wrapper {
			width: 100%;

			>div {
				position: relative;
			}

			iframe {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
			}
		}

		.native-video-wrapper {
			video.native-video-mobile {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				object-fit: cover;
			}
		}

		.container {
			position: relative;
		}
	}

		@media screen and (max-width: 575px) {
			.vimeo-wrapper,
			.native-video-wrapper {
				margin-left: calc(-1 * var(--bs-gutter-x, 0.75rem));
				margin-right: calc(-1 * var(--bs-gutter-x, 0.75rem));
				width: calc(100% + (2 * var(--bs-gutter-x, 0.75rem)));

				>div {
					height: 55vh;
					min-height: 320px;
					max-height: 124vw;
					padding-top: 0;
					overflow: hidden;
				}

				iframe,
				video.native-video-mobile {
					top: 0;
					bottom: auto;
					height: 100%;
					object-fit: cover;
					object-position: top center;
				}
			}
		}

		@media screen and (min-width: 576px) {
			.vimeo-wrapper>div,
			.native-video-wrapper>div {
				padding-top: 56.25%;
			}
		}

		/* Tonic Seizure page: position video from bottom */
		.page-node-21 & {
			@media screen and (max-width: 575px) {
				.vimeo-wrapper iframe,
				.native-video-wrapper video.native-video-mobile {
					object-position: bottom center;
				}
			}
		}

		.carousel-item--title-wrapper {
			display: flex;
			align-items: flex-start;
			flex-wrap: nowrap;
			gap: 12px;

			@media screen and (min-width: 768px) {
				gap: 20px;
			}

			h2 {
				margin: 0;
				flex: 1;
			}
		}

		.carousel-item--icon {
			flex-shrink: 0;

			img {
				width: var(--icon-width-mobile, 33px);
				margin-top: var(--icon-margin-top-mobile, 2px);

				@media screen and (min-width: 768px) {
					width: var(--icon-width-desktop, 46px);
					margin-top: var(--icon-margin-top-desktop, 2px);
				}
			}
		}
	}

	.carousel-fade {
		.carousel-inner {
			position: relative;
		}

		.carousel-item {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			opacity: 0;
			transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0s !important;
			transform: none !important;
			display: block;
			will-change: opacity;
			margin-right: 0;
			float: none;
			pointer-events: none;

			.animation-details {
				visibility: hidden;
			}
		}

		.carousel-item.active {
			position: relative;
			opacity: 1;
			z-index: 3;
			pointer-events: auto;

			.animation-details {
				visibility: visible;
			}
		}

		.carousel-item-next,
		.carousel-item-prev {
			position: absolute;
			opacity: 0;
			z-index: 1;
		}

		.carousel-item-next.carousel-item-start,
		.carousel-item-prev.carousel-item-end {
			position: absolute;
			opacity: 1;
			z-index: 2;
			transition-duration: 1.2s;
			transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
			transition-delay: 0s;
		}

		.active.carousel-item-start,
		.active.carousel-item-end {
			position: absolute;
			opacity: 0;
			z-index: 1;
			transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0s !important;
		}
	}

	.carousel-wrapper {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.5s ease, visibility 0.5s ease;
	}
}

.seizure-type-carousel {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.5s ease, visibility 0.5s ease;
}