/*
Theme Name: NYU Shanghai
Theme URI: https://shanghai.nyu.edu/
Description: 基于 NYU Shanghai Design System 的精简博客区块主题：NYU Violet、方角、Montserrat。首页就是文章列表，不需要手工填任何组件。适配 WordPress 7.0+。
Author: NYU Shanghai
Version: 1.0.7
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nyushanghai
Tags: blog, full-site-editing, one-column, editor-style, translation-ready
*/

/* theme.json 管不到的少量细节 */

/* 页眉、主体、页脚之间不留缝 */
.wp-site-blocks > * { margin-block-start: 0; }

/* 标题上方的 4px Ultra Violet 短横线 */
.is-style-rule::before {
	content: "";
	display: block;
	width: 88px;
	height: 4px;
	margin-bottom: var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--ultra-violet);
}

.is-style-eyebrow {
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ultra-violet);
}

/* 页眉：logo | 站点名 */
.nyush-logo img { display: block; height: 40px; width: auto; }
.nyush-site-title {
	padding-left: var(--wp--preset--spacing--40);
	border-left: 1px solid var(--wp--preset--color--hairline);
	line-height: 40px;
}
.nyush-site-title { white-space: nowrap; font-size: var(--wp--preset--font-size--medium) !important; }

/* 顶部导航：菜单项排成一行，不折行 */
header .wp-block-navigation { --navigation-layout-wrap: nowrap; white-space: nowrap; }

/* 窗口不够宽时先隐藏页眉里的站点名，给菜单让位 */
@media (max-width: 1240px) {
	.nyush-site-title { display: none; }
}
@media (max-width: 600px) {
	.nyush-logo img { height: 32px; }
}

/* 页眉搜索按钮：只放图标 */
.wp-block-search__button-only .wp-block-search__button {
	padding: 8px;
	background: transparent;
	border-color: transparent;
	color: var(--wp--preset--color--violet);
}
.wp-block-search__button-only .wp-block-search__button:hover { color: var(--wp--preset--color--ultra-violet); }

/* 首页横幅：手机上别太扁 */
.nyush-banner img { width: 100%; }
@media (max-width: 600px) { .nyush-banner img { aspect-ratio: 2 / 1 !important; } }

/* 城市网格线条：页脚、404 */
.has-citygrid { position: relative; isolation: isolate; }
.has-citygrid::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: url(assets/images/citygrid-wide-1.png) right top / cover no-repeat;
	opacity: .14;
	pointer-events: none;
}
.has-deep-violet-background-color.has-citygrid::after { filter: brightness(0) invert(1); opacity: .1; }

/* 文章列表 */
.nyush-post-item .wp-block-post-excerpt__excerpt { margin: 0; }
.nyush-post-item .wp-block-post-title { margin: 0; }

/* 正文：导入的经典 HTML（p / strong / 列表 / hr / h2-h4） */
.nyush-prose { line-height: 1.65; }
.nyush-prose img { max-width: 100%; height: auto; }
.nyush-prose h2 { font-size: var(--wp--preset--font-size--heading); font-weight: 800; margin-top: 1.6em; }
.nyush-prose h3 { font-size: var(--wp--preset--font-size--subhead); margin-top: 1.4em; }
.nyush-prose h4 { font-size: var(--wp--preset--font-size--lead); margin-top: 1.2em; }
.nyush-prose strong { color: var(--wp--preset--color--black); font-weight: 700; }
.nyush-prose ul, .nyush-prose ol { padding-left: 1.4em; }
.nyush-prose li + li { margin-top: .35em; }
.nyush-prose li:empty { display: none; }
.nyush-prose li::marker { color: var(--wp--preset--color--violet); }
.nyush-prose hr:not(.wp-block-separator) {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--hairline);
	margin: var(--wp--preset--spacing--60) 0;
}
.nyush-prose blockquote:not(.wp-block-quote) {
	margin: var(--wp--preset--spacing--50) 0;
	padding-left: var(--wp--preset--spacing--50);
	border-left: 4px solid var(--wp--preset--color--ultra-violet);
	font-family: var(--wp--preset--font-family--frank-ruhl-libre);
	font-size: var(--wp--preset--font-size--lead);
	color: var(--wp--preset--color--violet);
}

/* 标签：胶囊 */
.taxonomy-post_tag.wp-block-post-terms { display: flex; flex-wrap: wrap; gap: 8px; }
.taxonomy-post_tag.wp-block-post-terms a {
	padding: 4px 12px;
	border: 1px solid var(--wp--preset--color--violet);
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--caption);
	text-decoration: none;
}
.taxonomy-post_tag.wp-block-post-terms a:hover { background: var(--wp--preset--color--violet); color: var(--wp--preset--color--white); }
.taxonomy-post_tag .wp-block-post-terms__separator { display: none; }

/* 中文：更松的行距，不做大写、不做负字距 */
:lang(zh) { letter-spacing: 0.02em; }
:lang(zh) p, :lang(zh) li { line-height: 1.8; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { line-height: 1.25; letter-spacing: 0.02em; text-transform: none; }

.wp-block-button__link:active { background-color: var(--wp--preset--color--black) !important; }

@media (prefers-reduced-motion: reduce) {
	* { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
