/*
Theme Name: 晚曉報
Theme URI: https://dangan.loongpalace.com.cn/
Author: 晚曉報社
Description: 民國報紙風格復刻版面。首頁依序為頭條、有圖輪播、第一版（抗戰）、第二版（每日新聞）、第三版（世界新聞），並可依日期重新查詢稿件。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wansiao-daily
*/

/* ---------------------------------------------------------------
 * 變數與基礎
 * ------------------------------------------------------------ */
:root {
	--np-paper: #f5efe1;
	--np-paper-deep: #ece4d2;
	--np-ink: #191713;
	--np-ink-soft: #4a4238;
	--np-vermilion: #b0271f;
	--np-rule: #24211c;
	--np-gap: 1.5rem;
	--np-serif: "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
	--np-kai: "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif CJK SC", serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body.np-body {
	margin: 0;
	background-color: var(--np-paper);
	background-image:
		radial-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
		radial-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px);
	background-size: 4px 4px, 7px 7px;
	background-position: 0 0, 2px 3px;
	color: var(--np-ink);
	font-family: var(--np-serif);
	font-size: 16px;
	line-height: 1.7;
}

.np-body img {
	max-width: 100%;
	height: auto;
}

.np-body a {
	color: inherit;
	text-decoration: none;
}

.np-body a:hover,
.np-body a:focus {
	color: var(--np-vermilion);
	text-decoration: underline;
}

.np-body :focus-visible {
	outline: 2px solid var(--np-vermilion);
	outline-offset: 2px;
}

.np-skip {
	position: absolute;
	left: -9999px;
}

.np-skip:focus {
	left: 1rem;
	top: 1rem;
	z-index: 10;
	padding: 0.4rem 0.8rem;
	background: var(--np-paper);
	border: 1px solid var(--np-rule);
}

.np-wrap {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 1.25rem;
}

.np-shell {
	padding-bottom: 3rem;
}

.np-hint {
	margin: 0.75rem 0;
	padding: 0.6rem 0.9rem;
	border: 1px dashed var(--np-vermilion);
	color: var(--np-vermilion);
	font-size: 0.85rem;
}

/* ---------------------------------------------------------------
 * 報頭
 * ------------------------------------------------------------ */
.np-masthead {
	padding-top: 1.25rem;
}

.np-masthead__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	color: var(--np-ink-soft);
}

.np-masthead__issue {
	white-space: nowrap;
}

.np-masthead__title {
	margin: 0.5rem 0 0.35rem;
	border-top: 4px double var(--np-rule);
	border-bottom: 1px solid var(--np-rule);
	padding: 0.7rem 0 0.5rem;
	text-align: center;
}

.np-masthead__title a {
	display: inline-block;
	font-family: var(--np-kai);
	font-size: clamp(2.5rem, 8vw, 4.4rem);
	font-weight: 700;
	letter-spacing: 0.28em;
	text-indent: 0.28em;
	line-height: 1.05;
}

.np-masthead__title a:hover {
	text-decoration: none;
}

.np-masthead__tagline {
	margin: 0.35rem 0 0.6rem;
	border-bottom: 3px double var(--np-rule);
	padding-bottom: 0.4rem;
	text-align: center;
	font-size: 0.82rem;
	letter-spacing: 0.22em;
	color: var(--np-ink-soft);
}

/* 日期列 */
.np-datebar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin: 0.85rem 0 0.35rem;
	padding: 0.55rem 0.75rem;
	background: var(--np-paper-deep);
	border: 1px solid var(--np-rule);
}

.np-datebar__form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.np-datebar__label {
	font-size: 0.85rem;
	letter-spacing: 0.1em;
}

.np-datebar input[type="date"] {
	font-family: var(--np-serif);
	font-size: 0.9rem;
	padding: 0.25rem 0.4rem;
	background: var(--np-paper);
	border: 1px solid var(--np-rule);
	color: var(--np-ink);
}

.np-datebar button,
.np-search__btn {
	font-family: var(--np-serif);
	font-size: 0.9rem;
	padding: 0.25rem 0.75rem;
	background: var(--np-paper);
	border: 1px solid var(--np-rule);
	color: var(--np-ink);
	cursor: pointer;
}

.np-datebar button:hover,
.np-search__btn:hover {
	background: var(--np-vermilion);
	border-color: var(--np-vermilion);
	color: #fff;
}

.np-datebar__state {
	font-size: 0.82rem;
	color: var(--np-ink-soft);
}

.np-datebar__state strong {
	color: var(--np-vermilion);
	font-weight: 600;
}

.np-datebar__latest {
	border-bottom: 1px solid var(--np-vermilion);
	color: var(--np-vermilion);
}

