/**
 * JurSoc YouTube — sección clara, sutil y delicada.
 */

.jursoc-yt {
	--jyt-ink: #0f172a;
	--jyt-muted: #64748b;
	--jyt-line: rgba(15, 39, 68, 0.08);
	--jyt-line-strong: rgba(15, 39, 68, 0.14);
	--jyt-surface: #f7f9fc;
	--jyt-surface-2: #eef3f9;
	--jyt-navy: #003366;
	--jyt-navy-soft: rgba(0, 51, 102, 0.08);
	--jyt-focus: #c9a227;
	position: relative;
	isolation: isolate;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: clamp(2.25rem, 4.5vw, 3.5rem) 0 clamp(2.5rem, 5vw, 3.75rem);
	color: var(--jyt-ink);
	overflow: hidden;
	box-sizing: border-box;
}

.jursoc-yt__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background:
		radial-gradient(80% 55% at 100% 0%, rgba(0, 51, 102, 0.045), transparent 58%),
		radial-gradient(70% 50% at 0% 100%, rgba(201, 162, 39, 0.04), transparent 55%),
		linear-gradient(180deg, #fbfcfe 0%, var(--jyt-surface) 48%, var(--jyt-surface-2) 100%);
}

.jursoc-yt__bg::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(0, 51, 102, 0.12) 20%,
		rgba(0, 51, 102, 0.12) 80%,
		transparent 100%
	);
}

.jursoc-yt__bg::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(0, 51, 102, 0.1) 20%,
		rgba(0, 51, 102, 0.1) 80%,
		transparent 100%
	);
}

.jursoc-yt__cta {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--jyt-line-strong);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.72);
	color: var(--jyt-navy);
	font-size: 0.82rem;
	font-weight: 550;
	letter-spacing: 0.01em;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
	transition:
		color 0.22s ease,
		border-color 0.22s ease,
		background-color 0.22s ease,
		box-shadow 0.22s ease,
		gap 0.22s ease;
}

.jursoc-yt__cta:hover,
.jursoc-yt__cta:focus-visible {
	color: var(--jyt-navy);
	border-color: color-mix(in srgb, var(--jyt-navy) 28%, var(--jyt-line-strong));
	background: #fff;
	gap: 0.55rem;
	box-shadow: 0 4px 14px rgba(15, 39, 68, 0.07);
}

.jursoc-yt__cta:focus-visible {
	outline: 2px solid var(--jyt-focus);
	outline-offset: 3px;
}

.jursoc-yt__cta-icon {
	display: inline-flex;
	opacity: 0.65;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.jursoc-yt__cta:hover .jursoc-yt__cta-icon,
.jursoc-yt__cta:focus-visible .jursoc-yt__cta-icon {
	opacity: 1;
	transform: translate(1px, -1px);
}

.jursoc-yt__stage {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
	min-width: 0;
	padding: 0 clamp(1rem, 3vw, 2.25rem);
	box-sizing: border-box;
}

.jursoc-yt__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 0;
	max-height: min(58vh, 560px);
	border-radius: 14px;
	overflow: hidden;
	background: #0b1220;
	border: 1px solid var(--jyt-line);
	box-shadow:
		0 1px 2px rgba(15, 39, 68, 0.04),
		0 12px 32px rgba(15, 39, 68, 0.08);
	transition:
		max-height 0.35s ease,
		box-shadow 0.35s ease;
}

.jursoc-yt__player.is-playing {
	aspect-ratio: 16 / 9;
	width: 100%;
	min-height: 0;
	max-height: none;
	height: auto;
	box-shadow:
		0 1px 2px rgba(15, 39, 68, 0.04),
		0 16px 40px rgba(15, 39, 68, 0.1);
}

.jursoc-yt__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	text-align: left;
}

.jursoc-yt__poster {
	position: absolute;
	inset: 0;
	overflow: hidden;
	transform: scale(1.01);
	transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.jursoc-yt__poster-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transform: translateZ(0);
	filter: saturate(0.94) contrast(1.02);
	transition: filter 0.5s ease;
}

