/*
 * Hamilton Video Library styles.
 * PERF-003: this file is enqueued only on relevant templates (see
 * frontend/class-assets.php) — never loaded site-wide.
 */

.hvl-carousel-section,
.hvl-archive,
.hvl-single-video {
	--hvl-accent: #c8102e;
	--hvl-dark: #12151a;
	--hvl-muted: #6b7280;
	--hvl-border: #e5e7eb;
	box-sizing: border-box;
}

.hvl-carousel-section *,
.hvl-archive *,
.hvl-single-video * {
	box-sizing: inherit;
}

/* ---------- Carousel (homepage) ---------- */

.hvl-carousel-section {
	max-width: 1200px;
	margin: 4rem auto;
	padding: 0 1.5rem;
}

.hvl-carousel-header {
	text-align: center;
	margin-bottom: 2rem;
}

.hvl-carousel-label {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hvl-accent);
	margin-bottom: 0.5rem;
}

.hvl-carousel-heading {
	font-size: 2rem;
	margin: 0 0 0.5rem;
	color: var(--hvl-dark);
}

.hvl-carousel-subheading {
	color: var(--hvl-muted);
	max-width: 640px;
	margin: 0 auto 1.5rem;
}

.hvl-carousel-controls {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.hvl-carousel-search {
	width: 100%;
	max-width: 360px;
	padding: 0.65rem 1rem;
	border: 1px solid var(--hvl-border);
	border-radius: 999px;
	font-size: 0.95rem;
}

.hvl-carousel-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.hvl-chip {
	border: 1px solid var(--hvl-border);
	background: #fff;
	border-radius: 999px;
	padding: 0.35rem 0.9rem;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.hvl-chip.is-active,
.hvl-chip:hover,
.hvl-chip:focus-visible {
	background: var(--hvl-dark);
	color: #fff;
	border-color: var(--hvl-dark);
}

.hvl-carousel-track {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
	margin-top: 2rem;
}

.hvl-carousel-empty,
.hvl-carousel-no-results,
.hvl-archive-empty {
	text-align: center;
	color: var(--hvl-muted);
	padding: 2rem 0;
}

.hvl-carousel-footer {
	text-align: center;
	margin-top: 2.5rem;
}

.hvl-carousel-cta {
	display: inline-block;
	padding: 0.75rem 1.75rem;
	border-radius: 999px;
	background: var(--hvl-accent);
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	transition: opacity 0.15s ease;
}

.hvl-carousel-cta:hover {
	opacity: 0.85;
}

/* ---------- Cards (shared between carousel + archive) ---------- */

.hvl-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--hvl-border);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.hvl-card:hover,
.hvl-card:focus-visible {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.hvl-card-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: #111;
	overflow: hidden;
}

.hvl-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hvl-card-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	pointer-events: none;
}

.hvl-card-duration {
	position: absolute;
	right: 0.5rem;
	bottom: 0.5rem;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 0.75rem;
	padding: 0.15rem 0.45rem;
	border-radius: 4px;
}

.hvl-card-body {
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.hvl-card-category {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--hvl-accent);
}

.hvl-card-title {
	font-weight: 600;
	color: var(--hvl-dark);
}

.hvl-card-summary {
	font-size: 0.85rem;
	color: var(--hvl-muted);
}

/* ---------- Archive page ---------- */

.hvl-archive {
	max-width: 1200px;
	margin: 3rem auto;
	padding: 0 1.5rem;
}

.hvl-archive-header {
	text-align: center;
	margin-bottom: 2rem;
}

.hvl-archive-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
	margin-bottom: 2.5rem;
}

.hvl-archive-filters input,
.hvl-archive-filters select {
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--hvl-border);
	border-radius: 8px;
}

.hvl-archive-filter-submit {
	padding: 0.55rem 1.25rem;
	border-radius: 8px;
	border: none;
	background: var(--hvl-dark);
	color: #fff;
	cursor: pointer;
}

.hvl-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
}

