/* ==========================================================================
   Hello Biz Child – 文章画廊小部件
   面包屑 / 筛选栏 / 网格 / 悬停箭头 / 搜索框
   ========================================================================== */

/* 面包屑 --------------------------------------------------------------- */
.hbc-gallery__breadcrumb {
	margin-bottom: 24px;
	font-size: 13px;
	color: #555;
}

.hbc-gallery__breadcrumb-home {
	color: #555;
	text-decoration: none;
}

.hbc-gallery__breadcrumb-home:hover {
	color: #cc0000;
	text-decoration: underline;
}

.hbc-gallery__breadcrumb-sep {
	margin: 0 6px;
	color: #999;
}

.hbc-gallery__breadcrumb-current {
	color: #333;
}

/* 筛选栏 --------------------------------------------------------------- */
.hbc-gallery__filter-bar {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: 30px;
}

.hbc-gallery__filters {
	display: flex;
	flex-wrap: wrap;
}

.hbc-gallery__filter {
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	background-color: #1a1a1a;
	color: #ffffff;
	border: none;
	cursor: pointer;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
	line-height: 1;
}

.hbc-gallery__filter.is-active:not(.hbc-gallery__filter--all) {
	background-color: #000000;
	color: #ffffff;
}

.hbc-gallery__filter:not(.is-active):not(.hbc-gallery__filter--all):hover {
	background-color: #333333;
}

/* 「FILTER·ALL」按钮 - 始终红色，不受激活/默认状态影响 */
.hbc-gallery__filter--all,
.hbc-gallery__filter--all.is-active {
	background-color: #cc0000;
	color: #ffffff;
}

.hbc-gallery__filter--all:hover,
.hbc-gallery__filter--all.is-active:hover {
	background-color: #cc0000;
}

/* 搜索框 --------------------------------------------------------------- */
.hbc-gallery__search-wrap {
	display: flex;
	align-items: stretch;
	flex: 0 0 auto;
	background-color: #1a1a1a;
}

.hbc-gallery__search-input {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-color: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	color: #cccccc;
	padding: 10px 14px;
	font-size: 13px;
	outline: none;
	width: 180px;
	line-height: 1;
	margin: 0;
}

.hbc-gallery__search-input:focus {
	outline: none;
}

.hbc-gallery__search-input::placeholder {
	color: #777777;
	font-style: italic;
	opacity: 1;
}

.hbc-gallery__search-input::-webkit-input-placeholder {
	color: #777777;
	font-style: italic;
}

.hbc-gallery__search-input::-moz-placeholder {
	color: #777777;
	font-style: italic;
	opacity: 1;
}

/* 搜索按钮（白色图标，与输入框同底色） */
.hbc-gallery__search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: transparent;
	border: none;
	color: #ffffff;
	padding: 10px 12px;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: color 0.2s ease;
}

.hbc-gallery__search-btn:hover,
.hbc-gallery__search-btn:focus {
	color: #cccccc;
	outline: none;
}

.hbc-gallery__search-btn svg,
.hbc-gallery__search-clear svg {
	width: 15px;
	height: 15px;
	display: block;
}

/* 清空按钮（独立深色块，分隔显示） */
.hbc-gallery__search-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: #2a2a2a;
	border: none;
	color: #ffffff;
	padding: 10px 13px;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.2s ease;
}

.hbc-gallery__search-clear:hover,
.hbc-gallery__search-clear:focus {
	background-color: #cc0000;
	outline: none;
}

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

.hbc-gallery__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.hbc-gallery__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.hbc-gallery__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.hbc-gallery__grid.is-loading {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* 文章条目 ------------------------------------------------------------- */
.hbc-gallery__item {
	position: relative;
}

.hbc-gallery__item:hover {
	z-index: 5;
}

.hbc-gallery__item-link {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
}

/* 图片区 */
.hbc-gallery__item-img {
	position: relative;
	padding-bottom: 66.67%;
	overflow: hidden;
	background-color: #e5e5e5;
}

.hbc-gallery__item-img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hbc-gallery__item-placeholder {
	position: absolute;
	inset: 0;
	background-color: #d0d0d0;
}

/* 悬停遮罩 */
.hbc-gallery__item-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(0, 0, 0, 0.18);
	opacity: 0;
	transition: opacity 0.28s ease;
}

