.tepVisuallyHidden {
	display: block !important;
	clip-path: inset(50%) !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: none !important;
	overflow: hidden !important;
	outline: none !important;
}

.tePlayer {
	position: relative;
	text-align: left;
	max-width: 100%;
	margin: 0 auto;
	--te-color: white;
	--te-accent-color: Highlight; /* TODO AccentColor non encoré géré par Chrome) */
	accent-color: var(--te-accent-color);
}

.tepMainArea, .tepMainArea * {
	all: revert;
	color: inherit;
	margin: initial;
	padding: initial;
	background-color: initial;
}

.tePlayer *:hover {
	opacity: 1;
}

.tePlayer.teVideoType {
	width: 45em;
}

.tePlayer.teAudioType {
	width: 30em;
}

.tepMainArea {
	position: relative;
}

.tePlayer.teVideoType > .tepMainArea {
	aspect-ratio: 16/9;
	background-color: black;
}

.tePlayer.teVideoType.tePortrait > .tepMainArea {
	aspect-ratio: 9/16;
	max-height: 45em;
	margin: auto;
	max-width: 100%;
}

.tePlayer video[hidden],
.tePlayer audio[hidden],
.tePlayer mediaelementwrapper[hidden] {
	display: none !important;
}

.tePlayer.teVideoType video,
.tePlayer.teVideoType mediaelementwrapper {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
}

.tePlayer.teVideoType mediaelementwrapper.teNotNative::before {
	content: "";
	display: block;
	width: 100%;
	height: 0;
	padding-bottom: 56.25%;
	position: relative;
	z-index: 1;
}

.tePlayer.teVideoType.tePaused mediaelementwrapper.teNotNative::before {
	z-index: unset;
}

.tePlayer.teVideoType mediaelementwrapper.teNotNative > * {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: auto;
	border: none;
}

.tePlayer.teAudioType video,
.tePlayer.teAudioType mediaelementwrapper {
	display: none;
}

.tePlayer.teError video,
.tePlayer.teError audio,
.tePlayer.teError mediaelementwrapper,
.tePlayer.teError .tepController {
	display: none;
}

/* Erreur */
.tepErrorArea {
	text-align: center;
	font-weight: bold;
	margin: 0.5em 0;
}

.tepErrorArea[hidden] {
	display: none !important;
}

.tepErrorArea > p {
	text-align: inherit;
	margin: 0.3em 0;
}

.tepErrorArea a {
	text-decoration: underline;
	overflow-wrap: break-word;
}

/* Controlleur */
.tepController {
	display: flex;
	align-items: center;
}

.tePlayer.teVideoType .tepController {
	position: absolute;
	bottom: 0;
	width: 100%;
	opacity: 0;
	padding: 1em 0.3em 0.3em;
	transition: opacity 0.4s ease-in 0.4s;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0),
		rgba(0, 0, 0, 0.2) 0.6em,
		rgba(0, 0, 0, 0.7) 1.8em,
		rgba(0, 0, 0, .8)
	);
	color: var(--te-color);
	box-sizing: border-box;
	pointer-events: none;
	z-index: 2;
}

.tePlayer.teVideoType.tePaused .tepController,
.tePlayer.teVideoType > .tepMainArea.teActiveMouse > .tepController,
.tePlayer.teVideoType > .tepMainArea.teActiveFocus > .tepController,
.tePlayer.teVideoType > .tepMainArea:focus-within > .tepController:not(:has(> .tepPlayPause:focus)),
.tePlayer.teVideoType .tepController:hover {
	opacity: 1;
	pointer-events: visible;
	transition-delay: 0s;
}

.tePlayer.teVideoType.tePaused .tepSubtitlesArea,
.tePlayer.teVideoType > .tepMainArea.teActiveMouse > .tepSubtitlesArea,
.tePlayer.teVideoType > .tepMainArea.teActiveFocus > .tepSubtitlesArea,
.tePlayer.teVideoType > .tepMainArea:focus-within > .tepSubtitlesArea:not(:has(+ .tepController> .tepPlayPause:focus)),
.tePlayer.teVideoType .tepSubtitlesArea:has(+ .tepController:hover) {
	bottom: 1.6em;
	transition-delay: 0s;
}

.tePlayer.teAudioType .tepController {
	width: 30em;
	max-width: 100%;
	background-color: #666;
	color: var(--te-color);
	border-radius: 4px;
	box-sizing: border-box;
	padding: 0.3em 0.2em;
}

/* Boutons */
.tePlayer .tepButton {
	border: none;
	background: none;
	color: inherit;
	appearance: none;
	padding: 0;
	font-size: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	border-radius: 3px;
	margin: 0 0.1em;
	text-decoration: none;
	box-sizing: border-box;
	border: solid 2px transparent;
}

