/* ==========================================================================
   12. 猫咪专栏（/cat/）
   --------------------------------------------------------------------------
   只在 is_page('cat') 时加载。所有规则收在 .zc-cat 作用域内，
   不碰站点其它页面的排版。

   色彩复用 §1 的 token：纸面 / 墨色 / 中性阶 / 唯一强调色（蓝）。
   强调色只在序号、小标签上出现，占比远低于 3%。
   ========================================================================== */

.zc-cat {
	--zc-cat-gap: clamp(0.85rem, 1.8vw, 1.5rem);
	--zc-cat-space: clamp(2.2rem, 5vw, 3.6rem);
	--zc-cat-radius: 6px;
}

.zc-cat figure,
.zc-cat dl,
.zc-cat dd,
.zc-cat dialog {
	margin: 0;
}

.zc-cat img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* 站内链接默认带下划线与强调色（§2），图片链接不需要 */
.zc-cat a.zc-cat-shot {
	text-decoration: none;
	color: inherit;
}

.zc-cat a.zc-cat-shot:hover {
	text-decoration: none;
}

/* ==========================================================================
   页面版头
   ========================================================================== */

.zc-cat-head {
	padding-top: clamp(0.2rem, 1vw, 0.8rem);
}

.zc-cat-kicker {
	display: flex;
	align-items: center;
	gap: 0.9em;
	margin: 0 0 clamp(0.9rem, 2vw, 1.4rem);
	font-family: var(--zc-font-mono);
	font-size: 0.6875rem;
	line-height: 1;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--zc-neutral);
}

.zc-cat-kicker-rule {
	flex: 1 1 auto;
	height: 1px;
	background: var(--zc-rule);
}

.zc-cat-title {
	margin: 0;
	font-size: clamp(2.5rem, 6.4vw, 4.25rem);
	line-height: 1.06;
	letter-spacing: -0.045em;
	font-weight: 600;
}

.zc-cat-sub {
	margin: 1rem 0 0;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--zc-muted);
	letter-spacing: 0.01em;
}

/* ==========================================================================
   封面图
   ========================================================================== */

.zc-cat-cover {
	margin-top: clamp(1.6rem, 3.6vw, 2.6rem);
}

.zc-cat-cover .zc-cat-shot {
	display: block;
	border: 1px solid var(--zc-rule);
	border-radius: var(--zc-cat-radius);
	overflow: hidden;
	background: var(--zc-paper-2);
}

.zc-cat-cover img {
	width: 100%;
}

.zc-cat-cover figcaption {
	margin-top: 0.85rem;
	font-size: 0.8125rem;
	line-height: 1.75;
	color: var(--zc-muted);
}

.zc-cat-chip {
	display: inline-block;
	margin-right: 0.6em;
	font-family: var(--zc-font-mono);
	font-size: 0.625rem;
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--zc-accent);
	border: 1px solid var(--zc-accent-soft);
	background: var(--zc-accent-soft);
	border-radius: 999px;
	padding: 0.32em 0.7em 0.28em;
	vertical-align: 0.12em;
}

/* ==========================================================================
   导语
   ========================================================================== */

.zc-cat-lede {
	max-width: 62ch;
	margin-top: var(--zc-cat-space);
}

.zc-cat-lede p {
	margin: 0 0 1.15em;
	font-size: 1.0625rem;
	line-height: 1.9;
	letter-spacing: 0.005em;
}

.zc-cat-lede p:first-child {
	font-size: 1.1875rem;
	line-height: 1.85;
	color: var(--zc-ink);
}

.zc-cat-lede p:last-child {
	margin-bottom: 0;
	color: var(--zc-ink-2);
}

/* ==========================================================================
   档案（定义列表）
   ========================================================================== */

.zc-cat-facts {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 1.15rem 1.4rem;
	margin-top: var(--zc-cat-space);
	padding: 1.15rem 0;
	border-top: 1px solid var(--zc-rule);
	border-bottom: 1px solid var(--zc-rule);
}

.zc-cat-facts dt {
	margin-bottom: 0.55em;
	font-family: var(--zc-font-mono);
	font-size: 0.625rem;
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--zc-neutral);
}

.zc-cat-facts dd {
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--zc-ink);
}

/* ==========================================================================
   图鉴
   ========================================================================== */

.zc-cat-gallery {
	margin-top: var(--zc-cat-space);
}

.zc-cat-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--zc-rule);
}

.zc-cat-section-head h2 {
	margin: 0;
	font-size: clamp(1.45rem, 2.6vw, 1.85rem);
	letter-spacing: -0.02em;
}

.zc-cat-count {
	font-family: var(--zc-font-mono);
	font-size: 0.6875rem;
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--zc-neutral);
	white-space: nowrap;
}

.zc-cat-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1.5rem, 2.8vw, 2.2rem) var(--zc-cat-gap);
	margin-top: clamp(1.2rem, 2.4vw, 1.8rem);
	align-items: start;
}

.zc-cat-item {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.zc-cat-grid .zc-cat-shot {
	position: relative;
	display: block;
	overflow: hidden;
	border: 1px solid var(--zc-rule);
	border-radius: var(--zc-cat-radius);
	background: var(--zc-paper-2);
	cursor: zoom-in;
}

.zc-cat-grid .zc-cat-shot img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	transition: transform 600ms var(--zc-ease-out);
}

