/* Friendly Fix Video Gallery */
.ffv {
	--ffv-bg: #0c1117;
	--ffv-panel: #121a23;
	--ffv-line: rgba(255, 255, 255, .08);
	--ffv-text: #eef2f6;
	--ffv-muted: #93a1b0;
	--ffv-blue: #1d8fe1;
	--ffv-blue-dark: #1572b6;
	--ffv-gold: #c9a24b;
	--ffv-red: #ff3b30;
	--ffv-radius: 14px;
	position: relative;
	margin: 0 auto;
	max-width: 1320px;
	padding: clamp(20px, 3vw, 40px);
	border-radius: 22px;
	background:
		radial-gradient(1200px 400px at 15% -10%, rgba(29, 143, 225, .22), transparent 60%),
		radial-gradient(800px 300px at 100% 0%, rgba(201, 162, 75, .12), transparent 60%),
		var(--ffv-bg);
	color: var(--ffv-text);
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .55);
	font-size: 16px;
	line-height: 1.5;
	isolation: isolate;
}
.ffv *, .ffv *::before, .ffv *::after { box-sizing: border-box; }
.ffv p, .ffv h2, .ffv h3, .ffv ol { margin: 0; padding: 0; }
.ffv a { text-decoration: none; }

/* Header */
.ffv-head {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
	flex-wrap: wrap; margin-bottom: clamp(18px, 2.4vw, 28px);
}
.ffv-eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
	color: var(--ffv-gold);
}
.ffv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ffv-red); box-shadow: 0 0 0 4px rgba(255, 59, 48, .18); }
.ffv .ffv-title {
	margin-top: 6px; color: #fff; font-weight: 800; letter-spacing: -.01em;
	font-size: clamp(26px, 3.4vw, 42px); line-height: 1.1;
}
.ffv-subscribe {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 11px 18px; border-radius: 999px;
	background: #fff; color: #0c1117 !important; font-weight: 700; font-size: 14px;
	transition: transform .15s ease, box-shadow .15s ease;
}
.ffv-subscribe svg { width: 22px; height: 22px; fill: var(--ffv-red); }
.ffv-subscribe:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -8px rgba(255, 255, 255, .45); }

/* Layout */
.ffv-stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(18px, 2vw, 28px); align-items: start; }
@media (max-width: 1024px) { .ffv-stage { grid-template-columns: 1fr; } }

