/**
 * EcoVG TV Resume Playback
 *
 * Continue Watching responsive slider.
 */


/* =========================================================
   MAIN SECTION
   ========================================================= */

.ecovg-continue-watching {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	box-sizing: border-box;
}

.ecovg-continue-watching *,
.ecovg-continue-watching *::before,
.ecovg-continue-watching *::after {
	box-sizing: border-box;
}


/* =========================================================
   HEADER
   ========================================================= */

.ecovg-cw-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0 0 18px;
	padding: 0;
	gap: 20px;
}


/* Continue Watching heading */

.ecovg-cw-title {
	margin: 0 !important;
	padding: 0 !important;
	color: #1f1f1f !important;
	font-size: 22px !important;
	line-height: 1.25 !important;
	font-weight: 700 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
}


/* =========================================================
   SLIDER NAVIGATION
   ========================================================= */

.ecovg-cw-navigation {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
}


/*
 * JS sets hidden when there is no overflow.
 */

.ecovg-cw-navigation[hidden] {
	display: none !important;
}


/*
 * Backup hide state.
 */

.ecovg-continue-watching.ecovg-cw-no-scroll
.ecovg-cw-navigation {
	display: none !important;
}


/* Arrow button */

.ecovg-cw-arrow {
	appearance: none;
	-webkit-appearance: none;

	display: inline-flex !important;
	align-items: center;
	justify-content: center;

	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;

	margin: 0 !important;
	padding: 0 !important;

	border: 1px solid #e2e2e2 !important;
	border-radius: 50% !important;

	background: #ffffff !important;
	color: #222222 !important;

	font-family: Arial, Helvetica, sans-serif !important;
	font-size: 20px !important;
	font-weight: 600 !important;
	line-height: 1 !important;

	box-shadow: 0 2px 7px rgba(0, 0, 0, 0.08) !important;

	cursor: pointer;

	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		opacity 0.2s ease,
		transform 0.2s ease;

	-webkit-tap-highlight-color: transparent;
}


/* Arrow hover */

.ecovg-cw-arrow:hover,
.ecovg-cw-arrow:focus-visible {
	background: #111111 !important;
	color: #ffffff !important;
	border-color: #111111 !important;
	outline: none !important;
}


/* Arrow click */

.ecovg-cw-arrow:active {
	transform: scale(0.94);
}


/*
 * Start/end arrow remains visible but disabled.
 */

.ecovg-cw-arrow:disabled {
	opacity: 0.32 !important;
	cursor: default !important;
	pointer-events: none;
	background: #f5f5f5 !important;
	color: #777777 !important;
	border-color: #e4e4e4 !important;
	box-shadow: none !important;
}


/* =========================================================
   SLIDER TRACK
   ========================================================= */

.ecovg-cw-track {
	display: grid;
	grid-auto-flow: column;

	/*
	 * Not fixed to 4 cards.
	 * Number of visible cards automatically depends
	 * on available screen/container width.
	 */
	grid-auto-columns: clamp(230px, 24vw, 340px);

	width: 100%;

	gap: 18px;

	margin: 0;
	padding: 0 2px 10px;

	overflow-x: auto;
	overflow-y: hidden;

	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	overscroll-behavior-inline: contain;

	-webkit-overflow-scrolling: touch;

	scrollbar-width: none;
}


.ecovg-cw-track::-webkit-scrollbar {
	display: none;
}


/* =========================================================
   CARD
   ========================================================= */

.ecovg-cw-card {
	position: relative;

	display: block;

	width: 100%;
	min-width: 0;

	margin: 0;
	padding: 0;

	scroll-snap-align: start;

	transition:
		opacity 0.18s ease,
		transform 0.18s ease;
}


/*
 * Remove animation.
 */

.ecovg-cw-card.is-removing {
	opacity: 0;
	transform: scale(0.96);
	pointer-events: none;
}


/* Card link */

.ecovg-cw-card-link {
	display: block;

	width: 100%;

	color: inherit !important;
	text-decoration: none !important;

	outline: none;
}


.ecovg-cw-card-link:hover,
.ecovg-cw-card-link:focus,
.ecovg-cw-card-link:active {
	color: inherit !important;
	text-decoration: none !important;
}


/* =========================================================
   THUMBNAIL
   ========================================================= */

.ecovg-cw-thumbnail {
	position: relative;

	width: 100%;
	aspect-ratio: 16 / 9;

	overflow: hidden;

	border-radius: 8px;

	background: #111111;

	transform: translateZ(0);
}


/* Thumbnail image */

.ecovg-cw-thumbnail img {
	display: block;

	width: 100%;
	height: 100%;

	margin: 0;
	padding: 0;

	object-fit: cover;
	object-position: center;

	transition: transform 0.3s ease;
}


/* Desktop hover */

@media (hover: hover) and (pointer: fine) {

	.ecovg-cw-card-link:hover
	.ecovg-cw-thumbnail img {
		transform: scale(1.035);
	}
}


/* =========================================================
   REMOVE FROM CONTINUE WATCHING BUTTON
   ========================================================= */

