/**
 * Homepage featured slider.
 *
 * Tokens mirror assets/rsg-base.css but are redeclared here: rsg-base is only
 * enqueued on the two custom page templates, and this runs on the homepage.
 *
 * Everything is scoped under .rsg-slider — the parent theme sets global rules
 * (a:link { color:#000 }, h1-h6 { line-height:26px }, ul { list-style:none })
 * that would otherwise bleed in.
 */

.rsg-slider {
	--rsg-bg:        #0a0e16;
	--rsg-surface:   #111725;
	--rsg-text:      #e9edf3;
	--rsg-muted:     #9aa1ad;
	--rsg-dim:       #5f6775;
	--rsg-primary:   #0063BA;
	--rsg-primary-d: #004a8c;
	--rsg-accent:    #3aa3ff;

	/*
	 * Shared shadow stack. The slider is transparent, so every piece of text
	 * sits directly on the site's background photo — which is a busy image
	 * under a 50% black overlay, i.e. dark but not uniformly so. A tight
	 * shadow gives edge contrast, a wide soft one lifts the text off whatever
	 * is behind it.
	 */
	--rsg-tsh:      0 1px 2px rgba(0, 0, 0, .75), 0 2px 14px rgba(0, 0, 0, .55);
	--rsg-tsh-lg:   0 2px 4px rgba(0, 0, 0, .8),  0 4px 24px rgba(0, 0, 0, .6);

	position: relative;
	width: 100%;
	margin: 0 0 28px;
	background: transparent;
	overflow: hidden;
	box-sizing: border-box;
	/* Sits above the parent's floated layout without joining it */
	float: none;
	clear: both;
}

.rsg-slider *,
.rsg-slider *::before,
.rsg-slider *::after { box-sizing: border-box; }

.rsg-slider .rsg-sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ── Track ────────────────────────────────────────────────────────────── */

.rsg-slider-viewport { overflow: hidden; width: 100%; }

.rsg-slider-track {
	display: flex;
	flex-wrap: nowrap;
	width: 100%;
	will-change: transform;
	transition: transform .62s cubic-bezier(.65, .01, .25, 1);
}

/* Only the JS-driven slide changes animate; the first paint must not slide in */
.rsg-slider-track.is-jumping { transition: none; }

.rsg-slide {
	position: relative;
	flex: 0 0 100%;
	max-width: 100%;
	min-height: 480px;
	display: flex;
	align-items: center;
	overflow: hidden;
}

/* ── Slide content ────────────────────────────────────────────────────── */

.rsg-slide-inner {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 44px;
	width: 100%;
	max-width: 1300px;
	margin: 0 auto;
	padding: 54px 76px;
}

.rsg-slide-art {
	flex: 0 0 auto;
	display: block;
	width: 260px;
	border-radius: 16px;
	overflow: hidden;
	line-height: 0;
	border: 1px solid rgba(255, 255, 255, .14);
	box-shadow: 0 26px 60px rgba(0, 0, 0, .72);
	transform: translateY(16px);
	opacity: 0;
	transition: transform .6s cubic-bezier(.2, .7, .3, 1) .08s, opacity .5s ease .08s;
}
.rsg-slide.is-active .rsg-slide-art { transform: none; opacity: 1; }

.rsg-slide-art img {
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	display: block;
	border: 0;
}

.rsg-slide-body {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 640px;
}

/* Staggered entrance — each element trails the one above it. */
.rsg-slide-eyebrow,
.rsg-slide-title,
.rsg-slide-meta,
.rsg-slide-text,
.rsg-slide-cta {
	transform: translateY(18px);
	opacity: 0;
	transition: transform .55s cubic-bezier(.2, .7, .3, 1), opacity .45s ease;
}
.rsg-slide.is-active .rsg-slide-eyebrow { transform: none; opacity: 1; transition-delay: .10s; }
.rsg-slide.is-active .rsg-slide-title   { transform: none; opacity: 1; transition-delay: .16s; }
.rsg-slide.is-active .rsg-slide-meta    { transform: none; opacity: 1; transition-delay: .22s; }
.rsg-slide.is-active .rsg-slide-text    { transform: none; opacity: 1; transition-delay: .28s; }
.rsg-slide.is-active .rsg-slide-cta     { transform: none; opacity: 1; transition-delay: .34s; }

.rsg-slide-eyebrow {
	display: inline-block;
	margin: 0 0 14px;
	padding: 5px 13px;
	border-radius: 999px;
	background: rgba(11, 20, 34, .62);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(58, 163, 255, .45);
	color: #8fc9ff;
	text-shadow: var(--rsg-tsh);
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	line-height: 1.5;
}

.rsg-slider h2.rsg-slide-title {
	margin: 0 0 16px;
	font-size: clamp(28px, 3.4vw, 44px);
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -.8px;
	color: #fff;
	text-shadow: var(--rsg-tsh-lg);
	/* Long game names stay to two lines rather than shoving the CTA off-slide */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rsg-slider h2.rsg-slide-title a { color: #fff; text-decoration: none; transition: color .18s ease; }

/*
 * NOTE ON !important
 * The theme options emit a global `a:hover { color: #0a0000 !important; }`
 * from custom-style.php (Style Settings -> 2nd main colour). It is inline in
 * <head>, so it beats any later stylesheet on cascade order, and !important
 * beats specificity. Every link colour we set for :hover therefore has to be
 * !important too or it turns near-black on hover.
 */
.rsg-slider h2.rsg-slide-title a:hover,
.rsg-slider h2.rsg-slide-title a:focus { color: var(--rsg-accent) !important; }

.rsg-slide-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}

.rsg-slide-meta li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 13px;
	border-radius: 8px;
	background: rgba(11, 20, 34, .6);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, .2);
	color: #fff;
	text-shadow: var(--rsg-tsh);
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.45;
	white-space: nowrap;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rsg-slide-meta svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--rsg-accent); }