.tePlayer .tepButton[hidden] {
	display: none;
}

.tePlayer .tepButton:focus-visible,
.tePlayer input:focus + label.tepButton {
	border-color: var(--te-accent-color);
	outline: solid 2px var(--te-color);
}

.tePlayer .tepButton:hover {
	background: rgba(255, 255, 255, 0.3);
}

.tepPanel .tepButton {
	padding: .2em .5em;
	margin: 0;
	flex: 1;
}

.tepController > .tepButton {
	width: 1.8em;
	height: 1.8em;
	justify-content: center;
}

.tepController > .tepButton::before {
	content: '';
	display: block;
	width: 18px;
	height: 18px;
	background: transparent url("icons.svg") no-repeat;
}

.tepController .tepPlayPause::before {
	background-position: 0 0;
}

.tepController .tepPlayPause[data-pressed=true]::before {
	background-position: 0 -18px;
}

.teSeeking .tepController .tepPlayPause::before {
	background-position: 0 -36px;
	animation: tepSpin 0.8s linear infinite;
}

.tepController .tepMute::before {
	background-position: 0 -54px;
}

.tepController .tepMute[data-pressed=true]::before {
	background-position: 0 -72px;
}

.tepController .tepSettingsBtn::before {
	background-position: 0 -90px;
}

.tepController .tepFullscreen::before {
	background-position: 0 -108px;
}

.tepController .tepFullscreen[data-pressed=true]::before {
	background-position: 0 -126px;
}

/* Position et durée */
.tepCurrentTime,
.tepDuration {
	margin: 0 0.4em;
}

/* Fullscreen */
.tePlayer.teAudioType .tepFullscreen {
	display: none;
}

.tePlayer.teVideoType:fullscreen {
	display: flex;
	flex-direction: column;
	width: 100% !important;
	height: 100% !important;
	background-color: black;
}

.tePlayer.teVideoType:fullscreen > .tepMainArea {
	flex: 1;
	min-height: 0;
	max-height: none;
}

.tePlayer.teVideoType:fullscreen video,
.tePlayer.teVideoType:fullscreen mediaelementwrapper {
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	max-height: none;
}

.tePlayer.teVideoType:fullscreen > .tepTranscriptArea {
	max-height: 50vh;
}

/* Range */
.tepSeek, .tepVolume {
	appearance: none;
	touch-action: none;
	background: none;
	border: 0;
	border-radius: 2em;
	display: block;
	margin: 0;
	padding: 0;
	cursor: pointer;
	min-width: 0;
	outline: solid 2px var(--te-color);
	outline-offset: 1px;
	height: 8px;
}

.tepController input[type=range]::-webkit-slider-runnable-track {
	border: 0;
	border-radius: 3px;
	height: 6px;
	transition: all .3s ease;
	-webkit-user-select: none;
	user-select: none;
	background-image: linear-gradient(to right, currentColor var(--value, 0), transparent var(--value, 0))
}

.tepController input[type=range]::-moz-range-track {
	background: none;
	border: 0;
	border-radius: 3px;
	height: 6px;
	transition: all .3s ease;
	-moz-user-select: none;
	user-select: none
}

.tepController input[type=range]::-webkit-slider-thumb {
	appearance: none;
	width: 0;
}

.tepController input[type=range]::-moz-range-thumb {
	width: 0;
	border: none;
}

.tepController input[type=range]::-moz-range-progress {
	background: currentColor;
	border-radius: 3px;
	height: 6px
}

.tepController input[type=range]:focus-visible {
	background-color: var(--te-accent-color);
	outline: solid 3px var(--te-color);
}

.tepController input[type=range]::-moz-focus-outer {
	border: 0
}

.tepController input[type=range]::-webkit-slider-runnable-track {
	background-color: rgba(255, 255, 255, .25)
}

.tepController input[type=range]::-moz-range-track {
	background-color: rgba(255, 255, 255, .25)
}

.tepSeek {
	flex: 1;
	margin: 0 0.4em;
}

.tepVolume {
	width: 0;
	visibility: collapse;
	transition: padding-left 0.2s linear, width 0.2s linear, visibility 0s linear 0.2s;
}

.tepMute:hover + .tepVolume,
.tepMute:focus + .tepVolume,
.tepVolume:hover,
.tepVolume:focus {
	width: 7em;
	visibility: visible;
	margin-left: 0.5em;
	transition: padding-left 0.2s linear, width 0.2s linear;
}

/* Settings */
.tepPanel {
	position: absolute;
	background-color: rgba(0, 0, 0, 0.6);
	padding: 0.2em .5em;
	white-space: nowrap;
	transition: opacity 0.2s ease-in;
	z-index: 3;
	border-radius: 4px;
}

