/* Video Slider for YouTube – front end.
   Colors can be overridden in the theme via the --vsfy-* custom properties. */

.vsfy {
	--vsfy-ink: currentColor;
	--vsfy-muted: color-mix(in srgb, currentColor 62%, transparent);
	--vsfy-line: color-mix(in srgb, currentColor 14%, transparent);
	--vsfy-hover: color-mix(in srgb, currentColor 5%, transparent);
	--vsfy-btn: #1d2327;
	--vsfy-btn-ink: #fff;
	--vsfy-stage: #0e1014;
	--vsfy-radius: 6px;
	--vsfy-gap: 16px;
	--vsfy-per: 1.15;

	container-type: inline-size;
	container-name: vsfy;
	color: inherit;
	font-family: inherit;
	line-height: 1.45;
	margin: 0 0 1.5em;
}
.vsfy *, .vsfy *::before, .vsfy *::after { box-sizing: border-box; }

/* Neutralize theme button styles. */
.vsfy button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.vsfy button:focus-visible,
.vsfy a:focus-visible,
.vsfy [tabindex]:focus-visible { outline: 2px solid var(--vsfy-ink); outline-offset: 2px; }
.vsfy p { margin: 0; padding: 0; }

.vsfy-notice { padding: 10px 14px; border: 1px dashed currentColor; opacity: .7; font-size: 14px; }

