/* EagleX Product Media - front end */
.expm-media {
	margin: 0 0 1.5em;
	max-width: 100%;
	box-sizing: border-box;
}
.expm-media *,
.expm-media *::before,
.expm-media *::after {
	box-sizing: border-box;
}
.expm-block + .expm-block {
	margin-top: 2em;
}
.expm-heading {
	margin: 0 0 .75em;
	font-size: 1.15em;
}
.expm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 1.25rem;
}
.expm-item {
	margin: 0;
	min-width: 0;
}
.expm-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #111;
	border-radius: 8px;
	overflow: hidden;
}
.expm-frame video,
.expm-frame iframe,
.expm-embed {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}
.expm-frame video {
	object-fit: contain;
	background: #000;
}
.expm-embed {
	padding: 0;
	margin: 0;
	cursor: pointer;
	background: #1d1d1f;
	border-radius: 0;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.expm-embed img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.expm-embed:hover,
.expm-embed:focus {
	background: #2b2b2e;
}
.expm-embed:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: -3px;
}
.expm-play {
	position: relative;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .72);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .85);
	transition: transform .15s ease;
}
.expm-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent #fff;
}
.expm-embed:hover .expm-play {
	transform: scale(1.08);
}
.expm-caption {
	display: block;
	margin-top: .5em;
	font-size: .9em;
	line-height: 1.4;
}
.expm-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}
@supports not (aspect-ratio: 16 / 9) {
	.expm-frame {
		height: 0;
		padding-top: 56.25%;
	}
}
.expm-media video,
.expm-media audio,
.expm-media iframe {
	max-width: 100%;
}
.expm-media .expm-frame video {
	margin: 0;
}
@media (prefers-reduced-motion: reduce) {
	.expm-play {
		transition: none;
	}
}

/* Automatic placement */
.expm-pending {
	display: none;
}
.expm-pending.expm-pending--show {
	display: block;
}
.expm-media--placed {
	margin: 1.25rem 0;
	max-width: 100%;
}
.expm-media--video.expm-media--placed .expm-grid {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	gap: .75rem;
}
.expm-media--video.expm-media--placed .expm-block + .expm-block {
	margin-top: 1rem;
}
@media (max-width: 767px) {
	.expm-media--placed {
		float: none !important;
		clear: both !important;
		width: 100% !important;
	}
}

.expm-media--audio {
	margin: 1rem 0;
}

/* Videos inside the product gallery */
.expm-stage {
	position: absolute;
	inset: 0;
	z-index: 30;
	background: #000;
	border-radius: inherit;
	overflow: hidden;
	contain: layout paint;
	-webkit-tap-highlight-color: transparent;
}
.expm-stage[hidden] {
	display: none;
}
.expm-stage .expm-video,
.expm-stage iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	margin: 0;
	padding: 0;
	max-width: none;
	object-fit: contain;
	background: #000;
	cursor: pointer;
}
.expm-stage .expm-video.expm-cover {
	object-fit: cover;
}
.expm-stage iframe {
	cursor: auto;
}
/* Single round play / pause button, nothing else. */
.expm-stage .expm-toggle {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: clamp(48px, 18%, 84px);
	aspect-ratio: 1;
	height: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .88);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
	transform: translate(-50%, -50%);
	cursor: pointer;
	opacity: 1;
	transition: opacity .2s ease, transform .15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.expm-stage .expm-toggle::before,
.expm-stage .expm-toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}
/* Play icon (triangle), sized in % so it scales with the button. */
.expm-stage .expm-toggle::before {
	width: 36%;
	height: 40%;
	margin-left: 4%;
	background: #333;
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.expm-stage .expm-toggle::after {
	display: none;
}
/* Pause icon (two bars) while playing. */
.expm-stage.expm-playing .expm-toggle::before {
	width: 32%;
	height: 38%;
	margin: 0;
	clip-path: none;
	background: linear-gradient(to right, #333 0 36%, transparent 36% 64%, #333 64% 100%);
}
.expm-stage.expm-iframe-mode .expm-toggle {
	display: none;
}
.expm-stage .expm-toggle:hover {
	transform: translate(-50%, -50%) scale(1.06);
}
.expm-stage .expm-toggle:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}
/* While playing, the button hides and returns on hover / tap. */
.expm-stage.expm-playing .expm-toggle {
	opacity: 0;
}
.expm-stage.expm-playing:hover .expm-toggle,
.expm-stage.expm-playing.expm-show .expm-toggle,
.expm-stage.expm-playing .expm-toggle:focus-visible {
	opacity: 1;
}
@media (hover: none) {
	.expm-stage.expm-playing:hover .expm-toggle {
		opacity: 0;
	}
	.expm-stage.expm-playing.expm-show .expm-toggle {
		opacity: 1;
	}
}
/* Hide every native control the browser might still draw. */
.expm-stage video::-webkit-media-controls,
.expm-stage video::-webkit-media-controls-enclosure,
.expm-stage video::-webkit-media-controls-panel,
.expm-stage video::-webkit-media-controls-start-playback-button {
	display: none !important;
	-webkit-appearance: none;
}
.expm-thumb {
	position: relative;
	cursor: pointer;
}
.expm-thumb img {
	display: block;
}
.expm-thumb:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.expm-thumb.expm-thumb--active::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border: 2px solid var(--wd-primary-color, var(--wp--preset--color--primary, #333));
	border-radius: inherit;
	pointer-events: none;
}
.expm-thumb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 42%;
	min-width: 24px;
	max-width: 44px;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(255, 255, 255, .88);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
	pointer-events: none;
}
.expm-thumb-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #333;
}
@media (max-width: 767px) {
	.expm-thumb-play::after {
		border-width: 5px 0 5px 8px;
	}
}
/* Used only when the theme has no thumbnail strip to join. */
.expm-own-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: .75rem 0 0;
}
.expm-own-thumb {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 8px;
	overflow: hidden;
	background: #222;
}
.expm-own-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Poster state (gallery opens on the first video) */
.expm-stage .expm-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	display: none;
	cursor: pointer;
}
.expm-stage.expm-poster-mode .expm-poster {
	display: block;
}
.expm-stage.expm-poster-mode {
	background: transparent;
}

