/**
 * Client Video Hub: frontend styles.
 *
 * Every selector is scoped to .cvh-video-hub so nothing on the rest of the site changes.
 * Fonts and text colours are inherited from the theme (Divi). Adjust the look with the
 * custom properties below, e.g. in Divi > Theme Options > Custom CSS:
 *   .cvh-video-hub { --cvh-accent-color: #7214b6; }
 */

.cvh-video-hub {
	--cvh-accent-color: #7214b6;       /* Kilifi Creek purple */
	--cvh-accent-dark: #31094e;        /* hover / deep purple */
	--cvh-accent-contrast: #ffffff;
	--cvh-gradient: linear-gradient(90deg, #7214b6 0%, #480d74 45%, #050108 100%); /* brand purple-to-black */
	--cvh-badge-gradient: linear-gradient(135deg, #7214b6 0%, #480d74 100%);
	--cvh-rule-color: rgba(49, 9, 78, 0.16);
	--cvh-tint: rgba(114, 20, 182, 0.06);
	--cvh-media-bg: #1a0629;
	--cvh-focus-color: #1a1a1a;
	--cvh-card-radius: 4px;
	--cvh-card-gap: 36px;
	--cvh-section-gap: 80px;
	--cvh-series-gap: 56px;
	--cvh-content-width: 1080px;
	--cvh-text-width: 720px;
	--cvh-scroll-offset: 120px;

	position: relative;
	display: block;
	width: 100%;
	color: inherit;
	font-family: inherit;
	line-height: 1.6;
	text-align: left;
	scroll-margin-top: var(--cvh-scroll-offset);
}

.cvh-video-hub *,
.cvh-video-hub *::before,
.cvh-video-hub *::after {
	box-sizing: border-box;
}

.cvh-video-hub .cvh-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.cvh-video-hub a:focus-visible,
.cvh-video-hub button:focus-visible,
.cvh-video-hub input:focus-visible {
	outline: 3px solid var(--cvh-focus-color);
	outline-offset: 2px;
}

/* ---------- Page wrappers (plugin templates only) ---------- */

.cvh-video-hub.cvh-page {
	padding-bottom: 80px;
}

.cvh-site-main > .cvh-video-hub.cvh-page {
	max-width: var(--cvh-content-width);
	margin: 0 auto;
	padding: 48px 20px 80px;
}

/* ---------- Breadcrumbs ---------- */

.cvh-video-hub .cvh-breadcrumbs {
	margin: 0 0 28px;
}

.cvh-video-hub .cvh-breadcrumbs-list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 0;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	line-height: 1.5;
}

.cvh-video-hub .cvh-breadcrumbs-item {
	margin: 0;
	padding: 0;
}

.cvh-video-hub .cvh-breadcrumbs-item + .cvh-breadcrumbs-item::before {
	content: "/";
	margin: 0 10px;
	color: var(--cvh-rule-color);
	font-weight: 700;
}

.cvh-video-hub .cvh-breadcrumbs a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--cvh-rule-color);
	text-underline-offset: 3px;
}

.cvh-video-hub .cvh-breadcrumbs a:hover {
	text-decoration-color: var(--cvh-accent-color);
}

/* ---------- Library header ---------- */

.cvh-video-hub .cvh-library-header {
	max-width: var(--cvh-text-width);
	margin: 0 0 36px;
}

.cvh-video-hub .cvh-eyebrow {
	margin: 0 0 8px;
	padding: 0;
	color: var(--cvh-accent-color);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
}

.cvh-video-hub .cvh-eyebrow a {
	color: inherit;
	text-decoration: none;
}

.cvh-video-hub .cvh-eyebrow a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cvh-video-hub .cvh-library-title {
	margin: 0 0 14px;
	padding: 0;
	font-size: clamp(34px, 4vw, 56px);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.cvh-video-hub .cvh-library-intro {
	font-size: 1.15em;
	font-style: italic;
	font-weight: 600;
	line-height: 1.6;
}

.cvh-video-hub .cvh-library-intro p {
	margin: 0 0 0.75em;
	padding: 0;
}

.cvh-video-hub .cvh-library-intro p:last-child {
	margin-bottom: 0;
}

/* ---------- Toolbar: category filter + search ---------- */

.cvh-video-hub .cvh-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px 32px;
	margin: 0 0 48px;
	border-bottom: 1px solid var(--cvh-rule-color);
}

.cvh-video-hub .cvh-video-filter {
	flex: 1 1 auto;
	min-width: 0;
}

.cvh-video-hub .cvh-filter-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 28px;
}

