/* ======================================================
 * Brand Grid Widget — CSS
 * hello-biz-child / assets/css/brand-grid.css
 * ====================================================== */

/* ── Grid 容器 ───────────────────────────────────── */
.bgw-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 20px;
	row-gap: 28px;
	max-width: 100%;
	margin-bottom: 30px;
	box-sizing: border-box;
	min-height: 1px; /* Ensure container takes space */
}

/* ── 单个卡片 ────────────────────────────────────── */
.bgw-item {
	display: flex;
	flex-direction: column;
	max-width: 100%;
	min-width: 0;
}

/* ── 图片包裹层（保持宽高比） ──────────────────── */
.bgw-image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;        /* 现代浏览器首选 */
	padding-bottom: 100%;       /* 老浏览器后备 (两者不冲突) */
	overflow: hidden;
	display: block;
	border-radius: 4px;
	box-sizing: border-box;
}

.bgw-image-wrap img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

/* 悬停放大效果 */
.bgw-image-wrap.bgw-hover:hover img {
	transform: scale(1.04);
}

/* 图片链接外壳 — 强制 block 化避免 inline a 撑不开高度 */
a > .bgw-image-wrap,
span > .bgw-image-wrap {
	display: block;
}

.bgw-item > a,
.bgw-item > span {
	display: block;
	width: 100%;
	line-height: 0;
	font-size: 0;
}

.bgw-item > a.bgw-label-link {
	line-height: 1.4;
	font-size: 14px;
}

a:has(> .bgw-image-wrap),
a:has(> .bgw-image-wrap):hover {
	text-decoration: none;
}

/* ── 标签文字 ────────────────────────────────────── */
.bgw-label-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 10px;
	font-size: 14px;
	font-weight: 400;
	color: #333333;
	text-decoration: none;
	line-height: 1.4;
	transition: color 0.2s ease;
}

.bgw-label-link:hover {
	color: #9b2c7e;
	text-decoration: none;
}

.bgw-label-text {
	display: inline;
}

.bgw-arrow {
	display: inline-block;
	flex-shrink: 0;
	color: inherit;
	font-style: normal;
}

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width: 1024px) {
	.bgw-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 手机端：后备默认值，允许 Elementor 响应式控件覆盖 */
@media (max-width: 767px) {
	.bgw-grid {
		grid-template-columns: repeat(2, 1fr);
		column-gap: 12px;
		row-gap: 18px;
		margin-bottom: 24px;
	}

	.bgw-label-link {
		font-size: 12px;
		margin-top: 8px;
	}
}

@media (max-width: 480px) {
	.bgw-grid {
		column-gap: 10px;
		row-gap: 14px;
	}

	.bgw-label-link {
		font-size: 11px;
	}
}