/* 選單列 */
.np-nav {
	margin: 0.5rem 0 1.25rem;
	border-top: 1px solid var(--np-rule);
	border-bottom: 1px solid var(--np-rule);
	padding: 0.35rem 0;
}

.np-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9rem;
	letter-spacing: 0.08em;
}

.np-nav__item + .np-nav__item::before {
	content: "·";
	margin-right: 1.1rem;
	color: var(--np-vermilion);
}

.np-nav__toggle {
	display: none;
}

.np-search {
	margin-left: auto;
}

.np-search--form {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.np-search__label {
	font-size: 0.85rem;
	letter-spacing: 0.1em;
}

.np-search__input {
	width: 9rem;
	padding: 0.2rem 0.45rem;
	font-family: var(--np-serif);
	font-size: 0.85rem;
	background: var(--np-paper);
	border: 1px solid var(--np-rule);
	color: var(--np-ink);
}

/* ---------------------------------------------------------------
 * 頭條
 * ------------------------------------------------------------ */
.np-lead {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 15rem;
	gap: var(--np-gap);
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 3px double var(--np-rule);
}

.np-lead__label {
	display: inline-block;
	margin-bottom: 0.6rem;
	padding: 0.1rem 0.6rem;
	border: 1px solid var(--np-vermilion);
	color: var(--np-vermilion);
	font-size: 0.8rem;
	letter-spacing: 0.24em;
	text-indent: 0.24em;
}

.np-lead__title {
	margin: 0 0 0.65rem;
	font-family: var(--np-kai);
	font-size: clamp(1.7rem, 4.6vw, 2.5rem);
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.04em;
}

.np-lead__meta,
.np-card__meta {
	margin: 0 0 0.6rem;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	color: var(--np-ink-soft);
}

.np-lead__meta span + span::before,
.np-card__meta span + span::before {
	content: "・";
	margin: 0 0.35rem;
	color: var(--np-vermilion);
}

.np-lead__media {
	margin: 0 0 0.9rem;
	padding: 0.35rem;
	background: #fff;
	border: 1px solid var(--np-rule);
	box-shadow: 2px 2px 0 rgba(36, 33, 28, 0.12);
}

.np-lead__media img {
	display: block;
	width: 100%;
	filter: sepia(8%) contrast(1.02);
}

.np-lead__excerpt {
	margin: 0;
	text-align: justify;
	line-height: 1.95;
}

.np-lead__excerpt p {
	margin: 0 0 0.8rem;
	text-indent: 2em;
}

.np-lead__excerpt p:last-child {
	margin-bottom: 0;
}

.np-lead__aside {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* 啟事框（朱紅） */
.np-notice {
	border: 3px double var(--np-vermilion);
	background: rgba(176, 39, 31, 0.03);
	color: var(--np-vermilion);
	padding: 0.75rem;
}

.np-notice__title {
	margin: 0 0 0.5rem;
	font-family: var(--np-kai);
	font-size: 1.05rem;
	letter-spacing: 0.3em;
	text-indent: 0.3em;
	text-align: center;
	border-bottom: 1px solid var(--np-vermilion);
	padding-bottom: 0.3rem;
}

.np-notice__body {
	margin: 0;
	writing-mode: vertical-rl;
	text-orientation: upright;
	height: 15rem;
	max-height: 15rem;
	overflow: hidden;
	text-align: justify;
	line-height: 1.6;
	letter-spacing: 0.12em;
	font-size: 0.92rem;
}

.np-lead__more {
	margin: 0;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--np-rule);
	font-size: 0.85rem;
	letter-spacing: 0.06em;
}

.np-lead__more ul {
	margin: 0.4rem 0 0;
	padding-left: 1.1rem;
}

/* ---------------------------------------------------------------
 * 有圖輪播
 * ------------------------------------------------------------ */
.np-carousel {
	position: relative;
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--np-rule);
}

.np-carousel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.6rem;
}

.np-carousel__label {
	font-size: 0.85rem;
	letter-spacing: 0.24em;
	color: var(--np-vermilion);
}

.np-carousel__viewport {
	overflow: hidden;
	border: 1px solid var(--np-rule);
	background: var(--np-paper-deep);
}

.np-carousel__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	transition: transform 0.55s ease;
}

.np-carousel__slide {
	position: relative;
	min-width: 100%;
	margin: 0;
}

.np-carousel__slide img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	filter: sepia(6%);
}

.np-carousel__missing {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	background: repeating-linear-gradient(45deg, var(--np-paper), var(--np-paper) 12px, var(--np-paper-deep) 12px, var(--np-paper-deep) 24px);
	color: var(--np-ink-soft);
	font-size: 1.1rem;
	letter-spacing: 0.4em;
}

.np-carousel__cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0.6rem 0.9rem;
	background: rgba(245, 239, 225, 0.92);
	border-top: 1px solid var(--np-rule);
}

