/* ==========================================================================
   CreativeAlys Recent Videos for YouTube — Front-end styles
   ========================================================================== */

.ytrv-wrapper {
	margin: 24px 0;
}

.ytrv-heading {
	margin: 0 0 18px;
	font-size: 22px;
	font-weight: 700;
}

.ytrv-grid {
	display: grid;
	grid-template-columns: repeat(var(--ytrv-columns, 3), 1fr);
	gap: 24px;
}

.ytrv-video-card {
	display: block;
	text-decoration: none;
	color: inherit;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ytrv-video-card:hover,
.ytrv-video-card:focus {
	transform: translateY(-4px);
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
	text-decoration: none !important;
}

/* Thumbnail + hover overlay ------------------------------------------------ */

.ytrv-thumb-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

.ytrv-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.ytrv-video-card:hover .ytrv-thumb-wrap img,
.ytrv-video-card:focus .ytrv-thumb-wrap img {
	transform: scale(1.08);
	filter: brightness(0.55);
}

/* Play button ---------------------------------------------------------- */

.ytrv-play-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.8);
	width: 68px;
	height: 48px;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
	pointer-events: none;
}

.ytrv-video-card:hover .ytrv-play-button,
.ytrv-video-card:focus .ytrv-play-button {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.ytrv-play-bg {
	fill: #ff0000;
}

.ytrv-play-triangle {
	fill: #ffffff;
}

/* Title + meta ------------------------------------------------------------------ */

.ytrv-title {
	margin: 0;
	padding: 14px 16px 4px;
	font-size: 16px;
	line-height: 1.4;
	font-weight: 600;
	color: #1a1a1a;

	/* Clamp long titles to 2 lines */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ytrv-video-card:hover .ytrv-title,
.ytrv-video-card:focus .ytrv-title {
	color: #ff0000;
	text-decoration: none;
}

.ytrv-meta {
	margin: 0;
	padding: 4px 16px 16px;
	font-size: 13px;
	color: #6b6b6b;
}

/* View all button ---------------------------------------------------------- */

.ytrv-view-all-wrap {
	display: flex;
	justify-content: center;
	margin-top: 28px;
}

.ytrv-view-all-btn {
	display: inline-block;
	padding: 12px 28px;
	background: #ff0000;
	color: #ffffff;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	border-radius: 999px;
	transition: background 0.2s ease, transform 0.2s ease;
}

.ytrv-view-all-btn:hover,
.ytrv-view-all-btn:focus {
	background: #cc0000;
	transform: translateY(-2px);
	color: #ffffff;
	text-decoration: none !important;
}

/* Admin-facing error message (only visible to logged-in admins) ---------- */

.ytrv-error {
	padding: 12px 16px;
	background: #fff3f3;
	border-left: 4px solid #ff0000;
	color: #900;
	font-size: 14px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.ytrv-grid {
		grid-template-columns: repeat(min(var(--ytrv-columns, 3), 2), 1fr);
		gap: 18px;
	}
}

@media (max-width: 600px) {
	.ytrv-grid {
		grid-template-columns: 1fr !important;
		gap: 16px;
	}

	/* No hover on touch devices — keep the play button visible */
	.ytrv-play-button {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
}