.cvh-video-hub .cvh-filter-link {
	display: inline-block;
	margin: 0 0 -1px;
	padding: 10px 0 14px;
	border-bottom: 3px solid transparent;
	color: inherit;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.cvh-video-hub .cvh-filter-link:hover {
	border-bottom-color: var(--cvh-rule-color);
}

.cvh-video-hub .cvh-filter-link.is-active {
	border-bottom-color: var(--cvh-accent-color);
	color: var(--cvh-accent-color);
}

.cvh-video-hub .cvh-search {
	display: flex;
	flex: 0 1 360px;
	gap: 8px;
	margin: 0 0 14px;
	padding: 0;
}

.cvh-video-hub .cvh-search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--cvh-rule-color);
	border-radius: var(--cvh-card-radius);
	background: #fff;
	color: #222;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.2;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.cvh-video-hub .cvh-search-input:focus {
	border-color: var(--cvh-accent-color);
}

.cvh-video-hub .cvh-search-button,
.cvh-video-hub .cvh-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	border: 0;
	border-radius: var(--cvh-card-radius);
	background: var(--cvh-accent-color);
	color: var(--cvh-accent-contrast);
	font-family: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 150ms ease, box-shadow 150ms ease;
}

.cvh-video-hub .cvh-search-button {
	height: 46px;
	padding: 0 20px;
	font-size: 15px;
}

.cvh-video-hub .cvh-search-button:hover,
.cvh-video-hub .cvh-button:hover {
	background: var(--cvh-accent-dark);
	color: var(--cvh-accent-contrast);
}

/* ---------- Search status + empty states ---------- */

.cvh-video-hub .cvh-results-status {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 18px;
	margin: -24px 0 40px;
	outline: none;
}

.cvh-video-hub .cvh-results-status p {
	margin: 0;
	padding: 0;
	font-weight: 600;
}

.cvh-video-hub .cvh-clear-search {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cvh-video-hub .cvh-empty {
	padding: 56px 24px;
	border-top: 4px solid transparent;
	border-image: var(--cvh-gradient) 1;
	background: var(--cvh-tint);
	text-align: center;
}

.cvh-video-hub .cvh-empty p {
	margin: 0;
	padding: 0;
	font-size: 18px;
	font-weight: 600;
}

/* ---------- Category and series grouping ---------- */

.cvh-video-hub .cvh-category-section + .cvh-category-section {
	margin-top: var(--cvh-section-gap);
}

.cvh-video-hub .cvh-category-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 24px;
	position: relative;
	margin: 0 0 32px;
	padding: 0 0 14px;
}

.cvh-video-hub .cvh-category-header::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 4px;
	background: var(--cvh-gradient);
}

.cvh-video-hub .cvh-category-title {
	margin: 0;
	padding: 0;
	font-size: clamp(28px, 3vw, 40px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.cvh-video-hub .cvh-category-title a {
	color: inherit;
	text-decoration: none;
}

.cvh-video-hub .cvh-category-title a:hover {
	color: var(--cvh-accent-color);
}

.cvh-video-hub .cvh-category-count,
.cvh-video-hub .cvh-series-count {
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

.cvh-video-hub .cvh-video-series + .cvh-video-series {
	margin-top: var(--cvh-series-gap);
}

.cvh-video-hub .cvh-series-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 16px;
	margin: 0 0 22px;
}

.cvh-video-hub .cvh-series-title {
	margin: 0;
	padding: 0;
	font-size: clamp(20px, 2vw, 25px);
	line-height: 1.25;
}

.cvh-video-hub .cvh-series-title a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--cvh-rule-color);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.cvh-video-hub .cvh-series-title a:hover {
	text-decoration-color: var(--cvh-accent-color);
}

.cvh-video-hub .cvh-series-header .cvh-series-count {
	color: var(--cvh-accent-color);
}

.cvh-video-hub .cvh-series-description {
	max-width: var(--cvh-text-width);
	margin: -10px 0 24px;
	padding: 0;
}

/* ---------- Grid ---------- */

.cvh-video-hub .cvh-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--cvh-card-gap) calc(var(--cvh-card-gap) * 0.8);
	margin: 0;
	padding: 0;
}

.cvh-video-hub .cvh-grid.cvh-cols-1 {
	grid-template-columns: minmax(0, 1fr);
}

.cvh-video-hub .cvh-grid.cvh-cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cvh-video-hub .cvh-grid.cvh-cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cvh-video-hub .cvh-grid-item {
	display: flex;
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* ---------- Card ---------- */

.cvh-video-hub .cvh-video-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	margin: 0;
	padding: 0;
}

.cvh-video-hub .cvh-card-media {
	position: relative;
	margin: 0 0 16px;
	overflow: hidden;
	border-radius: var(--cvh-card-radius);
	background: var(--cvh-media-bg);
	aspect-ratio: 16 / 9;
}

