/* Places the gate on the poster and styles the player; the gate card itself is
   styled by demo-form.css. */

.lcc-gated-video {
	--gv-radius: 20px;
	--gv-ink: var(--wp--preset--color--neutral-900, #26272b);
	--gv-accent: var(--wp--preset--color--primary, #bee034);
	margin-block: var(--wp--preset--spacing--medium, 2rem);
	/* Keep in step with LT_LCC_GATED_VIDEO_MAX_WIDTH; fitFirstScreen's inline
	   --gv-max-width narrows it. */
	max-width: var(--gv-max-width, 1045px);
	margin-inline: auto;
}

.lcc-gated-video__stage {
	position: relative;
	aspect-ratio: var(--gv-aspect, 16 / 9);
	border-radius: var(--gv-radius);
	overflow: hidden;
	background: var(--gv-ink);
	isolation: isolate;
}

.lcc-gated-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(14px) brightness(0.62);
	transform: scale(1.1);
}

.lcc-gated-video__gate {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: var(--wp--preset--spacing--small, 1rem);
	background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4));
}

.lcc-gated-video *,
.lcc-gated-video *::before,
.lcc-gated-video *::after {
	box-sizing: border-box;
}

.lcc-gated-video__gate .lcc-form.lcc-form--card {
	--lcc-card-bg: rgba(255, 255, 255, 0.94);
	width: min(520px, 100%);
	margin: 0;
}

/* While locked, the frame's shape is a minimum, not a size: in a narrow column
   or on a phone the card is taller than the frame would be, so the frame grows
   to fit it instead of cutting the button off. */
.lcc-gated-video:not(.is-unlocked) .lcc-gated-video__stage {
	display: grid;
	aspect-ratio: auto;
}

.lcc-gated-video:not(.is-unlocked) .lcc-gated-video__stage::before {
	content: '';
	grid-area: 1 / 1;
	padding-top: calc(100% / (var(--gv-aspect, 16 / 9)));
}

.lcc-gated-video:not(.is-unlocked) .lcc-gated-video__gate {
	position: relative;
	inset: auto;
	grid-area: 1 / 1;
}

.lcc-gated-video--no-poster .lcc-gated-video__stage {
	background: linear-gradient(135deg, var(--gv-ink), #3a3b41);
}

.lcc-resource-form__eyebrow {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--neutral-700, #51525c);
}

.lcc-resource-form__eyebrow::before {
	content: '';
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 8px solid currentColor;
}

.lcc-gated-video__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	margin: 0;
}

.lcc-gated-video__player {
	position: absolute;
	inset: 0;
	background: #000;
	color: var(--wp--preset--color--white, #fff);
}

.lcc-gated-video__player:focus {
	outline: none;
}

.lcc-gated-video__player:focus-visible {
	outline: 3px solid var(--gv-accent);
	outline-offset: -3px;
}

.lcc-gated-video__media,
.lcc-gated-video__player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
}

.lcc-gated-video__player iframe {
	pointer-events: none;
}

.lcc-gated-video__player:fullscreen {
	border-radius: 0;
}

.lcc-gated-video button.lcc-gated-video__ctl,
.lcc-gated-video button.lcc-gated-video__bigplay {
	all: unset;
	box-sizing: border-box;
	display: inline-grid;
	place-items: center;
	cursor: pointer;
	color: inherit;
}

.lcc-gated-video button.lcc-gated-video__ctl {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex: none;
}

.lcc-gated-video button.lcc-gated-video__ctl:hover {
	background: rgba(255, 255, 255, 0.15);
}

.lcc-gated-video button.lcc-gated-video__ctl:focus-visible,
.lcc-gated-video button.lcc-gated-video__bigplay:focus-visible {
	outline: 2px solid var(--gv-accent);
	outline-offset: 2px;
}

.lcc-gated-video__ctl svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.lcc-gated-video__i-pause,
.lcc-gated-video__i-muted {
	display: none;
}

.lcc-gated-video.is-playing .lcc-gated-video__i-play,
.lcc-gated-video.is-muted .lcc-gated-video__i-vol {
	display: none;
}

.lcc-gated-video.is-playing .lcc-gated-video__i-pause,
.lcc-gated-video.is-muted .lcc-gated-video__i-muted {
	display: block;
}

.lcc-gated-video button.lcc-gated-video__bigplay {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: var(--gv-accent);
	color: var(--gv-ink);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.lcc-gated-video__bigplay svg {
	width: 34px;
	height: 34px;
	fill: currentColor;
	margin-left: 4px;
}

.lcc-gated-video.is-playing .lcc-gated-video__bigplay {
	display: none;
}

.lcc-gated-video__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 28px 12px 8px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	transition: opacity 0.25s;
}

.lcc-gated-video.is-idle .lcc-gated-video__controls {
	opacity: 0;
}

