/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme — 新智元 aiera.com.cn 设计层
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 * Version: 2.0.0
 */

/* =========================================================================
   新智元 · aiera.com.cn 设计层（2026-08-04）
   —— 只做「叠加」，不改 Blocksy 母主题文件；全部基于母主题暴露的
      --theme-palette-color-* 变量，换配色时跟着动。
   —— 两个自建专题页（WAIC 104188 / 秒追 ASI 107223）自带整套样式，
      正文排版规则一律用 body:not(.page-id-...) 排除掉，别互相打架。
   ========================================================================= */

:root {
	--xz-gold: var(--theme-palette-color-1, #e8bc00);
	--xz-gold-deep: #b08c00;
	--xz-ink: #14161c;          /* 标题 */
	--xz-text: #3d4250;         /* 正文 */
	--xz-dim: #767c8b;          /* 次要信息 */
	--xz-line: #e9eaf0;         /* 分隔线 */
	--xz-soft: #f5f6fa;         /* 浅底 */
	--xz-shadow: 0 10px 34px rgba(20, 22, 28, .08);
	/* 中文优先的字栈：拉丁字母走系统无衬线，汉字落到苹方/微软雅黑 */
	--xz-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
		"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
		"Noto Sans CJK SC", sans-serif;
}

/* ---------------------------------------------------------------- 基础 */

body,
button,
input,
select,
textarea {
	font-family: var(--xz-sans);
}

body {
	--theme-text-color: var(--xz-text);
	--theme-headings-color: var(--xz-ink);
	/* 金色选中条上必须是黑字，白字读不出来 */
	--theme-selection-text-color: #14161c;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

::selection {
	background: var(--xz-gold);
	color: #14161c;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--xz-gold);
	outline-offset: 2px;
	border-radius: 3px;
}

/* ---------------------------------------------------------------- 页头 */

.ct-header [data-id="menu"] > ul > li > a {
	position: relative;
	letter-spacing: .3px;
}

/* 导航项下方的金色滑出下划线；当前页常亮 */
.ct-header [data-id="menu"] > ul > li > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 2px;
	background: var(--xz-gold);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.ct-header [data-id="menu"] > ul > li > a:hover::after,
.ct-header [data-id="menu"] > ul > li.current-menu-item > a::after,
.ct-header [data-id="menu"] > ul > li.current_page_item > a::after {
	transform: scaleX(1);
}

.ct-header [data-id="menu"] > ul > li.current-menu-item > a {
	color: var(--xz-gold-deep);
}

/* 「寻求报道」按钮：黑底 → hover 翻金底黑字 */
.ct-header [data-id="button"] .ct-button {
	border-radius: 999px;
	font-weight: 700;
	letter-spacing: .5px;
	transition: background-color .22s, color .22s, transform .22s;
}

.ct-header [data-id="button"] .ct-button:hover {
	background-color: var(--xz-gold) !important;
	color: #14161c !important;
	transform: translateY(-1px);
}

/* ---------------------------------------------------------------- 列表页卡片 */

.entries .entry-card {
	position: relative;
	/* --card-inner-spacing 同时决定内边距和 boundless 图片的负边距，
	   两者必须是同一个值，图片才能严丝合缝贴到卡片边 */
	--card-inner-spacing: 26px;
	--card-media-max-width: 38%;
	min-height: 216px;
	border: 1px solid var(--xz-line);
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	box-shadow: none;
	transition: border-color .25s, box-shadow .25s, transform .25s;
}

.entries .entry-card:hover {
	border-color: #dcdee8;
	box-shadow: var(--xz-shadow);
	transform: translateY(-2px);
}

/* 左图右文时，flex 行高会被图片的原始比例撑起来——竖图能把卡片顶到 400px+
   （搜索结果页尤其明显）。给媒体框定死比例，行高就可预测了。 */
@media (min-width: 690px) {
	.entries[data-layout="simple"] .entry-card > .ct-media-container {
		aspect-ratio: 16 / 9;
	}

	.entries[data-layout="simple"] .entry-card {
		max-height: 268px;
	}

	/* 「头条更大」只在首页列表成立；搜索结果/分类页每条都是平等的 */
	body.home .entries[data-layout="simple"] .entry-card:first-child {
		max-height: 340px;
	}
}

/* 左图右文：图片满高裁切，卡片再长再短都不会露白边 */
.entries[data-layout="simple"] .entry-card .ct-media-container img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s cubic-bezier(.2, .6, .2, 1);
}

.entries .entry-card:hover .ct-media-container img {
	transform: scale(1.035);
}

.entries .entry-card .entry-title {
	margin: 0 0 10px;
	font-size: clamp(18px, 1.35vw, 21px);
	line-height: 1.5;
	font-weight: 700;
	letter-spacing: .2px;
}

.entries .entry-card .entry-title a {
	color: var(--xz-ink);
	background-image: linear-gradient(var(--xz-gold), var(--xz-gold));
	background-size: 0 2px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size .3s, color .2s;
}

.entries .entry-card:hover .entry-title a {
	background-size: 100% 2px;
}

/* 摘要：两行截断，长短不一也不会把卡片撑歪 */
.entries .entry-card .entry-excerpt {
	margin: 0 0 12px;
	font-size: 14.5px;
	line-height: 1.85;
	color: var(--xz-dim);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.entries .entry-card .entry-meta {
	font-size: 12.5px;
	color: #9aa0ad;
	letter-spacing: .3px;
}

.entries .entry-card .entry-meta .meta-date span {
	color: #b3b8c4;
}

/* 头条：列表第一条给更大的图和标题，一眼看出主次 */
@media (min-width: 1000px) {
	body.home .entries[data-layout="simple"] .entry-card:first-child {
		--card-media-max-width: 46%;
		min-height: 268px;
	}

	body.home .entries[data-layout="simple"] .entry-card:first-child .entry-title {
		font-size: 25px;
		line-height: 1.45;
	}

	body.home .entries[data-layout="simple"] .entry-card:first-child .entry-excerpt {
		-webkit-line-clamp: 3;
		font-size: 15px;
	}
}

/* 分页 */
.ct-pagination a,
.ct-pagination .page-numbers {
	border-radius: 10px;
	font-weight: 600;
}

/* ---------------------------------------------------------------- 侧栏 */

/* 侧栏里「Top10 热文」那种是 10 个各自独立的 widget，
   所以分隔线只画在「带标题的 widget」上方，不能见 widget 就画一条。 */
.ct-sidebar .ct-widget {
	margin-bottom: 20px;
}

.ct-sidebar .ct-widget:has(.widget-title, .wp-block-heading, .stk-block-heading__text):not(:first-child) {
	padding-top: 26px;
	border-top: 1px solid var(--xz-line);
}

/* 无标题 widget 连成一串时收紧行距（Top10 热文列表就是这形态） */
.ct-sidebar .widget_block:not(:has(.wp-block-heading, .stk-block-heading__text)) {
	margin-bottom: 10px;
}

.ct-sidebar .widget_block p {
	margin: 0;
	font-size: 14px;
	line-height: 1.8;
}

.ct-sidebar .widget-title,
.ct-sidebar .wp-block-heading,
.ct-sidebar .stk-block-heading__text {
	position: relative;
	margin-bottom: 16px !important;
	padding-left: 12px;
	font-size: 15px !important;
	font-weight: 800;
	letter-spacing: .6px;
	color: var(--xz-ink);
}

.ct-sidebar .widget-title::before,
.ct-sidebar .wp-block-heading::before,
.ct-sidebar .stk-block-heading__text::before {
	content: "";
	position: absolute;
	left: 0;
	top: .18em;
	bottom: .18em;
	width: 4px;
	border-radius: 3px;
	background: var(--xz-gold);
}

/* 侧栏文章缩略图：圆形裁切把横图切得七零八落，统一改成小圆角方图 */
.ct-sidebar .ct-dynamic-media img,
.ct-sidebar .wp-block-post-featured-image img {
	border-radius: 10px !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.ct-sidebar .ct-dynamic-data a {
	color: var(--xz-ink);
	transition: color .2s;
}

.ct-sidebar .ct-dynamic-data a:hover {
	color: var(--xz-gold-deep);
}

.ct-sidebar .wp-block-post {
	padding-bottom: 14px;
}

/* ---------------------------------------------------------------- 正文页 */

/* 两个自建专题页自带样式，正文排版规则一律绕开 */
body:not(.page-id-104188):not(.page-id-107223) .entry-content p {
	line-height: 1.95;
	color: var(--xz-text);
}

body:not(.page-id-104188):not(.page-id-107223) .entry-content > h2,
body:not(.page-id-104188):not(.page-id-107223) .entry-content > h3,
body:not(.page-id-104188):not(.page-id-107223) .entry-content > h4 {
	margin-top: 1.9em;
	margin-bottom: .7em;
	letter-spacing: .3px;
}

body:not(.page-id-104188):not(.page-id-107223) .entry-content blockquote {
	margin: 1.8em 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--xz-gold);
	background: none;
	color: #4b5060;
	font-style: normal;
}

body:not(.page-id-104188):not(.page-id-107223) .entry-content img {
	border-radius: 10px;
}

body:not(.page-id-104188):not(.page-id-107223) .entry-content a:not(.ct-button):not(.wp-element-button) {
	color: var(--xz-gold-deep);
	text-decoration: underline;
	text-decoration-color: rgba(232, 188, 0, .45);
	text-underline-offset: 3px;
	transition: text-decoration-color .2s;
}

body:not(.page-id-104188):not(.page-id-107223) .entry-content a:not(.ct-button):not(.wp-element-button):hover {
	text-decoration-color: var(--xz-gold);
}

/* 文章大图页头：压一层暗罩，标题才压得住花花绿绿的封面图 */
.hero-section[data-type="type-2"]::before,
.ct-hero-section[data-type="type-2"]::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(10, 11, 16, .32) 0%, rgba(10, 11, 16, .62) 100%);
	pointer-events: none;
}