.hbc-gallery__item-link:hover .hbc-gallery__item-overlay {
	opacity: 1;
}

/* 箭头按钮 */
.hbc-gallery__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background-color: #cc0000;
	color: #ffffff;
	transition: background-color 0.2s ease;
	pointer-events: auto;
}

.hbc-gallery__arrow svg {
	width: 18px;
	height: 18px;
	display: block;
}

.hbc-gallery__arrow:hover {
	background-color: #1a1a1a;
}

/* 标题区（默认隐藏，悬停时以绝对定位浮在下方图片之上，不推动布局） */
.hbc-gallery__item-caption {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 2;
	background-color: #ffffff;
	max-height: 0;
	overflow: hidden;
	text-align: center;
	padding: 0;
	transition: max-height 0.35s ease, padding 0.35s ease;
}

.hbc-gallery__item-link:hover .hbc-gallery__item-caption,
.hbc-gallery__item:hover .hbc-gallery__item-caption {
	max-height: 200px;
	padding-top: 12px;
	padding-bottom: 6px;
}

.hbc-gallery__item-title {
	font-size: 14px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0;
	line-height: 1.35;
}

/* 加载中 --------------------------------------------------------------- */
.hbc-gallery__loading {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 48px 0;
}

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

.hbc-gallery__spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: #cc0000;
	border-radius: 50%;
	animation: hbc-gallery-spin 0.7s linear infinite;
}

@keyframes hbc-gallery-spin {
	to { transform: rotate(360deg); }
}

/* 无结果 --------------------------------------------------------------- */
.hbc-gallery__no-results {
	padding: 48px 0;
	text-align: center;
	color: #888888;
	font-size: 15px;
	margin: 0;
}

/* 移动端下拉筛选 ------------------------------------------------------- */
.hbc-gallery__filter-mobile {
	display: none;
	position: relative;
	justify-content: center;
	margin-bottom: 12px;
}

.hbc-gallery .hbc-gallery__filter-trigger,
.hbc-gallery .hbc-gallery__filter-trigger:hover,
.hbc-gallery .hbc-gallery__filter-trigger:focus {
	background-color: transparent;
	background-image: none;
	box-shadow: none;
}

.hbc-gallery__filter-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #333333;
	padding: 8px 0;
}

.hbc-gallery__filter-chevron {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.hbc-gallery__filter-trigger[aria-expanded="true"] .hbc-gallery__filter-chevron {
	transform: rotate(180deg);
}

.hbc-gallery__filter-dropdown {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 160px;
	background: #ffffff;
	z-index: 200;
	list-style: none;
	margin: 0;
	padding: 4px 0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

.hbc-gallery__filter-option {
	padding: 10px 24px;
	font-size: 13px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: pointer;
	color: #333333;
}

.hbc-gallery__filter-option.is-active {
	color: #999999;
}

/* 响应式 --------------------------------------------------------------- */
@media (max-width: 1024px) {
	.hbc-gallery__grid--cols-4 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.hbc-gallery__filters {
		display: none;
	}

	.hbc-gallery__filter-mobile {
		display: flex;
	}

	.hbc-gallery__search-wrap {
		width: 100%;
	}

	.hbc-gallery__search-input {
		flex: 1;
		width: auto;
	}

	.hbc-gallery__grid--cols-3,
	.hbc-gallery__grid--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.hbc-gallery__grid--cols-2,
	.hbc-gallery__grid--cols-3,
	.hbc-gallery__grid--cols-4 {
		grid-template-columns: 1fr;
	}
}