.lcc-gated-video.is-idle .lcc-gated-video__player {
	cursor: none;
}

.lcc-gated-video__time {
	flex: none;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.lcc-gated-video__controls input[type='range'] {
	accent-color: var(--gv-accent);
	height: 24px;
	margin: 0;
	cursor: pointer;
	background: transparent;
}

.lcc-gated-video__seek {
	flex: 1 1 auto;
	min-width: 60px;
}

.lcc-gated-video__volume {
	flex: 0 0 80px;
	width: 80px;
}

.lcc-gated-video__spinner {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top-color: var(--gv-accent);
	display: none;
	animation: lcc-gated-video-spin 0.9s linear infinite;
}

.lcc-gated-video.is-buffering .lcc-gated-video__spinner {
	display: block;
}

.lcc-gated-video.is-failed .lcc-gated-video__controls,
.lcc-gated-video.is-failed .lcc-gated-video__bigplay,
.lcc-gated-video.is-failed .lcc-gated-video__spinner {
	display: none;
}

.lcc-gated-video.is-failed .lcc-gated-video__player iframe {
	pointer-events: auto;
}

/* End screen: overlay only; buttons use the site's button styles. */
.lcc-gated-video__end {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: grid;
	place-items: center;
	padding: var(--wp--preset--spacing--small, 1rem);
	background: rgba(14, 26, 38, 0.84);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--wp--preset--color--white, #fff);
	text-align: center;
}

.lcc-gated-video__end[hidden] {
	display: none;
}

.lcc-gated-video__end:focus {
	outline: none;
}

.lcc-gated-video__end-inner {
	width: min(560px, 100%);
}

.lcc-gated-video__end-title {
	margin: 0 0 8px;
	font-family: var(--wp--preset--font-family--headline);
	font-size: var(--wp--preset--font-size--headline-4, 1.75rem);
	font-weight: 700;
	line-height: 1.2;
	color: inherit;
}

.lcc-gated-video__end-text {
	margin: 0 0 24px;
	font-size: var(--wp--preset--font-size--body-1, 1rem);
	color: rgba(255, 255, 255, 0.82);
}

.lcc-gated-video__end-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 0;
}

.lcc-gated-video__end-buttons .wp-block-button__link:focus-visible {
	outline: 3px solid var(--gv-accent);
	outline-offset: 3px;
}

.lcc-gated-video button.lcc-gated-video__replay {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 18px;
	padding: 6px 8px;
	border-radius: 6px;
	font-size: var(--wp--preset--font-size--body-2, 0.875rem);
	color: rgba(255, 255, 255, 0.9);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.lcc-gated-video button.lcc-gated-video__replay:hover {
	color: var(--wp--preset--color--white, #fff);
}

.lcc-gated-video button.lcc-gated-video__replay:focus-visible {
	outline: 2px solid var(--gv-accent);
	outline-offset: 2px;
}

.lcc-gated-video__replay svg {
	width: 16px;
	height: 16px;
}

.lcc-gated-video.is-ended .lcc-gated-video__controls,
.lcc-gated-video.is-ended .lcc-gated-video__bigplay,
.lcc-gated-video.is-ended .lcc-gated-video__spinner {
	display: none;
}

.lcc-gated-video__failed {
	position: absolute;
	inset: auto 16px 50% 16px;
	transform: translateY(50%);
	margin: 0;
	text-align: center;
	color: var(--wp--preset--color--white, #fff);
}

.lcc-gated-video__failed a {
	color: inherit;
	text-decoration: underline;
}

@keyframes lcc-gated-video-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Phones: the frame is too short for the form and for the end screen, so it
   grows to fit them; the volume slider goes, since phones ignore it. */
@media (max-width: 640px) {
	.lcc-gated-video.is-ended .lcc-gated-video__stage {
		aspect-ratio: auto;
	}

	.lcc-gated-video.is-ended .lcc-gated-video__player {
		position: relative;
	}

	.lcc-gated-video.is-ended .lcc-gated-video__end {
		position: relative;
		inset: auto;
		padding: 28px 16px 20px;
	}

	.lcc-gated-video__end-title {
		font-size: 1.25rem;
	}

	.lcc-gated-video__end-text {
		margin-bottom: 18px;
		font-size: 0.9375rem;
	}

	.lcc-gated-video__end-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.lcc-gated-video__end-buttons .wp-block-button__link {
		width: 100%;
		justify-content: center;
	}

	.lcc-gated-video__volume {
		display: none;
	}

	.lcc-gated-video button.lcc-gated-video__bigplay {
		width: 60px;
		height: 60px;
	}

	.lcc-gated-video__controls {
		gap: 2px;
		padding-inline: 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lcc-gated-video__controls {
		transition: none;
	}

	.lcc-gated-video__spinner {
		animation-duration: 3s;
	}
}
