/**
 * Demo clip block (acf/demo-clip-section)
 */

 .demo-clip-section__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2rem;
}

.demo-clip-section__media {
	flex: 1 1 280px;
	min-width: 0;
	max-width: 100%;
	width: 100%;
}

.demo-clip-section__video {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	background: #000;
}

/* Press to play: poster stage */
.demo-clip-section__poster-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
}

.demo-clip-section__poster-wrap .demo-clip-section__video--click-to-play {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.demo-clip-section__poster-wrap:not(.is-playing) .demo-clip-section__video--click-to-play {
	opacity: 0;
	pointer-events: none;
}

.demo-clip-section__poster-wrap.is-playing .demo-clip-section__video--click-to-play {
	opacity: 1;
}

.demo-clip-section__poster-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.demo-clip-section__poster-overlay > * {
	pointer-events: auto;
}

.demo-clip-section__poster-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.demo-clip-section__poster-play {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	background: #6798ff;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease, background 0.2s ease;
}

.demo-clip-section__poster-play:hover {
	background: #4c84fe;
	transform: scale(1.05);
	transform-origin: center;
}

.demo-clip-section__poster-play:focus {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.demo-clip-section__poster-play:focus:not(:focus-visible) {
	outline: none;
}

.demo-clip-section__poster-play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.demo-clip-section__poster-play-icon {
	display: block;
	width: 24px;
	height: 24px;
	margin-left: 4px;
	background: transparent url("../../dist/images/icon-play-video.svg") 50% 50% no-repeat;
	background-size: contain;
}

.demo-clip-section__poster-wrap.is-playing .demo-clip-section__poster-overlay {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.demo-clip-section__poster-wrap.is-muted-fallback .demo-clip-section__poster-img {
	display: none;
}

.demo-clip-section__sound-toggle {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 5;
	display: none;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.72);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	transition: background 0.2s ease, transform 0.2s ease;
}

.demo-clip-section__sound-toggle:hover {
	background: rgba(0, 0, 0, 0.86);
	transform: translateY(-1px);
}

.demo-clip-section__sound-toggle:focus {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.demo-clip-section__sound-toggle:focus:not(:focus-visible) {
	outline: none;
}

.demo-clip-section__sound-toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.demo-clip-section__sound-toggle-icon {
	position: relative;
	display: block;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.demo-clip-section__sound-toggle-icon::before {
	content: "";
	position: absolute;
	left: 0;
	top: 4px;
	width: 6px;
	height: 8px;
	border-radius: 2px 0 0 2px;
	background: currentColor;
}

.demo-clip-section__sound-toggle-icon::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 9px;
	height: 12px;
	background: currentColor;
	clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 70%);
}

.demo-clip-section__poster-wrap.is-muted-fallback .demo-clip-section__sound-toggle {
	display: inline-flex;
}

/* Replay (after video ends, press-to-play mode) */
.demo-clip-section__replay-overlay {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.demo-clip-section__replay-overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
}

.demo-clip-section__poster-wrap.is-playing.has-ended .demo-clip-section__replay-overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.demo-clip-section__replay-btn {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	color: #fff;
	background: #6798ff;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease, background 0.2s ease;
	transform-origin: center;
}

.demo-clip-section__replay-btn:hover {
	background: #4c84fe;
	transform: scale(1.05);
}

.demo-clip-section__replay-btn:focus {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.demo-clip-section__replay-btn:focus:not(:focus-visible) {
	outline: none;
}

.demo-clip-section__replay-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.demo-clip-section__replay-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.demo-clip-section__replay-icon svg {
	display: block;
	width: 28px;
	height: 28px;
	/* Stroke icon reads slightly high in circle; nudge for optical center */
	transform: translateY(1px);
}

.demo-clip-section__text {
	flex: 1 1 240px;
	min-width: 0;
	max-width: 100%;
	width: 100%;
}


.demo-clip-section__title {
	margin: 0 0 1rem;
	font-size: clamp(1.5rem, 2.5vw, 2.25rem);
	font-weight: 700;
	line-height: 1.2;
	color: #1f2937;
}

.demo-clip-section__text-inner > *:first-child {
	margin-top: 0;
}

.demo-clip-section__text-inner > *:last-child {
	margin-bottom: 0;
}

/* When title + body: remove double gap between h2 and first paragraph */
.demo-clip-section__title + p {
	margin-top: 0;
}

/* Text column on the left (default): text first in DOM, video second — swap visual order */
.demo-clip-section--text-left .demo-clip-section__inner {
	flex-direction: row-reverse;
}

/* Text on the right: natural order — video first, text second */
.demo-clip-section--text-right .demo-clip-section__inner {
	flex-direction: row;
}

@media (max-width: 767px) {
	.demo-clip-section__inner {
		flex-direction: column !important;
		gap: 1.5rem;
	}

	.demo-clip-section--text-left .demo-clip-section__text {
		order: 2;
	}

	.demo-clip-section--text-left .demo-clip-section__media {
		order: 1;
	}

	.demo-clip-section--text-right .demo-clip-section__media {
		order: 1;
	}

	.demo-clip-section--text-right .demo-clip-section__text {
		order: 2;
	}
}