/* Kira HH3D — main stylesheet
   Dark magazine layout cho chuyên trang donghua. */

:root {
	--bg: #0e1015;
	--bg-soft: #161923;
	--bg-card: #1b1f2b;
	--border: #262b3a;
	--text: #e7e9f0;
	--text-muted: #9aa1b5;
	--accent: #ff7a18;
	--accent-2: #e53935;
	--accent-soft: rgba(255, 122, 24, 0.14);
	--radius: 12px;
	--container: 1200px;
	--content: 760px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #ffa45c; }

h1, h2, h3, h4, h5, h6 { line-height: 1.3; margin: 0 0 0.6em; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.2em; }

ul, ol { padding-left: 1.4em; }

blockquote {
	margin: 1.5em 0;
	padding: 0.8em 1.2em;
	border-left: 4px solid var(--accent);
	background: var(--bg-soft);
	border-radius: 0 var(--radius) var(--radius) 0;
	color: var(--text-muted);
}

table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; }
th, td { padding: 0.6em 0.8em; border: 1px solid var(--border); text-align: left; }
th { background: var(--bg-soft); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 8px; left: 8px;
	z-index: 1000;
	width: auto; height: auto;
	clip: auto;
	padding: 10px 16px;
	background: var(--accent);
	color: #fff;
	border-radius: 8px;
}

/* ---------- Buttons ---------- */
.btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.95rem;
	border: 1px solid transparent;
	cursor: pointer;
}
.btn-primary {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); color: #fff; }

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(14, 16, 21, 0.92);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 72px;
}
.site-logo, .custom-logo { width: auto; height: 46px; }

.main-navigation ul {
	display: flex;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}
.main-navigation a {
	display: block;
	padding: 10px 14px;
	color: var(--text);
	font-weight: 500;
	font-size: 0.95rem;
	border-radius: 8px;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: var(--accent);
	background: var(--accent-soft);
}

