/**
 * [un_anim] — animated illustrations (includes/anim.php).
 * The frame's aspect-ratio and the poster's sizing are inline in the markup so the
 * figure holds its size even before this sheet loads. The poster stays in flow (it
 * gives the frame its height); stage and player sit on top of it.
 */

.un-anim {
	max-width: 720px;
	margin: 2em auto;
	padding: 0;
}

.un-anim__frame {
	overflow: hidden;
	background: var(--un-bg, #fff);
	border-radius: var(--un-radius, 0);
	cursor: pointer; /* click = pause / play */
}

.un-anim__poster {
	display: block;
	object-fit: cover;
	transition: opacity 0.4s ease;
}

.un-anim.is-ready .un-anim__poster {
	opacity: 0;
	pointer-events: none;
}

.un-anim__stage {
	position: absolute;
	inset: 0;
}

.un-anim__player {
	position: absolute;
	inset: 0;
}

/* Play (reduced motion / paused) and replay (end of a play-once animation). */
.un-anim__btn {
	position: absolute;
	right: 16px;
	bottom: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--un-white, #fff);
	color: var(--un-rose-deep, #5e484b);
	box-shadow: var(--un-shadow-2, 0 2px 12px rgba(0, 0, 0, 0.12));
	cursor: pointer;
	animation: un-anim-btn-in 0.3s ease backwards;
	transition: transform 0.2s ease, color 0.2s ease;
}

.un-anim__btn:hover,
.un-anim__btn:focus-visible {
	color: var(--un-rose, #916f73);
	transform: scale(1.08);
}

.un-anim__btn:focus-visible {
	outline: 2px solid var(--un-rose, #916f73);
	outline-offset: 2px;
}

@keyframes un-anim-btn-in {
	from {
		opacity: 0;
		transform: scale(0.8);
	}
}

.un-anim__caption {
	margin-top: 0.75em;
	font-family: var(--un-font-body, sans-serif);
	font-size: 0.875em;
	line-height: var(--un-lh-body, 1.6);
	color: var(--un-text-2, rgba(0, 0, 0, 0.45));
	text-align: center;
}
