/*
 * Shared editorial choreography for public component, Journal and Newsroom
 * records. Core continues to own the records and their evidence; this layer
 * changes only how the theme introduces the existing server-rendered content.
 */

.ppps-editorial-scene {
	--ppps-editorial-distance: clamp(28px, 4vw, 64px);
	--ppps-editorial-duration: 760ms;
}

.ppps-editorial-scene--hero.is-motion-mounted .entry-hero__copy,
.ppps-editorial-scene--listing-header.is-motion-mounted .listing-header__inner {
	opacity: 0;
	clip-path: inset(0 100% 0 0);
	transform: translate3d(calc(-1 * var(--ppps-editorial-distance)), 0, 0);
	transition:
		clip-path var(--ppps-editorial-duration) var(--ppps-ease),
		opacity 420ms ease,
		transform var(--ppps-editorial-duration) var(--ppps-ease);
}

.ppps-editorial-scene--hero.is-motion-mounted.has-entered .entry-hero__copy,
.ppps-editorial-scene--listing-header.is-motion-mounted.has-entered .listing-header__inner {
	opacity: 1;
	clip-path: inset(0);
	transform: none;
}

.ppps-editorial-scene--hero.is-motion-mounted .entry-hero__media {
	opacity: 0;
	clip-path: inset(0 0 0 100%);
	transform: translate3d(var(--ppps-editorial-distance), 0, 0);
	transition:
		clip-path 900ms var(--ppps-ease) 90ms,
		opacity 460ms ease 90ms,
		transform 900ms var(--ppps-ease) 90ms;
}

.ppps-editorial-scene--hero.is-motion-mounted .entry-hero__media img {
	transform: scale(1.075);
	transition: transform 1100ms var(--ppps-ease) 90ms;
}

.ppps-editorial-scene--hero.is-motion-mounted.has-entered .entry-hero__media {
	opacity: 1;
	clip-path: inset(0);
	transform: none;
}

.ppps-editorial-scene--hero.is-motion-mounted.has-entered .entry-hero__media img {
	transform: scale(1);
}

.ppps-editorial-scene--newsroom.is-motion-mounted .ppna-shell {
	opacity: 0;
	clip-path: inset(0 100% 0 0);
	transform: translate3d(calc(-1 * var(--ppps-editorial-distance)), 0, 0);
	transition:
		clip-path 920ms var(--ppps-ease),
		opacity 460ms ease,
		transform 920ms var(--ppps-ease);
}

.ppps-editorial-scene--newsroom.is-motion-mounted .ppna-issuer-brand {
	opacity: 0;
	transform: translate3d(var(--ppps-editorial-distance), 0, 0) scale(.96);
	transition:
		opacity 520ms ease 160ms,
		transform 880ms var(--ppps-ease) 160ms;
}

.ppps-editorial-scene--newsroom.is-motion-mounted .ppna-facts > div {
	opacity: 0;
	transform: translate3d(0, 22px, 0);
	transition:
		opacity 420ms ease calc(180ms + var(--pp-record-index, 0) * 70ms),
		transform 700ms var(--ppps-ease) calc(180ms + var(--pp-record-index, 0) * 70ms);
}

.ppps-editorial-scene--newsroom.is-motion-mounted.has-entered :where(
	.ppna-shell,
	.ppna-issuer-brand,
	.ppna-facts > div
) {
	opacity: 1;
	clip-path: inset(0);
	transform: none;
}

/*
 * Fact rows need an explicit entered selector because the structural
 * `.ppna-facts > div` in the hidden state is more specific than :where().
 */
.ppps-editorial-scene--newsroom.is-motion-mounted.has-entered .ppna-facts > div {
	opacity: 1;
	transform: none;
}

/*
 * Lite and reduced tiers are complete static-safe compositions. Keep the
 * externally owned fact rows visible even when a tier change or restored
 * scroll position skips the hero's entrance transition.
 */
.ppps-editorial-scene--newsroom.is-motion-mounted:is(
	.is-capability-lite,
	.is-capability-reduced
) .ppna-facts > div {
	opacity: 1;
	clip-path: none;
	transform: none;
	transition: none;
}

.ppps-editorial-scene--hero.entry-hero--procedural.is-motion-mounted > .pp-procedural {
	opacity: 0.42;
	transform: scale(1.04);
	transform-origin: center;
	transition:
		opacity 980ms ease,
		transform 1300ms var(--ppps-ease);
}

.ppps-editorial-scene--hero.entry-hero--procedural.is-motion-mounted.has-entered > .pp-procedural {
	opacity: 1;
	transform: scale(1);
}

.ppps-editorial-scene--content.is-motion-mounted .single-entry-content__body {
	opacity: 0;
	transform: translate3d(0, var(--ppps-editorial-distance), 0);
	transition:
		opacity 520ms ease 80ms,
		transform 880ms var(--ppps-ease) 80ms;
}

.ppps-editorial-scene--newsroom-body.is-motion-mounted .ppna-body__label {
	opacity: 0;
	transform: translate3d(calc(-1 * var(--ppps-editorial-distance)), 0, 0);
	transition:
		opacity 460ms ease 80ms,
		transform 820ms var(--ppps-ease) 80ms;
}

