/**
 * 墨痕 · 书法展廊
 * 所有样式限定在 .shufa-gallery / .shufa-single / body.shufa-page 之内，不改动站点其它部分。
 */

/* ---------------------------------------------------------------
 * 公共
 * ------------------------------------------------------------ */
.shufa-gallery,
.shufa-single {
	font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Kaiti SC", KaiTi, Georgia, serif;
	color: #1f1c19;
	line-height: 1.75;
	letter-spacing: 0.02em;
	font-size: 16px;
}

.shufa-gallery *,
.shufa-single * {
	box-sizing: border-box;
}

/* 抵掉主题对正文图片的边框、内边距、阴影 */
.shufa-gallery img,
.shufa-single img {
	max-width: 100%;
	border: 0;
	padding: 0;
	margin: 0;
	background: none;
	box-shadow: none;
	border-radius: 0;
}

.shufa-rule {
	display: block;
	width: 30px;
	height: 1px;
	background: #9e2f28;
	opacity: 0.55;
	margin: 18px auto 14px;
}

.shufa-noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 160px;
	background: #f2ece0;
	color: #877e72;
	font-size: 13px;
	letter-spacing: 0.1em;
	text-align: center;
}

/* ---------------------------------------------------------------
 * 目录页
 * ------------------------------------------------------------ */
.shufa-gallery-head {
	text-align: center;
	margin: 0 0 30px;
}

.shufa-gallery-title {
	margin: 0;
	font-size: 28px;
	font-weight: 600;
	letter-spacing: 0.3em;
	text-indent: 0.3em;
	line-height: 1.4;
	color: #1f1c19;
}

.shufa-gallery-intro {
	margin: 0;
	font-size: 13px;
	letter-spacing: 0.12em;
	color: #6f675c;
}

.shufa-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 26px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.shufa-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border: 0;
	transition: transform 0.2s ease;
}

.shufa-card:hover,
.shufa-card:focus {
	text-decoration: none;
	color: inherit;
}

.shufa-frame {
	display: block;
	background: #fffdf8;
	padding: 6px;
	border: 1px solid rgba(31, 28, 25, 0.12);
	box-shadow: 0 1px 2px rgba(60, 45, 30, 0.05), 0 10px 26px -14px rgba(60, 45, 30, 0.32);
}

.shufa-frame .shufa-card-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: contain;
	background: #fbf8f1;
	transition: opacity 0.25s ease;
}

.shufa-card:hover .shufa-frame .shufa-card-img {
	opacity: 0.92;
}

@supports not (aspect-ratio: 3 / 4) {
	.shufa-frame {
		height: 300px;
		overflow: hidden;
	}

	.shufa-frame .shufa-card-img {
		height: 100%;
	}
}

.shufa-card-title {
	display: block;
	margin-top: 12px;
	font-size: 15px;
	letter-spacing: 0.12em;
	text-align: center;
	line-height: 1.5;
	color: #1f1c19;
	overflow: hidden;
}

.shufa-card-meta {
	display: block;
	margin-top: 3px;
	font-size: 11.5px;
	letter-spacing: 0.1em;
	color: #877e72;
	text-align: center;
}

.shufa-count {
	margin: 28px 0 0;
	text-align: center;
	font-size: 12px;
	letter-spacing: 0.14em;
	color: #877e72;
}

.shufa-empty {
	padding: 48px 0;
	text-align: center;
	color: #877e72;
	font-size: 14px;
	letter-spacing: 0.1em;
}

/* ---------------------------------------------------------------
 * 作品详情页
 * ------------------------------------------------------------ */
.shufa-single {
	max-width: 760px;
	margin: 0 auto;
	padding: 20px 0 50px;
}

.shufa-back {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 18px;
	font-size: 13px;
	letter-spacing: 0.12em;
}

.shufa-back a {
	color: #4a443d;
	text-decoration: none;
	border: 0;
	box-shadow: none;
}

.shufa-back a:hover {
	color: #9e2f28;
}

.shufa-pos {
	font-size: 11.5px;
	color: #877e72;
	letter-spacing: 0.16em;
}

.shufa-figure {
	margin: 0;
	text-align: center;
}

.shufa-figure .shufa-full-img {
	display: inline-block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 76vh;
	background: #fffdf8;
	padding: 8px;
	border: 1px solid rgba(31, 28, 25, 0.12);
	box-shadow: 0 1px 2px rgba(60, 45, 30, 0.05), 0 12px 30px -16px rgba(60, 45, 30, 0.35);
	cursor: zoom-in;
	vertical-align: middle;
}

.shufa-zoom-hint {
	margin: 10px 0 0;
	font-size: 11px;
	letter-spacing: 0.12em;
	color: #877e72;
	text-align: center;
}

.shufa-head {
	margin: 32px 0 0;
	text-align: center;
}

.shufa-title {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.18em;
	text-indent: 0.18em;
	color: #1f1c19;
}

.shufa-meta {
	margin: 8px 0 0;
	font-size: 12.5px;
	letter-spacing: 0.16em;
	color: #877e72;
}