@supports not (aspect-ratio: 16 / 9) {
	.cvh-video-hub .cvh-card-media {
		height: 0;
		padding-top: 56.25%;
	}
}

.cvh-video-hub .cvh-card-media .cvh-thumb-img,
.cvh-video-hub .cvh-card-media .cvh-thumb-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	object-fit: cover;
	color: transparent; /* hides alt text if an image ever fails to load */
	transition: transform 300ms ease;
}

.cvh-video-hub .cvh-card-media .cvh-thumb-placeholder {
	background: linear-gradient(135deg, var(--cvh-media-bg), var(--cvh-accent-color));
}

.cvh-video-hub .cvh-video-card:hover .cvh-thumb-img {
	transform: scale(1.03);
}

.cvh-video-hub .cvh-card-play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border-radius: 50%;
	background: rgba(20, 14, 11, 0.62);
	color: #fff;
	pointer-events: none;
	transition: background-color 150ms ease;
}

.cvh-video-hub .cvh-card-play svg {
	width: 22px;
	height: 22px;
	margin-left: 3px;
	fill: currentColor;
}

.cvh-video-hub .cvh-video-card:hover .cvh-card-play {
	background: var(--cvh-accent-color);
}

/* The part number: the one bold element. Parts are a real sequence, so the number earns its size. */
.cvh-video-hub .cvh-card-part {
	position: absolute;
	bottom: 0;
	left: 0;
	min-width: 52px;
	padding: 8px 14px 6px;
	border-top-right-radius: var(--cvh-card-radius);
	background: var(--cvh-badge-gradient);
	color: var(--cvh-accent-contrast);
	font-size: 30px;
	font-weight: 800;
	line-height: 1;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.cvh-video-hub .cvh-card-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 3px 9px;
	border-radius: 3px;
	background: rgba(20, 14, 11, 0.78);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}

.cvh-video-hub .cvh-card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

.cvh-video-hub .cvh-card-meta {
	margin: 0 0 6px;
	padding: 0;
	font-size: 14px;
	line-height: 1.45;
}

.cvh-video-hub .cvh-card-category {
	color: var(--cvh-accent-color);
	font-weight: 700;
}

.cvh-video-hub .cvh-card-category + .cvh-card-series::before {
	content: " / ";
	color: var(--cvh-rule-color);
	font-weight: 700;
}

.cvh-video-hub .cvh-card-title {
	margin: 0 0 8px;
	padding: 0;
	color: inherit;
	font-size: 19px;
	line-height: 1.35;
}

.cvh-video-hub .cvh-card-link {
	color: inherit;
	text-decoration: none;
}

/* Whole card is clickable through the title link (one link for screen readers). */
.cvh-video-hub .cvh-card-link::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
}

.cvh-video-hub .cvh-card-link:hover {
	text-decoration: underline;
	text-decoration-color: var(--cvh-accent-color);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.cvh-video-hub .cvh-card-link:focus,
.cvh-video-hub .cvh-card-link:focus-visible {
	outline: none;
}

.cvh-video-hub .cvh-card-link:focus-visible::after {
	outline: 3px solid var(--cvh-focus-color);
	outline-offset: 4px;
}

.cvh-video-hub .cvh-card-excerpt {
	margin: 0 0 16px;
	padding: 0;
	font-size: 15px;
	line-height: 1.6;
}

.cvh-video-hub .cvh-card-actions {
	margin-top: auto;
}

.cvh-video-hub .cvh-button {
	position: relative;
	z-index: 2;
	min-height: 42px;
	padding: 10px 18px;
	font-size: 15px;
}

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

.cvh-video-hub .cvh-single-header {
	max-width: 880px;
	margin: 0 0 28px;
}

.cvh-video-hub .cvh-single-context {
	margin: 0 0 10px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}

.cvh-video-hub .cvh-single-context a {
	color: var(--cvh-accent-color);
	text-decoration: none;
}

.cvh-video-hub .cvh-single-context a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cvh-video-hub .cvh-single-category + .cvh-single-series::before {
	content: " / ";
	color: var(--cvh-rule-color);
}

.cvh-video-hub .cvh-single-title {
	margin: 0 0 12px;
	padding: 0;
	font-size: clamp(30px, 3.6vw, 48px);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.cvh-video-hub .cvh-single-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin: 0;
	padding: 0;
	font-size: 15px;
}

.cvh-video-hub .cvh-single-part {
	padding: 3px 10px;
	border-radius: 3px;
	background: var(--cvh-accent-color);
	color: var(--cvh-accent-contrast);
	font-weight: 700;
}

.cvh-video-hub .cvh-player {
	margin: 0 0 48px;
}

.cvh-video-hub .cvh-player-frame {
	position: relative;
	width: 100%;
	height: 0;
	padding-top: 56.25%;
	overflow: hidden;
	border-radius: var(--cvh-card-radius);
	background: #000;
}

.cvh-video-hub .cvh-player-frame iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border: 0;
}

