/* [cf_videos] feature video gallery. Selectors start with "html body" so they outrank Elementor's global
   button style (Site Settings > Buttons: .elementor-kit-N button and its :hover/:focus).
    MD3 tokens from the courseforge-core design layer, with fallbacks. */
html body .cfv {
	--cfv-primary: var(--md-sys-color-primary, #0f6cbd);
	--cfv-on-surface: var(--md-sys-color-on-surface, #191c21);
	--cfv-variant: var(--md-sys-color-on-surface-variant, #414751);
	--cfv-outline: var(--md-sys-color-outline-variant, #c1c7d3);
	--cfv-low: var(--md-sys-color-surface-container-low, #f2f3fb);
	--cfv-high: var(--md-sys-color-surface-container-high, #e6e8ef);
	--cfv-sec: var(--md-sys-color-secondary-container, #d8e3f8);
	--cfv-on-sec: var(--md-sys-color-on-secondary-container, #111c2b);
	--cfv-ease: var(--md-sys-motion-easing-emphasized-decelerate, cubic-bezier(.05, .7, .1, 1));
	display: flex;
	flex-direction: column;
	gap: 24px;
	font-family: var(--cf-font, inherit);
	color: var(--cfv-on-surface);
}

/* Neutralise the global button look inside the gallery; component rules below set their own. */
:where(.cfv) button { min-height: 0; margin: 0; text-transform: none; }
html body .cfv button:is(:hover, :focus) { background-color: transparent; color: inherit; }

/* Filter chips */
html body .cfv-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
html body .cfv-chip {
	position: relative; isolation: isolate; overflow: hidden;
	display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px;
	border: 0; border-radius: 8px; background: transparent; color: var(--cfv-variant);
	box-shadow: inset 0 0 0 1px var(--cfv-outline);
	font: 500 .875rem/1 var(--cf-font, inherit); letter-spacing: .01em; cursor: pointer;
	transition: background-color 200ms, color 200ms;
}
html body .cfv-chip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: 0; transition: opacity 150ms; }
html body .cfv-chip:hover { background: transparent; color: var(--cfv-on-surface); }
html body .cfv-chip:hover::before { opacity: .08; }
html body .cfv-chip:active::before { opacity: .12; }
html body .cfv-chip span { font-size: .8125rem; opacity: .8; }
html body .cfv-chip.is-active, html body .cfv-chip.is-active:hover { background: var(--cfv-sec); color: var(--cfv-on-sec); box-shadow: none; }
html body .cfv-chip:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--cfv-primary); }

/* Stage */
html body .cfv-stage { display: flex; flex-direction: column; gap: 20px; }
html body .cfv-player {
	position: relative; aspect-ratio: 16 / 9; overflow: hidden;
	border-radius: 16px; background: #fff;
	box-shadow: 0 0 0 1px var(--cfv-outline), 0 1px 2px rgba(25, 28, 33, .06), 0 8px 24px -8px rgba(25, 28, 33, .12);
}
html body .cfv-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; cursor: pointer; }
html body .cfv-player.is-swap .cfv-video { animation: cfv-in 450ms var(--cfv-ease) both; }
@keyframes cfv-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* Play / pause button: black face, grey track, blue progress ring (top left) */
html body .cfv-play {
	position: absolute; top: 16px; left: 16px; z-index: 2;
	width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%;
	background: transparent; cursor: pointer; transition: transform 200ms var(--cfv-ease);
}
html body .cfv-play:hover { transform: scale(1.06); background: transparent; }
html body .cfv-play:active { transform: scale(.96); }
html body .cfv-play:focus-visible { outline: 3px solid var(--cfv-primary); outline-offset: 3px; }
html body .cfv-ring { display: block; width: 100%; height: 100%; overflow: visible; }
html body .cfv-ring__track { fill: none; stroke: #9aa0a6; stroke-width: 6; }
html body .cfv-ring__bar {
	fill: none; stroke: var(--cfv-primary); stroke-width: 6; stroke-linecap: round;
	stroke-dasharray: 0 100; transform: rotate(-90deg); transform-origin: 28px 28px;
}
html body .cfv-ring__face { fill: #111; }
html body .cfv-ring path { fill: #fff; }
html body .cfv-i-pause, html body .cfv-i-replay { display: none; }
html body .cfv-player.is-playing .cfv-i-play { display: none; }
html body .cfv-player.is-playing .cfv-i-pause { display: inline; }
html body .cfv-player.is-ended .cfv-i-play { display: none; }
html body .cfv-player.is-ended .cfv-i-replay { display: inline; }

/* Full screen and arrows: tonal icon buttons that fade in on hover (always visible on touch) */
html body .cfv-full, html body .cfv-arrow {
	position: absolute; z-index: 2; display: grid; place-items: center;
	width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .92); color: var(--cfv-on-surface);
	box-shadow: 0 0 0 1px var(--cfv-outline), 0 2px 8px rgba(25, 28, 33, .12);
	cursor: pointer; opacity: 0; transition: opacity 200ms, background-color 200ms;
}
html body .cfv-full { top: 16px; right: 16px; }
html body .cfv-arrow { top: 50%; margin-top: -22px; }
html body .cfv-arrow--prev { left: 16px; }
html body .cfv-arrow--next { right: 16px; }
html body .cfv-full svg, html body .cfv-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html body .cfv-player:hover .cfv-full, html body .cfv-player:hover .cfv-arrow, html body .cfv-player.is-idle .cfv-arrow, html body .cfv-full:focus-visible, html body .cfv-arrow:focus-visible { opacity: 1; }
html body .cfv-full:hover, html body .cfv-arrow:hover { background: var(--cfv-sec); color: var(--cfv-on-sec); }
html body .cfv-full:focus-visible, html body .cfv-arrow:focus-visible { outline: 3px solid var(--cfv-primary); outline-offset: 2px; }
@media (hover: none) { html body .cfv-full, html body .cfv-arrow { opacity: 1; } }
html body .cfv-player:fullscreen { border-radius: 0; background: #000; }
html body .cfv-player:fullscreen .cfv-video { background: #000; }

/* Caption */
html body .cfv-caption { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; max-width: 64ch; margin: 0 auto; }
html body .cfv-caption__tag { font-size: .75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--cfv-primary); }
html body .cfv-caption__title { margin: 0; font-size: var(--md-sys-typescale-title-large-size, 1.375rem); font-weight: 500; line-height: 1.3; color: var(--cfv-on-surface); }
html body .cfv-caption__text { margin: 0; font-size: 1rem; color: var(--cfv-variant); }
html body .cfv-caption__time { white-space: nowrap; font-variant-numeric: tabular-nums; }
html body .cfv-caption__time::before { content: "·"; margin: 0 6px; }

/* Thumbnail strip */
html body .cfv-strip {
	display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 16px) / 5);
	gap: 16px; margin: 0; padding: 4px 4px 12px; list-style: none;
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 4px; scrollbar-width: thin;
	scrollbar-color: var(--cfv-outline) transparent; overscroll-behavior-x: contain;
}
html body .cfv-item { scroll-snap-align: start; margin: 0; padding: 0; }
html body .cfv-item[hidden] { display: none; }
html body .cfv-thumb {
	display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 0; border: 0;
	background: transparent; color: var(--cfv-variant); text-align: left; cursor: pointer;
	font: inherit;
}
html body .cfv-thumb:hover, html body .cfv-thumb:focus { background: transparent; color: var(--cfv-on-surface); }
html body .cfv-thumb__img {
	position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px;
	background: #fff; box-shadow: 0 0 0 1px var(--cfv-outline); transition: box-shadow 200ms;
}
html body .cfv-thumb__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 450ms var(--cfv-ease); }
html body .cfv-thumb:hover .cfv-thumb__img img { transform: scale(1.04); }
html body .cfv-thumb__badge { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; }
html body .cfv-thumb__badge .cfv-ring__track { stroke-width: 5; }
html body .cfv-thumb__time {
	position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 4px;
	background: rgba(17, 17, 17, .78); color: #fff; font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums;
}
html body .cfv-thumb__title { font-size: .875rem; font-weight: 500; line-height: 1.35; }
html body .cfv-thumb.is-current .cfv-thumb__img { box-shadow: 0 0 0 3px var(--cfv-primary); }
html body .cfv-thumb.is-current .cfv-thumb__title { color: var(--cfv-primary); }
html body .cfv-thumb:focus-visible { outline: 0; }
html body .cfv-thumb:focus-visible .cfv-thumb__img { box-shadow: 0 0 0 3px var(--cfv-primary), 0 0 0 6px var(--cfv-sec); }

/* Strip arrows: round buttons over the list edges, vertically centred on the thumbnail images */
html body .cfv-rail { position: relative; }
html body .cfv-scroll {
	position: absolute; z-index: 3; top: calc(4px + (100% - 4px - 12px - 2.6em) / 2); transform: translateY(-50%);
	display: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
	background: var(--md-sys-color-surface-container-lowest, #fff); color: var(--cfv-on-surface);
	box-shadow: 0 0 0 1px var(--cfv-outline), 0 4px 12px rgba(25, 28, 33, .16);
	cursor: pointer; transition: opacity 200ms, background-color 200ms, transform 200ms var(--cfv-ease);
}
html body .cfv.is-scrollable .cfv-scroll { display: grid; }
html body .cfv-scroll--prev { left: -22px; }
html body .cfv-scroll--next { right: -22px; }
html body .cfv-scroll svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html body .cfv-scroll:focus { background: var(--md-sys-color-surface-container-lowest, #fff); color: var(--cfv-on-surface); }
html body .cfv-scroll:hover, html body .cfv-scroll:focus:hover { background: var(--cfv-primary); color: #fff; box-shadow: 0 0 0 1px var(--cfv-primary), 0 6px 16px rgba(15, 108, 189, .32); }
html body .cfv-scroll:active { transform: translateY(-50%) scale(.94); }
html body .cfv-scroll:focus-visible { outline: 3px solid var(--cfv-primary); outline-offset: 2px; }
html body .cfv-scroll:disabled { opacity: 0; pointer-events: none; }

/* "Show all videos" (phones only) */
html body .cfv-more { display: none; }

@media (max-width: 1024px) {
	html body .cfv-scroll--prev { left: -10px; }
	html body .cfv-scroll--next { right: -10px; }
	html body .cfv-strip { grid-auto-columns: calc((100% - 2 * 16px) / 3.4); }
}
@media (max-width: 767px) {
	html body .cfv { gap: 16px; }
	html body .cfv-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
	html body .cfv-chip { flex: none; }
	html body .cfv-player { border-radius: 12px; }
	html body .cfv-play { top: 10px; left: 10px; width: 48px; height: 48px; }
	html body .cfv-full { top: 10px; right: 10px; width: 36px; height: 36px; }
	html body .cfv-arrow { width: 36px; height: 36px; margin-top: -18px; }
	html body .cfv-arrow--prev { left: 8px; }
	html body .cfv-arrow--next { right: 8px; }
	html body .cfv-caption { align-items: flex-start; text-align: left; }
	/* Vertical list: small thumbnail on the left, title on the right; three shown, then "Show all" */
	html body .cfv.is-scrollable .cfv-scroll { display: none; }
	html body .cfv-strip { display: flex; flex-direction: column; gap: 8px; padding: 0; overflow: visible; scroll-snap-type: none; }
	html body .cfv-item.is-extra { display: none; }
	html body .cfv-thumb { flex-direction: row; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; }
	html body .cfv-thumb:hover, html body .cfv-thumb:focus { background: var(--cfv-low); }
	html body .cfv-thumb.is-current { background: var(--cfv-sec); }
	html body .cfv-thumb.is-current .cfv-thumb__title { color: var(--cfv-on-sec); }
	html body .cfv-thumb__img { flex: none; width: 40%; max-width: 168px; border-radius: 8px; }
	html body .cfv-thumb.is-current .cfv-thumb__img { box-shadow: 0 0 0 2px var(--cfv-primary); }
	html body .cfv-thumb__badge { top: 6px; left: 6px; width: 24px; height: 24px; }
	html body .cfv-thumb__time { right: 6px; bottom: 6px; font-size: .6875rem; }
	html body .cfv-thumb__title { font-size: .9375rem; }
	html body .cfv-thumb:hover .cfv-thumb__img img { transform: none; }
	html body .cfv-more:not([hidden]) {
		position: relative; isolation: isolate; overflow: hidden;
		display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px;
		margin: 0; padding: 0 24px; border: 0; border-radius: 999px; background: var(--cfv-sec); color: var(--cfv-on-sec);
		font: 500 .9375rem/1 var(--cf-font, inherit); letter-spacing: .01em; text-transform: none; cursor: pointer;
	}
	html body .cfv-more::before { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: 0; transition: opacity 150ms; }
	html body .cfv-more:is(:hover, :focus) { background: var(--cfv-sec); color: var(--cfv-on-sec); }
	html body .cfv-more:hover::before { opacity: .08; }
	html body .cfv-more:focus-visible { outline: 3px solid var(--cfv-primary); outline-offset: 2px; }
	html body .cfv-more svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 250ms var(--cfv-ease); }
	html body .cfv-more[aria-expanded="true"] svg { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) {
	html body .cfv *, html body .cfv *::before { animation: none !important; transition: none !important; }
}