.zc-cat-item:hover .zc-cat-shot img,
.zc-cat-item:focus-within .zc-cat-shot img {
	transform: scale(1.025);
}

.zc-cat-grid .zc-cat-shot:focus-visible {
	outline: 2px solid var(--zc-focus);
	outline-offset: 3px;
}

.zc-cat-cap {
	display: block;
	margin-top: 0.9rem;
}

.zc-cat-num {
	font-family: var(--zc-font-mono);
	font-size: 0.6875rem;
	line-height: 1;
	letter-spacing: 0.14em;
	color: var(--zc-accent);
}

.zc-cat-name {
	display: block;
	margin-top: 0.35em;
	font-family: var(--zc-font-display);
	font-size: 1.125rem;
	line-height: 1.4;
	letter-spacing: -0.01em;
	color: var(--zc-ink);
}

.zc-cat-desc {
	display: block;
	margin-top: 0.4em;
	font-size: 0.875rem;
	line-height: 1.72;
	color: var(--zc-muted);
}

/* 引文卡：填满图鉴网格的第六格 */
.zc-cat-quote {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: clamp(1.5rem, 3vw, 2.4rem);
	padding: clamp(1.25rem, 2.2vw, 2rem);
	background: var(--zc-paper-2);
	border: 1px solid var(--zc-rule);
	border-radius: var(--zc-cat-radius);
}

.zc-cat-quote-text {
	margin: 0;
	font-family: var(--zc-font-display);
	font-size: clamp(1.05rem, 1.35vw, 1.25rem);
	line-height: 1.8;
	letter-spacing: 0.005em;
	color: var(--zc-ink-2);
}

.zc-cat-quote-foot {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	padding-top: 1rem;
	border-top: 1px solid var(--zc-rule);
}

.zc-cat-quote-by {
	font-family: var(--zc-font-mono);
	font-size: 0.625rem;
	line-height: 1;
	letter-spacing: 0.14em;
	color: var(--zc-neutral);
}

.zc-cat-quote-meta {
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--zc-muted);
}

/* ==========================================================================
   页脚（专栏落款）
   ========================================================================== */

.zc-cat-end {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem 2rem;
	margin-top: var(--zc-cat-space);
	padding-top: 1.15rem;
	border-top: 1px solid var(--zc-rule);
	font-size: 0.8125rem;
	line-height: 1.7;
	color: var(--zc-muted);
}

.zc-cat-end p {
	margin: 0;
}

.zc-cat-pill {
	display: inline-block;
	margin-left: 0.45em;
	padding: 0.16em 0.7em;
	border: 1px solid var(--zc-rule);
	border-radius: 999px;
	font-family: var(--zc-font-mono);
	font-size: 0.625rem;
	letter-spacing: 0.1em;
	color: var(--zc-neutral);
	vertical-align: 0.05em;
}

/* ==========================================================================
   看大图（<dialog>，JS 缺失时退化为直接打开原图）
   ========================================================================== */

.zc-cat-lb {
	width: auto;
	max-width: min(94vw, 1400px);
	max-height: 92vh;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.zc-cat-lb::backdrop {
	background: oklch(16% 0.01 260 / 0.93);
}

.zc-cat-lb figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.9rem;
}

.zc-cat-lb img {
	max-width: min(94vw, 1400px);
	max-height: 80vh;
	width: auto;
	height: auto;
	border-radius: 4px;
}

.zc-cat-lb figcaption {
	max-width: 60ch;
	font-size: 0.8125rem;
	line-height: 1.65;
	text-align: center;
	color: oklch(86% 0.008 250);
}

.zc-cat-lb form {
	position: fixed;
	top: 1.1rem;
	right: 1.4rem;
	margin: 0;
}

.zc-cat-lb-close {
	width: 2.4rem;
	height: 2.4rem;
	padding: 0;
	border: 1px solid oklch(60% 0.01 250 / 0.5);
	border-radius: 999px;
	background: oklch(24% 0.012 260 / 0.85);
	color: oklch(94% 0.004 250);
	font-family: var(--zc-font-mono);
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--zc-dur-micro) var(--zc-ease-out);
}

/* Astra 给 button:focus 设了强调色底（0,1,1），这里要用更高权重压回来 */
.zc-cat-lb .zc-cat-lb-close:hover,
.zc-cat-lb .zc-cat-lb-close:focus {
	background: oklch(34% 0.012 260 / 0.95);
	color: oklch(97% 0.004 250);
}

.zc-cat-lb .zc-cat-lb-close:focus-visible {
	outline: 2px solid oklch(88% 0.01 250);
	outline-offset: 3px;
	border-radius: 999px;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 921px) {
	.zc-cat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.zc-cat-facts {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.zc-cat-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.zc-cat-facts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.zc-cat-title {
		letter-spacing: -0.03em;
	}

	.zc-cat-end {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ==========================================================================
   打印
   ========================================================================== */

@media print {
	.zc-cat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.zc-cat-lb {
		display: none;
	}
}