.ecovg-cw-remove {
	position: absolute;

	top: 8px;
	right: 8px;

	z-index: 20;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 30px;
	height: 30px;
	min-width: 30px;

	margin: 0;
	padding: 0;

	border: 1px solid rgba(255, 255, 255, 0.4) !important;
	border-radius: 50% !important;

	background: rgba(0, 0, 0, 0.72) !important;
	color: #ffffff !important;

	font-family: Arial, Helvetica, sans-serif !important;
	font-size: 23px !important;
	font-weight: 400 !important;
	line-height: 1 !important;

	cursor: pointer;

	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);

	opacity: 0;

	transform: scale(0.9);

	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		background-color 0.2s ease;

	-webkit-tap-highlight-color: transparent;
}


/*
 * Keep × perfectly centered.
 */

.ecovg-cw-remove span {
	display: block;

	position: relative;

	top: -1px;

	line-height: 1;
}


/*
 * Show remove button when hovering card.
 */

.ecovg-cw-card:hover
.ecovg-cw-remove,
.ecovg-cw-remove:focus-visible {
	opacity: 1;
	transform: scale(1);
}


/* Remove hover */

.ecovg-cw-remove:hover,
.ecovg-cw-remove:focus-visible {
	background: #000000 !important;
	color: #ffffff !important;

	outline: none !important;
}


/* Removing/loading */

.ecovg-cw-remove.is-removing,
.ecovg-cw-remove:disabled {
	opacity: 0.45 !important;
	cursor: wait;
	pointer-events: none;
}


/* =========================================================
   PROGRESS BAR
   ========================================================= */

.ecovg-cw-progress {
	position: absolute;

	left: 10px;
	right: 10px;
	bottom: 8px;

	z-index: 5;

	height: 4px;

	overflow: hidden;

	border-radius: 20px;

	background: rgba(255, 255, 255, 0.45);

	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.12);
}


/*
 * Watched portion.
 */

.ecovg-cw-progress-value {
	display: block;

	width: 0;
	max-width: 100%;
	height: 100%;

	border-radius: inherit;

	background: #e50914;
}


/* =========================================================
   VIDEO TITLE
   ========================================================= */

.ecovg-cw-card-title {
	display: -webkit-box;

	margin: 9px 0 0 !important;
	padding: 0 !important;

	min-height: 42px;

	overflow: hidden;

	color: #222222 !important;

	font-size: 15px !important;
	line-height: 1.4 !important;
	font-weight: 600 !important;

	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}


/* =========================================================
   LAPTOP / TABLET
   ========================================================= */

@media screen and (max-width: 1024px) {

	.ecovg-cw-track {
		grid-auto-columns:
			clamp(220px, 36vw, 320px);

		gap: 15px;
	}


	.ecovg-cw-title {
		font-size: 21px !important;
	}


	.ecovg-cw-arrow {
		width: 36px !important;
		height: 36px !important;
		min-width: 36px !important;
		min-height: 36px !important;

		font-size: 19px !important;
	}
}


/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 767px) {

	.ecovg-cw-header {
		margin-bottom: 14px;

		gap: 12px;
	}


	.ecovg-cw-title {
		font-size: 19px !important;
		line-height: 1.3 !important;
	}


	.ecovg-cw-navigation {
		gap: 6px;
	}


	/*
	 * A bit of the next card stays visible,
	 * indicating that the row can be swiped.
	 */

	.ecovg-cw-track {
		grid-auto-columns:
			minmax(220px, 79vw);

		gap: 12px;

		padding-bottom: 8px;
	}


	.ecovg-cw-arrow {
		width: 33px !important;
		height: 33px !important;
		min-width: 33px !important;
		min-height: 33px !important;

		font-size: 17px !important;
	}


	.ecovg-cw-thumbnail {
		border-radius: 7px;
	}


	/*
	 * Always show remove button on touch devices.
	 */

	.ecovg-cw-remove {
		top: 7px;
		right: 7px;

		width: 28px;
		height: 28px;
		min-width: 28px;

		font-size: 21px !important;

		opacity: 1;

		transform: scale(1);
	}


	.ecovg-cw-progress {
		left: 8px;
		right: 8px;
		bottom: 7px;

		height: 4px;
	}


	.ecovg-cw-card-title {
		margin-top: 8px !important;

		min-height: 39px;

		font-size: 14px !important;
	}
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media screen and (max-width: 420px) {

	.ecovg-cw-track {
		grid-auto-columns:
			minmax(210px, 82vw);
	}


	.ecovg-cw-title {
		font-size: 18px !important;
	}


	.ecovg-cw-arrow {
		width: 31px !important;
		height: 31px !important;
		min-width: 31px !important;
		min-height: 31px !important;

		font-size: 16px !important;
	}
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

	.ecovg-cw-track {
		scroll-behavior: auto;
	}


	.ecovg-cw-card,
	.ecovg-cw-thumbnail img,
	.ecovg-cw-arrow,
	.ecovg-cw-remove {
		transition: none;
	}
}