.tePlayer.teAudioType .tepPanel {
	background-color: #666;
}

.tepPanel[hidden] {
	display: block;
	visibility: collapse;
	opacity: 0;
	transition: opacity 0.2s ease-in, visibility 0s linear 0.2s;
}

.tepSettingsPanel {
	bottom: 2.7em;
	right: 0;
}

.tePlayer.teVideoType .tepSettingsPanel {
	right: 0.5em;
}

.tepSettingsPanel > ul {
	list-style: none;
	padding: 0;
}

.tepSettingsPanel li {
	margin-block: .2em;
	display: flex;
}

.tepSettingsPanel li > div:first-child {
	display: contents;
}

.tepSettingsPanel a {
	margin-left: 1.1em;
}

.tepSettingsPanel input + label::before {
	content: '';
	width: 9px;
	height: 9px;
	display: inline-block;
	background-color: var(--te-color);
	opacity: 0.33;
	margin-right: 0.5em;
	transition: opacity 0.2s ease-in;
}

.tepSettingsPanel input[type=radio] + label::before {
	border-radius: 100%;
}

.tepSettingsPanel input:checked + label::before {
	opacity: 1;
}

.tepSubtitlesBtn[data-pressed=true], .tepQualitiesBtn[data-pressed=true], .tepPlaybackRatesBtn[data-pressed=true] {
	text-decoration: underline;
}

.tepSubtitlesBtn::before, .tepQualitiesBtn::before, .tepPlaybackRatesBtn::before {
	content: '';
	display: inline-block;
	opacity: 0.33;
	margin-left: 0.2em;
	margin-right: 0.5em;
	padding: 2px;
	border-style: solid;
	border-width: 0 0 2px 2px;
	transform: rotate(45deg);
}

.tepSubtitlesBtn[data-pressed=true]::before, .tepQualitiesBtn[data-pressed=true]::before, .tepPlaybackRatesBtn[data-pressed=true]::before {
	opacity: 1;
}

.tepSubtitlesPanel {
	right: calc(100% + 0.2em);
	top: 0;
}

.tepQualitiesPanel, .tepPlaybackRatesPanel {
	right: calc(100% + 0.2em);
	bottom: 0;
}

.tepPanel label {
	cursor: pointer;
}

/* Subtitles */
.tepSubtitlesArea {
	text-align: center;
	box-sizing: border-box;
	position: relative;
	pointer-events: none;
}

.tepSubtitlesArea[hidden] {
	display: none !important;
}

.tepSubtitlesArea > div {
	display: inline-block;
	color: var(--te-color);
	background-color: rgba(8, 8, 8, 0.75);
	margin: 0 auto;
	white-space: pre-line;
	padding-inline: .25em;
}

.tePlayer.teAudioType .tepSubtitlesArea {
	width: 30em;
	max-width: 100%;
	min-height: 4em;
	margin-bottom: 0.5em;
	display: flex;
	align-items: center;
}


.tePlayer.teVideoType .tepSubtitlesArea {
	position: absolute;
	inset: auto .4em .4em;
	transition: bottom .4s linear .4s;
	font-size: 1.5em;
}

.tePlayer.teVideoType.teActiveMouse .tepSubtitlesArea {
	bottom: 2em;
}

.tePlayer.teAudioType .tepSubtitlesArea > div {
	background: inherit;
	padding: 0;
	color: inherit;
	text-shadow: none;
}

/* Transcription */
.tepTranscriptArea {
	position: relative;
	background-color: rgba(0, 0, 0, 0.6);
	margin: 0.3em auto 0;
	color: white;
	max-width: 100%;
	overflow: auto;
	transition: height 0.2s ease-in;
	padding: 0.5em 1em;
	height: fit-content;
	max-height: 50vh;
}

.tePlayer.teVideoType .tepTranscriptArea {
	width: 40em;
	box-sizing: border-box;
}

.tepTranscriptArea[hidden] {
	display: block;
	visibility: collapse;
	height: 0;
	width: 0;
	padding: 0;
	margin: 0;
	overflow: hidden;
}

.tepTranscriptTitle {
	all: unset;
	display: block;
	text-align: center;
	font-weight: bold;
	margin-block: 1ex;
}

.tePlayer p.voice {
	font-style: italic;
	margin-top: .5em;
}

.tePlayer .txt_tcLink {
	text-decoration: none;
	color: inherit;
}

.tePlayer .txt_tcLink:hover {
	color: inherit;
	text-decoration: underline;
}

/* Animations */
@keyframes tepSpin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

@keyframes tepBezelFadeout {
	0% {
		opacity: 1;
	}

	to {
		opacity: 0;
		transform: scale(2)
	}
}
