/*
 * TutsVela video player skin. Loaded after plyr.css.
 * Colours follow the Kadence global palette, so light and dark mode and any palette change apply here too.
 */
.tv-player {
	--plyr-color-main: var(--global-palette1, #F05A35);
	--plyr-video-background: #111;
	--plyr-font-family: inherit;
	--plyr-font-size-base: 14px;
	--plyr-font-size-small: 13px;
	--plyr-control-radius: 8px;
	--plyr-control-spacing: 10px;
	--plyr-control-icon-size: 18px;
	--plyr-video-controls-background: linear-gradient(transparent, rgba(0, 0, 0, .78));
	--plyr-video-control-color: #fff;
	--plyr-video-control-color-hover: #1A1A1A;
	--plyr-video-control-background-hover: var(--global-palette1, #F05A35);
	--plyr-range-thumb-height: 14px;
	--plyr-range-track-height: 5px;
	--plyr-range-fill-background: var(--global-palette1, #F05A35);
	--plyr-video-progress-buffered-background: rgba(255, 255, 255, .3);
	--plyr-tooltip-background: #fff;
	--plyr-tooltip-color: #1A1A1A;
	--plyr-tooltip-radius: 6px;
	--plyr-menu-background: #fff;
	--plyr-menu-color: #1A1A1A;
	--plyr-menu-radius: 10px;
	--plyr-progress-marker-background: #fff;
	--plyr-progress-marker-width: 3px;
	position: relative;
	aspect-ratio: 16 / 9;
	width: 100%; /* keeps the column width; with min-height the ratio would otherwise widen the box */
	min-height: 200px; /* YouTube requires an embedded player viewport of at least 200 x 200 px. */
	margin: 0;
	background: #111;
	border-radius: 12px;
	overflow: hidden;
	color: #fff;
	isolation: isolate;
}

/* Poster and the single play control (before the player loads). */
.tv-player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; max-width: none; }
.tv-player__play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; place-content: center; gap: 12px; color: #fff; text-decoration: none; background: radial-gradient(60% 60% at 50% 55%, rgba(0, 0, 0, .05), rgba(0, 0, 0, .4)); cursor: pointer; }
.tv-player__play-icon { width: clamp(64px, 9vw, 84px); height: clamp(64px, 9vw, 84px); border-radius: 50%; background: var(--global-palette1, #F05A35); display: grid; place-items: center; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 12px 30px -8px color-mix(in srgb, var(--global-palette1, #F05A35) 75%, transparent); transition: transform .2s cubic-bezier(.2, .7, .2, 1); }
.tv-player__play-icon svg { width: 40%; height: 40%; margin-left: 6%; color: #1A1A1A; }
.tv-player__play:hover .tv-player__play-icon { transform: scale(1.06); }
.tv-player__play:focus-visible { outline: none; }
.tv-player__play:focus-visible .tv-player__play-icon { outline: 3px solid #fff; outline-offset: 4px; }
.tv-player__resume { font-size: 14px; font-weight: 600; line-height: 1.2; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .65); }
.tv-player__badge { position: absolute; left: 14px; bottom: 14px; z-index: 2; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); pointer-events: none; }
.tv-player[data-state] .tv-player__play, .tv-player[data-state] .tv-player__badge { display: none; }

/* Plyr fills the frame. */
.tv-player .plyr { position: absolute; inset: 0; z-index: 3; height: 100%; border-radius: 0; }
/* Plyr crops YouTube's frame by default (240% height, shifted up) to hide YouTube's title and logo.
   YouTube's branding must stay visible, so the crop is switched off: the iframe shows exactly 16:9. */
.tv-player .plyr__video-embed { height: 100%; }
.tv-player .plyr--full-ui .plyr__video-embed > .plyr__video-embed__container { padding-bottom: 0; height: 100%; transform: none; }
.tv-player .plyr__control--overlaid { background: var(--global-palette1, #F05A35); color: #1A1A1A; }
.tv-player .plyr__control--overlaid svg { color: #1A1A1A; }
.tv-player .plyr__progress__marker { opacity: .85; }

/* Loading and error states. */
.tv-player__status { position: absolute; inset: 0; z-index: 4; display: none; place-items: center; place-content: center; gap: 12px; padding: 24px; text-align: center; font-size: 15.5px; line-height: 1.5; pointer-events: none; }
.tv-player[data-state="loading"] .tv-player__status { display: grid; color: transparent; }
.tv-player[data-state="loading"] .tv-player__status::before { content: ""; width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: tv-spin .8s linear infinite; }
.tv-player[data-state="error"] .tv-player__status, .tv-player[data-state="consent"] .tv-player__status { display: grid; gap: 14px; align-content: center; justify-items: center; text-align: center; padding: 24px; background: rgba(17, 17, 17, .94); color: #F1F2F2; pointer-events: auto; }
.tv-player[data-state="consent"] .tv-player__status p { margin: 0; max-width: 40ch; }
.tv-player[data-state="consent"] .tv-player__status a { color: #fff; font-weight: 700; border-bottom: 2px solid var(--global-palette1, #F05A35); text-decoration: none; }
.tv-player__allow { font: inherit; font-weight: 700; color: #fff; background: #B93C1A; border: 0; border-radius: 12px; padding: 12px 20px; cursor: pointer; }
.tv-player__allow:hover { background: #9E3215; }
.tv-player__allow:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.tv-player[data-state="error"] .tv-player__status { display: grid; background: rgba(17, 17, 17, .94); color: #F1F2F2; pointer-events: auto; }
.tv-player[data-state="error"] .tv-player__status p { margin: 0; max-width: 40ch; }
.tv-player[data-state="error"] .tv-player__status a { color: #fff; font-weight: 700; border-bottom: 2px solid var(--global-palette1, #F05A35); text-decoration: none; }
@keyframes tv-spin { to { transform: rotate(360deg); } }

/* Current chapter label and chapter menu (inside the control bar). */
.tv-player__now { min-width: 0; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: rgba(255, 255, 255, .85); margin-left: 6px; }
.tv-player__chapters { position: relative; }
.tv-player__menu { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 5; width: min(340px, 80vw); max-height: min(320px, 60vh); overflow: auto; padding: 6px; border-radius: 10px; background: #fff; color: #1A1A1A; box-shadow: 0 12px 40px -10px rgba(0, 0, 0, .5); }
.tv-player__menu[hidden] { display: none; }
.tv-player__menu button { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 14px; line-height: 1.35; text-align: left; cursor: pointer; }
.tv-player__menu button:hover, .tv-player__menu button:focus-visible { background: #F5F5F4; outline: none; }
.tv-player__menu button[aria-checked="true"] { background: #F5F5F4; box-shadow: inset 3px 0 0 var(--global-palette1, #F05A35); font-weight: 700; }
.tv-player__menu-time { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; color: #5C5F5F; padding-top: 2px; }
@media (max-width: 640px) {
	.tv-player__now { display: none; }
	.tv-player .plyr__volume { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.tv-player__play-icon { transition: none; }
	.tv-player__play:hover .tv-player__play-icon { transform: none; }
	.tv-player[data-state="loading"] .tv-player__status::before { animation-duration: 2s; }
}

/* Editor placeholder (Kadence Element preview has no tutorial). */
.tv-player--placeholder { display: grid; place-items: center; text-align: center; padding: 24px; font-size: 15px; color: #F1F2F2; }
