/**
 * RetroTube Child - Dedicated Shorts Stylesheet
 * Consolidates all vertical short cards, homepage & category rails, archive grid,
 * paywall gating overlays, and the headerless mobile-native app snap-scroll feed.
 *
 * @package RetroTube_Child
 */

/* ==========================================================================
   1. VARIABLES & BASE RESETS FOR SHORTS
   ========================================================================== */
:root {
	--shorts-header-offset: 0px;
	--shorts-bottom-bar-height: 56px;
}

/* ==========================================================================
   2. VERTICAL SHORT CARDS & ARCHIVE GRID
   ========================================================================== */
.shorts-grid.shorts-grid {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
	gap: 16px 12px !important;
}

.short-card.short-card {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	float: none !important;
	margin: 0 !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	position: relative !important;
	display: flex !important;
	flex-direction: column !important;
}

.short-card .short-thumb {
	position: relative !important;
	aspect-ratio: 9 / 16 !important;
	width: 100% !important;
	height: auto !important;
	border-radius: var(--c-radius-lg, 8px) !important;
	overflow: hidden !important;
	background: var(--c-surface-2, #18181f) !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	max-height: 420px !important;
}

.short-card .short-thumb .video-main-thumb {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	transform: scale(1);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.short-card:hover .video-main-thumb {
	transform: scale(1.05) !important;
}

.short-card .short-play-badge {
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	width: 44px !important;
	height: 44px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: #ffffff !important;
	background: rgba(0, 0, 0, 0.45) !important;
	backdrop-filter: blur(4px) !important;
	border-radius: var(--c-radius-pill, 9999px) !important;
	opacity: 0.85;
	z-index: 15 !important;
	transition: var(--c-transition, all 0.2s ease) !important;
	pointer-events: none !important;
}

.short-card:hover .short-play-badge {
	opacity: 1;
	background: rgba(0, 0, 0, 0.65) !important;
}

.short-card .badge-duration {
	position: absolute !important;
	bottom: 8px !important;
	right: 8px !important;
	z-index: 15 !important;
	background: rgba(0, 0, 0, 0.75) !important;
	color: #ffffff !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	padding: 4px 7px !important;
	border-radius: var(--c-radius-sm, 4px) !important;
	pointer-events: none !important;
}

.short-card .short-card-body {
	padding: 10px 2px 0 2px !important;
	background: transparent !important;
	border: none !important;
}

.short-card .short-title {
	font-size: 13px !important;
	font-weight: 600 !important;
	color: var(--c-white, #ffffff) !important;
	margin: 0 !important;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.short-open-feed-link {
	display: inline-flex !important;
	align-items: center !important;
	gap: 4px !important;
	font-size: 11px !important;
	color: var(--c-text-muted, #71717a) !important;
	text-transform: uppercase !important;
	letter-spacing: 0.04em !important;
}

.short-open-feed-link:hover {
	color: var(--c-white, #ffffff) !important;
}

/* --- Archive Header / Load More --- */
.shorts-archive-header .widget-title {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
}

.shorts-more-wrap {
	display: flex !important;
	justify-content: center !important;
	margin: 24px 0 40px 0 !important;
}

.btn-load-more-shorts.is-busy {
	opacity: 0.55;
	pointer-events: none;
}

/* ==========================================================================
   3. HOMEPAGE & CATEGORY HORIZONTAL RAIL
   ========================================================================== */
.shorts-rail-section {
	margin-bottom: 36px !important;
}

.shorts-rail-header {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	margin-bottom: 14px !important;
	padding-bottom: 10px !important;
	border-bottom: 1px solid var(--c-border, #272732) !important;
}

.shorts-rail-title {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	margin: 0 !important;
	font-size: 20px !important;
}

.shorts-rail-view-all {
	font-size: 13px !important;
	color: var(--c-text-secondary, #a1a1aa) !important;
	padding: 5px 12px !important;
	border: 1px solid var(--c-border, #272732) !important;
	border-radius: var(--c-radius-pill, 9999px) !important;
	white-space: nowrap !important;
}

.shorts-rail-view-all:hover {
	color: var(--c-white, #ffffff) !important;
	border-color: var(--c-border-hover, #ffffff) !important;
}

.shorts-rail-scroller {
	display: grid !important;
	grid-auto-flow: column !important;
	grid-auto-columns: minmax(150px, 180px) !important;
	gap: 14px !important;
	overflow-x: auto !important;
	overscroll-behavior-x: contain !important;
	scroll-snap-type: x mandatory !important;
	padding-bottom: 6px !important;
	scrollbar-width: thin;
	scrollbar-color: var(--c-border, #272732) transparent;
}

.shorts-rail-scroller::-webkit-scrollbar {
	height: 6px;
}

.shorts-rail-scroller::-webkit-scrollbar-thumb {
	background: var(--c-border, #272732);
	border-radius: 9999px;
}

.shorts-rail-scroller .short-card {
	scroll-snap-align: start !important;
}

/* ==========================================================================
   4. SINGLE SHORTS: IMMERSIVE MOBILE-NATIVE SNAP-SCROLL FEED
   ========================================================================== */

/* Remove desktop site header and footer on single-shorts */
body.single-shorts {
	overflow: hidden !important;
	background: #000000 !important;
}

body.single-shorts #masthead,
body.single-shorts .site-header,
body.single-shorts .site-footer,
body.single-shorts #colophon,
body.single-shorts #back-to-top {
	display: none !important;
}

body.single-shorts #page,
body.single-shorts .site-wrapper {
	min-height: 100vh !important;
	min-height: 100dvh !important;
	height: 100vh !important;
	height: 100dvh !important;
	overflow: hidden !important;
}

body.single-shorts #primary,
body.single-shorts #main,
body.single-shorts #content,
body.single-shorts .site-content {
	padding: 0 !important;
	margin: 0 !important;
	max-width: 100% !important;
	width: 100% !important;
	height: calc(100vh - var(--shorts-bottom-bar-height, 56px)) !important;
	height: calc(100dvh - var(--shorts-bottom-bar-height, 56px)) !important;
	overflow: hidden !important;
}

/* Force Mobile Bottom Bar on ALL devices (desktop + mobile) */
body.single-shorts .mobile-bottom-bar {
	display: flex !important;
	position: fixed !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	height: var(--shorts-bottom-bar-height, 56px) !important;
	background: rgba(14, 14, 18, 0.98) !important;
	backdrop-filter: blur(20px) !important;
	-webkit-backdrop-filter: blur(20px) !important;
	border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
	z-index: 9999 !important;
}

/* Floating Mobile Top Bar */
.shorts-floating-topbar {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	height: 56px !important;
	z-index: 95 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	padding: 0 16px !important;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 70%, transparent 100%) !important;
	pointer-events: none !important;
}

.shorts-floating-topbar button,
.shorts-floating-topbar a {
	pointer-events: auto !important;
}

.btn-shorts-back {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 40px !important;
	height: 40px !important;
	background: rgba(18, 18, 24, 0.7) !important;
	backdrop-filter: blur(10px) !important;
	-webkit-backdrop-filter: blur(10px) !important;
	border: 1px solid rgba(255, 255, 255, 0.18) !important;
	border-radius: 50% !important;
	color: #ffffff !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
}

.btn-shorts-back:hover {
	background: rgba(255, 255, 255, 0.22) !important;
	border-color: #ffffff !important;
	transform: scale(1.05);
}

.shorts-topbar-brand {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	padding: 6px 14px !important;
	background: rgba(18, 18, 24, 0.6) !important;
	backdrop-filter: blur(10px) !important;
	-webkit-backdrop-filter: blur(10px) !important;
	border: 1px solid rgba(255, 255, 255, 0.12) !important;
	border-radius: 20px !important;
	color: #ffffff !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: 0.3px !important;
	user-select: none !important;
}

.shorts-topbar-brand svg {
	color: #ffffff;
}

.shorts-topbar-actions {
	width: 40px;
	height: 40px;
}

/* Feed Track & Snap-Scroll Container */
.shorts-feed {
	position: relative !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	z-index: 90 !important;
	background: #000000 !important;
	overflow-y: scroll !important;
	overscroll-behavior-y: contain !important;
	scroll-snap-type: y mandatory !important;
	scrollbar-width: none !important;
	-ms-overflow-style: none !important;
	height: calc(100vh - var(--shorts-bottom-bar-height, 56px)) !important;
	height: calc(100dvh - var(--shorts-bottom-bar-height, 56px)) !important;
}

.shorts-feed::-webkit-scrollbar {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
}

.shorts-track {
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	min-height: 100% !important;
}

/* Individual Short Stage */
.short-stage {
	position: relative !important;
	width: 100% !important;
	height: calc(100vh - var(--shorts-bottom-bar-height, 56px)) !important;
	height: calc(100dvh - var(--shorts-bottom-bar-height, 56px)) !important;
	min-height: calc(100vh - var(--shorts-bottom-bar-height, 56px)) !important;
	min-height: calc(100dvh - var(--shorts-bottom-bar-height, 56px)) !important;
	max-height: calc(100vh - var(--shorts-bottom-bar-height, 56px)) !important;
	max-height: calc(100dvh - var(--shorts-bottom-bar-height, 56px)) !important;
	scroll-snap-align: start !important;
	scroll-snap-stop: always !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #000000 !important;
	flex: 0 0 auto !important;
	padding: 12px 16px !important;
	box-sizing: border-box !important;
}

/* Clean 9:16 Phone-App Frame on Desktop */
.short-stage-inner {
	position: relative !important;
	width: 100% !important;
	height: 100% !important;
	max-height: 100% !important;
	aspect-ratio: 9 / 16 !important;
	max-width: min(calc((100vh - var(--shorts-bottom-bar-height, 56px) - 24px) * 9 / 16), 460px) !important;
	max-width: min(calc((100dvh - var(--shorts-bottom-bar-height, 56px) - 24px) * 9 / 16), 460px) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #0a0a0e !important;
	border: 1px solid #24242d !important;
	border-radius: 14px !important;
	overflow: hidden !important;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
	box-sizing: border-box !important;
}

.short-player {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	background: #000000 !important;
	display: block !important;
	cursor: pointer !important;
}

.short-progress {
	position: absolute !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	height: 3px !important;
	background: rgba(255, 255, 255, 0.2) !important;
	z-index: 6 !important;
	pointer-events: none !important;
}

.short-progress-bar {
	width: 0 !important;
	height: 100% !important;
	background: #ffffff !important;
	transition: width 0.15s linear !important;
}

.short-unmute-hint {
	position: absolute !important;
	top: 14px !important;
	left: 50% !important;
	transform: translateX(-50%) !important;
	z-index: 7 !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	background: rgba(16, 16, 22, 0.85) !important;
	color: #ffffff !important;
	border: 1px solid rgba(255, 255, 255, 0.3) !important;
	border-radius: 20px !important;
	padding: 6px 14px !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	cursor: pointer !important;
	animation: wpst-pulse-hint 2s ease-in-out infinite !important;
}

.short-stage.has-sound .short-unmute-hint {
	display: none !important;
	animation: none !important;
}

@keyframes wpst-pulse-hint {
	0%, 100% { opacity: 0.75; }
	50% { opacity: 1; }
}

.short-meta-overlay {
	position: absolute !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 5 !important;
	display: flex !important;
	align-items: flex-end !important;
	justify-content: space-between !important;
	gap: 14px !important;
	padding: 48px 16px 20px 16px !important;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%) !important;
	pointer-events: none !important;
}

.short-meta-text {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	gap: 8px !important;
	max-width: 74% !important;
	pointer-events: auto !important;
}

.short-title-link {
	color: #ffffff !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.35 !important;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8) !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.short-model-chip {
	display: inline-flex !important;
	align-items: center !important;
	color: #ffffff !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	background: rgba(255, 255, 255, 0.16) !important;
	border: 1px solid rgba(255, 255, 255, 0.24) !important;
	border-radius: var(--c-radius-pill, 9999px) !important;
	padding: 5px 12px !important;
}

.short-model-chip:hover {
	background: rgba(255, 255, 255, 0.26) !important;
}

.short-views {
	font-size: 12px !important;
	color: var(--c-text-secondary, #a1a1aa) !important;
}

.short-actions {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	gap: 14px !important;
	pointer-events: auto !important;
}

.short-action-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 46px !important;
	height: 46px !important;
	color: #ffffff !important;
	background: rgba(255, 255, 255, 0.14) !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	border-radius: var(--c-radius-pill, 9999px) !important;
	cursor: pointer !important;
	transition: var(--c-transition, all 0.2s ease) !important;
}

.short-action-btn:hover {
	background: rgba(255, 255, 255, 0.28) !important;
	border-color: #ffffff !important;
	color: #ffffff !important;
	transform: scale(1.06);
}

.shorts-feed-loader {
	display: flex !important;
	justify-content: center !important;
	padding: 20px 0 !important;
	visibility: hidden !important;
}

.shorts-feed-loader.is-loading {
	visibility: visible !important;
}

.shorts-feed-loader .spinner {
	width: 28px !important;
	height: 28px !important;
	border: 3px solid rgba(255, 255, 255, 0.2) !important;
	border-top-color: #ffffff !important;
	border-radius: 50% !important;
	animation: wpst-spin 0.8s linear infinite !important;
}

@keyframes wpst-spin {
	to { transform: rotate(360deg); }
}

/* ==========================================================================
   5. MOBILE VIEWPORT OVERRIDES (< 782px)
   ========================================================================== */
@media (max-width: 782px) {
	.short-stage {
		padding: 0 !important;
	}
	.short-stage-inner {
		max-width: 100% !important;
		width: 100% !important;
		height: 100% !important;
		border-radius: 0 !important;
		border: none !important;
		box-shadow: none !important;
	}
	.short-player {
		object-fit: cover !important;
	}
	.shorts-grid.shorts-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
	}
}

/* ==========================================================================
   6. SHORTS PAYWALL OVERLAY (3-SHORTS LIMIT)
   ========================================================================== */
.short-stage.is-stage-locked .short-stage-inner {
	position: relative !important;
	width: 100% !important;
	height: 100% !important;
	overflow: hidden !important;
}

.short-player-poster {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background-size: cover !important;
	background-position: center !important;
	filter: blur(16px) brightness(0.28) !important;
	transform: scale(1.1) !important;
	z-index: 1 !important;
}

.short-paywall-overlay {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 10 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 24px !important;
	box-sizing: border-box !important;
	background: rgba(0, 0, 0, 0.5) !important;
}

.short-paywall-card {
	background: #14141a !important;
	border: 1px solid rgba(255, 255, 255, 0.16) !important;
	border-radius: 16px !important;
	padding: 36px 26px !important;
	max-width: 360px !important;
	width: 100% !important;
	text-align: center !important;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(234, 179, 8, 0.1) !important;
	box-sizing: border-box !important;
	animation: wpstFadeIn 0.3s ease-out forwards !important;
}

.short-paywall-badge {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	background: rgba(234, 179, 8, 0.15) !important;
	border: 1px solid rgba(234, 179, 8, 0.4) !important;
	color: #facc15 !important;
	font-size: 10.5px !important;
	font-weight: 700 !important;
	letter-spacing: 0.6px !important;
	text-transform: uppercase !important;
	padding: 5px 12px !important;
	border-radius: 20px !important;
	margin-bottom: 16px !important;
}

.short-paywall-badge svg {
	color: #facc15 !important;
}

.short-paywall-title {
	font-size: 20px !important;
	font-weight: 800 !important;
	color: #ffffff !important;
	margin: 0 0 12px 0 !important;
	line-height: 1.25 !important;
}

.short-paywall-desc {
	font-size: 13px !important;
	color: #a0a0b2 !important;
	line-height: 1.5 !important;
	margin: 0 0 22px 0 !important;
}

.short-paywall-actions {
	display: flex !important;
	flex-direction: column !important;
	gap: 12px !important;
	align-items: center !important;
	width: 100% !important;
}

.short-btn-upgrade {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	background: #ffffff !important;
	color: #0a0a0c !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	padding: 12px 20px !important;
	border-radius: 24px !important;
	text-decoration: none !important;
	transition: all 0.2s ease !important;
	box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2) !important;
}

.short-btn-upgrade:hover {
	background: #e6e6e6 !important;
	color: #000000 !important;
	transform: translateY(-1px) !important;
}

.short-paywall-login-link {
	font-size: 12.5px !important;
	color: #88889c !important;
	text-decoration: none !important;
}

.short-paywall-login-link:hover {
	color: #ffffff !important;
	text-decoration: underline !important;
}
