/* ==========================================================================
   产品演示视频（Vimeo 懒加载封面）
   仅「有视频的产品页」加载。封面常驻，点击后才注入播放器，首屏零负担。

   v1.0.66 布局规则（按用户标注位置 + 严格边界约束）：
   - 视频块位于 .product-body__inner 内部、紧贴「Product Description」标题上方；
   - 视频容器与文字列「同宽同源」：width:100% 直接继承 .product-body__inner
     的左右边界，再用左右相等的 padding-inline:6% 在内部收窄播放器（视觉宽 88%）。
     居中不依赖 margin:auto 计算，因此不受断点 / 容器宽度 / RTL / 缩放影响；
   - 无任何背景色块、无模糊拉伸层；没视频的产品零输出、零资源。
   - 竖屏：播放器直接给 9:16 竖幅盒子，视频自己填满，两侧从根上无黑边。

   【边界约束】本文件所有选择器只允许命中视频模块自身的类名
   （.product-video / .osman-vimeo*），不得修改 .product-body__title、
   .product-body__inner、.entry-content 或任何其它既有元素的样式。
   与标题的 22px 间距由视频块自身的 margin-bottom 结合 CSS 外边距合并实现，
   不覆盖标题原有的 margin-top（34px）：34 + (-12) = 22px。

   注意：本块位于 .entry-content 内，需覆盖
   .entry-content img / .product-body__inner img / iframe 对本模块内部元素的
   既有样式（外边距、圆角、max-width 等），故选择器带 .product-video 前缀。
   ========================================================================== */

/* --- 视频块：与文字列同宽同源，任何设备都严格居中 ---
   容器本身 width:100%（左右边界 == 文字列），播放器由左右各 6% 的
   padding-inline 收窄到视觉 88%；左右留白恒等，无需 margin:auto 计算。
   padding-inline / margin-inline 为逻辑属性，RTL（阿语）下同样对称。 */
.product-video {
	width: 100%;
	box-sizing: border-box;
	padding-inline: 6%;
	/* 只改视频模块自身：与后续标题的 34px 上边距合并后得到 22px，
	   不覆盖标题的 margin-top（那属于「其它元素」，按约束不动）。 */
	margin: 0 0 -12px;
}

/* --- 播放器外框：横屏（默认 16:9），无背景块 --- */
.osman-vimeo {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;       /* 无需 JS 计算，无布局跳动 */
	background: #111;           /* 播放器底色，封面/视频会盖住 */
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}

/* 竖屏：窄竖幅盒子在块内居中，视频填满 → 零黑边、零背景块 */
.osman-vimeo--portrait {
	width: 62%;
	margin-inline: auto;
	aspect-ratio: 9 / 16;
}

/* --- 舞台：封面 + 播放按钮（点击后被 iframe 顶替） --- */
.osman-vimeo__stage {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* 前缀提升特异性，覆盖 .entry-content img 的 margin:12px 0 24px、
   .product-body__inner img 的 height:auto / border-radius。
   否则绝对定位的封面会被外边距整体下推 12px，顶部露出黑边、上下不对称。 */
.product-video .osman-vimeo__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

/* --- 播放按钮：居中，悬停变主题色 --- */
.osman-vimeo__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 68px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}

.osman-vimeo__play:hover,
.osman-vimeo__play:focus-visible {
	background: rgba(172, 102, 32, .92); /* 主题强调色 --brown */
	transform: translate(-50%, -50%) scale(1.06);
	outline: none;
}

.osman-vimeo__play svg {
	width: 28px;
	height: 28px;
	fill: #fff;
	margin-left: 3px; /* 三角形视觉居中 */
}

/* --- 点击后注入的 iframe：铺满舞台 ---
   前缀提升特异性，覆盖 .product-body__inner iframe 的 aspect-ratio / display */
.product-video .osman-vimeo__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	aspect-ratio: auto;
	border: 0;
	border-radius: 0;
}

/* --- 移动端：宽度放宽到整列，间距收敛 --- */
@media (max-width: 640px) {
	.product-video {
		width: 100%;
		padding-inline: 0;   /* 窄屏不再内部收窄，播放器占满文字列 */
		/* 不覆盖基础规则的 margin-bottom:-12px：与标题 34px 合并后
		   仍是 22px，保持各断点间距一致（不使用 18px，避免合并后变 34px）。 */
	}
	.osman-vimeo--portrait {
		width: 78%;
	}
	.osman-vimeo__play {
		width: 56px;
		height: 56px;
	}
	.osman-vimeo__play svg {
		width: 24px;
		height: 24px;
	}
}