.menu-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 10px;
	cursor: pointer;
}
.menu-toggle-bar { width: 22px; height: 2px; background: var(--text); transition: transform 0.2s ease, opacity 0.2s ease; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero slider ---------- */
.hero-slider { position: relative; overflow: hidden; }
.hero-slide {
	display: none;
	position: relative;
	min-height: 440px;
	background-size: cover;
	background-position: center;
}
.hero-slide.is-active { display: flex; align-items: center; }
.hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(14, 16, 21, 0.55) 0%, rgba(14, 16, 21, 0.85) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 720px; padding-top: 48px; padding-bottom: 48px; }
.hero-badge {
	display: inline-block;
	padding: 4px 14px;
	margin-bottom: 14px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.hero-badge:hover { color: #fff; }
.hero-title { font-size: 2.2rem; margin-bottom: 12px; }
.hero-title a { color: #fff; }
.hero-title a:hover { color: #ffd9b8; }
.hero-excerpt { color: #cfd3de; margin-bottom: 20px; }

.hero-nav { position: absolute; right: 24px; bottom: 24px; z-index: 3; display: flex; gap: 8px; }
.hero-prev, .hero-next {
	width: 42px; height: 42px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(14, 16, 21, 0.5);
	color: #fff;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.2s ease;
}
.hero-prev:hover, .hero-next:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- Layout ---------- */
#main { padding: 36px 20px 64px; }

.layout-with-sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 40px;
	align-items: start;
}
.content-area { min-width: 0; }

.front-page { padding-bottom: 64px; }
.front-page-body { max-width: 880px; padding-top: 40px; }
.front-section { margin-top: 48px; }

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
	border-left: 4px solid var(--accent);
	padding-left: 12px;
}
.section-title { margin: 0; font-size: 1.35rem; }
.section-more { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

/* ---------- Post cards ---------- */
.post-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}
.post-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.post-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform 0.2s ease, border-color 0.2s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.post-card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-badge {
	position: absolute;
	top: 12px; left: 12px;
	padding: 3px 12px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.post-card-body { padding: 16px 18px 20px; }
.post-card-title { font-size: 1.05rem; margin-bottom: 6px; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); }
.post-card-meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.post-card-excerpt { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

/* ---------- Category cards ---------- */
.category-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}
.category-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 150px;
	padding: 16px;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--bg-card);
	border: 1px solid var(--border);
}
.category-card-img {
	position: absolute;
	inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	opacity: 0.45;
	transition: opacity 0.2s ease, transform 0.3s ease;
}
.category-card:hover .category-card-img { opacity: 0.65; transform: scale(1.04); }
.category-card-name { position: relative; font-weight: 700; color: #fff; }
.category-card-count { position: relative; font-size: 0.82rem; color: #cfd3de; }

/* ---------- Category banner ---------- */
.category-banner {
	position: relative;
	background-size: cover;
	background-position: center;
	padding: 72px 0;
}
.category-banner-content { position: relative; z-index: 2; }
.category-banner .page-title { color: #fff; margin-bottom: 8px; }
.category-banner .archive-description { color: #cfd3de; max-width: 640px; margin: 0; }

/* ---------- Entry ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb .sep { margin: 0 8px; opacity: 0.5; }
.breadcrumb .current { color: var(--text); }

.page-header { margin-bottom: 28px; }
.archive-description { color: var(--text-muted); }

.entry-header { margin-bottom: 20px; }
.entry-title { font-size: 1.9rem; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 0.88rem; }
.meta-sep { opacity: 0.5; }

.entry-thumbnail { margin: 0 0 24px; }
.entry-thumbnail img { border-radius: var(--radius); width: 100%; }

.entry-content { max-width: var(--content); font-size: 1.02rem; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content img { border-radius: var(--radius); margin: 1.2em 0; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }

.entry-tags { margin-top: 24px; font-size: 0.88rem; }
.entry-tags a {
	display: inline-block;
	margin: 0 6px 6px 0;
	padding: 3px 12px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--text-muted);
}
.entry-tags a:hover { color: var(--accent); border-color: var(--accent); }

.related-posts { margin-top: 48px; }
.related-posts .section-title {
	border-left: 4px solid var(--accent);
	padding-left: 12px;
	margin-bottom: 20px;
	font-size: 1.25rem;
}

/* ---------- Sidebar ---------- */
.widget-area { position: sticky; top: 96px; }
.widget {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 24px;
}
.widget-title {
	font-size: 1rem;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--accent);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.widget ul li:last-child { border-bottom: 0; }
.widget a { color: var(--text-muted); }
.widget a:hover { color: var(--accent); }

.recent-post { display: flex; gap: 12px; align-items: flex-start; }
.recent-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.recent-post-title { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.recent-post:hover .recent-post-title { color: var(--accent); }
.recent-post-date { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; }
.search-field {
	flex: 1;
	min-width: 0;
	padding: 10px 14px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text);
	font-size: 0.95rem;
}
.search-field:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.search-submit {
	padding: 10px 18px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	border: 0;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Pagination ---------- */
.pagination, .navigation.pagination { margin-top: 36px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links .page-numbers {
	display: inline-block;
	padding: 8px 16px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text-muted);
}
.nav-links .page-numbers.current,
.nav-links .page-numbers:hover {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	border-color: transparent;
}

/* ---------- 404 ---------- */
.error-404-wrap { padding-top: 48px; }
.error-404 { text-align: center; max-width: 560px; margin: 0 auto 32px; }
.error-code {
	font-size: 5rem;
	font-weight: 800;
	line-height: 1;
	margin-bottom: 8px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.error-search { margin: 24px 0; }
.no-results { padding: 32px 0; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 48px; max-width: var(--content); }
.comment-list { list-style: none; padding: 0; }
.comment-body {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 20px;
	margin-bottom: 16px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text);
}
.comment-form .submit {
	padding: 10px 24px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	border: 0;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: 0; }
.footer-inner {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 40px;
	padding: 48px 20px 32px;
}
.footer-logo { height: 44px; width: auto; margin-bottom: 14px; }
.footer-about p { color: var(--text-muted); font-size: 0.92rem; }
.footer-col .widget-title { border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 6px; }
.footer-cats, .footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-cats li, .footer-menu li { padding: 5px 0; }
.footer-cats a, .footer-menu a { color: var(--text-muted); font-size: 0.92rem; }
.footer-cats a:hover, .footer-menu a:hover { color: var(--accent); }

.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; }
.copyright { margin: 0; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.layout-with-sidebar { grid-template-columns: 1fr; }
	.widget-area { position: static; }
	.category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.post-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
	.menu-toggle { display: flex; }
	.main-navigation {
		display: none;
		position: absolute;
		top: 100%;
		left: 0; right: 0;
		background: var(--bg-soft);
		border-bottom: 1px solid var(--border);
		padding: 12px 20px 20px;
	}
	.main-navigation.is-open { display: block; }
	.main-navigation ul { flex-direction: column; }
	.hero-title { font-size: 1.5rem; }
	.hero-slide { min-height: 380px; }
	.post-grid, .post-grid-3 { grid-template-columns: 1fr; }
	.category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-inner { grid-template-columns: 1fr; gap: 28px; }
	.entry-title { font-size: 1.5rem; }
	h1, .page-title { font-size: 1.6rem; }
}

@media (max-width: 420px) {
	.category-grid { grid-template-columns: 1fr; }
	.hero-content { padding-top: 32px; padding-bottom: 32px; }
}