/* ---------- Media: thumbnail, play button, player ---------- */
.vsfy-media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--vsfy-stage);
	border-radius: var(--vsfy-radius);
	container-type: inline-size;
	container-name: vsfy-media;
}
.vsfy-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.vsfy .vsfy-facade { position: absolute; inset: 0; display: block; overflow: hidden; }
/* Doubled class: themes often set "img { height: auto }" with the same specificity. */
.vsfy.vsfy .vsfy-facade img,
.vsfy .vsfy-ph {
	position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
	margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
	object-fit: cover; display: block;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .4s;
}
.vsfy-ph { background: radial-gradient(120% 90% at 30% 20%, #2f3440 0%, #171a21 60%, #0e1014 100%); }
.vsfy-facade::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: radial-gradient(ellipse at center, rgba(14, 16, 20, 0) 45%, rgba(14, 16, 20, .4) 100%);
}
.vsfy-facade:hover img { transform: scale(1.035); filter: brightness(.94); }

.vsfy-play {
	position: absolute; left: 50%; top: 50%; z-index: 1;
	width: clamp(44px, 14cqi, 76px); aspect-ratio: 1; border-radius: 50%;
	transform: translate(-50%, -50%);
	transition: transform .25s ease, background .25s ease;
}
.vsfy-play::before {
	content: ""; position: absolute; left: 54%; top: 50%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: clamp(8px, 2.6cqi, 13px) 0 clamp(8px, 2.6cqi, 13px) clamp(13px, 4.2cqi, 21px);
	border-color: transparent;
}
.vsfy--play-light .vsfy-play { background: rgba(255, 255, 255, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.vsfy--play-light .vsfy-play::before { border-left-color: #14161b; }
.vsfy--play-dark .vsfy-play { background: rgba(14, 16, 20, .72); border: 2px solid rgba(255, 255, 255, .85); }
.vsfy--play-dark .vsfy-play::before { border-left-color: #fff; }
.vsfy--play-red .vsfy-play { border-radius: 28%; aspect-ratio: 1.42; background: #e62117; }
.vsfy--play-red .vsfy-play::before { border-left-color: #fff; }
.vsfy-facade:hover .vsfy-play,
.vsfy-facade:focus-visible .vsfy-play { transform: translate(-50%, -50%) scale(1.08); }
.vsfy .vsfy-facade:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

.vsfy-badge {
	position: absolute; left: 8px; top: 8px; z-index: 2;
	padding: 2px 7px; border-radius: 3px;
	background: rgba(14, 16, 20, .8); color: #fff;
	font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5;
}

/* ---------- Consent overlay ---------- */
.vsfy-consent {
	position: absolute; inset: 0; z-index: 3;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
	padding: 6% 8%;
	background: rgba(14, 16, 20, .92); color: #fff;
	text-align: center; font-size: 13px; line-height: 1.5;
}
.vsfy-consent p { max-width: 46ch; }
.vsfy .vsfy-consent-ok {
	padding: 9px 16px; border-radius: var(--vsfy-radius);
	background: #fff; color: #14161b; font-weight: 600; font-size: 13px;
}
.vsfy .vsfy-consent-ok:hover { background: #e9eaec; }
.vsfy-consent label { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; opacity: .85; cursor: pointer; }
@container vsfy-media (max-width: 300px) {
	.vsfy-consent { font-size: 11.5px; gap: 8px; padding: 5%; }
	.vsfy-consent p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
	.vsfy-consent label { display: none; }
}

/* ---------- Subscribe button ---------- */
.vsfy .vsfy-subscribe {
	display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
	padding: 10px 16px;
	background: var(--vsfy-btn); color: var(--vsfy-btn-ink);
	border-radius: var(--vsfy-radius);
	font-size: 13px; font-weight: 500; letter-spacing: .01em; line-height: 1.2; text-decoration: none;
	transition: filter .2s, transform .2s;
}
.vsfy .vsfy-subscribe:hover { filter: brightness(1.15); transform: translateY(-1px); color: var(--vsfy-btn-ink); }
.vsfy-subscribe svg { color: #ff3b30; flex: 0 0 auto; }

/* ---------- Cards (slider + grid) ---------- */
.vsfy--size-small { --vsfy-card-min: 200px; }
.vsfy--size-medium { --vsfy-card-min: 270px; }
.vsfy--size-large { --vsfy-card-min: 380px; }

.vsfy-card { min-width: 0; }
.vsfy-card .vsfy-media { transition: box-shadow .3s, transform .3s; }
.vsfy-card:hover .vsfy-media { box-shadow: 0 14px 30px -18px rgba(14, 16, 20, .6); }
.vsfy-card-body { padding: 10px 2px 0; }
.vsfy .vsfy-card-title {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
	font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--vsfy-ink);
}
.vsfy .vsfy-card-date { margin-top: 4px; font-size: 12.5px; color: var(--vsfy-muted); }

/* Slider */
.vsfy-track {
	display: grid; grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--vsfy-per) - 1) * var(--vsfy-gap)) / var(--vsfy-per));
	gap: var(--vsfy-gap);
	overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 4px 2px 6px;
	margin: -4px -2px 0;
}
.vsfy-track::-webkit-scrollbar { display: none; }
.vsfy-track > .vsfy-card { scroll-snap-align: start; }

/* Visible cards per container width and card size. */
.vsfy--size-small { --vsfy-per: 1.6; }
.vsfy--size-medium, .vsfy--size-large { --vsfy-per: 1.15; }
@container vsfy (min-width: 440px) { .vsfy--size-small .vsfy-track { --vsfy-per: 2; } }
@container vsfy (min-width: 560px) { .vsfy--size-medium .vsfy-track { --vsfy-per: 2; } }
@container vsfy (min-width: 660px) { .vsfy--size-small .vsfy-track { --vsfy-per: 3; } }
@container vsfy (min-width: 760px) { .vsfy--size-large .vsfy-track { --vsfy-per: 2; } }
@container vsfy (min-width: 860px) { .vsfy--size-medium .vsfy-track { --vsfy-per: 3; } }
@container vsfy (min-width: 880px) { .vsfy--size-small .vsfy-track { --vsfy-per: 4; } }
@container vsfy (min-width: 1100px) { .vsfy--size-small .vsfy-track { --vsfy-per: 5; } }
@container vsfy (min-width: 1140px) { .vsfy--size-medium .vsfy-track { --vsfy-per: 4; } .vsfy--size-large .vsfy-track { --vsfy-per: 3; } }

.vsfy-controls { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.vsfy-arrows { display: flex; gap: 8px; flex: 0 0 auto; }
.vsfy .vsfy-arrow {
	width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center;
	border: 1px solid var(--vsfy-line); color: var(--vsfy-ink);
	font-size: 17px; line-height: 1;
	transition: background .2s, border-color .2s, opacity .2s;
}
.vsfy .vsfy-arrow:hover { background: var(--vsfy-hover); border-color: var(--vsfy-ink); }
.vsfy .vsfy-arrow[disabled] { opacity: .3; cursor: default; pointer-events: none; }
.vsfy-progress { position: relative; flex: 1 1 auto; height: 2px; background: var(--vsfy-line); border-radius: 2px; overflow: hidden; }
.vsfy-progress span {
	position: absolute; left: 0; top: 0; bottom: 0; width: 0;
	background: var(--vsfy-ink); border-radius: 2px;
	transition: width .25s ease, left .25s ease;
}
.vsfy--slider.is-static .vsfy-arrows,
.vsfy--slider.is-static .vsfy-progress { visibility: hidden; }

/* Grid */
.vsfy-grid {
	display: grid; gap: calc(var(--vsfy-gap) * 1.4) var(--vsfy-gap);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--vsfy-card-min)), 1fr));
}
.vsfy-footer { display: flex; justify-content: flex-end; margin-top: 16px; }

/* ---------- Player + playlist / single ---------- */
.vsfy-stage .vsfy-media { box-shadow: 0 18px 40px -24px rgba(14, 16, 20, .55); }

.vsfy-caption {
	display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
	gap: 10px 18px; margin-top: 14px;
}
.vsfy-caption-text { flex: 1 1 260px; min-width: 0; }
.vsfy .vsfy-title { margin-bottom: 3px; font-size: 17px; font-weight: 500; line-height: 1.35; color: var(--vsfy-ink); }
.vsfy .vsfy-meta { font-size: 13px; color: var(--vsfy-muted); }
.vsfy-meta [data-vsfy-date]:not(:empty)::after { content: "·"; margin: 0 .5em; }
.vsfy .vsfy-meta a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--vsfy-line); transition: color .2s, border-color .2s; }
.vsfy .vsfy-meta a:hover { color: var(--vsfy-ink); border-color: currentColor; }