.hvl-archive-pagination {
	margin-top: 2.5rem;
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

/* ---------- Single video page ---------- */

.hvl-single-video.hvl-premium-video {
	max-width: none;
	margin: 0;
	padding: 0;
	background:
		radial-gradient(circle at top left, rgba(200, 16, 46, 0.07), transparent 32rem),
		linear-gradient(180deg, #f7f7f8 0%, #ffffff 34rem);
	color: var(--hvl-dark);
}

.hvl-video-shell {
	max-width: 1040px;
	margin: 0 auto;
	padding: 2rem 1.5rem 4.5rem;
}

.hvl-back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 1.25rem;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--hvl-accent);
	text-decoration: none;
}

.hvl-back-link:hover,
.hvl-back-link:focus-visible {
	text-decoration: underline;
}

.hvl-hero-video {
	display: block;
}

.hvl-hero-player-card,
.hvl-video-intro,
.hvl-premium-section {
	border: 1px solid rgba(18, 21, 26, 0.08);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 18px 48px rgba(18, 21, 26, 0.08);
}

.hvl-hero-player-card {
	overflow: hidden;
	background: #050505;
	max-width: min(860px, 100%);
	margin: 0 auto 1.5rem;
}

.hvl-player-wrap.hvl-player-premium {
	margin: 0;
	border-radius: 0;
	background: #000;
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: min(72vh, 484px);
	overflow: hidden;
}

/* Hard 16:9 fallback for themes/browsers that ignore aspect-ratio or force
 * video height:auto. This keeps the player YouTube-shaped instead of letting
 * the raw uploaded video dimensions stretch the page.
 */
.hvl-player-wrap.hvl-player-premium::before {
	content: '';
	display: block;
	padding-top: 56.25%;
}

.hvl-player-wrap.hvl-player-premium video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	max-height: none;
	background: #000;
	object-fit: contain;
}

.hvl-player-wrap.hvl-player-premium:fullscreen,
.hvl-player-wrap.hvl-player-premium:-webkit-full-screen {
	max-height: none;
	height: 100vh;
}

.hvl-player-wrap.hvl-player-premium:fullscreen video,
.hvl-player-wrap.hvl-player-premium:-webkit-full-screen video {
	object-fit: contain;
}


.hvl-fullscreen-play {
	appearance: none;
	-webkit-appearance: none;
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.85rem;
	width: 100%;
	height: 100%;
	border: 0;
	background: radial-gradient(circle, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.58));
	color: #fff;
	cursor: pointer;
	z-index: 20;
	transition: opacity 180ms ease, visibility 180ms ease;
}

.hvl-fullscreen-play.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.hvl-fullscreen-play-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 5.5rem;
	height: 5.5rem;
	border-radius: 999px;
	background: var(--hvl-accent);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
	font-size: 2rem;
	line-height: 1;
	padding-left: 0.25rem;
}

.hvl-fullscreen-play-text {
	display: inline-flex;
	align-items: center;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	padding: 0.5rem 0.9rem;
	background: rgba(0, 0, 0, 0.45);
	font-size: 0.85rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.hvl-fullscreen-play:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
}

.hvl-player-missing {
	min-height: 320px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
}

.hvl-video-intro {
	padding: 1.75rem;
	max-width: 860px;
	margin: 0 auto;
}

.hvl-video-kicker,
.hvl-section-label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hvl-accent);
}

.hvl-video-kicker::before,
.hvl-section-label::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: var(--hvl-accent);
	box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.12);
}

.hvl-video-intro h1 {
	font-size: clamp(2rem, 4vw, 3.7rem);
	line-height: 0.98;
	letter-spacing: -0.04em;
	margin: 0.85rem 0 1rem;
	color: #111318;
}

.hvl-video-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}

.hvl-video-meta span {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--hvl-border);
	border-radius: 999px;
	padding: 0.35rem 0.7rem;
	font-size: 0.82rem;
	font-weight: 700;
	color: #4b5563;
	background: #fff;
}

.hvl-summary-card {
	border-top: 1px solid var(--hvl-border);
	padding-top: 1.25rem;
}

.hvl-summary-card h2 {
	font-size: 1rem;
	margin: 0 0 0.45rem;
	color: #111318;
}

.hvl-summary-card p {
	margin: 0;
	color: #5b6472;
	line-height: 1.7;
}

