/*
 * How-to video tiles and the inline player, on public pages.
 *
 * Used by /my-account/, /guides/<slug>/ and the wwh/help-videos block, all in
 * waterwheel-core, through wwh_help_video_tiles_html() / _inline_html(). The
 * pop-up player styles itself (help-videos.php), since wp-admin uses it too.
 *
 * Theme tokens, with fallbacks so the tiles still read on a theme without them.
 */

.wwh-vtiles {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wwh-vtile {
	margin: 0;
}

.wwh-vtile__btn {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.wwh-vtile__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var( --wp--preset--color--warm-obsidian, #1d1b18 );
}

.wwh-vtile__media img,
.wwh-vtile__media video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wwh-vtile__play {
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.7 );
	box-shadow: 0 0 0 2px rgba( 255, 255, 255, 0.8 );
	transition: background-color 0.15s ease;
}

.wwh-vtile__play::after {
	content: "";
	position: absolute;
	left: 19px;
	top: 14px;
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent #fff;
}

.wwh-vtile__btn:hover .wwh-vtile__play,
.wwh-vtile__btn:focus-visible .wwh-vtile__play {
	background: var( --wp--preset--color--ink-primary, #1d2327 );
}

.wwh-vtile__btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.wwh-vtile__title {
	font-family: var( --wp--preset--font-family--ui, inherit );
	font-weight: 600;
	line-height: 1.3;
}

.wwh-vtile__btn:hover .wwh-vtile__title {
	text-decoration: underline;
}

.wwh-vtile__len {
	font-size: var( --wp--preset--font-size--cap, 0.8rem );
	color: var( --wp--preset--color--ink-caption, #5f5a53 );
}

/* Inline player (/guides/<slug>/). */
.wwh-vinline {
	margin: 0 0 32px;
}

.wwh-vinline video,
.wwh-vinline iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
	background: #000;
}

.wwh-vinline figcaption {
	margin-top: 8px;
	font-family: var( --wp--preset--font-family--ui, inherit );
	font-size: var( --wp--preset--font-size--cap, 0.8rem );
	color: var( --wp--preset--color--ink-caption, #5f5a53 );
}

@media ( prefers-reduced-motion: reduce ) {
	.wwh-vtile__play {
		transition: none;
	}
}