.vsfy-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.vsfy .vsfy-list {
	list-style: none; margin: 0; padding: 0;
	scrollbar-width: thin; scrollbar-color: var(--vsfy-line) transparent;
}
.vsfy .vsfy-list li { margin: 0; padding: 0; list-style: none; }
.vsfy .vsfy-list li::before, .vsfy .vsfy-list li::marker { content: none; }

.vsfy .vsfy-item { display: block; width: 100%; border-radius: var(--vsfy-radius); transition: background .2s; }
.vsfy .vsfy-item:hover, .vsfy .vsfy-item.is-active { background: var(--vsfy-hover); }
.vsfy-item-thumb {
	position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
	border-radius: max(0px, calc(var(--vsfy-radius) - 2px));
	background: var(--vsfy-stage);
}
.vsfy.vsfy .vsfy-item-thumb img,
.vsfy .vsfy-item-thumb .vsfy-ph {
	position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
	margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
	object-fit: cover; display: block; transition: transform .4s ease, filter .3s;
}
.vsfy-item:hover .vsfy-item-thumb img { transform: scale(1.05); }
.vsfy-item.is-active .vsfy-item-thumb img { filter: brightness(.55); }
.vsfy-item.is-active .vsfy-item-thumb::before {
	content: ""; position: absolute; left: 50%; top: 50%; z-index: 1;
	transform: translate(-35%, -50%);
	border-style: solid; border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
}
.vsfy-item-thumb .vsfy-badge { left: 5px; top: 5px; font-size: 9px; padding: 1px 5px; }
.vsfy-item-text { display: block; min-width: 0; padding-top: 1px; }
.vsfy-item-title {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
	font-size: 13px; font-weight: 500; line-height: 1.38; color: var(--vsfy-ink);
}
.vsfy-item-date { display: block; margin-top: 4px; font-size: 11.5px; color: var(--vsfy-muted); }

@container vsfy (min-width: 720px) {
	.vsfy-layout { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 24px; align-items: start; }
	.vsfy-aside { position: relative; align-self: stretch; min-height: 240px; }
	.vsfy .vsfy-list { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
	.vsfy .vsfy-list .vsfy-item { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px; }
}
@container vsfy (max-width: 719.98px) {
	.vsfy .vsfy-list { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-bottom: 8px; }
	.vsfy .vsfy-list li { flex: 0 0 clamp(150px, 42%, 220px); scroll-snap-align: start; }
	.vsfy .vsfy-list .vsfy-item { padding: 6px; }
	.vsfy-item-text { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.vsfy *, .vsfy *::before, .vsfy *::after { transition: none !important; }
	.vsfy-track { scroll-behavior: auto; }
	.vsfy-facade:hover img, .vsfy-item:hover .vsfy-item-thumb img { transform: none; }
}