/* YouTube Shorts: portrait player, centred, never taller than the screen. */
.cvh-video-hub .cvh-player--short {
	width: 100%;
	max-width: min(360px, calc((100vh - 160px) * 0.5625));
	margin-right: auto;
	margin-left: auto;
}

.cvh-video-hub .cvh-player--short .cvh-player-frame {
	padding-top: 177.7778%;
}

.cvh-video-hub .cvh-single-body {
	max-width: var(--cvh-text-width);
	margin: 0 0 48px;
}

.cvh-video-hub .cvh-section-title {
	margin: 0 0 18px;
	padding: 0;
	font-size: 24px;
	line-height: 1.3;
}

.cvh-video-hub .cvh-description {
	font-size: 1.08em;
	line-height: 1.75;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.cvh-video-hub .cvh-description p {
	margin: 0 0 1.1em;
	padding: 0;
}

.cvh-video-hub .cvh-description ul,
.cvh-video-hub .cvh-description ol {
	margin: 0 0 1.1em 1.4em;
	padding: 0;
}

.cvh-video-hub .cvh-description ul {
	list-style: disc;
}

.cvh-video-hub .cvh-description ol {
	list-style: decimal;
}

.cvh-video-hub .cvh-description li {
	margin: 0 0 0.4em;
	padding: 0;
}

.cvh-video-hub .cvh-description a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cvh-video-hub .cvh-description img {
	max-width: 100%;
	height: auto;
}

.cvh-video-hub .cvh-series-nav {
	margin: 0 0 64px;
	padding: 24px;
	border-top: 4px solid transparent;
	border-image: var(--cvh-gradient) 1;
	background: var(--cvh-tint);
}

.cvh-video-hub .cvh-series-nav-label {
	margin: 0 0 16px;
	padding: 0;
	font-weight: 600;
}

.cvh-video-hub .cvh-series-nav-label a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cvh-video-hub .cvh-series-nav-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.cvh-video-hub .cvh-series-nav-link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px;
	border: 1px solid var(--cvh-rule-color);
	border-radius: var(--cvh-card-radius);
	background: #fff;
	color: #222;
	text-decoration: none;
}

.cvh-video-hub .cvh-series-nav-link:hover {
	border-color: var(--cvh-accent-color);
}

.cvh-video-hub .cvh-series-nav-link--next {
	grid-column: 2;
	text-align: right;
}

.cvh-video-hub .cvh-series-nav-dir {
	color: var(--cvh-accent-color);
	font-size: 14px;
	font-weight: 700;
}

.cvh-video-hub .cvh-series-nav-title {
	font-weight: 600;
	line-height: 1.4;
}

.cvh-video-hub .cvh-related {
	padding-top: 40px;
	border-top: 1px solid var(--cvh-rule-color);
}

.cvh-video-hub .cvh-back-link {
	margin: 48px 0 0;
	padding: 0;
}

.cvh-video-hub .cvh-back-link a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: var(--cvh-accent-color);
	text-underline-offset: 4px;
}

/* ---------- Tablet (Divi breakpoint) ---------- */

@media (max-width: 980px) {
	.cvh-video-hub {
		--cvh-card-gap: 28px;
		--cvh-section-gap: 64px;
		--cvh-series-gap: 44px;
	}

	.cvh-video-hub .cvh-grid.cvh-cols-3,
	.cvh-video-hub .cvh-grid.cvh-cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cvh-video-hub .cvh-search {
		flex: 1 1 100%;
		order: -1;
		margin: 0 0 8px;
	}
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
	.cvh-video-hub .cvh-grid,
	.cvh-video-hub .cvh-grid.cvh-cols-2,
	.cvh-video-hub .cvh-grid.cvh-cols-3,
	.cvh-video-hub .cvh-grid.cvh-cols-4 {
		grid-template-columns: minmax(0, 1fr);
	}

	.cvh-video-hub .cvh-filter-list {
		flex-wrap: nowrap;
		gap: 0 22px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.cvh-video-hub .cvh-filter-link {
		white-space: nowrap;
	}

	.cvh-video-hub .cvh-series-nav-links {
		grid-template-columns: minmax(0, 1fr);
	}

	.cvh-video-hub .cvh-series-nav-link--next {
		grid-column: 1;
		text-align: left;
	}

	.cvh-site-main > .cvh-video-hub.cvh-page {
		padding-top: 32px;
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.cvh-video-hub *,
	.cvh-video-hub *::before,
	.cvh-video-hub *::after {
		transition: none;
	}

	.cvh-video-hub .cvh-video-card:hover .cvh-thumb-img {
		transform: none;
	}
}
