/**
 * DWYT Latest YouTube Video — front-end styles.
 * Scoped under .dwyt-lv to avoid theme collisions.
 */

.dwyt-lv {
	--dwyt-ink: #1a1410;
	--dwyt-muted: #6b5e54;
	--dwyt-paper: #f7f2eb;
	--dwyt-accent: #c43c1a;
	--dwyt-accent-deep: #9a2e12;
	--dwyt-glow: rgba(196, 60, 26, 0.35);
	--dwyt-radius: 14px;
	--dwyt-font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
	--dwyt-font-body: "Source Sans 3", "Segoe UI", sans-serif;

	position: relative;
	isolation: isolate;
	color: var(--dwyt-ink);
	font-family: var(--dwyt-font-body);
	line-height: 1.45;
}

.dwyt-lv__stage {
	position: relative;
	border-radius: var(--dwyt-radius);
	overflow: hidden;
	background:
		radial-gradient(120% 80% at 10% 0%, #2a221c 0%, #120e0c 55%, #0a0807 100%);
	box-shadow:
		0 18px 40px rgba(26, 20, 16, 0.22),
		0 1px 0 rgba(255, 255, 255, 0.08) inset;
	aspect-ratio: 16 / 9;
}

.dwyt-lv__play {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: inherit;
	text-align: left;
	appearance: none;
}

.dwyt-lv__play:focus-visible {
	outline: 2px solid var(--dwyt-accent);
	outline-offset: 3px;
}

.dwyt-lv__thumb-wrap {
	position: absolute;
	inset: 0;
	display: block;
}

.dwyt-lv__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1.02);
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
	filter: saturate(1.05) contrast(1.04);
}

.dwyt-lv__play:hover .dwyt-lv__thumb,
.dwyt-lv__play:focus-visible .dwyt-lv__thumb {
	transform: scale(1.07);
	filter: saturate(1.12) contrast(1.06);
}

.dwyt-lv__shade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(10, 8, 7, 0.08) 0%, rgba(10, 8, 7, 0.15) 45%, rgba(10, 8, 7, 0.55) 100%),
		radial-gradient(60% 50% at 50% 50%, transparent 40%, rgba(10, 8, 7, 0.35) 100%);
	pointer-events: none;
}

.dwyt-lv__pulse {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 72px;
	height: 72px;
	margin: -36px 0 0 -36px;
	border-radius: 50%;
	background: var(--dwyt-glow);
	transform: scale(0.85);
	opacity: 0;
	animation: dwyt-pulse 2.4s ease-out infinite;
	pointer-events: none;
}

.dwyt-lv__btn {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 64px;
	height: 64px;
	margin: -32px 0 0 -32px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	color: #fff;
	background: linear-gradient(145deg, var(--dwyt-accent) 0%, var(--dwyt-accent-deep) 100%);
	box-shadow:
		0 10px 28px rgba(154, 46, 18, 0.45),
		0 0 0 1px rgba(255, 255, 255, 0.18) inset;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
	pointer-events: none;
}

.dwyt-lv__btn svg {
	margin-left: 3px;
}

.dwyt-lv__play:hover .dwyt-lv__btn,
.dwyt-lv__play:focus-visible .dwyt-lv__btn {
	transform: scale(1.08);
	box-shadow:
		0 14px 34px rgba(154, 46, 18, 0.55),
		0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.dwyt-lv__player {
	position: absolute;
	inset: 0;
	background: #000;
}

.dwyt-lv__player iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.dwyt-lv.is-playing .dwyt-lv__play {
	display: none;
}

.dwyt-lv-shortcode {
	max-width: 40rem;
}

.dwyt-lv__heading {
	margin: 0 0 0.75rem;
	font-family: var(--dwyt-font-display, "Fraunces", Georgia, serif);
	font-size: clamp(1.15rem, 2.6vw, 1.45rem);
	font-weight: 650;
	letter-spacing: -0.015em;
	line-height: 1.2;
	color: var(--dwyt-ink, #1a1410);
}

.dwyt-lv__meta {
	padding: 0.95rem 0.15rem 0.15rem;
}

.dwyt-lv__channel {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0 0 0.4rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dwyt-muted);
}

.dwyt-lv__badge {
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: var(--dwyt-accent);
	box-shadow: 0 0 0 3px rgba(196, 60, 26, 0.18);
	flex-shrink: 0;
	animation: dwyt-live 2s ease-in-out infinite;
}

.dwyt-lv__title {
	margin: 0;
	font-family: var(--dwyt-font-display);
	font-size: clamp(1.05rem, 2.4vw, 1.25rem);
	font-weight: 650;
	font-optical-sizing: auto;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.dwyt-lv__title a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0 1px;
	transition: background-size 0.35s ease, color 0.2s ease;
}

.dwyt-lv__title a:hover,
.dwyt-lv__title a:focus-visible {
	background-size: 100% 1px;
	color: var(--dwyt-accent-deep);
}

.dwyt-lv__date {
	margin: 0.45rem 0 0;
	font-size: 0.85rem;
	color: var(--dwyt-muted);
}

.dwyt-lv__error,
.dwyt-lv__admin-hint {
	margin: 0;
	padding: 0.85rem 1rem;
	border-radius: 10px;
	background: var(--dwyt-paper);
	color: var(--dwyt-ink);
	font-size: 0.9rem;
}

.dwyt-lv__error {
	border-left: 3px solid var(--dwyt-accent);
}

@keyframes dwyt-pulse {
	0% {
		transform: scale(0.85);
		opacity: 0.55;
	}
	70% {
		transform: scale(1.55);
		opacity: 0;
	}
	100% {
		transform: scale(1.55);
		opacity: 0;
	}
}

@keyframes dwyt-live {
	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(0.85);
		opacity: 0.65;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dwyt-lv__thumb,
	.dwyt-lv__btn,
	.dwyt-lv__title a {
		transition: none;
	}

	.dwyt-lv__pulse,
	.dwyt-lv__badge {
		animation: none;
	}
}
