/**
 * Rotador cinematográfico — full-bleed, rail de miniaturas, Ken Burns.
 */

.jursoc-cinematic-band {
	--jcin-primary: #003366;
	--jcin-accent: #c9a227;
	--jcin-accent-soft: #8b6914;
	--jcin-ink: #ffffff;
	--jcin-glass: #f8fafc;
	--jcin-glass-border: #e2e8f0;
	/* Halo legible sobre fotos claras u oscuras */
	--jcin-text-halo:
		0 0 1px #fff,
		0 0 10px rgba(255, 255, 255, 0.98),
		0 0 22px rgba(255, 255, 255, 0.92),
		0 1px 2px rgba(15, 23, 42, 0.55),
		0 2px 12px rgba(0, 33, 71, 0.35);
	--jcin-text-halo-soft:
		0 0 8px rgba(255, 255, 255, 0.95),
		0 1px 2px rgba(15, 23, 42, 0.45);
	position: relative;
	z-index: 1;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow: hidden;
	background: #fff;
	border-bottom: 1px solid #e8ecf1;
}

.jursoc-news-rotator--cinematic {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: clamp(420px, 72vh, 680px);
	color: #0f172a;
}

/* Sin fondos decorativos oscuros */
.jursoc-cinematic__mesh,
.jursoc-cinematic__glow {
	display: none;
}

.jursoc-cinematic__counter {
	display: flex;
	align-items: baseline;
	flex-shrink: 0;
	gap: 0.35rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	font-size: clamp(1rem, 2vw, 1.25rem);
	line-height: 1;
	letter-spacing: -0.03em;
}

.jursoc-news-rotator--cinematic .jursoc-news-rotator__counter-current {
	color: var(--jcin-accent);
}

.jursoc-cinematic__counter-sep,
.jursoc-cinematic__counter-total {
	color: #94a3b8;
	font-size: 0.65em;
	font-weight: 600;
}

/* Layout principal */
.jursoc-cinematic__layout {
	position: relative;
	z-index: 2;
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
	gap: clamp(0.75rem, 2vw, 1.25rem);
	padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1.25rem, 4vw, 3rem) clamp(1rem, 2vw, 1.5rem);
	min-height: 0;
}

.jursoc-cinematic__stage {
	position: relative;
	z-index: 1;
	min-height: clamp(380px, 58vh, 560px);
	border-radius: clamp(12px, 1.5vw, 20px);
	overflow: hidden;
	border: 1px solid #e8ecf1;
	box-shadow: 0 8px 32px rgba(0, 33, 71, 0.08);
	background: #fff;
}

.jursoc-cinematic__track {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: inherit;
}

.jursoc-cinematic__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.7s;
	z-index: 0;
}

.jursoc-cinematic__slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 1;
}

.jursoc-cinematic__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #f8fafc;
}

.jursoc-cinematic__bg {
	position: absolute;
	inset: -4%;
	width: 108%;
	height: 108%;
	object-fit: cover;
	display: block;
	background-color: #f1f5f9;
	transform: scale(1.08);
	transition: transform 8s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.jursoc-cinematic__bg--default {
	background-size: cover;
	background-position: center;
	background-color: #eef4fa;
}

.jursoc-cinematic__bg--placeholder {
	background: linear-gradient(145deg, #eef4fa 0%, #f8fafc 50%, #e8ecf1 100%);
}

.jursoc-cinematic__slide.is-active .jursoc-cinematic__bg {
	transform: scale(1);
}

/* Aclarado inferior (blanco) para leer el texto sobre la foto */
.jursoc-cinematic__scrim {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 62%;
	background: linear-gradient(
		180deg,
		transparent 0%,
		rgba(255, 255, 255, 0.82) 32%,
		rgba(255, 255, 255, 0.96) 58%,
		#fff 78%
	);
	pointer-events: none;
}

.jursoc-cinematic__content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	padding:
		clamp(1.5rem, 4vw, 2.75rem)
		clamp(4rem, 12vw, 5.5rem)
		clamp(1.35rem, 3vw, 2rem);
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.65rem;
	pointer-events: none;
	transform: translateY(12px);
	opacity: 0;
	transition:
		transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
		opacity 0.55s ease 0.12s;
}

.jursoc-cinematic__slide.is-active .jursoc-cinematic__content {
	transform: translateY(0);
	opacity: 1;
}

.jursoc-cinematic__cat {
	display: inline-flex;
	align-self: center;
	font-size: 0.65rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	background: var(--cat-color, var(--jcin-primary));
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 2px 12px rgba(0, 33, 71, 0.12);
}

.jursoc-cinematic__title {
	margin: 0;
	width: 100%;
	max-width: min(92%, 40rem);
	font-size: clamp(1.65rem, 4.2vw, 2.85rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: #0f172a;
	text-align: center;
	text-wrap: balance;
	text-shadow: var(--jcin-text-halo);
	overflow: visible;
	filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.85));
}