.np-carousel__cap a {
	font-family: var(--np-kai);
	font-size: 1.05rem;
	letter-spacing: 0.03em;
}

.np-carousel__ctrls {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.6rem;
}

.np-carousel__btn {
	width: 2rem;
	height: 2rem;
	font-size: 1rem;
	line-height: 1;
	background: var(--np-paper);
	border: 1px solid var(--np-rule);
	color: var(--np-ink);
	cursor: pointer;
}

.np-carousel__btn:hover {
	background: var(--np-vermilion);
	border-color: var(--np-vermilion);
	color: #fff;
}

.np-carousel__dots {
	display: flex;
	gap: 0.4rem;
	margin-left: auto;
}

.np-carousel__dot {
	width: 0.6rem;
	height: 0.6rem;
	padding: 0;
	background: transparent;
	border: 1px solid var(--np-rule);
	border-radius: 50%;
	cursor: pointer;
}

.np-carousel__dot.is-active {
	background: var(--np-vermilion);
	border-color: var(--np-vermilion);
}

.np-carousel.is-single .np-carousel__ctrls {
	display: none;
}

/* ---------------------------------------------------------------
 * 版面與稿件
 * ------------------------------------------------------------ */
.np-section {
	margin-bottom: 2.25rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--np-rule);
}

.np-section:last-of-type {
	border-bottom: 0;
}

.np-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.9rem;
	padding-bottom: 0.35rem;
	border-bottom: 3px double var(--np-rule);
}

.np-section__title {
	margin: 0;
	font-family: var(--np-kai);
	font-size: 1.35rem;
	letter-spacing: 0.18em;
}

.np-section__title::before {
	content: "";
	display: inline-block;
	width: 0.45rem;
	height: 0.45rem;
	margin-right: 0.5rem;
	background: var(--np-vermilion);
	vertical-align: middle;
}

.np-section__meta {
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	color: var(--np-ink-soft);
}

.np-cards {
	display: flex;
	flex-wrap: wrap;
	flex-direction: row-reverse;
	align-items: flex-start;
	gap: 1.25rem;
}

.np-card {
	margin: 0;
}

.np-card__flow {
	writing-mode: vertical-rl;
	text-orientation: upright;
	overflow: hidden;
	text-align: justify;
	line-height: 1.75;
	letter-spacing: 0.06em;
	border-top: 1px solid var(--np-rule);
	padding-top: 0.5rem;
}

.np-card__cat {
	display: inline-block;
	margin-block-end: 0.5rem;
	color: var(--np-vermilion);
	font-size: 0.72rem;
	letter-spacing: 0.2em;
}

.np-card__title {
	margin: 0 0 0.45rem;
	font-family: var(--np-kai);
	font-weight: 700;
	line-height: 1.45;
}

.np-card__title a {
	display: inline;
}

.np-card__excerpt {
	margin: 0;
	color: var(--np-ink-soft);
	font-size: 0.9em;
	line-height: 1.7;
}

.np-card__meta {
	margin-block-end: 0.45rem;
	font-size: 0.7rem;
}

.np-card__thumb {
	margin-block-end: 0.6rem;
	border: 1px solid var(--np-rule);
	background: #fff;
	padding: 2px;
}

.np-card__thumb img {
	display: block;
}

.np-card__thumb--missing {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--np-paper-deep);
	color: var(--np-ink-soft);
	font-size: 0.72rem;
	letter-spacing: 0.2em;
}

/* 一級版面 */
.np-card--1 .np-card__flow {
	width: 19rem;
	height: 22rem;
	font-size: 0.95rem;
}

.np-card--1 .np-card__title {
	font-size: 1.22rem;
}

.np-card--1 .np-card__thumb {
	width: 19rem;
}

/* 二級版面 */
.np-card--2 .np-card__flow {
	width: 16.5rem;
	height: 18rem;
	font-size: 0.88rem;
}

.np-card--2 .np-card__title {
	font-size: 1rem;
}

.np-card--2 .np-card__thumb {
	width: 16.5rem;
}

/* 三級版面 */
.np-card--3 .np-card__flow {
	width: 14rem;
	height: 14rem;
	font-size: 0.82rem;
	line-height: 1.65;
}

.np-card--3 .np-card__title {
	font-size: 0.92rem;
}

.np-card--3 .np-card__thumb {
	width: 14rem;
}

.np-card--3 .np-card__excerpt {
	display: none;
}

.np-empty {
	margin: 0;
	padding: 1.5rem 1rem;
	border: 1px dashed var(--np-rule);
	text-align: center;
	letter-spacing: 0.3em;
	color: var(--np-ink-soft);
}

/* ---------------------------------------------------------------
 * 內頁
 * ------------------------------------------------------------ */
.np-single {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 15rem;
	gap: var(--np-gap);
}

.np-entry {
	max-width: 46rem;
}

