// Mobile
@media screen and (max-width: ($breakpoint - 1)) {
	.sensei-course-theme {
		&__video-container {
			border-width: 0 !important;
			padding: 0 !important;
			display: contents;
		}
	}
}

.sensei-course-theme {
	&__video-container.has-background-color &__sidebar {
		background: inherit;
	}
}

// Desktop
@media screen and (min-width: ($breakpoint)) {
	.sensei-course-theme {
		&__video-container {
			--sensei-lm-sidebar-width: 300px;
			display: flex;
			position: relative;
			gap: var(--wp--style--block-gap, 2em);

			.wp-block-sensei-lms-course-theme-lesson-video {
				flex: 1;
			}

			&:not(.has-background) {
				border: 1px solid currentColor;
			}
		}

		&__video-container::after {
			flex: 0 0 var(--sensei-lm-sidebar-width);
			content: '';
		}

		&__video-container &__sidebar {
			position: absolute;
			width: var(--sensei-lm-sidebar-width);
			top: 20px;
			bottom: 20px;
			right: 20px;
			overflow-y: auto;
			scrollbar-gutter: stable both-edges;


			&::-webkit-scrollbar {
				width: 6px;
				margin: 2px;
			}

			&::-webkit-scrollbar-track {
				background: transparent;
			}

			&::-webkit-scrollbar-thumb {
				background-color: rgba(155, 155, 155, 0.3);
				border-radius: 20px;
				border: transparent;
			}
		}

		/**
		 * Fixed right sidebar mode when there is no video.
		 */
		body:not(.sensei-video-lesson):not(.editor-styles-wrapper) &__video-container {
			justify-content: flex-end;
			border: none;
			height: 0;
			overflow: visible;
			padding: 0 !important;
			margin-top: 0 !important;
			margin-bottom: -32px !important;
			transition: none;

			&:after {
				content: none;
			}

			.wp-block-cover {
				display: none;
			}

			.sensei-course-theme__sidebar {
				height: max-content;
				max-height: 80vh;
				position: static;
				padding: 12px;
				background: var(--sensei-background-color);
				color: var(--sensei-text-color);
			}

			&:not(.has-background) .sensei-course-theme__sidebar {
				border: 1px solid currentColor;
			}

			& ~ * .sensei-course-theme__secondary-sidebar {
				position: relative;
				top: calc(80vh + 48px);
				width: var(--sensei-lm-sidebar-width);
				left: var(--wp--style--block-gap, 2em);
			}
		}
	}
}