.jursoc-cinematic__title-link {
	color: inherit;
	text-decoration: none;
	pointer-events: auto;
	text-shadow: inherit;
}

.jursoc-cinematic__title-link:hover {
	color: var(--jcin-primary);
}

.jursoc-cinematic__excerpt {
	margin: 0;
	font-size: clamp(0.9rem, 1.5vw, 1.05rem);
	line-height: 1.55;
	color: #334155;
	text-shadow: var(--jcin-text-halo-soft);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	width: 100%;
	max-width: 48ch;
	text-align: center;
}

.jursoc-cinematic__meta {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	width: 100%;
	max-width: 48ch;
	margin-top: 0.35rem;
	padding-top: 0.85rem;
	border-top: 1px solid #e2e8f0;
}

.jursoc-cinematic__date {
	font-size: 0.8rem;
	color: #475569;
	font-variant-numeric: tabular-nums;
	text-shadow: var(--jcin-text-halo-soft);
}

.jursoc-cinematic__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.78rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--jcin-primary);
	text-decoration: none;
	pointer-events: auto;
	text-shadow: var(--jcin-text-halo-soft);
	transition: gap 0.25s ease, color 0.25s ease;
}

.jursoc-cinematic__cta:hover {
	gap: 0.65rem;
	color: var(--jcin-accent);
}

/* Navegación lateral en escenario */
.jursoc-cinematic__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 30;
	pointer-events: auto;
	width: 48px;
	height: 48px;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(8px);
	color: var(--jcin-primary);
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 33, 71, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.25s, transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

/* Fallback robusto: flechas por CSS (evita desaparición por estilos externos sobre SVG) */
.jursoc-cinematic__nav::before {
	display: block;
	font-size: 1.55rem;
	line-height: 1;
	font-weight: 700;
	color: currentColor;
	transform: translateY(-1px);
}

.jursoc-cinematic__nav--prev::before {
	content: "‹";
}

.jursoc-cinematic__nav--next::before {
	content: "›";
}

.jursoc-cinematic__nav > svg {
	display: none !important;
}

.jursoc-cinematic__nav:hover {
	background: var(--jcin-accent);
	border-color: var(--jcin-accent);
	color: #fff;
	transform: translateY(-50%) scale(1.06);
	box-shadow: 0 6px 20px rgba(201, 162, 39, 0.35);
}

.jursoc-cinematic__nav--prev { left: clamp(0.65rem, 2vw, 1.25rem); }
.jursoc-cinematic__nav--next { right: clamp(0.65rem, 2vw, 1.25rem); }

/* Rail de miniaturas */
.jursoc-cinematic__rail {
	position: relative;
	z-index: 4;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-height: 0;
	padding: 0.25rem 0;
}

.jursoc-cinematic__rail-title {
	margin: 0;
	font-size: 0.65rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: #94a3b8;
}

