/* =====================================================================
   远道山庄 — Additional CSS

   1. Fonts and type
   2. Site header and menus
   3. All pages: images, captions, audio player
   4. Novels: chapter list, prev/next links, book-title links
   5. 评论随笔: tab bar, 文艺评论 page, 随想 list
   6. 词曲创作: song gallery and Playground
   7. Comments
   8. Social icons
   ===================================================================== */


/* ---------- 1. Fonts and type ---------- */

/* Straight apostrophe fix: draw U+2019 with a Latin font instead of the full-width CJK glyph */
@font-face {
	font-family: "ApostropheFix";
	src: local("Georgia"), local("Times New Roman"), local("Noto Serif"), local("Droid Serif"), local("Times");
	unicode-range: U+2019;
}

/* Logo — brush script */
.wp-block-site-title,
.wp-block-site-title a {
	font-family: 'Zhi Mang Xing', cursive !important;
	font-weight: 400;
	letter-spacing: .05em;
}

/* Chapter, page, and post titles (site title excluded on purpose) */
.wp-block-post-title,
h2, h3 {
	font-family: 'ApostropheFix', 'Noto Serif SC', serif !important;
	font-weight: 900 !important;
}

/* Body copy */
body,
.entry-content,
.wp-block-post-content,
p {
	font-family: 'ApostropheFix', 'Noto Serif SC', serif;
	font-weight: 400;
	letter-spacing: .02em;
	line-height: 1.9;
}


/* ---------- 2. Site header and menus ---------- */

/* Top menu: underline draws in on hover */
.wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	background-image: linear-gradient(#6e9682, #6e9682);
	background-repeat: no-repeat;
	background-position: left bottom;
	background-size: 0% 2px;
	transition: background-size 0.3s ease, color 0.2s ease;
}
.wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover {
	background-size: 100% 2px;
	color: #4f6f60;
}

/* Dropdown: green accent bar on hover */
.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	border-left: 3px solid transparent;
	transition: border-color 0.25s ease, color 0.2s ease, padding-left 0.25s ease;
}
.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	border-left-color: #6e9682;
	color: #4f6f60;
	padding-left: 20px !important;
}


/* ---------- 3. All pages: images, captions, audio player ---------- */

/* Rounded corners on every image */
.entry-content img:not(.avatar):not(.wp-smiley):not(.emoji),
.wp-block-post-featured-image img {
	border-radius: 14px;
}

/* Single-image captions (gallery captions have their own style) */
.entry-content .wp-block-image:not(.wp-block-gallery .wp-block-image) figcaption,
.entry-content .wp-block-image:not(.wp-block-gallery .wp-block-image) .wp-element-caption {
	font-size: 0.85rem !important;
	line-height: 1.6;
	color: #777;
	margin-top: 8px;
}

/* Song player stays at the top while scrolling (first player only) */
.entry-content > .wp-block-audio {
	position: sticky;
	top: 0;
	z-index: 100;
	margin: 0 0 1em;
	padding: 10px 0;
	background: rgba(255, 255, 255, 0.94);
}
.entry-content > .wp-block-audio ~ .wp-block-audio { position: static; }
body.admin-bar .entry-content > .wp-block-audio { top: 32px; }


/* ---------- 4. Novels ---------- */

/* Chapter list (the Navigation block used as a table of contents): 3 columns,
   2 on 画眉鸟, 1 on phones. Change --toc-cols to adjust. */
.entry-content .wp-block-navigation__container {
	--toc-cols: 3;
	display: grid !important;
	grid-template-columns: repeat(var(--toc-cols), minmax(0, 1fr));
	gap: 2px 12px;
}
.postid-2333 .entry-content .wp-block-navigation__container { --toc-cols: 2; }

.entry-content .wp-block-navigation-item__content {
	display: block;
	font-family: 'Noto Serif SC', serif;
	text-decoration: none !important;
	color: #1a1a1a;
	padding: 10px 12px;
	border-radius: 8px;
	transition: background-color 0.15s ease;
}
.entry-content .wp-block-navigation-item__content:hover { background-color: rgba(110, 150, 130, 0.1); }

@media (max-width: 700px) {
	.entry-content .wp-block-navigation__container,
	.postid-2333 .entry-content .wp-block-navigation__container { --toc-cols: 1; }
}