.rsg-slide-ver {
	background: linear-gradient(135deg, var(--rsg-primary) 0%, var(--rsg-primary-d) 100%) !important;
	border-color: transparent !important;
	color: #fff !important;
	box-shadow: 0 4px 14px rgba(0, 99, 186, .34);
}

.rsg-slider p.rsg-slide-text {
	margin: 0 0 24px;
	color: #dfe5ee;
	text-shadow: var(--rsg-tsh);
	font-size: 15px;
	line-height: 1.66;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rsg-slider a.rsg-slide-cta {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	padding: 15px 32px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--rsg-primary) 0%, var(--rsg-primary-d) 100%);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: .6px;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: 0 10px 30px rgba(0, 99, 186, .42);
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.rsg-slider a.rsg-slide-cta:hover,
.rsg-slider a.rsg-slide-cta:focus {
	color: #fff !important;
	transform: translateY(-2px);
	filter: brightness(1.08);
	box-shadow: 0 14px 38px rgba(0, 99, 186, .56);
}
.rsg-slide-cta svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* ── Prev / next ──────────────────────────────────────────────────────── */

.rsg-slider-nav {
	position: absolute;
	top: 50%;
	z-index: 5;
	width: 52px;
	height: 52px;
	margin-top: -26px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .16);
	background: rgba(10, 14, 22, .6);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transition: opacity .25s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.rsg-slider-prev { left: 18px; transform: translateX(-8px); }
.rsg-slider-next { right: 18px; transform: translateX(8px); }

/* Revealed on hover/focus so they never sit on top of the art unprompted */
.rsg-slider:hover .rsg-slider-nav,
.rsg-slider:focus-within .rsg-slider-nav { opacity: 1; transform: none; }

.rsg-slider-nav:hover {
	background: rgba(0, 99, 186, .82);
	border-color: rgba(58, 163, 255, .5);
}
.rsg-slider-nav:focus-visible {
	opacity: 1;
	transform: none;
	outline: 2px solid var(--rsg-accent);
	outline-offset: 3px;
}
.rsg-slider-nav svg { width: 21px; height: 21px; }

/* ── Dots ─────────────────────────────────────────────────────────────── */

.rsg-slider-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 22px;
	z-index: 5;
	display: flex;
	justify-content: center;
	gap: 9px;
	padding: 0 20px;
}

.rsg-slider-dot {
	position: relative;
	width: 34px;
	height: 5px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .34);
	box-shadow: 0 1px 6px rgba(0, 0, 0, .5);
	cursor: pointer;
	overflow: hidden;
	transition: width .3s ease, background .2s ease;
}
.rsg-slider-dot:hover { background: rgba(255, 255, 255, .5); }
.rsg-slider-dot:focus-visible { outline: 2px solid var(--rsg-accent); outline-offset: 3px; }
.rsg-slider-dot.is-active { width: 58px; background: rgba(255, 255, 255, .24); }

/*
 * The fill doubles as an autoplay progress bar. JS sets --rsg-dot-ms and adds
 * .is-running; a paused slider simply keeps the fill at full width.
 */
.rsg-slider-dot-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	border-radius: 999px;
	background: var(--rsg-accent);
}
.rsg-slider-dot.is-active .rsg-slider-dot-fill { width: 100%; }
.rsg-slider-dot.is-active.is-running .rsg-slider-dot-fill {
	width: 0;
	animation: rsg-dot-progress var(--rsg-dot-ms, 7000ms) linear forwards;
}

@keyframes rsg-dot-progress { from { width: 0; } to { width: 100%; } }

/* Single slide: nothing to navigate */
.rsg-slider.is-single .rsg-slider-nav,
.rsg-slider.is-single .rsg-slider-dots { display: none; }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
	.rsg-slide-inner { gap: 34px; padding: 46px 60px; }
	.rsg-slide-art { width: 214px; }
	.rsg-slide { min-height: 430px; }
}

@media (max-width: 860px) {
	.rsg-slide { min-height: 400px; }
	.rsg-slide-inner { gap: 26px; padding: 40px 46px; }
	.rsg-slide-art { width: 172px; }
	.rsg-slider p.rsg-slide-text { display: none; }
	.rsg-slider-nav { width: 44px; height: 44px; margin-top: -22px; }
	.rsg-slider-prev { left: 10px; }
	.rsg-slider-next { right: 10px; }
}

@media (max-width: 640px) {
	/* Art above the text; nav buttons would sit on the poster, so they go */
	.rsg-slide { min-height: 0; }
	.rsg-slide-inner {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 20px;
		padding: 34px 20px 54px;
	}
	.rsg-slide-art { width: 156px; }
	.rsg-slide-body { max-width: none; }
	.rsg-slide-meta { justify-content: center; }
	.rsg-slider-nav { display: none; }
	.rsg-slider-dots { bottom: 16px; }
	.rsg-slider a.rsg-slide-cta { padding: 13px 26px; font-size: 14px; }
}

/* ── Motion preferences ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.rsg-slider-track { transition: none; }
	.rsg-slide-art,
	.rsg-slide-eyebrow,
	.rsg-slide-title,
	.rsg-slide-meta,
	.rsg-slide-text,
	.rsg-slide-cta {
		transition: none;
		transform: none;
		opacity: 1;
	}
	.rsg-slider-dot.is-active.is-running .rsg-slider-dot-fill { animation: none; width: 100%; }
	.rsg-slider a.rsg-slide-cta:hover { transform: none; }
}
