/*
Theme Name: Newsfeed Lite
Description: Giao diện blog đọc truyện theo chương: một cột, không sidebar, có nút Load more, chuyển chương và mục lục chương.
Version: 1.4.0
Requires at least: 5.8
Requires PHP: 7.4
Text Domain: nfl
*/

:root {
	--bg: #f8fafc;
	--card: #ffffff;
	--text: #1f2937;
	--muted: #6b7280;
	--accent: #1d4ed8;
	--blue: #2563eb;
	--line: #e5e7eb;
	--wrap: 782px; /* 750px nội dung + 16px lề mỗi bên */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }

.container,
.header-inner,
.footer-inner {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 16px;
}

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

/* Header */
.site-header {
	background: #fff;
	border-bottom: 1px solid var(--line);
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 24px;
	min-height: 64px;
}
.site-title {
	font-weight: 800;
	font-size: 1.4rem;
	text-decoration: none;
}
.custom-logo { max-height: 48px; width: auto; display: block; }
.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
}
.main-nav a {
	text-decoration: none;
	font-weight: 700;
	font-size: .95rem;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--accent); }

/* Khung chính */
main.container { padding-top: 24px; padding-bottom: 40px; }
.archive-head h1 { font-size: 1.6rem; margin: 0 0 16px; }

/* Meta (ngày đăng) */
.meta {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--muted);
	font-weight: 700;
	font-size: 1rem;
}
.icon-clock { flex: none; }

/* Danh sách bài (trang chủ, danh mục, tìm kiếm) */
.search-form {
	position: relative;
	max-width: 700px;
	margin: 0 auto 20px;
}
.search-form svg {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--muted);
	pointer-events: none;
}
.search-form input[type="search"] {
	width: 100%;
	height: 42px;
	padding: 0 14px 0 40px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	font: inherit;
	font-size: .95rem;
}
.search-form input[type="search"]:focus {
	outline: 2px solid var(--accent);
	outline-offset: -1px;
}

.card-list { display: grid; gap: 25px; }
.card {
	display: flex;
	background: var(--card);
	border: 1px solid var(--line);
	min-height: 224px;
	transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 10px 25px rgba(0, 0, 0, .12); }
.card-thumb { flex: none; width: 224px; display: block; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { flex: 1; min-width: 0; padding: 14px 15px; }
.card-title {
	font-size: 1.6rem;
	line-height: 1.25;
	font-weight: 700;
	margin: 0 0 8px;
	color: #374151;
}
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card .meta { color: #374151; font-size: 1.05rem; }
.card-excerpt {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 1.15rem;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 600px) {
	.card { flex-direction: column; min-height: 0; }
	.card-thumb { width: 100%; height: 190px; }
}

.btn {
	display: inline-block;
	background: #111827;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 10px 22px;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.btn:hover { background: var(--accent); }
.btn[disabled] { opacity: .6; cursor: default; }
.loadmore-wrap { text-align: center; margin-top: 24px; }

/* Bài viết */
.entry-title {
	font-family: "Times New Roman", Times, serif;
	font-size: 2.6rem;
	line-height: 1.15;
	font-weight: 700;
	margin: 0 0 12px;
}
.single .meta { font-size: 1.2rem; margin-bottom: 24px; }
.entry-content {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.15rem;
	line-height: 1.85;
	overflow-wrap: break-word;
}
.entry-content p { margin: 0 0 1.2em; }
.entry-content h2,
.entry-content h3 { line-height: 1.3; margin: 1.6em 0 .6em; }

/* Chuyển chương */
.chapter-nav {
	display: flex;
	gap: 6px;
	margin: 28px 0 24px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}
.nav-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	background: var(--blue);
	color: #fff;
	border-radius: 8px;
	font-weight: 700;
	text-decoration: none;
	transition: background .15s;
}
.nav-btn:hover { background: var(--accent); }
.nav-btn.disabled {
	background: #e5e7eb;
	color: #9ca3af;
	pointer-events: none;
}
.nav-list { flex: none; width: 44px; }

/* Mục lục chương */
.chapter-list {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 32px;
}
.chapter-list h2 { font-size: 1.15rem; margin: 0 0 8px; }
.chapter-list ol { margin: 0; padding-left: 28px; }
.chapter-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.chapter-list li:last-child { border-bottom: 0; }
.chapter-list a { text-decoration: none; }
.chapter-list a:hover { color: var(--accent); }
.chapter-list .current > a { font-weight: 700; color: var(--accent); }

/* Bình luận */
.comments-area {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 18px;
	margin: 0 0 32px;
}
.comments-title {
	margin: 0 0 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
	font-size: 1.15rem;
	text-transform: uppercase;
	color: #0f2744;
}
.no-comments { margin: 0 0 16px; color: #374151; }
.comment-list { list-style: none; margin: 0 0 16px; padding: 0; }
.comment-list .children { list-style: none; margin: 0; padding-left: 24px; }
.comment-body { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-author { font-weight: 700; }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-metadata { font-size: .85rem; color: var(--muted); }
.comment-metadata a { text-decoration: none; }
.comment-content p { margin: 6px 0; }
.reply a { font-size: .85rem; font-weight: 700; color: var(--accent); text-decoration: none; }

.comment-reply-title:empty { display: none; }
.comment-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.comment-form p { margin: 0; }
.comment-form .comment-form-comment,
.comment-form .form-submit { grid-column: 1 / -1; }
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"] {
	width: 100%;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 10px 12px;
	font: inherit;
	background: #fff;
}
.comment-form textarea { min-height: 96px; resize: vertical; }
.comment-form textarea:focus,
.comment-form input:focus {
	outline: 2px solid var(--blue);
	outline-offset: -1px;
}
.form-submit button {
	background: var(--blue);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 10px 18px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.form-submit button:hover { background: var(--accent); }

/* Nhãn danh mục + bài liên quan */
.cat-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.cat-pills a {
	background: #fce8e8;
	color: #9b1c1c;
	font-weight: 700;
	padding: 10px 14px;
	border-radius: 4px;
	text-decoration: none;
}
.cat-pills a:hover { background: #f9d2d2; }

@media (max-width: 600px) {
	.comment-form { grid-template-columns: 1fr; }
}

/* Khu vực quảng cáo (widget) */
.ad-wrap { margin: 16px 0; text-align: center; }
.ad-label { font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.ad-widget { max-width: 100%; margin: 0 auto; }
.ad-ad-footer { margin: 0; }

/* Footer */
.site-footer {
	border-top: 1px solid var(--line);
	background: #fff;
	padding: 20px 0;
	text-align: center;
	color: var(--muted);
	font-size: .9rem;
}
.footer-nav ul {
	list-style: none; margin: 0 0 8px; padding: 0;
	display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px;
}
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }

@media (max-width: 600px) {
	.entry-title { font-size: 2rem; }
	.header-inner { justify-content: center; }
	.main-nav ul { justify-content: center; }
}
