/* ==========================================================================
   Film Player — tarjetas con preview + lightbox
   Cambia los tokens de :root para ajustar colores sin tocar el resto.
   ========================================================================== */

:root {
	--fp-ink: #131313;
	--fp-paper: #f4f4f1;
	--fp-accent: #776e77;
	--fp-white: #ffffff;
	--fp-radius: 16px;
	--fp-font: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--fp-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------ Layout */

.fp {
	width: 100%;
	max-width: 1250px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: var(--fp-font);
}

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

.fp-track {
	display: grid;
	grid-template-columns: repeat(var(--fp-cols, 1), minmax(0, 1fr));
	gap: var(--fp-gap, clamp(16px, 2.4vw, 32px));
}

/* Reels: tres columnas a todo el ancho, con aire entre ellas */
.fp--9x16.fp--count-3 { --fp-cols: 3; }
.fp--9x16.fp--count-2 { --fp-cols: 2; max-width: 900px; }
.fp--9x16.fp--count-1 { --fp-cols: 1; max-width: 440px; }

/* Carrusel deslizable, con la siguiente tarjeta asomando:
   tres reels en tablet y móvil; dos reels solo en móvil. */
.fp-track::-webkit-scrollbar {
	display: none;
}

@media (max-width: 1024px) {
	.fp--9x16.fp--count-3 .fp-track {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 42%;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		padding: 8px 0 4px;
		margin-top: -8px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.fp--9x16.fp--count-3 .fp-card {
		scroll-snap-align: start;
	}
}

@media (max-width: 767px) {
	.fp--9x16.fp--count-2 {
		max-width: none;
	}

	.fp--9x16.fp--count-2 .fp-track,
	.fp--9x16.fp--count-3 .fp-track {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 78%;
		gap: 14px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		padding: 8px 0 4px;
		margin-top: -8px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.fp--9x16.fp--count-2 .fp-card,
	.fp--9x16.fp--count-3 .fp-card {
		scroll-snap-align: center;
	}
}

/* Puntos del carrusel (solo aparecen si hay algo que deslizar) */
.fp-dots {
	display: none;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
}

.fp.is-carousel .fp-dots {
	display: flex;
}

.fp-dot {
	width: 8px;
	height: 8px;
	border-radius: 9999px;
	background: rgba(19, 19, 19, 0.2);
	cursor: pointer;
	transition: width 0.4s var(--fp-ease), background 0.3s ease;
}

.fp-dot.is-active {
	width: 24px;
	background: var(--fp-ink);
}

/* -------------------------------------------------------------------- Card */

.fp-card {
	position: relative;
	display: block;
	width: 100%;
	container-type: inline-size;
	overflow: hidden;
	border-radius: var(--fp-radius);
	background: var(--fp-ink);
	cursor: pointer;
	isolation: isolate;
	transform: translateZ(0);
	transition: transform 0.5s var(--fp-ease), box-shadow 0.5s var(--fp-ease);
	-webkit-tap-highlight-color: transparent;
}

.fp--16x9 .fp-card {
	aspect-ratio: 16 / 9;
}

.fp--9x16 .fp-card {
	aspect-ratio: 9 / 16;
}

.fp-card:focus {
	outline: none;
}

.fp-card:focus-visible {
	outline: 2px solid var(--fp-white);
	outline-offset: 3px;
	box-shadow: 0 0 0 6px var(--fp-ink);
}

@media (hover: hover) {
	.fp-card:hover {
		transform: translateY(-4px);
		box-shadow: 0 18px 36px rgba(19, 19, 19, 0.16);
	}
}

/* Poster + preview: desenfocados y ampliados para ocultar bordes y marcas de YouTube */
.fp-card__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.fp-card__poster,
.fp-card__preview {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: scale(1.22);
	filter: blur(14px) saturate(1.1);
	transition: filter 0.9s var(--fp-ease), transform 0.9s var(--fp-ease), opacity 0.9s ease;
}

.fp-card__poster {
	object-fit: cover;
	background: var(--fp-ink);
	display: block;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
}

.fp-card__preview {
	opacity: 0;
	pointer-events: none;
}

.fp-card__preview iframe {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
	pointer-events: none;
}

.fp-card.is-previewing .fp-card__preview {
	opacity: 1;
}

/* Al pasar el mouse, el video se enfoca un poco: invita a verlo */
@media (hover: hover) {
	.fp-card:hover .fp-card__poster,
	.fp-card:hover .fp-card__preview {
		filter: blur(7px) saturate(1.15);
		transform: scale(1.16);
	}
}

.fp-card__veil {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		radial-gradient(120% 80% at 50% 50%, rgba(19, 19, 19, 0.18) 0%, rgba(19, 19, 19, 0.58) 100%),
		linear-gradient(180deg, rgba(19, 19, 19, 0.1) 0%, rgba(19, 19, 19, 0.35) 100%);
	transition: opacity 0.6s var(--fp-ease);
}

@media (hover: hover) {
	.fp-card:hover .fp-card__veil {
		opacity: 0.8;
	}
}

.fp-card__content {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 22px;
	padding: 24px;
	text-align: center;
	color: var(--fp-white);
}

.fp-card__label {
	display: block;
	margin: 0;
	font-family: var(--fp-font);
	font-size: 40px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--fp-white);
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.fp-card__title {
	display: block;
	max-width: 32ch;
	margin: 0;
	font-family: var(--fp-font);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.84);
}

.fp-card__play {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.38);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--fp-white);
	transition: transform 0.5s var(--fp-ease), background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.fp-card__play svg {
	width: 28px;
	height: 28px;
	margin-left: 3px;
	fill: currentColor;
}

@media (hover: hover) {
	.fp-card:hover .fp-card__play {
		transform: scale(1.08);
		background: var(--fp-white);
		border-color: var(--fp-white);
		color: var(--fp-ink);
	}
}

.fp-card:focus-visible .fp-card__play {
	background: var(--fp-white);
	color: var(--fp-ink);
}

.fp--9x16 .fp-card__label {
	font-size: clamp(26px, 10cqi, 40px);
}

@media (max-width: 767px) {
	.fp-card__label,
	.fp--9x16 .fp-card__label {
		font-size: 32px;
	}

	.fp-card__content {
		gap: 16px;
		padding: 18px;
	}

	.fp-card__play {
		width: 68px;
		height: 68px;
	}

	.fp-card__play svg {
		width: 24px;
		height: 24px;
	}
}

/* Horizontal en móvil: el alto es poco, se compacta el contenido */
@media (max-width: 480px) {
	.fp--16x9 .fp-card__content {
		gap: 12px;
	}

	.fp--16x9 .fp-card__play {
		width: 56px;
		height: 56px;
	}

	.fp--16x9 .fp-card__title {
		display: none;
	}
}

.fp-empty {
	padding: 16px 20px;
	border: 1px dashed var(--fp-accent);
	border-radius: 12px;
	font-family: var(--fp-font);
	font-size: 17px;
	color: var(--fp-ink);
	background: var(--fp-paper);
}

/* ================================================================== Lightbox */

html.fp-lock,
html.fp-lock body {
	overflow: hidden !important;
}

.fp-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: var(--fp-font);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.fp-modal *,
.fp-modal *::before,
.fp-modal *::after {
	box-sizing: border-box;
}

.fp-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.fp-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
}

