/*
 * Sigma-RT homepage — waterfall article grid.
 * Source design: 设计样式 / blog/index.html (section ② 瀑布流文章区).
 *
 * Loaded on the front page only (see inc/home-waterfall.php). Every rule is
 * scoped under .sigma-home so the original header/footer (style.min.css)
 * are not affected. Change --sigma-accent to switch the accent colour.
 */

/* Same grey behind the strip under the fixed navbar, so it blends into the grid area. */
body.home {
	background: #f4f5f7;
}

.sigma-home {
	--sigma-accent: #2f6bff;
	--sigma-accent-soft: #eef4ff;
	--sigma-ink: #2b2f36;
	--sigma-muted: #7a808a;
	--sigma-faint: #a0a6b0;

	background: #f4f5f7;
	color: var(--sigma-ink);
	font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.sigma-home *,
.sigma-home *::before,
.sigma-home *::after {
	box-sizing: border-box;
}

/* ---- Page heading ---- */
.sigma-home .sigma-home__head {
	text-align: center;
	padding: 24px 16px 4px;
}

.sigma-home .sigma-home__title {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--sigma-ink);
}

.sigma-home .sigma-home__subtitle {
	margin: 0;
	font-size: 14px;
	text-align: center; /* style.min.css sets p { text-align: left } */
	color: #8a909a;
}

/* ---- Search box ---- */
.sigma-home .sigma-home__search {
	display: flex;
	align-items: center;
	max-width: 420px;
	margin: 16px auto 0;
	border: 1px solid #e2e4e9;
	border-radius: 999px;
	background: #fff;
	overflow: hidden;
}

.sigma-home .sigma-home__search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	padding: 10px 16px;
	font-size: 14px;
	color: var(--sigma-ink);
	background: transparent;
}

.sigma-home .sigma-home__search-btn {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--sigma-muted);
	cursor: pointer;
}

.sigma-home .sigma-home__search-btn:hover {
	color: var(--sigma-accent);
}

.sigma-home .sigma-home__empty {
	margin: 0;
	padding: 48px 16px 96px;
	text-align: center;
	color: #8a909a;
}

/* ---- Waterfall (CSS columns) ---- */
.sigma-home .sigma-waterfall {
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 16px 8px;
	column-count: 4;
	column-gap: 18px;
}

@media (max-width: 1200px) {
	.sigma-home .sigma-waterfall { column-count: 3; }
}
@media (max-width: 900px) {
	.sigma-home .sigma-waterfall { column-count: 2; }
}
@media (max-width: 560px) {
	.sigma-home .sigma-waterfall { column-count: 1; }
}

/* ---- Card ---- */
.sigma-home .sigma-card {
	position: relative;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin: 0 0 18px;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(20, 30, 50, .06);
	cursor: pointer;
	transition: transform .25s, box-shadow .25s;
}

.sigma-home .sigma-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 28px rgba(20, 30, 50, .14);
}

.sigma-home .sigma-card__cover {
	display: block;
	width: 100%;
}

.sigma-home .sigma-card__cover img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

/* Placeholder cover (used when a post has no featured image). */
.sigma-home .sigma-h140 { height: 140px; }
.sigma-home .sigma-h180 { height: 180px; }
.sigma-home .sigma-h220 { height: 220px; }
.sigma-home .sigma-h260 { height: 260px; }
.sigma-home .sigma-h300 { height: 300px; }

.sigma-home .sigma-g1 { background: linear-gradient(135deg, #5b8def, #8fc0ff); }
.sigma-home .sigma-g2 { background: linear-gradient(135deg, #f7971e, #ffd200); }
.sigma-home .sigma-g3 { background: linear-gradient(135deg, #38ef7d, #11998e); }
.sigma-home .sigma-g4 { background: linear-gradient(135deg, #8e2de2, #4a00e0); }
.sigma-home .sigma-g5 { background: linear-gradient(135deg, #fc4a1a, #f7b733); }
.sigma-home .sigma-g6 { background: linear-gradient(135deg, #00c6fb, #005bea); }
.sigma-home .sigma-g7 { background: linear-gradient(135deg, #c31432, #240b36); }
.sigma-home .sigma-g8 { background: linear-gradient(135deg, #1488cc, #2b32b2); }

.sigma-home .sigma-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	padding: 3px 10px;
	border-radius: 12px;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font-size: 12px;
	line-height: 1.5;
	pointer-events: none;
}

.sigma-home .sigma-card__body {
	padding: 14px 16px 6px;
}

.sigma-home .sigma-card__title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--sigma-ink);
}

/* Whole card is clickable: the title link is stretched over the card. */
.sigma-home .sigma-card__title a,
.sigma-home .sigma-card__title a:hover,
.sigma-home .sigma-card__title a:focus {
	color: inherit;
	text-decoration: none;
}

.sigma-home .sigma-card__title a::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
}

.sigma-home .sigma-card__title a:focus { outline: none; }

.sigma-home .sigma-card__title a:focus-visible::after {
	outline: 2px solid var(--sigma-accent);
	outline-offset: -2px;
	border-radius: 10px;
}

.sigma-home .sigma-card__excerpt {
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.7;
	color: var(--sigma-muted);
}

.sigma-home .sigma-card__meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 16px 14px;
	font-size: 12px;
	color: var(--sigma-faint);
}

.sigma-home .sigma-card__meta time {
	margin-left: auto;
}

.sigma-home .sigma-card__tag {
	padding: 1px 8px;
	border-radius: 10px;
	background: var(--sigma-accent-soft);
	color: var(--sigma-accent);
}

/* ---- "Load more" ---- */
.sigma-home .sigma-home__pager {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 0 16px 56px;
}

.sigma-home .sigma-pager__link {
	display: inline-block;
	padding: 10px 40px;
	border: 1px solid var(--sigma-accent);
	border-radius: 24px;
	background: #fff;
	color: var(--sigma-accent);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
}

.sigma-home .sigma-pager__link:hover,
.sigma-home .sigma-pager__link:focus {
	background: var(--sigma-accent);
	color: #fff;
	text-decoration: none;
}

.sigma-home .sigma-pager__link[aria-busy="true"] {
	opacity: .6;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.sigma-home .sigma-card { transition: none; }
	.sigma-home .sigma-card:hover { transform: none; }
}
