/* Channel Video Gallery — player & gallery */

.cvg, .cvg-modal {
	--cvg-accent: #c9a24b;
	--cvg-radius: 12px;
	--cvg-ui: #fff;
	--cvg-crop: max(64px, 12%);
	--cvg-line: rgba(127, 127, 127, .28);
	--cvg-muted: .68;
}
.cvg { margin: 0 0 2em; }
.cvg *, .cvg-modal * { box-sizing: border-box; }
:where(.cvg, .cvg-modal) button { font-family: inherit; }
:where(.cvg-player, .cvg-modal) button {
	margin: 0; min-height: 0; text-transform: none; letter-spacing: normal; font-size: inherit; line-height: 1;
	text-shadow: none; -webkit-appearance: none; appearance: none;
}
html.cvg-noscroll, html.cvg-noscroll body { overflow: hidden !important; }

/* ------------------------------------------------------------------ */
/* Player                                                              */
/* ------------------------------------------------------------------ */
.cvg-player {
	position: relative;
	background: #000;
	color: var(--cvg-ui);
	border-radius: var(--cvg-radius);
	overflow: hidden;
	outline: none;
	box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .55);
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}
.cvg-player:focus-visible { box-shadow: 0 0 0 3px var(--cvg-accent); }
.cvg-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
@supports not (aspect-ratio: 1) { .cvg-stage { height: 0; padding-top: 56.25%; } }