.fp-modal__dialog {
	position: relative;
	z-index: 2;
	width: min(92vw, 1280px, calc((100vh - 120px) * 16 / 9));
	width: min(92vw, 1280px, calc((100dvh - 120px) * 16 / 9));
	transform: translateY(16px) scale(0.98);
	transition: transform 0.5s var(--fp-ease);
}

.fp-modal.is-open .fp-modal__dialog {
	transform: none;
}

.fp-modal--9x16 .fp-modal__dialog {
	width: min(92vw, 480px, calc((100vh - 120px) * 9 / 16));
	width: min(92vw, 480px, calc((100dvh - 120px) * 9 / 16));
}

.fp-modal__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--fp-radius);
	background: #000;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
	container-type: inline-size;
}

.fp-modal--9x16 .fp-modal__stage {
	aspect-ratio: 9 / 16;
}

.fp-modal__player {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.fp-modal__player video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	pointer-events: none;
}

/* El iframe es 120px más alto que el escenario: el video queda del mismo tamaño,
   pero la barra superior de YouTube (título y canal) y la inferior quedan fuera de vista. */
.fp-modal__player iframe {
	position: absolute !important;
	top: -60px !important;
	left: 0 !important;
	width: 100% !important;
	height: calc(100% + 120px) !important;
	max-width: none !important;
	border: 0 !important;
	pointer-events: none;
}