.jursoc-cinematic__thumbs {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.jursoc-cinematic__thumb {
	display: grid;
	grid-template-columns: auto 72px minmax(0, 1fr);
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.65rem;
	border: 1px solid var(--jcin-glass-border);
	border-radius: 12px;
	background: var(--jcin-glass);
	backdrop-filter: none;
	cursor: pointer;
	text-align: left;
	color: inherit;
	font: inherit;
	transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.jursoc-cinematic__thumb:hover {
	border-color: #cbd5e1;
	background: #f1f5f9;
	transform: translateX(4px);
}

.jursoc-cinematic__thumb.is-active {
	border-color: var(--jcin-accent);
	background: color-mix(in srgb, var(--jcin-accent) 10%, #fff);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--jcin-accent) 30%, transparent) inset;
}

.jursoc-cinematic__thumb-num {
	font-size: 0.7rem;
	font-weight: 800;
	color: #94a3b8;
	font-variant-numeric: tabular-nums;
}

.jursoc-cinematic__thumb.is-active .jursoc-cinematic__thumb-num {
	color: var(--jcin-accent);
}

.jursoc-cinematic__thumb-media {
	width: 72px;
	height: 52px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	background: #e2e8f0;
}

.jursoc-cinematic__thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background-size: cover;
	background-position: center;
}

.jursoc-cinematic__thumb-text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.jursoc-cinematic__thumb-cat {
	font-size: 0.58rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
	opacity: 1;
}

.jursoc-cinematic__thumb-title {
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.3;
	color: #1e293b;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Footer / progreso */
.jursoc-cinematic__footer {
	position: relative;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(1rem, 2.5vw, 1.5rem);
}

.jursoc-cinematic__progress {
	flex: 1;
	height: 3px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
}

.jursoc-news-rotator--cinematic .jursoc-news-rotator__progress-fill {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--jcin-accent), var(--jcin-accent-soft));
	border-radius: inherit;
}

@keyframes jcin-rotator-progress {
	from { width: 0; }
	to { width: 100%; }
}

.jursoc-cinematic__dots {
	display: flex;
	gap: 0.4rem;
	flex-shrink: 0;
}

.jursoc-cinematic__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: #cbd5e1;
	cursor: pointer;
	pointer-events: auto;
	transition: width 0.3s, background 0.3s;
}

.jursoc-cinematic__dot.is-active {
	width: 28px;
	background: var(--jcin-accent);
}

/* Vacío */
.jursoc-news-rotator--cinematic.jursoc-news-rotator--empty {
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

/* —— Móvil —— */
@media (max-width: 900px) {
	.jursoc-news-rotator--cinematic {
		min-height: clamp(380px, 85vh, 560px);
	}

	.jursoc-cinematic__layout {
		grid-template-columns: 1fr;
		padding-bottom: 0.5rem;
	}

	.jursoc-cinematic__stage {
		min-height: clamp(360px, 62vh, 500px);
	}

	.jursoc-cinematic__rail {
		order: 1;
		padding-top: 0;
	}

	.jursoc-cinematic__rail-title {
		display: none;
	}

	.jursoc-cinematic__thumbs {
		flex-direction: row;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 0.5rem;
		padding-bottom: 0.25rem;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
	}

	.jursoc-cinematic__thumb {
		flex: 0 0 min(240px, 78vw);
		grid-template-columns: auto 64px minmax(0, 1fr);
		scroll-snap-align: start;
	}

	.jursoc-cinematic__thumb:hover {
		transform: none;
	}

	.jursoc-cinematic__content {
		padding-left: clamp(3.25rem, 14vw, 4.25rem);
		padding-right: clamp(3.25rem, 14vw, 4.25rem);
		padding-bottom: clamp(1.1rem, 4vw, 1.5rem);
	}

	.jursoc-cinematic__title {
		font-size: clamp(1.35rem, 6vw, 1.85rem);
		max-width: min(94%, 28rem);
	}

	.jursoc-cinematic__excerpt {
		-webkit-line-clamp: 2;
	}

	.jursoc-cinematic__nav {
		width: 42px;
		height: 42px;
	}
}

@media (max-width: 480px) {
	.jursoc-cinematic__layout,
	.jursoc-cinematic__footer {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.jursoc-cinematic__meta {
		flex-direction: column;
		align-items: center;
		gap: 0.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jursoc-cinematic__glow,
	.jursoc-cinematic__bg {
		animation: none;
		transition: none;
	}

	.jursoc-cinematic__slide,
	.jursoc-cinematic__content {
		transition: none;
	}

	.jursoc-news-rotator--cinematic .jursoc-news-rotator__progress-fill {
		display: none;
	}
}
