/**
 * YouTube Latest Videos — front-end styles.
 * Vanilla CSS, no framework dependencies.
 */

.ylv-container {
	--ylv-radius: 14px;
	--ylv-thumb-radius: 8px;
	--ylv-text: #0f0f0f;
	--ylv-muted: #757575;
	--ylv-border: #ececec;
	--ylv-card-bg: #ffffff;
	--ylv-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
	--ylv-accent: #1a73e8;
	--ylv-accent-hover: #1558b0;
	--ylv-thumb-width: 118px;
	--ylv-thumb-height: 66px;

	max-width: 420px;
	margin: 0 auto;
	background: var(--ylv-card-bg);
	border: 1px solid var(--ylv-border);
	border-radius: var(--ylv-radius);
	box-shadow: var(--ylv-shadow);
	padding: 8px 18px;
	font-family: "Roboto", "Segoe UI", Arial, sans-serif;
	box-sizing: border-box;
}

.ylv-container *,
.ylv-container *::before,
.ylv-container *::after {
	box-sizing: border-box;
}

.ylv-video-list {
	display: flex;
	flex-direction: column;
}

.ylv-video-item {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	color: inherit;
	padding: 14px 0;
	border-bottom: 1px solid var(--ylv-border);
	transition: opacity 0.15s ease;
}

.ylv-video-list .ylv-video-item:last-child {
	border-bottom: none;
}

.ylv-video-item:hover,
.ylv-video-item:focus-visible {
	opacity: 0.82;
}

.ylv-thumbnail {
	position: relative;
	flex: 0 0 var(--ylv-thumb-width);
	width: var(--ylv-thumb-width);
	height: var(--ylv-thumb-height);
	border-radius: var(--ylv-thumb-radius);
	overflow: hidden;
	background: #000;
}

.ylv-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ylv-duration {
	position: absolute;
	right: 5px;
	bottom: 5px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	padding: 3px 5px;
	border-radius: 4px;
	letter-spacing: 0.2px;
}

.ylv-content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	min-width: 0;
}

.ylv-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--ylv-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ylv-time {
	font-size: 12.5px;
	color: var(--ylv-muted);
}

.ylv-view-all {
	text-align: center;
	padding: 14px 0 10px;
}

.ylv-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	color: var(--ylv-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	padding: 0;
	border-radius: 0;
	box-shadow: none;
	transition: color 0.15s ease;
}

.ylv-button:hover,
.ylv-button:focus-visible {
	color: var(--ylv-accent-hover);
	text-decoration: underline;
}

.ylv-error {
	background: #fdecea;
	border: 1px solid #f5c2c0;
	color: #611a15;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	margin: 8px 0;
}

.ylv-empty {
	color: var(--ylv-muted);
	font-size: 14px;
	text-align: center;
	padding: 16px 0;
}

/* ---------------------------------------------------------------- */
/* Responsive: when the container itself is placed full-width (e.g. */
/* inside page content on a phone), stack thumbnail above content.  */
/* ---------------------------------------------------------------- */
@media (max-width: 420px) {
	.ylv-container {
		max-width: 100%;
		padding: 8px 14px;
	}

	.ylv-video-item {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 14px 0;
	}

	.ylv-thumbnail {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
	}

	.ylv-title {
		font-size: 15px;
	}
}