.cvg-frame { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.cvg-frame iframe {
	position: absolute; left: 0; top: 0; width: 100%; height: 100%;
	border: 0; pointer-events: none;
}
/* Clean mode: the iframe is taller than the stage, so YouTube's title bar
   and corner branding sit in the hidden letterbox above/below the video. */
.cvg-player.is-clean .cvg-frame iframe {
	top: calc(-1 * var(--cvg-crop));
	height: calc(100% + 2 * var(--cvg-crop));
}

.cvg-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.cvg-player.is-playing:not(.show-ui) .cvg-shield { cursor: none; }

/* Poster (before first play) */
.cvg-poster {
	position: absolute; inset: 0; z-index: 4; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	background: #000; transition: opacity .35s ease, visibility .35s;
}
.cvg-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cvg-poster::after {
	content: ""; position: absolute; inset: 0;
	background: radial-gradient(ellipse at center, rgba(0,0,0,.05) 0%, rgba(0,0,0,.45) 100%);
}
.cvg-player:not(.is-idle) .cvg-poster { opacity: 0; visibility: hidden; pointer-events: none; }

/* Pause layer: dims the frame and hides YouTube's pause overlays */
.cvg-pausedlayer {
	position: absolute; inset: 0; z-index: 3; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .45);
	-webkit-backdrop-filter: blur(10px) saturate(.8);
	backdrop-filter: blur(10px) saturate(.8);
	opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.cvg-player.is-paused .cvg-pausedlayer { opacity: 1; visibility: visible; }

.cvg-bigplay {
	position: relative; z-index: 1;
	width: clamp(56px, 9vw, 84px); height: clamp(56px, 9vw, 84px);
	border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	background: var(--cvg-accent); color: #111;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
	transition: transform .2s ease, box-shadow .2s ease;
}
.cvg-bigplay svg { width: 42%; height: 42%; fill: currentColor; margin-left: 6%; }
.cvg-poster:hover .cvg-bigplay, .cvg-pausedlayer:hover .cvg-bigplay, .cvg-bigplay:focus-visible { transform: scale(1.08); box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
.cvg-bigplay:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Spinner */
.cvg-spinner {
	position: absolute; left: 50%; top: 50%; z-index: 5;
	width: 54px; height: 54px; margin: -27px 0 0 -27px;
	border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--cvg-accent);
	animation: cvg-spin .8s linear infinite;
	opacity: 0; visibility: hidden; transition: opacity .2s;
	pointer-events: none;
}
.cvg-player.is-buffering .cvg-spinner { opacity: 1; visibility: visible; }
.cvg-player.is-buffering.is-idle .cvg-bigplay { opacity: 0; }
@keyframes cvg-spin { to { transform: rotate(360deg); } }

/* End screen */
.cvg-end {
	position: absolute; inset: 0; z-index: 6; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	background: #000; opacity: 0; visibility: hidden; transition: opacity .3s;
}
.cvg-player.is-ended .cvg-end { opacity: 1; visibility: visible; }
.cvg-end-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(18px) brightness(.4); }
.cvg-end-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 20px; max-width: 90%; }
.cvg-end-next { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cvg-end-next[hidden] { display: none; }
.cvg-end-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.cvg-end-title { font-size: clamp(15px, 2.2vw, 22px); font-weight: 600; line-height: 1.3; max-width: 34ch; }
.cvg-end-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.cvg-end-play {
	position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	background: var(--cvg-accent); color: #111; display: flex; align-items: center; justify-content: center;
}
.cvg-end-play > svg:first-child { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.cvg-ring { position: absolute; inset: -6px; width: 76px; height: 76px; transform: rotate(-90deg); fill: none; stroke: #fff; stroke-width: 2.5; stroke-dasharray: 138.2; stroke-dashoffset: 138.2; opacity: 0; }
.cvg-player.is-counting .cvg-ring { opacity: 1; animation: cvg-ring 6s linear forwards; }
@keyframes cvg-ring { to { stroke-dashoffset: 0; } }
.cvg-end-cancel, .cvg-end-replay {
	border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff;
	border-radius: 999px; padding: 8px 16px; cursor: pointer; font-size: 14px;
	display: inline-flex; align-items: center; gap: 8px;
}
.cvg-end-cancel { display: none; }
.cvg-player.is-counting .cvg-end-cancel { display: inline-flex; }
.cvg-end-replay svg { width: 16px; height: 16px; }
.cvg-end-cancel:hover, .cvg-end-replay:hover { background: rgba(255, 255, 255, .18); }

/* Error */
.cvg-error {
	position: absolute; inset: 0; z-index: 7; display: none;
	flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	background: #0b0b0b; text-align: center; padding: 20px;
}
.cvg-player.is-error .cvg-error { display: flex; }
.cvg-error p { margin: 0; opacity: .85; }
.cvg-error-link { display: inline-flex; align-items: center; gap: 8px; color: #111 !important; background: var(--cvg-accent); border-radius: 999px; padding: 9px 18px; text-decoration: none !important; font-weight: 600; }
.cvg-error-link svg { width: 16px; height: 16px; }

/* Tap to unmute */
.cvg-unmute {
	position: absolute; top: 14px; left: 14px; z-index: 8;
	display: inline-flex; align-items: center; gap: 8px;
	border: 0; border-radius: 999px; padding: 8px 14px 8px 10px; cursor: pointer;
	background: rgba(0, 0, 0, .72); color: #fff; font-size: 14px; font-weight: 600;
}
.cvg-unmute[hidden] { display: none; }
.cvg-unmute svg { width: 20px; height: 20px; fill: currentColor; }

/* ------------------------------------------------------------------ */
/* Control bar                                                         */
/* ------------------------------------------------------------------ */
.cvg-controls {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
	padding: 36px 14px 8px;
	background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.cvg-player.show-ui:not(.is-idle):not(.is-error) .cvg-controls,
.cvg-player.is-paused .cvg-controls,
.cvg-player.is-ended .cvg-controls { opacity: 1; visibility: visible; transform: none; }

.cvg-bar { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.cvg-bar-left, .cvg-bar-right { display: flex; align-items: center; gap: 2px; flex: none; }
.cvg-bar-title { flex: 1 1 auto; min-width: 0; font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

.cvg-bar .cvg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-width: 38px; height: 38px; padding: 0 7px;
	border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer;
	text-decoration: none !important; line-height: 1;
	transition: background-color .15s, color .15s;
}
.cvg-bar .cvg-btn[hidden] { display: none; }
.cvg-bar .cvg-btn svg { width: 22px; height: 22px; fill: currentColor; }
.cvg-bar .cvg-btn:hover { background: rgba(255, 255, 255, .12); }
.cvg-bar .cvg-btn:focus-visible { outline: 2px solid var(--cvg-accent); outline-offset: 1px; }
.cvg-bar .cvg-play svg { width: 26px; height: 26px; }
.cvg-bar .cvg-prev svg, .cvg-bar .cvg-next svg { width: 18px; height: 18px; }
.cvg-ytlink { font-size: 12px; font-weight: 600; letter-spacing: .02em; opacity: .75; color: #fff !important; }
.cvg-ytlink:hover { opacity: 1; }
.cvg-bar .cvg-ytlink svg { width: 15px; height: 15px; fill: none; }

.cvg-time { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; opacity: .92; }
.cvg-sep { opacity: .55; }

/* Volume */
.cvg-vol { display: flex; align-items: center; }
.cvg-vol-range {
	--cvg-vol: 100%;
	-webkit-appearance: none; appearance: none;
	width: 0; opacity: 0; height: 4px; margin: 0; padding: 0; border-radius: 4px; cursor: pointer;
	background: linear-gradient(to right, #fff var(--cvg-vol), rgba(255, 255, 255, .3) var(--cvg-vol));
	transition: width .2s ease, opacity .2s ease, margin .2s ease;
}
.cvg-vol:hover .cvg-vol-range, .cvg-vol:focus-within .cvg-vol-range { width: 76px; opacity: 1; margin: 0 6px 0 2px; }
.cvg-vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.cvg-vol-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.cvg-vol-range::-moz-range-track { background: transparent; }

/* Progress bar */
.cvg-progress { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.cvg-progress-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; transition: height .15s ease; }
.cvg-progress:hover .cvg-progress-track, .cvg-progress.is-drag .cvg-progress-track, .cvg-progress:focus-visible .cvg-progress-track { height: 6px; }
.cvg-progress-buf, .cvg-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.cvg-progress-buf { background: rgba(255, 255, 255, .35); }
.cvg-progress-fill { background: var(--cvg-accent); }
.cvg-progress-thumb {
	position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px;
	border-radius: 50%; background: var(--cvg-accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25);
	transform: scale(0); transition: transform .15s ease;
}
.cvg-progress:hover .cvg-progress-thumb, .cvg-progress.is-drag .cvg-progress-thumb, .cvg-progress:focus-visible .cvg-progress-thumb { transform: scale(1); }
.cvg-progress-tip {
	position: absolute; bottom: 22px; left: 0; transform: translateX(-50%);
	background: rgba(0, 0, 0, .85); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums;
	padding: 3px 7px; border-radius: 5px; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.cvg-progress:hover .cvg-progress-tip, .cvg-progress.is-drag .cvg-progress-tip { opacity: 1; }

/* Full screen */
.cvg-player.is-fs { border-radius: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; box-shadow: none; }
.cvg-player.is-fs .cvg-stage { width: min(100vw, 177.78vh); max-height: 100vh; }
.cvg-player.is-pseudo-fs { position: fixed; inset: 0; z-index: 2147483000; width: 100vw; height: 100vh; height: 100dvh; }
.cvg-player:fullscreen { background: #000; }

@media (max-width: 600px) {
	.cvg-bar-title, .cvg-vol-range, .cvg-ytlink span { display: none; }
	.cvg-controls { padding: 28px 6px 2px; }
	.cvg-bar .cvg-btn { min-width: 34px; height: 34px; padding: 0 5px; }
	.cvg-time { font-size: 12px; padding: 0 4px; }
	.cvg-end-title { font-size: 14px; }
	.cvg-end-play { width: 52px; height: 52px; }
	.cvg-ring { width: 64px; height: 64px; }
	.cvg-end-inner { gap: 10px; }
}

/* ------------------------------------------------------------------ */
/* Featured layout                                                     */
/* ------------------------------------------------------------------ */
.cvg-feature { margin-bottom: 2.25em; }
.cvg--single .cvg-feature { margin-bottom: 0; }
.cvg-feature-info { padding: 1.1em 2px 0; }
.cvg-feature-title { margin: 0 0 .3em; font-size: 1.45em; line-height: 1.25; }
.cvg-feature-meta { font-size: .9em; opacity: var(--cvg-muted); }
.cvg-feature-desc { margin-top: .9em; font-size: .95em; line-height: 1.6; overflow-wrap: anywhere; }
.cvg-feature-desc:empty { display: none; }
.cvg-feature-desc p { margin: 0 0 .7em; }
.cvg-feature-desc a { color: var(--cvg-accent); }
.cvg-feature-desc.is-long:not(.is-open) {
	max-height: 7.2em; overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
	mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.cvg-desc-toggle { font-size: .9em; background: none; border: 0; padding: 4px 0; margin-top: .3em; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ */
/* Filters                                                             */
/* ------------------------------------------------------------------ */
.cvg-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.4em; }
.cvg-filter {
	border: 1px solid var(--cvg-line); background: transparent; color: inherit;
	border-radius: 999px; padding: .45em 1.05em; font-size: .9em; line-height: 1.2; cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.cvg-filter:hover { border-color: var(--cvg-accent); }
.cvg-filter.is-active { background: var(--cvg-accent); border-color: var(--cvg-accent); color: #111; }

/* ------------------------------------------------------------------ */
/* Grid & cards                                                        */
/* ------------------------------------------------------------------ */
.cvg-grid {
	display: grid; gap: 1.9em 1.4em;
	grid-template-columns: repeat(var(--cvg-cols, 3), minmax(0, 1fr));
	transition: opacity .2s;
}
.cvg-grid[hidden] { display: none; }
.cvg-grid.is-loading { opacity: .4; pointer-events: none; }
@media (max-width: 960px) { .cvg:not(.cvg-cols-1) .cvg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cvg-grid { grid-template-columns: minmax(0, 1fr); } }

.cvg-card { display: block; color: inherit !important; text-decoration: none !important; outline: none; -webkit-tap-highlight-color: transparent; }
.cvg-card-media {
	position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
	border-radius: var(--cvg-radius); background: #111;
}
.cvg-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1), filter .3s; }
.cvg-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45), transparent 45%); opacity: .8; transition: opacity .3s; }
.cvg-card-play {
	position: absolute; left: 50%; top: 50%; z-index: 1; width: 56px; height: 56px; margin: -28px 0 0 -28px;
	border-radius: 50%; background: var(--cvg-accent); color: #111;
	display: flex; align-items: center; justify-content: center;
	opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.cvg-card-play svg { width: 24px; height: 24px; fill: currentColor; margin-left: 3px; }
.cvg-card-dur {
	position: absolute; right: 8px; bottom: 8px; z-index: 1;
	background: rgba(0, 0, 0, .78); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
	padding: 3px 6px; border-radius: 5px; line-height: 1.2;
}
.cvg-card:hover .cvg-card-media img, .cvg-card:focus-visible .cvg-card-media img { transform: scale(1.06); }
.cvg-card:hover .cvg-card-play, .cvg-card:focus-visible .cvg-card-play { opacity: 1; transform: scale(1); }
.cvg-card:focus-visible .cvg-card-media { box-shadow: 0 0 0 3px var(--cvg-accent); }
.cvg-card-body { display: block; padding: .75em 2px 0; }
.cvg-card-title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	font-weight: 600; line-height: 1.35; font-size: .95em;
}
.cvg-card-date { display: block; margin-top: .3em; font-size: .85em; opacity: var(--cvg-muted); }

/* Now playing */
.cvg-card-now { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: none; align-items: flex-end; gap: 3px; height: 16px; }
.cvg-card-now i { display: block; width: 3px; background: var(--cvg-accent); border-radius: 2px; animation: cvg-eq 1s ease-in-out infinite; }
.cvg-card-now i:nth-child(2) { animation-delay: -.4s; }
.cvg-card-now i:nth-child(3) { animation-delay: -.7s; }
@keyframes cvg-eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.cvg--featured .cvg-card.is-active .cvg-card-media { box-shadow: 0 0 0 3px var(--cvg-accent); }
.cvg--featured .cvg-card.is-active .cvg-card-now { display: flex; }
.cvg--featured .cvg-card.is-active .cvg-card-title { color: var(--cvg-accent); }

/* Load more */
.cvg-more-wrap { display: flex; justify-content: center; margin-top: 2.2em; }
.cvg-more-wrap[hidden] { display: none; }
.cvg-more {
	border: 1.5px solid var(--cvg-accent); background: transparent; color: inherit;
	border-radius: 999px; padding: .75em 1.8em; font-size: .95em; font-weight: 600; cursor: pointer; letter-spacing: .02em;
	transition: background-color .15s, color .15s;
}
.cvg-more:hover { background: var(--cvg-accent); color: #111; }
.cvg-more.is-loading { opacity: .6; cursor: wait; }
.cvg-empty { opacity: .7; }

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */
.cvg-modal { position: fixed; inset: 0; z-index: 2147482000; display: flex; align-items: center; justify-content: center; padding: 64px 4vw 24px; }
.cvg-modal[hidden] { display: none; }
.cvg-modal-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 5, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .25s; }
.cvg-modal-box { position: relative; width: min(1200px, 100%, calc((100vh - 170px) * 16 / 9)); opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .3s ease, transform .3s ease; color: #fff; }
.cvg-modal.is-open .cvg-modal-backdrop, .cvg-modal.is-open .cvg-modal-box { opacity: 1; transform: none; }
.cvg-modal-info { padding: 14px 2px 0; }
.cvg-modal-title { margin: 0; color: #fff; font-size: 1.2em; line-height: 1.3; }
.cvg-modal-meta { margin-top: 4px; font-size: .88em; opacity: .65; }
.cvg-modal-close {
	position: absolute; top: 14px; right: 14px; width: 44px; height: 44px;
	border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center; transition: background-color .15s;
}
.cvg-modal-close:hover { background: rgba(255, 255, 255, .22); }
.cvg-modal-close svg { width: 22px; height: 22px; }
@media (max-width: 600px) { .cvg-modal { padding: 60px 0 0; align-items: flex-start; } .cvg-modal .cvg-player { border-radius: 0; } .cvg-modal-info { padding: 12px 16px 0; } }

@media (prefers-reduced-motion: reduce) {
	.cvg *, .cvg-modal * { transition: none !important; animation-duration: .01ms !important; }
}