.np-entry__label {
	display: inline-block;
	margin-bottom: 0.5rem;
	padding: 0.1rem 0.6rem;
	border: 1px solid var(--np-vermilion);
	color: var(--np-vermilion);
	font-size: 0.78rem;
	letter-spacing: 0.2em;
}

.np-entry__title {
	margin: 0 0 0.6rem;
	font-family: var(--np-kai);
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	line-height: 1.4;
}

.np-entry__meta {
	margin: 0 0 1.1rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--np-rule);
	font-size: 0.82rem;
	color: var(--np-ink-soft);
}

.np-entry__thumb {
	margin: 0 0 1.2rem;
	padding: 0.35rem;
	background: #fff;
	border: 1px solid var(--np-rule);
}

.np-entry__content {
	font-size: 1.02rem;
	line-height: 2;
}

.np-entry__content p {
	margin: 0 0 1.1rem;
	text-indent: 2em;
}

.np-entry__content h2,
.np-entry__content h3 {
	font-family: var(--np-kai);
	letter-spacing: 0.08em;
}

.np-entry__content blockquote {
	margin: 1.2rem 0;
	padding: 0.4rem 1rem;
	border-left: 4px solid var(--np-vermilion);
	background: var(--np-paper-deep);
}

.np-entry__content img {
	filter: sepia(6%);
}

.np-entry__nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 3px double var(--np-rule);
	font-size: 0.9rem;
}

.np-side .np-notice__body {
	height: 12rem;
	max-height: 12rem;
}

.np-404 {
	padding: 3rem 0;
	text-align: center;
}

.np-404__code {
	font-family: var(--np-kai);
	font-size: 4rem;
	letter-spacing: 0.2em;
	color: var(--np-vermilion);
}

.np-search-head {
	margin: 1rem 0 1.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 3px double var(--np-rule);
}

/* ---------------------------------------------------------------
 * 報尾
 * ------------------------------------------------------------ */
.np-footer {
	margin-top: 2rem;
	padding: 1rem 0 2rem;
	border-top: 4px double var(--np-rule);
	font-size: 0.82rem;
	color: var(--np-ink-soft);
	text-align: center;
	letter-spacing: 0.12em;
}

.np-footer__nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem 1rem;
	margin: 0 0 0.6rem;
	padding: 0;
	list-style: none;
}

/* ---------------------------------------------------------------
 * 回應式
 * ------------------------------------------------------------ */
@media (max-width: 900px) {
	.np-lead,
	.np-single {
		grid-template-columns: minmax(0, 1fr);
	}

	.np-lead__aside {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.np-lead__aside > * {
		flex: 1 1 14rem;
	}
}

@media (max-width: 782px) {
	.np-cards {
		flex-direction: row;
	}

	.np-card__flow {
		writing-mode: horizontal-tb;
		text-orientation: mixed;
		width: auto;
		height: auto;
	}

	.np-card--1 .np-card__flow,
	.np-card--2 .np-card__flow,
	.np-card--3 .np-card__flow {
		width: 100%;
		height: auto;
	}

	.np-card--1 .np-card__flow {
		font-size: 0.95rem;
	}

	.np-card--3 .np-card__excerpt {
		display: block;
	}

	.np-card--1 .np-card__thumb,
	.np-card--2 .np-card__thumb,
	.np-card--3 .np-card__thumb {
		width: 100%;
	}

	.np-card {
		flex: 1 1 100%;
	}

	.np-notice__body,
	.np-side .np-notice__body {
		writing-mode: horizontal-tb;
		text-orientation: mixed;
		height: auto;
		max-height: none;
	}

	.np-nav__toggle {
		display: inline-block;
		margin: 0.35rem 0;
		padding: 0.2rem 0.7rem;
		background: var(--np-paper);
		border: 1px solid var(--np-rule);
		font-family: var(--np-serif);
		cursor: pointer;
	}

	.np-nav__list {
		display: none;
	}

	.np-nav__list.is-open {
		display: flex;
	}

	.np-nav__item + .np-nav__item::before {
		content: none;
	}

	.np-search {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.np-carousel__track {
		transition: none;
	}
}

@media print {
	.np-datebar,
	.np-carousel__ctrls,
	.np-nav,
	.np-footer__nav {
		display: none;
	}

	body.np-body {
		background: #fff;
	}
}

/* ---------------------------------------------------------------
 * 組合補遺
 * ------------------------------------------------------------ */
.np-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1rem;
}

.np-lead__more-title {
	display: block;
	font-size: 0.82rem;
	letter-spacing: 0.16em;
	color: var(--np-ink-soft);
}

.np-entry__meta span + span::before {
	content: "・";
	margin: 0 0.35rem;
	color: var(--np-vermilion);
}

.np-section__title a {
	text-decoration: none;
}