.ppps-editorial-scene--newsroom-body.is-motion-mounted .ppna-prose {
	opacity: 0;
	transform: translate3d(var(--ppps-editorial-distance), 0, 0);
	transition:
		opacity 520ms ease 120ms,
		transform 900ms var(--ppps-ease) 120ms;
}

.ppps-editorial-scene--newsroom-body.is-motion-mounted .ppna-evidence__field {
	clip-path: inset(0 0 100% 0);
	transition: clip-path 980ms var(--ppps-ease) 220ms;
}

.ppps-editorial-scene--newsroom-body.is-motion-mounted .ppna-evidence__image {
	transform: scale(1.06);
	transition: transform 1200ms var(--ppps-ease) 220ms;
}

.ppps-editorial-scene--newsroom-body.is-motion-mounted.has-entered :where(
	.ppna-body__label,
	.ppna-prose
) {
	opacity: 1;
	transform: none;
}

.ppps-editorial-scene--newsroom-body.is-motion-mounted.has-entered .ppna-evidence__field {
	clip-path: inset(0);
}

.ppps-editorial-scene--newsroom-body.is-motion-mounted.has-entered .ppna-evidence__image {
	transform: scale(1);
}

.ppps-editorial-scene--dossier.is-motion-mounted .component-dossier__heading {
	opacity: 0;
	transform: translate3d(calc(-1 * var(--ppps-editorial-distance)), 0, 0);
	transition:
		opacity 480ms ease 120ms,
		transform 820ms var(--ppps-ease) 120ms;
}

.ppps-editorial-scene--dossier.is-motion-mounted .component-dossier__facts {
	opacity: 0;
	transform: translate3d(var(--ppps-editorial-distance), 0, 0);
	transition:
		opacity 480ms ease 190ms,
		transform 820ms var(--ppps-ease) 190ms;
}

.ppps-editorial-scene--dossier.is-motion-mounted :where(.component-dossier__note, .button-link) {
	opacity: 0;
	transform: translate3d(0, 24px, 0);
	transition:
		opacity 420ms ease 280ms,
		transform 680ms var(--ppps-ease) 280ms;
}

.ppps-editorial-scene--content.is-motion-mounted.has-entered .single-entry-content__body,
.ppps-editorial-scene--dossier.is-motion-mounted.has-entered :where(
	.component-dossier__heading,
	.component-dossier__facts,
	.component-dossier__note,
	.button-link
) {
	opacity: 1;
	transform: none;
}

.single-entry-content__body > :last-child {
	margin-bottom: 0;
}

.ppps-editorial-scene--listing-header::after {
	position: absolute;
	z-index: 2;
	right: var(--ppps-gutter);
	bottom: 0;
	left: var(--ppps-gutter);
	height: 2px;
	background: var(--ppps-oxide);
	content: "";
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 880ms var(--ppps-ease) 180ms;
}

.ppps-editorial-scene--listing-header.has-entered::after {
	transform: scaleX(1);
}

.ppps-editorial-scene--listing-records.is-motion-mounted .record-card:nth-child(odd) {
	transform: translate3d(calc(-1 * var(--ppps-editorial-distance)), 0, 0);
}

.ppps-editorial-scene--listing-records.is-motion-mounted .record-card:nth-child(even) {
	transform: translate3d(var(--ppps-editorial-distance), 0, 0);
}

.ppps-editorial-scene--listing-records.is-motion-mounted .record-card__media {
	clip-path: inset(0 0 100% 0);
	transition:
		clip-path 820ms var(--ppps-ease)
		calc(min(var(--pp-record-index, 0), 7) * var(--ppps-stagger));
}

.ppps-editorial-scene--listing-records.is-motion-mounted.has-entered .record-card:nth-child(n),
.ppps-editorial-scene--listing-records.has-entered .record-card:nth-child(n) {
	transform: none;
}

.ppps-editorial-scene--listing-records.is-motion-mounted.has-entered
	.record-grid > .record-card:nth-child(n) {
	transform: none;
	will-change: auto;
}

.ppps-editorial-scene--listing-records.has-entered .record-card__media {
	clip-path: inset(0);
}

@media (max-width: 900px) {
	.ppps-editorial-scene {
		--ppps-editorial-distance: 28px;
		--ppps-editorial-duration: 620ms;
	}

	.ppps-editorial-scene--listing-records.is-motion-mounted .record-card:nth-child(n) {
		transform: translate3d(0, 28px, 0);
	}

	.ppps-editorial-scene--listing-records.has-entered .record-card:nth-child(n) {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ppps-editorial-scene,
	.ppps-editorial-scene *,
	.ppps-editorial-scene *::before,
	.ppps-editorial-scene *::after {
		animation: none !important;
		transition: none !important;
	}

	.ppps-editorial-scene :where(
		.entry-hero__copy,
		.entry-hero__media,
		.entry-hero__media img,
		.pp-procedural,
		.listing-header__inner,
		.single-entry-content__body,
		.component-dossier__heading,
		.component-dossier__facts,
		.component-dossier__note,
		.component-dossier .button-link,
		.ppna-shell,
		.ppna-issuer-brand,
		.ppna-facts > div,
		.ppna-body__label,
		.ppna-prose,
		.ppna-evidence__field,
		.ppna-evidence__image,
		.record-card,
		.record-card__media
	) {
		opacity: 1 !important;
		clip-path: none !important;
		transform: none !important;
	}
}