.hero-section .page-title,
.ct-hero-section .page-title {
	text-shadow: 0 2px 22px rgba(0, 0, 0, .45);
	letter-spacing: .5px;
}

/* 文章底部的相关阅读 */
.ct-related-posts .related-entry-title {
	font-size: 16px;
	line-height: 1.6;
	font-weight: 700;
}

.ct-related-posts .ct-media-container img {
	border-radius: 10px;
}

/* ---------------------------------------------------------------- 页脚 */

.ct-footer [data-row="middle"] {
	background: #101218;
	color: #9ba1b0;
	--theme-text-color: #9ba1b0;
	--theme-link-initial-color: #c9cede;
	--theme-link-hover-color: var(--xz-gold);
	--theme-headings-color: #fff;
	padding-block: 12px;
}

.ct-footer [data-row="middle"] .widget-title {
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: .6px;
}

.ct-footer [data-row="middle"] p {
	line-height: 1.95;
	font-size: 14px;
}

.ct-footer [data-row="middle"] img {
	border-radius: 8px;
}

.ct-footer [data-row="bottom"] {
	background: #0a0b10;
	--theme-text-color: #6f7686;
	--theme-link-initial-color: #8d94a4;
	--theme-link-hover-color: var(--xz-gold);
}

.ct-footer [data-row="bottom"] p {
	font-size: 12.5px;
	line-height: 2;
}

.ct-footer [data-row="bottom"] img {
	vertical-align: -2px;
}

/* 回到顶部 */
.ct-back-to-top {
	border-radius: 12px !important;
	box-shadow: 0 6px 20px rgba(20, 22, 28, .18);
}

/* ---------------------------------------------------------------- 表单 / 搜索 */

.ct-search-form input[type="search"] {
	border-radius: 12px;
}

#search-modal .modal-field {
	letter-spacing: .5px;
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 999px) {
	.entries .entry-card .card-content {
		padding: 20px;
	}

	.entries[data-layout="simple"] .entry-card .ct-media-container img {
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 689px) {
	.entries .entry-card {
		border-radius: 14px;
	}

	.entries .entry-card .entry-title {
		font-size: 18px;
	}

	.entries .entry-card .entry-excerpt {
		font-size: 14px;
	}
}
