/* 唯匠藝廊 Weijan Gallery for Elementor
 * 極簡、無多餘 JS,版面全部用 CSS Grid,載入快。
 */

.wj-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	width: 100%;
	box-sizing: border-box;
	/* 連續格線:容器負責最上與最左邊,顏色/寬度由 Elementor 控制項注入 */
	border-top: 0 solid transparent;
	border-left: 0 solid transparent;
}

.wj-gallery-item {
	display: block;
	box-sizing: border-box;
	position: relative;
	line-height: 0;
	/* 連續格線:每格負責右與下,和相鄰格不重疊 */
	border-right: 0 solid transparent;
	border-bottom: 0 solid transparent;
}

.wj-gallery-link {
	display: block;
	text-decoration: none;
	line-height: 0;
	color: inherit;
}

.wj-gallery-thumb {
	display: block;
	position: relative;
	width: 100%;
	overflow: hidden;
	line-height: 0;
}

.wj-gallery-img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	will-change: transform;
	transition: transform 0.45s ease, opacity 0.3s ease;
	background-color: transparent;
}

/* 懸停:放大 */
.wj-hover-zoom .wj-gallery-item:hover .wj-gallery-img {
	transform: scale(1.06);
}

/* 懸停:淡出變暗 */
.wj-hover-fade .wj-gallery-item:hover .wj-gallery-img {
	opacity: 0.78;
}

/* 說明文字 */
.wj-gallery-caption {
	line-height: 1.4;
	word-break: break-word;
}

/* 尊重使用者的減少動態設定 */
@media (prefers-reduced-motion: reduce) {
	.wj-gallery-img {
		transition: none;
	}
}
