.youtube-video__preview {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-position: center;
	background-size: cover;
	display: grid;
	place-items: center;
	padding: 1rem;
	isolation: isolate;
}

.youtube-video__play {
	display: grid;
	place-items: center;
	width: min(8rem, 50%, 20vw);
	aspect-ratio: 1 / 1;
	padding: 0;
	background: rgba(0, 0, 0, 0.2);
	backdrop-filter: blur(4px);
	box-shadow: none;
	border: none;
	cursor: pointer;
	border-radius: 9999px;
	color: #fff;
	transition: color, background 0.2s ease-in-out;
}

.youtube-video__play:hover,
.youtube-video__play:focus-visible {
	background: var(--primary-color-contrast);
	color: var(--primary-color);
}

.youtube-video__play svg {
	height: 70%;
	width: 70%;
	color: currentColor;
	margin-left: 10%;
}

/**
 * Dialog
 */
.youtube-video__dialog {
	background: none;
	border: none;
	width: 100%;
	max-width: 750px;
	overflow-y: hidden;
}

/**
Media Query Calculations:
<video width> * (9/16) + 60px
Example:
1000 * (9/16) + 60px = 585px
 */

@media (min-height: 590px) {
	.youtube-video__dialog {
		max-width: 1000px;
	}
}

@media (min-height: 740px) {
	.youtube-video__dialog {
		max-width: 1200px;
	}
}

@media (min-height: 850px) {
	.youtube-video__dialog {
		max-width: 1400px;
	}
}

@media (min-height: 960px) {
	.youtube-video__dialog {
		max-width: 1600px;
	}
}

.youtube-video__dialog::backdrop {
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
}

.youtube-video__dialog__close {
	height: 3rem;
	width: 3rem;
	display: grid;
	place-items: center;
	margin-bottom: 1rem;
	color: #fff;
	border: none;
	box-shadow: none;
	background: none;
	cursor: pointer;
	padding: 0;
	margin-left: auto;
}

.youtube-video__dialog__close:hover,
.youtube-video__dialog__close:focus-visible {
	color: var(--primary-color);
}

.youtube-video__dialog__content {
	width: 100%;
	aspect-ratio: 16 / 9;
}

.youtube-video__dialog__content__video {
	width: 100%;
	height: 100%;
	border: none;
	padding: 0;
}

/**
 * Gutenberg
 */
.youtube-video__input {
	background: #fff;
	padding: 2rem;
	border-radius: 0.5rem;
	box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.5);
	width: 100%;
	max-width: 640px;
}

.youtube-video__input label span {
	display: block;
	margin-bottom: 0.5rem;
}

.youtube-video__input label input {
	display: block;
	width: 100%;
}

.youtube-video--editor .youtube-video__preview::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	/*background: linear-gradient(rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.6) 100%) repeat;*/
	/*background-size: 100% 20px;*/
	background: radial-gradient(rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.2) 50%);
}

.youtube-video--editor .youtube-video__error {
	color: red;
	font-weight: bold;
}

.youtube-video--editor .youtube-video__input button {
	margin-top: 1rem;
	border: none;
	background: var(--primary-color);
	color: var(--primary-color-contrast);
	padding: 0.5rem 1rem;
	border-radius: 0.25rem;
	font-weight: normal;
	box-shadow: none;
}

.youtube-video--editor .youtube-video__input button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.youtube-video--editor .youtube-video__input button::before,
.youtube-video--editor .youtube-video__input button::after {
	display: none;
}

.youtube-video__privacy {
	position: absolute;
	bottom: 0;
	background: rgba(0, 0, 0, 0.2);
	color: #fff;
	backdrop-filter: blur(4px);
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	padding: 12px 8px;
	text-align: center;
}

.youtube-video__privacy a {
	color: #fff;
	text-decoration: underline;
}

@media(max-width: 420px) {
	.youtube-video__privacy {
		font-size: 0.8rem;
	}
}