.hvl-premium-section {
	margin: 2rem 0 0;
	padding: 1.75rem;
}

.hvl-section-heading-row {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 1rem;
	margin-bottom: 1.35rem;
}

.hvl-section-heading-row h2,
.hvl-related-products h2,
.hvl-related-videos h2 {
	font-size: clamp(1.5rem, 2.5vw, 2.2rem);
	line-height: 1.1;
	letter-spacing: -0.03em;
	margin: 0.35rem 0 0;
	color: #111318;
}

.hvl-related-products-grid.hvl-product-grid-premium {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem;
}

.hvl-related-product.hvl-product-card-premium {
	text-align: left;
	border: 1px solid var(--hvl-border);
	border-radius: 16px;
	padding: 1rem;
	background: linear-gradient(180deg, #fff, #fafafa);
	box-shadow: none;
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hvl-related-product.hvl-product-card-premium:hover,
.hvl-related-product.hvl-product-card-premium:focus-visible {
	border-color: rgba(200, 16, 46, 0.35);
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(18, 21, 26, 0.08);
}

.hvl-product-image-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	background: #f4f5f6;
	margin-bottom: 0.85rem;
	overflow: hidden;
}

.hvl-product-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.hvl-related-product-title {
	font-weight: 800;
	line-height: 1.25;
	color: #171a20;
}

.hvl-related-product-price {
	font-weight: 700;
	color: #6b7280;
}

.hvl-product-card-cta {
	margin-top: 0.25rem;
	font-size: 0.85rem;
	font-weight: 800;
	color: var(--hvl-accent);
}

.hvl-related-video-grid {
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.hvl-single-content {
	line-height: 1.75;
	color: #4b5563;
}

.hvl-transcript details {
	border: 1px solid var(--hvl-border);
	border-radius: 16px;
	background: #fff;
	overflow: hidden;
}

.hvl-transcript summary {
	cursor: pointer;
	font-weight: 900;
	font-size: 1.05rem;
	padding: 1rem 1.15rem;
	color: #111318;
	list-style-position: inside;
}

.hvl-transcript-body {
	border-top: 1px solid var(--hvl-border);
	padding: 1.25rem;
	color: #5b6472;
	line-height: 1.8;
	max-height: 520px;
	overflow: auto;
}

@media (max-width: 980px) {
	.hvl-hero-player-card,
	.hvl-video-intro {
		max-width: 100%;
	}
}

@media (max-width: 640px) {
	.hvl-video-shell {
		padding: 1rem 1rem 3rem;
	}

	.hvl-video-intro,
	.hvl-premium-section {
		padding: 1.15rem;
		border-radius: 16px;
	}

	.hvl-related-products-grid.hvl-product-grid-premium,
	.hvl-related-video-grid {
		grid-template-columns: 1fr;
	}

	.hvl-video-meta span {
		font-size: 0.78rem;
	}
}

/* ---------- Admin ---------- */

.hvl-fields textarea {
	width: 100%;
}

.hvl-product-picker {
	position: relative;
	max-width: 480px;
}

.hvl-product-picker-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}

.hvl-product-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	background: #f0f0f1;
	border: 1px solid #dcdcde;
	border-radius: 999px;
	padding: 0.25rem 0.6rem;
	font-size: 0.85rem;
}

.hvl-product-chip-remove {
	border: none;
	background: transparent;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	color: #6b7280;
	padding: 0;
}

.hvl-product-chip-remove:hover {
	color: #d63638;
}

#hvl_related_products_search {
	width: 100%;
}

.hvl-product-picker-results {
	position: absolute;
	z-index: 10;
	top: 100%;
	left: 0;
	right: 0;
	margin: 0.25rem 0 0;
	padding: 0.25rem 0;
	list-style: none;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	max-height: 220px;
	overflow-y: auto;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hvl-product-picker-results li {
	padding: 0.45rem 0.75rem;
	cursor: pointer;
	font-size: 0.9rem;
}

.hvl-product-picker-results li:hover,
.hvl-product-picker-results li:focus {
	background: #f0f0f1;
}