.shufa-block {
	margin: 34px 0 0;
}

.shufa-label {
	display: flex;
	align-items: center;
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.3em;
	color: #877e72;
	line-height: 1;
}

.shufa-label::before {
	content: "";
	width: 3px;
	height: 13px;
	background: #9e2f28;
	opacity: 0.75;
	margin-right: 9px;
}

.shufa-content .shufa-line {
	margin: 0 0 0.4em;
	font-size: 17px;
	line-height: 2.05;
	letter-spacing: 0.08em;
	color: #1f1c19;
	text-align: justify;
}

.shufa-note p {
	margin: 0 0 0.9em;
	font-size: 14.5px;
	line-height: 1.95;
	color: #4a443d;
	letter-spacing: 0.04em;
	text-align: justify;
}

.shufa-pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 42px 0 0;
	padding-top: 24px;
	border-top: 1px solid rgba(31, 28, 25, 0.1);
}

.shufa-pager-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 11px 13px;
	border: 1px solid rgba(31, 28, 25, 0.1);
	background: rgba(255, 253, 248, 0.6);
	text-decoration: none;
	min-height: 58px;
}

.shufa-pager-item:hover {
	text-decoration: none;
	background: #f2ece0;
}

.shufa-pager-item.ghost {
	border: 0;
	background: none;
	min-height: 0;
}

.shufa-pager-item.next {
	text-align: right;
}

.shufa-pager-dir {
	font-size: 10.5px;
	letter-spacing: 0.18em;
	color: #877e72;
}

.shufa-pager-title {
	font-size: 13.5px;
	letter-spacing: 0.06em;
	color: #1f1c19;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shufa-foot-link {
	margin: 26px 0 0;
	text-align: center;
	font-size: 12.5px;
	letter-spacing: 0.16em;
}

.shufa-foot-link a {
	color: #4a443d;
	text-decoration: none;
	border-bottom: 1px solid rgba(31, 28, 25, 0.2);
	padding-bottom: 2px;
}

/* ---------------------------------------------------------------
 * 全屏看图
 * ------------------------------------------------------------ */
.shufa-viewer {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #12100e;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 10px;
}

.shufa-viewer.open {
	display: flex;
}

.shufa-viewer img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	box-shadow: none;
	border: 0;
	padding: 0;
	background: none;
}

.shufa-viewer-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.12);
	color: #f6f1e6;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
}

body.shufa-viewer-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------
 * 窄屏适配
 * 只作用于展廊页面，帮 Twenty Ten 这类老主题在手机上不横向溢出。
 * ------------------------------------------------------------ */
@media (max-width: 767px) {
	/* Twenty Ten 把 #main / #wrapper 写死成 940px，这里逐层放开 */
	body.shufa-page #wrapper {
		width: auto !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 12px !important;
	}

	body.shufa-page #main {
		width: auto !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: visible !important;
	}

	body.shufa-page #container {
		width: auto !important;
		max-width: 100% !important;
		margin: 0 !important;
		float: none !important;
	}

	body.shufa-page #content,
	body.shufa-page.one-column #content {
		width: auto !important;
		max-width: 100% !important;
		margin: 0 0 24px !important;
		float: none !important;
	}

	body.shufa-page #branding,
	body.shufa-page #access,
	body.shufa-page #footer,
	body.shufa-page #colophon,
	body.shufa-page #site-title,
	body.shufa-page #site-description {
		width: auto !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	/* 主题的头部横幅、导航、页脚也是定宽，一并放开 */
	body.shufa-page #branding img {
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
	}

	body.shufa-page #access .menu,
	body.shufa-page .menu,
	body.shufa-page #access ul,
	body.shufa-page #access li {
		width: auto !important;
		max-width: 100% !important;
	}

	body.shufa-page #site-info,
	body.shufa-page #site-generator {
		width: auto !important;
		max-width: 100% !important;
		white-space: normal !important;
		float: none !important;
	}

	.shufa-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 12px;
	}

	.shufa-title {
		font-size: 20px;
		letter-spacing: 0.12em;
		text-indent: 0.12em;
	}

	.shufa-content .shufa-line {
		font-size: 16px;
		line-height: 2;
	}

	.shufa-single {
		padding-bottom: 36px;
	}

	.shufa-figure .shufa-full-img {
		max-height: 72vh;
	}
}

/* 单栏时去掉主题为侧栏预留的空间 */
body.shufa-page.one-column #secondary,
body.shufa-page.one-column .widget-area {
	display: none;
}

/* ---------------------------------------------------------------
 * 宽屏：主题单栏只有 640px，展廊略放宽些，作品看着舒展
 * ------------------------------------------------------------ */
@media (min-width: 1024px) {
	body.shufa-page.one-column #content {
		width: 900px !important;
	}

	body.shufa-page .shufa-single {
		max-width: 900px;
	}

	body.shufa-page .shufa-grid {
		gap: 34px 22px;
	}
}