/* Previous / next chapter links: arrow only, no label */
.wp-block-post-navigation-link .post-navigation-link__label { display: none; }
.wp-block-post-navigation-link a {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	text-decoration: none !important;
	transition: color 0.2s ease;
}
.wp-block-post-navigation-link a:hover { color: #6e9682; }
.post-navigation-link-previous a::before,
.post-navigation-link-next a::before {
	content: "‹";
	font-size: 1.2em;
	line-height: 1.4;
	flex-shrink: 0;
}
.post-navigation-link-next a {
	flex-direction: row-reverse;
	text-align: right;
}
.post-navigation-link-next a::before { content: "›"; }

/* Centered book-title links inside a post: soft pill on hover */
.wp-block-post-content p.has-text-align-center > a {
	text-decoration: none !important;
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	transition: background-color 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.wp-block-post-content p.has-text-align-center > a:hover {
	background-color: rgba(110, 150, 130, 0.15);
	color: #4f6f60;
	transform: scale(1.05);
}

/* Banner cards on the novel, short-story and song index pages */
.page-id-74 .entry-content .wp-block-image,
.page-id-96 .entry-content .wp-block-image,
.page-id-115 .entry-content .wp-block-image {
	border-radius: 14px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.page-id-74 .entry-content .wp-block-image:hover,
.page-id-96 .entry-content .wp-block-image:hover,
.page-id-115 .entry-content .wp-block-image:hover {
	transform: translateY(-6px) scale(1.015);
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
	border-color: rgba(0, 0, 0, 0.15);
}


/* ---------- 5. 评论随笔 ---------- */

/* Tab bar: 文艺评论 | 随想 (HTML block at the top of each page) */
.sub-tabs {
	display: flex;
	justify-content: center;
	gap: 36px;
	margin: 0 0 28px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.sub-tabs a {
	font-family: 'Noto Serif SC', serif;
	font-size: 1.05rem;
	padding: 10px 4px;
	margin-bottom: -1px;
	color: #888;
	text-decoration: none !important;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.sub-tabs a:hover {
	color: #1a1a1a;
	border-bottom-color: rgba(110, 150, 130, 0.45);
}
.sub-tabs a.is-active {
	color: #1a1a1a;
	font-weight: 900;
	border-bottom-color: rgba(110, 150, 130, 0.9);
}

/* 文艺评论 page (id 1877): review cards */
.page-id-1877 .wp-block-column a {
	text-decoration: none;
	color: inherit;
}
.page-id-1877 .wp-block-heading a {
	font-weight: 900;
	font-size: inherit;
	color: #1a1a1a;
	transition: color 0.2s ease;
}
.page-id-1877 .wp-block-heading a:hover { color: #5c7c74; }

.page-id-1877 .wp-block-column > p:first-of-type {
	font-size: 14px;
	color: #777;
	margin-top: 4px;
}
.page-id-1877 .wp-block-column > p:first-of-type a {
	text-decoration: underline;
	text-decoration-color: #ccc;
}
.page-id-1877 .wp-block-column > p:first-of-type a:hover { text-decoration-color: currentColor; }

.page-id-1877 .wp-block-column > p:nth-of-type(2) {
	font-style: normal;
	color: #555;
	border-left: 2px solid #ddd;
	padding-left: 12px;
	margin: 10px 0;
}
.page-id-1877 .wp-block-column > p:nth-of-type(2) strong { font-weight: 400; }

.page-id-1877 .wp-block-column > p.has-text-align-right {
	font-size: 12px;
	color: #999;
}

.page-id-1877 .entry-content .wp-block-columns .wp-block-columns {
	border-radius: 14px;
	padding: 12px;
	margin-left: -12px;
	margin-right: -12px;
	transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.page-id-1877 .entry-content .wp-block-columns .wp-block-columns:hover {
	background-color: rgba(0, 0, 0, 0.05);
	box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
}
.page-id-1877 .entry-content .wp-block-columns .wp-block-columns:hover .wp-block-image img { transform: scale(1.03); }

/* 随想 page (id 3067): post list — image, title, date, excerpt */
.page-id-3067 .wp-block-post-template {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 16px;
}
.page-id-3067 .wp-block-post-template > li {
	position: relative;
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	column-gap: 20px;
	align-content: center;
	align-items: center;
	margin: 0;
	padding: 14px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
	transition: background-color 0.15s ease;
}
.page-id-3067 .wp-block-post-template > li:hover { background-color: rgba(110, 150, 130, 0.08); }
.page-id-3067 .wp-block-post-template > li > *:not(.wp-block-post-featured-image) { grid-column: 2; margin: 0; }
.page-id-3067 .wp-block-post-featured-image { grid-column: 1; grid-row: 1 / span 3; margin: 0; }
.page-id-3067 .wp-block-post-featured-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; display: block; }
.page-id-3067 .wp-block-post-template .wp-block-post-title { font-size: 1.25rem !important; font-style: normal !important; line-height: 1.5; margin: 0 0 4px; }
.page-id-3067 .wp-block-post-template .wp-block-post-title a { color: inherit; text-decoration: none !important; }
/* stretch the title link over the whole card so the card is clickable */
.page-id-3067 .wp-block-post-template .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.page-id-3067 .wp-block-post-date { font-size: 0.85rem; color: #888; margin-bottom: 6px; }
.page-id-3067 .wp-block-post-excerpt { font-size: 0.95rem; color: #555; line-height: 1.8; }
.page-id-3067 .wp-block-post-excerpt p { margin: 0; text-indent: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page-id-3067 .wp-block-post-excerpt__more-link { display: none; }

@media (max-width: 700px) {
	.page-id-3067 .wp-block-post-template > li { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
	.page-id-3067 .wp-block-post-template > li > *:not(.wp-block-post-featured-image),
	.page-id-3067 .wp-block-post-featured-image { grid-column: 1; grid-row: auto; }
}


/* ---------- 6. 词曲创作 (id 115) ---------- */

.page-id-115 .wp-block-gallery .wp-block-image .wp-element-caption {
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.1) 70%, rgba(0, 0, 0, 0) 100%) !important;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.6);
}
/* a lone last gallery card keeps its width instead of stretching */
.page-id-115 .wp-block-gallery.has-nested-images figure.wp-block-image { flex-grow: 0 !important; }

/* Playground: draft songs and lyrics written for others */
.page-id-115 .pg-shelf {
	margin-top: 40px;
	padding-top: 28px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.page-id-115 .pg-shelf .pg-head {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 16px;
}
.page-id-115 .pg-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}
.page-id-115 .pg-card {
	display: block;
	padding: 10px 10px 14px;
	border: 1px dashed rgba(0, 0, 0, 0.3);
	border-radius: 14px;
	color: inherit;
	text-decoration: none !important;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}
.page-id-115 a.pg-card:hover {
	background-color: rgba(110, 150, 130, 0.1);
	border-color: #6e9682;
}
.page-id-115 .pg-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 10px;
}
.page-id-115 .pg-chip {
	display: inline-block;
	padding: 0 8px;
	border-radius: 10px;
	font-family: sans-serif;
	font-size: 11px;
	line-height: 1.7;
	color: #4f6f60;
	background: rgba(110, 150, 130, 0.15);
}
.page-id-115 .pg-thumb + .pg-chip { margin-top: 12px; }
.page-id-115 .pg-title {
	display: block;
	margin-top: 8px;
	font-size: 15px;
	line-height: 1.5;
}
.page-id-115 .pg-src {
	display: block;
	margin-top: 4px;
	font-family: sans-serif;
	font-size: 12px;
	color: #888;
}

@media (max-width: 700px) {
	.page-id-115 .pg-cards { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- 7. Comments ---------- */

.wp-block-comments-title {
	font-family: sans-serif !important;
	font-style: normal !important;
	font-weight: 700 !important;
	font-size: 16px !important;
	border-left: 4px solid #6e9682;
	padding-left: 10px;
}
li.comment {
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 12px;
}
.wp-block-comment-author-name {
	font-family: sans-serif;
	font-size: 13px !important;
	font-weight: 700;
}
.wp-block-comment-date time,
.wp-block-comment-date a {
	font-family: sans-serif;
	font-size: 12px !important;
	color: #999;
	text-decoration: none;
}
.wp-block-comment-content p {
	font-size: 14px !important;
	line-height: 1.75;
	color: #555;
}
.comment-edit-link,
.comment-reply-link {
	font-size: 12px !important;
	font-family: sans-serif;
	color: #999;
}


/* ---------- 8. Social icons ----------
   To add a site: add its domain to the two lists below and give it an icon
   in the last block (icons are from simple-icons.org). */

.wp-block-social-links a[href*="douban.com"] svg,
.wp-block-social-links a[href*="musescore.com"] svg,
.wp-block-social-links a[href*="bilibili.com"] svg,
.wp-block-social-links a[href*="weibo.com"] svg,
.wp-block-social-links a[href*="163.com"] svg {
	display: none;
}

.wp-block-social-links a[href*="douban.com"]::before,
.wp-block-social-links a[href*="musescore.com"]::before,
.wp-block-social-links a[href*="bilibili.com"]::before,
.wp-block-social-links a[href*="weibo.com"]::before,
.wp-block-social-links a[href*="163.com"]::before {
	content: "";
	display: block;
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
}

.wp-block-social-links a[href*="douban.com"]    { --icon: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/douban.svg'); }
.wp-block-social-links a[href*="musescore.com"] { --icon: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/musescore.svg'); }
.wp-block-social-links a[href*="bilibili.com"]  { --icon: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/bilibili.svg'); }
.wp-block-social-links a[href*="weibo.com"]     { --icon: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/sinaweibo.svg'); }
.wp-block-social-links a[href*="163.com"]       { --icon: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/neteasecloudmusic.svg'); }