/* Audio player */
.expm-item--audio.expm-ap {
	--expm-accent: var(--wd-primary-color, var(--wp--preset--color--primary, #1d1d1f));
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid rgba(128, 128, 128, .22);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.expm-ap-btn {
	flex: 0 0 auto;
	position: relative;
	width: 46px;
	height: 46px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--expm-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	transition: transform .15s ease, opacity .2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.expm-ap-btn:hover {
	transform: scale(1.06);
}
.expm-ap-btn:focus-visible {
	outline: 3px solid var(--expm-accent);
	outline-offset: 2px;
}
.expm-ap-btn:disabled {
	opacity: .4;
	cursor: not-allowed;
	transform: none;
}
.expm-ap-btn::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34%;
	height: 38%;
	margin-left: 3%;
	transform: translate(-50%, -50%);
	background: #fff;
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.expm-ap--playing .expm-ap-btn::before {
	margin-left: 0;
	clip-path: none;
	width: 32%;
	height: 36%;
	background: linear-gradient(to right, #fff 0 36%, transparent 36% 64%, #fff 64% 100%);
}
.expm-ap--loading .expm-ap-btn {
	animation: expm-pulse 1s ease-in-out infinite;
}
@keyframes expm-pulse {
	50% {
		opacity: .55;
	}
}
.expm-ap-body {
	flex: 1 1 auto;
	min-width: 0;
}
.expm-ap-title {
	display: block;
	margin: 0 0 6px;
	font-size: .95em;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.expm-ap-row {
	display: flex;
	align-items: center;
	gap: 12px;
}
.expm-ap-time {
	flex: 0 0 auto;
	min-width: 5.5em;
	font-size: .8em;
	text-align: right;
	font-variant-numeric: tabular-nums;
	opacity: .7;
}
.expm-ap-seek {
	--p: 0%;
	flex: 1 1 auto;
	min-width: 0;
	height: 18px;
	margin: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.expm-ap-seek::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(to right, var(--expm-accent) var(--p), rgba(128, 128, 128, .28) var(--p));
}
.expm-ap-seek::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: rgba(128, 128, 128, .28);
}
.expm-ap-seek::-moz-range-progress {
	height: 4px;
	border-radius: 2px;
	background: var(--expm-accent);
}
.expm-ap-seek::-webkit-slider-thumb {
	width: 12px;
	height: 12px;
	margin-top: -4px;
	border: 0;
	border-radius: 50%;
	background: var(--expm-accent);
	-webkit-appearance: none;
	appearance: none;
	transition: transform .12s ease;
}
.expm-ap-seek::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border: 0;
	border-radius: 50%;
	background: var(--expm-accent);
}
.expm-ap-seek:hover::-webkit-slider-thumb,
.expm-ap-seek:active::-webkit-slider-thumb {
	transform: scale(1.3);
}
.expm-ap-seek:focus-visible {
	outline: 2px solid var(--expm-accent);
	outline-offset: 3px;
	border-radius: 4px;
}
.expm-ap--error .expm-ap-title::after {
	content: " (unavailable)";
	font-weight: 400;
	opacity: .7;
}
@media (max-width: 480px) {
	.expm-item--audio.expm-ap {
		gap: 10px;
		padding: 12px;
	}
	.expm-ap-btn {
		width: 42px;
		height: 42px;
	}
	.expm-ap-time {
		min-width: 4.8em;
	}
}
@media (prefers-reduced-motion: reduce) {
	.expm-ap-btn,
	.expm-ap-seek::-webkit-slider-thumb {
		transition: none;
	}
	.expm-ap--loading .expm-ap-btn {
		animation: none;
	}
}
.expm-item--audio:not(.expm-ap) {
	padding: .85rem 1rem;
	border: 1px solid rgba(128, 128, 128, .3);
	border-radius: 8px;
}
.expm-item--audio:not(.expm-ap) audio {
	display: block;
	width: 100%;
}
