/* ─── 瀑布式店家列表 ─────────────────────
 *
 * 實作方式:CSS column-count(純 CSS,無需 JS)
 * 優點:順序自動依照優先度從上往下、從左欄往右欄填入
 *      圖片高度不一也能自然錯落,跨瀏覽器穩定
 * ────────────────────────────────────── */

.spg-masonry {
	column-count: var(--spg-cols, 3);
	column-gap: 20px;
	margin: 0 auto;
}

@media (max-width: 1024px) {
	.spg-masonry { column-count: 2; }
}
@media (max-width: 600px) {
	.spg-masonry {
		column-count: 1;
		column-gap: 0;
	}
}

.spg-card {
	break-inside: avoid;
	page-break-inside: avoid;       /* 老瀏覽器 */
	-webkit-column-break-inside: avoid;
	display: block;
	margin-bottom: 20px;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	text-decoration: none;
	color: inherit;
}

.spg-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(255, 20, 147, 0.15);
}

.spg-card-image {
	width: 100%;
	overflow: hidden;
	background: #f5f5f5;
}
.spg-card-image img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.4s ease;
}
.spg-card:hover .spg-card-image img {
	transform: scale(1.05);
}

.spg-card-body {
	padding: 14px 16px 16px;
}

.spg-card-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
	color: #222;
}

.spg-card-meta {
	font-size: 13px;
	color: #ff1493;
	margin-bottom: 8px;
	font-weight: 500;
}

.spg-card-excerpt {
	font-size: 13px;
	color: #666;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ─── 也讓 Elementor Loop Grid 能套同樣樣式 ───
 * 在 Elementor Loop Grid 的 Advanced → CSS Classes 加上 `spg-masonry`
 * 然後 Layout → 把 Columns 設成你要的數字(會被覆蓋成瀑布式)
 * ────────────────────────────────────────── */
.elementor-loop-container.spg-masonry {
	display: block !important;
	grid-template-columns: none !important;
	column-count: var(--spg-cols, 3);
	column-gap: 20px;
}
.elementor-loop-container.spg-masonry > * {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin-bottom: 20px;
	display: block !important;
	width: 100% !important;
}
@media (max-width: 1024px) {
	.elementor-loop-container.spg-masonry { column-count: 2; }
}
@media (max-width: 600px) {
	.elementor-loop-container.spg-masonry { column-count: 1; }
}

/* 分頁 */
.spg-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 30px 0;
}
.spg-pagination a,
.spg-pagination span {
	padding: 8px 14px;
	border-radius: 6px;
	background: #fff;
	border: 1px solid #e0e0e0;
	color: #333;
	text-decoration: none;
	font-size: 14px;
}
.spg-pagination .current {
	background: #ff1493;
	color: #fff;
	border-color: #ff1493;
}
.spg-pagination a:hover {
	border-color: #ff1493;
	color: #ff1493;
}

.spg-empty {
	text-align: center;
	padding: 60px 20px;
	color: #999;
	font-size: 16px;
}