/* Player */
.ffv-player {
	position: relative; aspect-ratio: 16 / 9; width: 100%;
	border-radius: var(--ffv-radius); overflow: hidden; background: #000;
	box-shadow: 0 0 0 1px var(--ffv-line), 0 24px 60px -24px rgba(0, 0, 0, .8);
}
.ffv-player iframe, .ffv-poster, .ffv-poster img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ffv-poster { padding: 0; margin: 0; cursor: pointer; background: #000; display: block; }
.ffv-poster img { object-fit: cover; transition: transform .6s ease, filter .3s ease; }
.ffv-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55)); }
.ffv-poster:hover img { transform: scale(1.025); filter: brightness(1.05); }
.ffv-play {
	position: absolute; left: 50%; top: 50%; z-index: 1;
	width: clamp(64px, 8vw, 92px); aspect-ratio: 1; transform: translate(-50%, -50%);
	display: grid; place-items: center; border-radius: 50%;
	background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 18px 40px -10px rgba(0, 0, 0, .7);
	transition: transform .2s ease, background .2s ease;
}
.ffv-play svg { width: 42%; fill: #fff; margin-left: 6%; }
.ffv-poster:hover .ffv-play, .ffv-poster:focus-visible .ffv-play { transform: translate(-50%, -50%) scale(1.08); background: var(--ffv-blue); }
.ffv-poster:focus-visible { outline: 3px solid var(--ffv-gold); outline-offset: -3px; }

/* Now playing info */
.ffv-info { padding: 18px 2px 0; }
.ffv .ffv-now-title { color: #fff; font-size: clamp(19px, 2vw, 24px); font-weight: 750; line-height: 1.25; }
.ffv-meta { margin-top: 6px !important; color: var(--ffv-muted); font-size: 14px; }
.ffv-sep { margin: 0 8px; opacity: .6; }
.ffv-desc { margin-top: 12px; color: #c9d3dd; font-size: 15px; max-width: 75ch; }
.ffv-clamp p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ffv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.ffv-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 700; font-size: 15px; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.ffv-btn-primary { background: var(--ffv-blue); color: #fff !important; }
.ffv-btn-primary:hover { background: var(--ffv-blue-dark); }
.ffv-btn-ghost { border: 1px solid rgba(255, 255, 255, .22); color: #fff !important; }
.ffv-btn-ghost:hover { border-color: #fff; }
.ffv-btn-link { color: var(--ffv-muted) !important; padding: 0 8px; }
.ffv-btn-link:hover { color: #fff !important; }

/* Rail */
.ffv-rail {
	background: var(--ffv-panel); border-radius: var(--ffv-radius);
	box-shadow: 0 0 0 1px var(--ffv-line);
	display: flex; flex-direction: column; max-height: min(760px, 82vh);
}
@media (max-width: 1024px) { .ffv-rail { max-height: none; } }
.ffv-rail-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--ffv-line); }
.ffv-rail-title { font-weight: 800; font-size: 15px; letter-spacing: .02em; color: #fff; }
.ffv-rail-title span { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ffv-muted); font-size: 12px; font-weight: 700; }
.ffv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ffv-chip {
	appearance: none; border: 1px solid rgba(255, 255, 255, .14); background: transparent; color: #c9d3dd;
	padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.2;
	transition: all .15s ease;
}
.ffv-chip:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }
.ffv-chip.is-on { background: #fff; border-color: #fff; color: #0c1117; }

.ffv-list { list-style: none; overflow-y: auto; padding: 8px !important; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.ffv-item { margin: 0 !important; }
.ffv-item[hidden] { display: none; }
.ffv-item-link { display: grid; grid-template-columns: 148px 1fr; gap: 12px; align-items: start; padding: 8px; border-radius: 10px; color: inherit; transition: background .15s ease; }
.ffv-item-link:hover { background: rgba(255, 255, 255, .05); }
.ffv-item-link:focus-visible { outline: 2px solid var(--ffv-gold); outline-offset: 1px; }
.ffv-item.is-active .ffv-item-link { background: rgba(29, 143, 225, .14); box-shadow: inset 3px 0 0 var(--ffv-blue); }
.ffv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.ffv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ffv-playing {
	position: absolute; inset: auto 6px 6px auto; display: none;
	padding: 3px 7px; border-radius: 5px; background: var(--ffv-blue); color: #fff;
	font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.ffv-item.is-active .ffv-playing { display: block; }
.ffv-item-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #fff; font-weight: 650; font-size: 14px; line-height: 1.3; }
.ffv-item-meta { display: block; margin-top: 4px; color: var(--ffv-muted); font-size: 12.5px; }
@media (max-width: 1024px) and (min-width: 640px) {
	.ffv-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
}
@media (max-width: 420px) { .ffv-item-link { grid-template-columns: 120px 1fr; } }

@media (prefers-reduced-motion: reduce) { .ffv * { transition: none !important; } }

/* v1.0.1: player sits at the top of the page as the page header */
#main:has(.ffv) { padding-top: 6px !important; }
.ffv-sub-long { margin-left: -7px; }
.ffv h1 { margin: 0; padding: 0; }
.ffv h1.ffv-title, .ffv h2.ffv-title { margin: 6px 0 0 !important; color: #fff !important; font-size: clamp(26px, 3.2vw, 40px) !important; line-height: 1.1 !important; }
.ffv .ffv-sub { margin-top: 8px; color: var(--ffv-muted); font-size: 16px; max-width: 60ch; }
.ffv-head { align-items: center; }

@media (max-width: 640px) {
	#main:has(.ffv) { padding-top: 0 !important; }
	.ffv { padding: 16px 14px 18px; border-radius: 16px; }
	.ffv-head { flex-wrap: nowrap; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
	.ffv h1.ffv-title, .ffv h2.ffv-title { font-size: 23px !important; }
	.ffv .ffv-sub { display: none; }
	.ffv-subscribe { padding: 8px 12px; font-size: 13px; flex: none; gap: 6px; }
	.ffv-subscribe svg { width: 18px; height: 18px; }
	.ffv-sub-long { display: none; }
}

/* v1.0.4: less scrolling, plus a full screen mode for the whole gallery */
.ffv-head-actions{display:flex;align-items:center;gap:10px;flex:none}
.ffv-fs-btn{appearance:none;display:inline-flex;align-items:center;gap:8px;cursor:pointer;padding:10px 16px;border-radius:999px;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.06);color:#fff;font-weight:700;font-size:14px;line-height:1.2;transition:background .15s ease,border-color .15s ease}
.ffv-fs-btn:hover{background:rgba(255,255,255,.14);border-color:#fff}
.ffv-fs-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ffv-fs-btn .ffv-fs-off,.ffv.is-fs .ffv-fs-btn .ffv-fs-on{display:none}
.ffv.is-fs .ffv-fs-btn .ffv-fs-off{display:inline}
@media (min-width:1025px){
.ffv{padding:22px 26px 24px}.ffv-head{margin-bottom:16px}
.ffv h1.ffv-title,.ffv h2.ffv-title{font-size:clamp(24px,2.4vw,32px)!important}
.ffv .ffv-sub{margin-top:4px;font-size:15px}
.ffv-stage{align-items:stretch}
.ffv-player{max-height:max(300px,calc(100vh - 400px))}
.ffv-info{padding-top:12px}.ffv-clamp p{-webkit-line-clamp:2}.ffv-actions{margin-top:12px}
.ffv-rail{height:0;min-height:100%;max-height:none}
.ffv-list{flex:1;min-height:0}
.ffv-item-link{grid-template-columns:128px 1fr;padding:6px}
}
@media (max-width:1024px){
.ffv-list{display:flex!important;gap:10px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;padding:10px!important}
.ffv-item{flex:0 0 200px;scroll-snap-align:start}
.ffv-item-link{display:block;padding:6px}
.ffv-item-text{display:block;margin-top:8px}
.ffv-item-title{-webkit-line-clamp:2}
.ffv-item.is-active .ffv-item-link{box-shadow:inset 0 3px 0 var(--ffv-blue)}
.ffv-clamp p{-webkit-line-clamp:2}
.ffv-fs-btn span{display:none}.ffv-fs-btn{padding:8px 10px}
}
@media (max-width:640px){.ffv-item{flex-basis:160px}.ffv-head-actions{gap:6px}}
.ffv.is-fs,.ffv:fullscreen{position:fixed;inset:0;z-index:2147483000;max-width:none;width:100%;height:100%;margin:0;border-radius:0;overflow:auto;display:flex;flex-direction:column}
.ffv.is-fs .ffv-stage{flex:1;min-height:0}
.ffv.is-fs .ffv-sub{display:none}
@media (min-width:1025px){.ffv.is-fs .ffv-stage{grid-template-columns:minmax(0,1fr) 400px}.ffv.is-fs .ffv-player{max-height:calc(100vh - 290px)}}
html.ffv-lock,html.ffv-lock body{overflow:hidden!important}

/* v1.0.6: stop the swipe row from stretching the page on phones and tablets */
.ffv-stage { grid-template-columns: minmax(0, 1fr) 380px; }
.ffv-main, .ffv-rail { min-width: 0; }
@media (max-width: 1024px) {
	.ffv { overflow: hidden; }
	.ffv-stage { grid-template-columns: minmax(0, 1fr); }
	.ffv-main, .ffv-rail, .ffv-list { max-width: 100%; }
	.ffv-player { max-height: none; }
}
@media (min-width: 1025px) { .ffv.is-fs .ffv-stage { grid-template-columns: minmax(0, 1fr) 400px; } }
