/* LTS Child: component de vídeo (inc/video.php + assets/js/lts-video.js).
   Tessel·la 16:9 amb pòster propi i botó de reproduir de la marca; diàleg amb l'iframe.
   .lts-video--fill: ocupa el contenidor (que ja té mida), p. ex. una tessel·la de galeria. */
.lts-video {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 2px;
	color: #fdfdfd;
	text-decoration: none;
	background: radial-gradient(120% 90% at 30% 20%, rgba(253, 253, 253, 0.08), rgba(253, 253, 253, 0) 70%), #0c1821;
}
.lts-video--tall {
	aspect-ratio: 4 / 3; /* vídeos verticals: el fotograma es retalla per la cara */
}
/* Degradat subtil perquè el botó i el peu es lligen sobre qualsevol fotograma. */
.lts-video::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		radial-gradient(circle at 50% 50%, rgba(12, 24, 33, 0.32), rgba(12, 24, 33, 0) 45%),
		linear-gradient(0deg, rgba(12, 24, 33, 0.38), rgba(12, 24, 33, 0) 45%);
}
.lts-video__icon,
.lts-video__label {
	z-index: 2;
}
.lts-video--tall img.lts-video__poster {
	object-position: 50% 15%; /* fotograma vertical: la cara, sense els subtítols cremats del mig */
}
.lts-video--fill {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
	border-radius: 0;
}
/* Dins d'un embed de WordPress: el wrapper ja no necessita el truc del padding. */
.wp-block-embed .wp-block-embed__wrapper:has(> .lts-video)::before {
	display: none;
}
.lts-video img.lts-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	aspect-ratio: auto;
	object-fit: cover;
	object-position: 50% 30%;
	filter: brightness(0.92);
	transition: transform 0.6s cubic-bezier(.2,.7,.2,1), filter 0.3s ease;
}
.lts-video__icon {
	position: absolute;
	left: 50%;
	top: 50%;
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin: -32px 0 0 -32px;
	border: 1px solid rgba(253, 253, 253, 0.7);
	border-radius: 50%;
	background: rgba(12, 24, 33, 0.45);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.lts-video__icon svg {
	width: 24px;
	height: 24px;
	margin-left: 3px; /* el triangle es veu centrat òpticament */
	fill: currentColor;
}
.lts-video__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 14px 10px;
	background: linear-gradient(0deg, rgba(12, 24, 33, 0.82), rgba(12, 24, 33, 0));
	font-family: var(--wp--preset--font-family--tenor, sans-serif);
	font-size: 0.75rem;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-align: left;
}
.lts-video:hover .lts-video__icon,
.lts-video:focus-visible .lts-video__icon {
	background: var(--lts-acento, #fd9840);
	border-color: var(--lts-acento, #fd9840);
	transform: scale(1.06);
}
.lts-video:hover img.lts-video__poster {
	transform: scale(1.03);
	filter: brightness(1);
}
.lts-video:focus-visible {
	outline: 2px solid var(--lts-acento, #fd9840);
	outline-offset: 2px;
}
.lts-video--fill:focus-visible {
	outline-offset: -2px;
}
@media (max-width: 781px) {
	.lts-video__icon { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
}

/* Diàleg (16:9; els Shorts, 9:16 i tan alts com permeta la pantalla) */
.lts-video-dialog {
	width: min(1100px, calc(100vw - 32px));
	max-width: none;
	max-height: none;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: #000;
	overflow: visible;
}
.lts-video-dialog::backdrop {
	background: rgba(8, 16, 22, 0.88);
}
.lts-video-dialog__frame {
	aspect-ratio: 16 / 9;
	max-height: calc(100vh - 120px);
}
.lts-video-dialog--vertical {
	width: min(calc(100vw - 32px), calc((100vh - 120px) * 9 / 16), 480px);
}
.lts-video-dialog--vertical .lts-video-dialog__frame {
	aspect-ratio: 9 / 16;
	max-height: none;
}
.lts-video-dialog__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}
.lts-video-dialog__close {
	position: absolute;
	right: 0;
	bottom: calc(100% + 10px);
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(253, 253, 253, 0.5);
	border-radius: 2px;
	background: transparent;
	color: #fdfdfd;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease;
}
.lts-video-dialog__close:hover {
	border-color: var(--lts-acento, #fd9840);
	color: var(--lts-acento, #fd9840);
}
.lts-video-dialog__close:focus-visible {
	outline: 2px solid var(--lts-acento, #fd9840);
	outline-offset: 2px;
}
.lts-video-dialog__close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
	.lts-video__icon,
	.lts-video img.lts-video__poster {
		transition: none;
	}
	.lts-video:hover .lts-video__icon,
	.lts-video:focus-visible .lts-video__icon,
	.lts-video:hover img.lts-video__poster {
		transform: none;
	}
}