.jursoc-yt__poster::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(
			180deg,
			rgba(8, 18, 34, 0.08) 0%,
			rgba(8, 18, 34, 0.12) 42%,
			rgba(8, 18, 34, 0.62) 100%
		);
	pointer-events: none;
}

.jursoc-yt__play:hover .jursoc-yt__poster,
.jursoc-yt__play:focus-visible .jursoc-yt__poster {
	transform: scale(1.025);
}

.jursoc-yt__play:hover .jursoc-yt__poster-img,
.jursoc-yt__play:focus-visible .jursoc-yt__poster-img {
	filter: saturate(1) contrast(1.04);
}

.jursoc-yt__play-btn {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: clamp(3.25rem, 5.5vw, 3.85rem);
	height: clamp(3.25rem, 5.5vw, 3.85rem);
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.55);
	background: rgba(255, 255, 255, 0.88);
	color: var(--jyt-navy);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow:
		0 1px 2px rgba(15, 39, 68, 0.08),
		0 10px 28px rgba(15, 39, 68, 0.16);
	transition:
		transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
		background-color 0.28s ease,
		border-color 0.28s ease,
		color 0.28s ease,
		box-shadow 0.28s ease;
}

.jursoc-yt__play-btn .lucide {
	margin-left: 2px;
	fill: currentColor;
	stroke: none;
}

.jursoc-yt__play:hover .jursoc-yt__play-btn,
.jursoc-yt__play:focus-visible .jursoc-yt__play-btn {
	transform: scale(1.06);
	background: #fff;
	border-color: transparent;
	color: var(--jyt-navy);
	box-shadow:
		0 2px 4px rgba(15, 39, 68, 0.08),
		0 14px 32px rgba(15, 39, 68, 0.18);
}

.jursoc-yt__play:focus-visible {
	outline: none;
}

.jursoc-yt__play:focus-visible .jursoc-yt__play-btn {
	outline: 2px solid var(--jyt-focus);
	outline-offset: 4px;
}

.jursoc-yt__play-title {
	position: absolute;
	z-index: 1;
	left: 0;
	right: 0;
	bottom: 0;
	padding: clamp(1.1rem, 2.5vw, 1.5rem) clamp(1rem, 2.5vw, 1.5rem);
	font-family: var(--font-heading, "Bitter", serif);
	font-size: clamp(0.95rem, 1.5vw, 1.2rem);
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: -0.01em;
	color: #f8fafc;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	pointer-events: none;
}

.jursoc-yt__frame-wrap {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #000;
}

.jursoc-yt__frame-wrap iframe {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.jursoc-yt__player.is-playing .jursoc-yt__play {
	display: none;
}

.jursoc-yt__rail {
	padding: 0;
	box-sizing: border-box;
}

.jursoc-yt__rail-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.55rem;
	border-bottom: 1px solid var(--jyt-line);
}

.jursoc-yt__rail-label {
	margin: 0;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--jyt-muted);
}

.jursoc-yt__rail-actions {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}

.jursoc-yt__toolbar {
	display: flex;
	justify-content: flex-end;
}

.jursoc-yt__rail-nav {
	display: inline-flex;
	gap: 0.35rem;
}

.jursoc-yt__nav-btn {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	margin: 0;
	padding: 0;
	border: 1px solid var(--jyt-line-strong);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.75);
	color: var(--jyt-navy);
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.jursoc-yt__nav-btn:hover,
.jursoc-yt__nav-btn:focus-visible {
	background: #fff;
	border-color: color-mix(in srgb, var(--jyt-navy) 22%, var(--jyt-line-strong));
	box-shadow: 0 2px 8px rgba(15, 39, 68, 0.06);
}

.jursoc-yt__nav-btn:focus-visible {
	outline: 2px solid var(--jyt-focus);
	outline-offset: 2px;
}

.jursoc-yt__nav-btn:disabled {
	opacity: 0.35;
	cursor: default;
	box-shadow: none;
}

