/* ============================================================
 * 18+ 内容：缩略图高斯模糊 + 正中限制图标
 *
 * 生效开关来自 Age Gate 插件的文章级判定（inc/age-gate-18.php）。
 * 命中：容器加 .zb-age18，缩略图恒定模糊、正中叠加一张图标，
 *       与访客是否点过「已满18岁」无关（本文件不读验证 Cookie）。
 * 未命中：不输出任何额外类，样式零影响。
 *
 * 三个参数由主题设置下发（CSS 变量，见 zb_age18_style()）：
 *   --zb-age18-icon        图标图片地址（留空则只模糊、不显示图标）
 *   --zb-age18-icon-size   图标边长（px）
 *   --zb-age18-blur        高斯模糊半径（px）
 * ============================================================ */

/* ---------- 1. 容器：定位 + 裁切，避免模糊后出现半透明边缘 ---------- */
/* display:block 是必须的：popular-thumb 等是行内 <a>，行内元素上
   宽度、padding-top 撑高和 overflow 裁切都不生效，图标会定位错乱 */
.entry-media.zb-age18,
.popular-thumb.zb-age18,
.zb-lpw-thumb.zb-age18,
.zb-age18-wrap {
	position: relative;
	display: block;
	overflow: hidden;
}

.zb-age18-wrap {
	display: block;
	line-height: 0;
}

/* ---------- 2. 正中图标 ---------- */
/* 图标是背景图而非 <img>，不会被图片的 object-fit / 绝对定位规则影响；
   --zb-age18-icon 为空时 background-image 落回 none，即「只模糊不显示图标」 */
.entry-media.zb-age18::before,
.popular-thumb.zb-age18::after,
.zb-lpw-thumb.zb-age18::after,
.zb-age18-wrap::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 9;
	width: var(--zb-age18-icon-size, 46px);
	height: var(--zb-age18-icon-size, 46px);
	transform: translate(-50%, -50%);
	background-image: var(--zb-age18-icon, none);
	background-position: center center;
	background-repeat: no-repeat;
	background-size: contain;
	filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .45));
	pointer-events: none;
}

/* ---------- 3. 缩略图本体：高斯模糊 ---------- */
/* 放大 10% 是为了把模糊采样出来的半透明边推到容器外，由容器裁掉 */
.entry-media.zb-age18 .media-img,
.entry-media.zb-age18 > img,
.popular-thumb.zb-age18 img,
.zb-lpw-thumb.zb-age18 img,
.zb-age18-wrap > img {
	filter: blur(var(--zb-age18-blur, 6px)) !important;
	transform: scale(1.1) !important;
	transform-origin: 50% 50%;
}

/* 模糊状态下取消放大动效，避免悬停时露出边缘 */
.zb-lpw-item:hover .zb-lpw-thumb.zb-age18 img,
.popular-item:hover .popular-thumb.zb-age18 img {
	transform: scale(1.1) !important;
}

/* ---------- 4. 小尺寸缩略图：图标收一点，避免盖满整张图 ---------- */
/* 横向列表的左侧小图（col-4 / col-md-3）与侧栏最新文章小图 */
.post-list .entry-media.zb-age18::before,
.zb-lpw-thumb.zb-age18::after {
	width: calc(var(--zb-age18-icon-size, 46px) * .68);
	height: calc(var(--zb-age18-icon-size, 46px) * .68);
}