/* Capa que evita los clics sobre la interfaz de YouTube: un clic pausa o reproduce */
.fp-modal__shield {
	position: absolute;
	inset: 0;
	z-index: 20;
	cursor: pointer;
}

.fp-modal.is-idle .fp-modal__shield {
	cursor: none;
}

.fp-modal__loader {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 15;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--fp-white);
	animation: fp-spin 0.9s linear infinite;
	transition: opacity 0.3s ease;
}

.fp-modal.is-ready .fp-modal__loader {
	opacity: 0;
	animation-play-state: paused;
}

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

.fp-modal__title {
	position: absolute;
	top: 22px;
	left: 24px;
	right: 84px;
	z-index: 30;
	margin: 0;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--fp-white);
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: opacity 0.3s ease;
}

.fp-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: var(--fp-white);
	cursor: pointer;
	transition: all 0.3s var(--fp-ease);
}

.fp-modal__close svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.fp-modal__close:hover,
.fp-modal__close:focus-visible {
	background: rgba(255, 255, 255, 0.95);
	border-color: rgba(255, 255, 255, 0.95);
	color: #000;
	transform: scale(1.08) rotate(90deg);
	outline: none;
}

/* ---------------------------------------------------------------- Controls */

.fp-controls {
	position: absolute;
	left: 20px;
	right: 20px;
	bottom: 20px;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	border-radius: 9999px;
	background: rgba(19, 19, 19, 0.75);
	border: 1px solid rgba(255, 255, 255, 0.15);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	color: var(--fp-white);
	transition: opacity 0.35s ease, transform 0.35s var(--fp-ease);
}

.fp-modal.is-idle .fp-controls,
.fp-modal.is-idle .fp-modal__title {
	opacity: 0;
}

.fp-modal.is-idle .fp-controls {
	transform: translateY(10px);
	pointer-events: none;
}

.fp-ctrl {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--fp-white);
	cursor: pointer;
	transition: background 0.25s ease, transform 0.25s ease;
}

.fp-ctrl svg {
	width: 18px;
	height: 18px;
	margin: 0;
	fill: currentColor;
}

.fp-ctrl:hover {
	background: var(--fp-accent);
	transform: scale(1.1);
}

.fp-ctrl:focus-visible {
	outline: 2px solid var(--fp-white);
	outline-offset: 1px;
}

.fp-ctrl [data-icon] {
	display: none;
}

.fp-ctrl[data-state="a"] [data-icon="a"],
.fp-ctrl[data-state="b"] [data-icon="b"] {
	display: block;
}

.fp-time {
	flex: 0 0 auto;
	min-width: 4.2ch;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, 0.78);
	text-align: center;
}

/* Barras de rango (progreso y volumen) */
.fp-range {
	--fp-fill: 0%;
	--fp-buffer: 0%;
	flex: 1 1 auto;
	min-width: 0;
	height: 18px;
	margin: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.fp-range--volume {
	flex: 0 0 72px;
}

.fp-range:focus {
	outline: none;
}

.fp-range:focus-visible {
	outline: 2px solid var(--fp-white);
	outline-offset: 2px;
	border-radius: 4px;
}

.fp-range::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 4px;
	background:
		linear-gradient(90deg, var(--fp-white) var(--fp-fill), transparent var(--fp-fill)),
		linear-gradient(90deg, rgba(255, 255, 255, 0.38) var(--fp-buffer), rgba(255, 255, 255, 0.16) var(--fp-buffer));
}

.fp-range::-moz-range-track {
	height: 4px;
	border-radius: 4px;
	background:
		linear-gradient(90deg, var(--fp-white) var(--fp-fill), transparent var(--fp-fill)),
		linear-gradient(90deg, rgba(255, 255, 255, 0.38) var(--fp-buffer), rgba(255, 255, 255, 0.16) var(--fp-buffer));
}

