/**
 * 文章相册图小部件 - 样式
 */

/* 网格 ----------------------------------------------------------------- */
.hbc-album__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.hbc-album__item {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background-color: #f3f3f3;
	cursor: zoom-in;
	text-decoration: none;
	color: inherit;
}

.hbc-album__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
	will-change: transform;
}

/* 悬停遮罩（默认透明，悬停时淡入） */
.hbc-album__item::after {
	content: '';
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	z-index: 1;
}

.hbc-album__item:hover::after,
.hbc-album__item:focus::after {
	opacity: 1;
}

.hbc-album__item:hover img,
.hbc-album__item:focus img {
	transform: scale(1.05);
}

.hbc-album__empty {
	color: #888;
	text-align: center;
	padding: 32px 0;
	margin: 0;
}

/* 灯箱 ----------------------------------------------------------------- */
.hbc-album__lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.85);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 80px;
	-webkit-tap-highlight-color: transparent;
}

.hbc-album__lightbox[hidden] {
	display: none;
}

.hbc-album__stage {
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hbc-album__stage-img {
	max-width: 100%;
	max-height: calc(100vh - 120px);
	display: block;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

/* 关闭按钮 */
.hbc-album__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 50%;
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background-color 0.2s, border-color 0.2s;
}

.hbc-album__close svg {
	width: 18px;
	height: 18px;
}

.hbc-album__close:hover,
.hbc-album__close:focus {
	background-color: rgba(255, 255, 255, 0.15);
	border-color: #ffffff;
}

/* 左右箭头 */
.hbc-album__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 50%;
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background-color 0.2s, border-color 0.2s;
}

.hbc-album__nav svg {
	width: 22px;
	height: 22px;
}

.hbc-album__nav:hover,
.hbc-album__nav:focus {
	background-color: rgba(255, 255, 255, 0.15);
	border-color: #ffffff;
}

.hbc-album__nav--prev { left: 18px; }
.hbc-album__nav--next { right: 18px; }

/* 计数器 */
.hbc-album__counter {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.85);
	font-size: 13px;
	letter-spacing: 0.06em;
	white-space: nowrap;
	pointer-events: none;
}

/* 锁定 body 滚动（由 JS 加 .hbc-album-locked 到 body） */
body.hbc-album-locked {
	overflow: hidden;
}

/* 响应式 --------------------------------------------------------------- */
@media (max-width: 1024px) {
	.hbc-album__grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.hbc-album__lightbox {
		padding: 50px 60px;
	}
}

@media (max-width: 768px) {
	.hbc-album__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}
	.hbc-album__lightbox {
		padding: 50px 12px;
	}
	.hbc-album__nav {
		width: 36px;
		height: 36px;
	}
	.hbc-album__nav--prev { left: 8px; }
	.hbc-album__nav--next { right: 8px; }
}