.jursoc-yt__track {
	display: flex;
	gap: 0.85rem;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-behavior: smooth;
	padding: 0.15rem 0.05rem 0.35rem;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 51, 102, 0.22) transparent;
}

.jursoc-yt__track:focus-visible {
	outline: 2px solid var(--jyt-focus);
	outline-offset: 3px;
}

.jursoc-yt__thumb {
	flex: 0 0 clamp(10.25rem, 15vw, 12.5rem);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	cursor: pointer;
	scroll-snap-align: start;
}

.jursoc-yt__thumb-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background-position: center;
	background-size: cover;
	border: 1px solid var(--jyt-line);
	box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
	overflow: hidden;
	transition:
		transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
		border-color 0.3s ease,
		box-shadow 0.3s ease;
}

.jursoc-yt__thumb-media::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 60%, rgba(8, 18, 34, 0.22) 100%);
	opacity: 0.55;
	pointer-events: none;
}

.jursoc-yt__thumb-media::after {
	content: "";
	position: absolute;
	left: 0.55rem;
	right: 0.55rem;
	bottom: 0;
	height: 2px;
	border-radius: 999px;
	background: var(--jyt-navy);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.28s ease;
}

.jursoc-yt__thumb:hover .jursoc-yt__thumb-media,
.jursoc-yt__thumb:focus-visible .jursoc-yt__thumb-media {
	transform: translateY(-2px);
	border-color: color-mix(in srgb, var(--jyt-navy) 18%, var(--jyt-line));
	box-shadow: 0 8px 20px rgba(15, 39, 68, 0.1);
}

.jursoc-yt__thumb:hover .jursoc-yt__thumb-media::after,
.jursoc-yt__thumb:focus-visible .jursoc-yt__thumb-media::after,
.jursoc-yt__thumb.is-active .jursoc-yt__thumb-media::after {
	transform: scaleX(1);
}

.jursoc-yt__thumb.is-active .jursoc-yt__thumb-media {
	border-color: color-mix(in srgb, var(--jyt-navy) 28%, var(--jyt-line));
	box-shadow:
		0 0 0 1px color-mix(in srgb, var(--jyt-navy) 12%, transparent),
		0 6px 16px rgba(15, 39, 68, 0.09);
}

.jursoc-yt__thumb:focus-visible {
	outline: none;
}

.jursoc-yt__thumb-label {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-family: var(--font-heading, "Bitter", serif);
	font-size: 0.8rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -0.01em;
	color: color-mix(in srgb, var(--jyt-ink) 78%, #64748b);
	transition: color 0.2s ease;
}

.jursoc-yt__thumb.is-active .jursoc-yt__thumb-label,
.jursoc-yt__thumb:hover .jursoc-yt__thumb-label {
	color: var(--jyt-navy);
}

.jursoc-yt__reveal {
	opacity: 0;
	transform: translateY(10px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.jursoc-yt.is-inview .jursoc-yt__reveal {
	opacity: 1;
	transform: none;
}

.jursoc-yt.is-inview .jursoc-yt__stage {
	transition-delay: 0.08s;
}

@media (max-width: 760px) {
	.jursoc-yt__rail-head {
		flex-wrap: wrap;
		gap: 0.65rem;
	}

	.jursoc-yt__rail-actions {
		width: 100%;
		justify-content: space-between;
	}

	.jursoc-yt__player {
		aspect-ratio: 16 / 9;
		min-height: 0;
		max-height: none;
		border-radius: 12px;
	}

	.jursoc-yt__thumb {
		flex-basis: clamp(9rem, 44vw, 11rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.jursoc-yt__reveal,
	.jursoc-yt__poster,
	.jursoc-yt__poster-img,
	.jursoc-yt__play-btn,
	.jursoc-yt__thumb-media,
	.jursoc-yt__thumb-media::after,
	.jursoc-yt__cta,
	.jursoc-yt__cta-icon,
	.jursoc-yt__track,
	.jursoc-yt__player {
		transition: none !important;
		scroll-behavior: auto;
	}

	.jursoc-yt__reveal {
		opacity: 1;
		transform: none;
	}
}