.fp-range::-webkit-slider-thumb {
	width: 12px;
	height: 12px;
	margin-top: -4px;
	border: 0;
	border-radius: 50%;
	background: var(--fp-white);
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
	transform: scale(0.85);
	transition: transform 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.fp-range::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border: 0;
	border-radius: 50%;
	background: var(--fp-white);
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.fp-range:hover::-webkit-slider-thumb,
.fp-range:focus-visible::-webkit-slider-thumb {
	transform: scale(1.1);
}

/* Diálogos angostos (verticales o móvil): se simplifican los controles */
@container (max-width: 480px) {
	.fp-controls {
		left: 12px;
		right: 12px;
		bottom: 12px;
		gap: 6px;
		padding: 6px 10px;
	}

	.fp-time--duration {
		display: none;
	}

	.fp-range--volume {
		flex-basis: 52px;
	}
}

/* Muy angosto (móvil): el volumen queda en el botón de silencio y en los botones del teléfono */
@container (max-width: 360px) {
	.fp-range--volume {
		display: none;
	}
}

@media (hover: none) {
	.fp-modal.is-idle .fp-controls,
	.fp-modal.is-idle .fp-modal__title {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

@media (max-width: 767px) {
	.fp-modal {
		padding: 16px;
	}

	.fp-modal__close {
		top: 12px;
		right: 12px;
	}

	.fp-modal__title {
		top: 18px;
		left: 18px;
		right: 70px;
	}
}

/* Pantalla completa: el escenario ocupa todo */
.fp-modal__dialog:fullscreen {
	width: 100vw;
	height: 100vh;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fp-modal__dialog:fullscreen .fp-modal__stage {
	width: min(100vw, calc(100vh * 16 / 9));
	border-radius: 0;
	box-shadow: none;
}

.fp-modal--9x16 .fp-modal__dialog:fullscreen .fp-modal__stage {
	width: min(100vw, calc(100vh * 9 / 16));
}

/* ------------------------------------------------------ Movimiento reducido */

@media (prefers-reduced-motion: reduce) {
	.fp-card,
	.fp-card__poster,
	.fp-card__preview,
	.fp-card__play,
	.fp-modal,
	.fp-modal__dialog,
	.fp-controls {
		transition: none !important;
	}

	.fp-card:hover {
		transform: none;
	}
}

/* ==========================================================================
   Blindaje contra los estilos de botón del tema / Elementor
   (Hello Elementor y los kits de Elementor pintan todos los <button>:
   borde, color, padding, radio y fondo al pasar el mouse).
   ========================================================================== */

html body .fp-modal button.fp-ctrl,
html body .fp-modal button.fp-modal__close {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #ffffff !important;
	font: inherit !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	outline: none;
}

html body .fp-modal button.fp-ctrl[hidden] {
	display: none !important;
}

html body .fp-modal button.fp-ctrl {
	width: 34px !important;
	height: 34px !important;
}

html body .fp-modal button.fp-ctrl:hover,
html body .fp-modal button.fp-ctrl:focus-visible {
	background: var(--fp-accent) !important;
	color: #ffffff !important;
}

html body .fp-modal button.fp-ctrl:focus:not(:focus-visible),
html body .fp-modal button.fp-ctrl:active {
	background: transparent !important;
	color: #ffffff !important;
}

html body .fp-modal button.fp-ctrl:focus-visible {
	outline: 2px solid #ffffff !important;
	outline-offset: 1px !important;
}

html body .fp-modal button.fp-modal__close {
	width: 44px !important;
	height: 44px !important;
	background: rgba(255, 255, 255, 0.15) !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

html body .fp-modal button.fp-modal__close:hover,
html body .fp-modal button.fp-modal__close:focus-visible {
	background: rgba(255, 255, 255, 0.95) !important;
	border-color: rgba(255, 255, 255, 0.95) !important;
	color: #000000 !important;
}

html body .fp-modal button.fp-modal__close:focus:not(:focus-visible) {
	background: rgba(255, 255, 255, 0.15) !important;
	color: #ffffff !important;
}

html body .fp-modal button.fp-ctrl svg,
html body .fp-modal button.fp-modal__close svg {
	fill: currentColor !important;
	stroke: none !important;
	pointer-events: none;
}
