/*
Theme Name: LifeMag
Theme URI: https://example.com/lifemag
Author: LifeMag
Description: Theme blog cá nhân / lifestyle kiểu tạp chí: header sticky thông minh, mega menu chuyên mục, ticker tin nóng, 3 layout bài viết (classic / cover / large), dark mode và Customizer đầy đủ.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lifemag
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks
*/

/* ==========================================================================
   1. Biến & reset
   ========================================================================== */
:root {
	--accent: #e4572e;
	--text: #1f2328;
	--bg: #ffffff;
	--header-bg: #ffffff;
	--footer-bg: #16181d;
	--muted: #6b7280;
	--line: #e7e5e0;
	--surface: #f6f4f0;
	--container: 1200px;
	--font-head: 'Playfair Display', Georgia, serif;
	--font-body: 'Be Vietnam Pro', system-ui, sans-serif;
	--base: 16px;
	--radius: 12px;
	--shadow: 0 12px 32px rgba(20, 22, 26, .12);
}
html[data-theme="dark"] {
	--text: #e8eaee;
	--bg: #14161a;
	--header-bg: #1a1d22;
	--muted: #98a1b0;
	--line: #2b2f36;
	--surface: #1e2127;
	--shadow: 0 12px 32px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--base); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
h1, h2, h3, h4, h5 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow-wrap { max-width: 800px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; background: #000; color: #fff;
	padding: 10px 16px; z-index: 1000; top: 8px; left: 8px;
}

body.layout-boxed { background: var(--surface); }
body.layout-boxed .site { max-width: calc(var(--container) + 80px); margin: 0 auto; background: var(--bg); box-shadow: var(--shadow); }

/* Nút */
.btn {
	display: inline-block; background: var(--accent); color: #fff; border: 0;
	padding: 12px 26px; border-radius: 99px; font-weight: 600; font-size: .95rem;
	transition: filter .2s, transform .2s;
}
.btn:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }
.btn-sm { padding: 8px 18px; font-size: .85rem; }

.icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
	transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--surface); color: var(--accent); }

/* Tiêu đề khu vực */
.section-title {
	font-size: 1.35rem; margin: 0 0 28px; display: flex; align-items: center; gap: 16px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title span { position: relative; padding-bottom: 2px; }
.section-title span::before {
	content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 3px; background: var(--accent); border-radius: 2px;
}

/* ==========================================================================
   2. Header
   ========================================================================== */
.site-header {
	background: var(--header-bg);
	border-bottom: 1px solid var(--line);
	position: relative;
	z-index: 100;
	transition: transform .3s ease, box-shadow .3s ease;
}
.site-header.is-sticky { position: sticky; top: 0; }
.admin-bar .site-header.is-sticky { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header.is-sticky { top: 46px; } }
.site-header.is-stuck { box-shadow: 0 6px 24px rgba(0, 0, 0, .08); }
.site-header.is-hidden { transform: translateY(-110%); }

.topbar { background: #16181d; color: #c9ced6; font-size: .8rem; }
.topbar a:hover { color: #fff; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 16px; }
.topbar-left { display: flex; align-items: center; gap: 20px; }
.topbar-date { text-transform: capitalize; white-space: nowrap; }
.topbar .menu { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }

.social-links { display: flex; gap: 6px; flex-wrap: wrap; }
.social-links a {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 28px; height: 28px; padding: 0 6px; border-radius: 99px;
	font-size: .7rem; font-weight: 700; border: 1px solid rgba(255, 255, 255, .22);
}
.social-links a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.social-links.social-lg a { min-width: 40px; height: 40px; font-size: .8rem; }

.header-main { display: flex; align-items: center; gap: 24px; min-height: 80px; position: relative; transition: min-height .3s; }
.site-header.is-stuck .header-main { min-height: 64px; }
.brand { flex: 0 0 auto; }
.brand img { max-height: 52px; width: auto; }
.site-title { font-family: var(--font-head); font-size: 1.85rem; font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.1; display: inline-block; }
.site-tagline { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.menu-toggle { display: none; }

/* Menu chính */
.primary-nav { flex: 1 1 auto; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav .menu { display: flex; flex-wrap: wrap; gap: 2px; }
.primary-nav .menu > li { position: relative; }
.primary-nav .menu > li > a {
	display: block; padding: 28px 12px; font-weight: 600; font-size: .86rem;
	text-transform: uppercase; letter-spacing: .06em; position: relative;
}
.primary-nav .menu > li > a::after {
	content: ""; position: absolute; left: 12px; right: 12px; bottom: 20px; height: 2px;
	background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.primary-nav .menu > li:hover > a::after,
.primary-nav .menu > li.current-menu-item > a::after,
.primary-nav .menu > li.current-menu-ancestor > a::after { transform: scaleX(1); }
.primary-nav .menu > li:hover > a { color: var(--accent); }
.site-header.is-stuck .primary-nav .menu > li > a { padding-top: 20px; padding-bottom: 20px; }
.site-header.is-stuck .primary-nav .menu > li > a::after { bottom: 12px; }

.primary-nav .menu-item-has-children:not(.has-mega) > a::before {
	content: ""; position: absolute; right: -2px; top: 50%; width: 5px; height: 5px;
	border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
	transform: translateY(-70%) rotate(45deg); opacity: .5;
}
.primary-nav .menu-item-has-children > a { padding-right: 20px !important; }

.primary-nav .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 230px; background: var(--bg);
	border: 1px solid var(--line); border-top: 3px solid var(--accent);
	border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); padding: 8px 0;
	opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .2s, transform .2s, visibility .2s;
	z-index: 20;
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu li { position: relative; }
.primary-nav .sub-menu a { display: block; padding: 9px 20px; font-size: .92rem; }
.primary-nav .sub-menu a:hover { background: var(--surface); }
.primary-nav .sub-menu .sub-menu { top: -11px; left: 100%; }

/* Mega menu */
.primary-nav .menu > li.has-mega { position: static; }
.primary-nav .has-mega > .sub-menu { display: none; }
.mega-panel {
	position: absolute; left: 0; right: 0; top: 100%; background: var(--bg);
	border: 1px solid var(--line); border-top: 3px solid var(--accent);
	border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); padding: 24px;
	opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: opacity .25s, transform .25s, visibility .25s; z-index: 20;
}
.has-mega:hover > .mega-panel, .has-mega:focus-within > .mega-panel { opacity: 1; visibility: visible; transform: none; }
.mega-grid { display: grid; gap: 22px; }
.mega-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mega-cols-4 { grid-template-columns: repeat(4, 1fr); }
.mega-cols-5 { grid-template-columns: repeat(5, 1fr); }
.mega-cols-6 { grid-template-columns: repeat(6, 1fr); }
.mega-thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 8px; background: var(--surface); margin-bottom: 10px; }
.mega-thumb img, .mega-thumb .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.mega-item:hover .mega-thumb img { transform: scale(1.06); }
.mega-item h4 { font-family: var(--font-body); font-size: .92rem; line-height: 1.4; margin: 0 0 4px; font-weight: 600; text-transform: none; }
.mega-item time { font-size: .76rem; color: var(--muted); }

.header-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-btn { margin-right: 8px; }
.js-dark-toggle .ico-sun { display: none; }
html[data-theme="dark"] .js-dark-toggle .ico-sun { display: inline-flex; }
html[data-theme="dark"] .js-dark-toggle .ico-moon { display: none; }

/* Kiểu header: centered */
.header-centered .header-main { flex-wrap: wrap; justify-content: center; padding-top: 22px; gap: 0 24px; }
.header-centered .brand { width: 100%; text-align: center; }
.header-centered .site-title { font-size: 2.4rem; }
.header-centered .primary-nav { order: 2; flex: 0 1 auto; border-top: 1px solid var(--line); width: 100%; margin-top: 14px; }
.header-centered .primary-nav .menu { justify-content: center; }
.header-centered .primary-nav .menu > li > a { padding-top: 16px; padding-bottom: 16px; }
.header-centered .primary-nav .menu > li > a::after { bottom: 8px; }
.header-centered .header-tools { position: absolute; right: 20px; top: 20px; }
.header-centered.is-stuck .header-main { min-height: 0; }
.header-centered .brand img { margin: 0 auto; max-height: 64px; }

/* Kiểu header: minimal */
.header-minimal .menu-toggle { display: inline-flex; }
.header-minimal .primary-nav { display: none; }
.header-minimal .brand { flex: 1; text-align: center; }
.header-minimal .brand img { margin: 0 auto; }
.header-minimal .header-tools { margin-left: 0; min-width: 40px; }
.header-minimal .menu-toggle { min-width: 40px; }

/* Ticker */
.ticker-bar { background: var(--surface); border-bottom: 1px solid var(--line); font-size: .9rem; }
.ticker { display: flex; align-items: center; gap: 16px; height: 46px; }
.ticker-label {
	flex: none; background: var(--accent); color: #fff; padding: 4px 14px; border-radius: 99px;
	font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; position: relative;
}
.ticker-label::after {
	content: ""; position: absolute; right: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
	border-radius: 50%; background: #fff; opacity: 0; animation: lm-pulse 1.6s infinite;
}
.ticker-label { padding-right: 24px; }
.ticker-label::after { opacity: 1; }
@keyframes lm-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.7); } }
.ticker-items { position: relative; flex: 1; height: 46px; overflow: hidden; }
.ticker-items a {
	position: absolute; inset: 0; display: flex; align-items: center; font-weight: 500;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0;
	transform: translateY(100%); transition: opacity .4s, transform .4s; pointer-events: none;
}
.ticker-items a.is-active { opacity: 1; transform: none; pointer-events: auto; }
.ticker-items a.is-leaving { opacity: 0; transform: translateY(-100%); }
.no-js .ticker-items a:first-child { opacity: 1; transform: none; pointer-events: auto; }
.ticker-nav { display: flex; flex: none; }
.ticker-nav button { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.ticker-nav button:hover { background: var(--line); color: var(--accent); }

/* Off-canvas */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 16, .55); opacity: 0; visibility: hidden; transition: .3s; z-index: 190; }
.offcanvas {
	position: fixed; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); background: var(--bg);
	z-index: 200; transform: translateX(-100%); transition: transform .3s ease; overflow-y: auto; padding: 64px 24px 32px;
}
.admin-bar .offcanvas { top: 32px; }
body.menu-open { overflow: hidden; }
body.menu-open .offcanvas { transform: none; }
body.menu-open .overlay { opacity: 1; visibility: visible; }
.offcanvas-close { position: absolute; top: 12px; right: 12px; }
.offcanvas .search-form { margin-bottom: 20px; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav li { position: relative; border-bottom: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 13px 40px 13px 0; font-weight: 600; }
.mobile-nav .sub-menu { display: none; padding-left: 14px; }
.mobile-nav li.open > .sub-menu { display: block; }
.mobile-nav .sub-menu a { font-weight: 500; font-size: .95rem; padding: 10px 0; }
.mobile-nav .sub-toggle { position: absolute; top: 6px; right: 0; width: 36px; height: 36px; border: 0; background: var(--surface); border-radius: 50%; font-size: 1.1rem; line-height: 1; }
.offcanvas .social-links { margin-top: 24px; }
.offcanvas .social-links a { border-color: var(--line); }

/* Tìm kiếm */
.search-form { position: relative; display: flex; }
.search-field {
	width: 100%; padding: 13px 52px 13px 20px; border: 1px solid var(--line); border-radius: 99px;
	background: var(--bg); color: var(--text); font: inherit; font-size: .95rem;
}
.search-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228, 87, 46, .15); }
.search-submit { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.search-submit:hover { color: var(--accent); }
.search-modal {
	position: fixed; inset: 0; background: rgba(12, 14, 18, .94); z-index: 300; display: flex;
	align-items: flex-start; justify-content: center; padding: 22vh 20px 0; opacity: 0; visibility: hidden; transition: .25s;
}
body.search-open .search-modal { opacity: 1; visibility: visible; }
.search-modal-inner { width: 100%; max-width: 720px; }
.search-modal .search-field { font-size: 1.3rem; padding: 20px 64px 20px 28px; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.search-modal .search-submit { color: #fff; width: 48px; height: 48px; }
.search-close { position: absolute; top: 24px; right: 24px; color: #fff; }
.search-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* Thanh tiến độ đọc + nút lên đầu */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 400; pointer-events: none; }
.admin-bar .read-progress { top: 32px; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.back-to-top {
	position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; border: 0;
	background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center;
	box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s; z-index: 90;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ==========================================================================
   3. Khu vực nổi bật (trang chủ)
   ========================================================================== */
.featured { padding: 28px 0 8px; }
.featured-grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; height: 540px; }
.featured-grid .tile:first-child { grid-row: 1 / 3; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius); background: #23262c; color: #fff; }
.tile-link { position: absolute; inset: 0; z-index: 3; }
.tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.tile:hover .tile-img { transform: scale(1.05); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 9, 12, .82) 0%, rgba(8, 9, 12, .1) 62%); z-index: 1; }
.tile-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px; z-index: 2; pointer-events: none; }
.tile-body a { pointer-events: auto; position: relative; z-index: 4; }
.tile-title { font-size: 1.25rem; margin: 10px 0 8px; color: #fff; }
.featured-grid .tile:first-child .tile-title { font-size: clamp(1.5rem, 3vw, 2.3rem); }
.tile .meta, .tile .meta a { color: rgba(255, 255, 255, .8); }

.featured-slider { position: relative; height: 540px; border-radius: var(--radius); overflow: hidden; background: #23262c; }
.featured-slider .tile { position: absolute; inset: 0; border-radius: 0; opacity: 0; visibility: hidden; transition: opacity .7s, visibility .7s; }
.featured-slider .tile.is-active { opacity: 1; visibility: visible; }
.featured-slider .tile-body { max-width: 760px; padding: 40px; }
.featured-slider .tile-title { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
.slider-btn {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 46px; height: 46px; border-radius: 50%;
	border: 0; background: rgba(255, 255, 255, .9); color: #111; display: inline-flex; align-items: center; justify-content: center;
	opacity: 0; transition: opacity .25s, background .2s;
}
.featured-slider:hover .slider-btn { opacity: 1; }
.slider-btn:hover { background: var(--accent); color: #fff; }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }
.slider-dots { position: absolute; right: 24px; bottom: 24px; z-index: 6; display: flex; gap: 8px; }
.slider-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .5); transition: .25s; }
.slider-dots button.is-active { background: #fff; width: 28px; border-radius: 99px; }

/* ==========================================================================
   4. Khung nội dung + sidebar
   ========================================================================== */
.site-content { padding-bottom: 20px; }
.main-grid { display: grid; gap: 48px; padding-top: 40px; padding-bottom: 40px; }
.main-grid.has-sidebar.sidebar-right { grid-template-columns: minmax(0, 1fr) 320px; }
.main-grid.has-sidebar.sidebar-left { grid-template-columns: 320px minmax(0, 1fr); }
.main-grid.has-sidebar.sidebar-left .sidebar { order: -1; }
.main-grid.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.content-area { min-width: 0; }

.sidebar .widget { margin-bottom: 36px; }
.widget-title { font-size: 1.1rem; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.widget-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.widget-title span { border-bottom: 3px solid var(--accent); padding-bottom: 2px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget .children, .widget .sub-menu { padding-left: 16px; margin-top: 6px; }
.widget_search .search-form { margin: 0; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a, .entry-tags a {
	display: inline-block; padding: 4px 14px; border: 1px solid var(--line); border-radius: 99px;
	font-size: .84rem !important; transition: .2s;
}
.tagcloud a:hover, .entry-tags a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==========================================================================
   5. Thẻ bài viết
   ========================================================================== */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 28px; }
.no-sidebar .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-grid.layout-mixed .card-large { grid-column: 1 / -1; }
.related-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.related-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.related-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.thumb { display: block; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); aspect-ratio: 3 / 2; }
.thumb img, .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.thumb-placeholder { display: block; background: linear-gradient(135deg, var(--surface), var(--line)); }
.card:hover .thumb img { transform: scale(1.06); }

.cat-label {
	display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: .1em; color: var(--accent); margin-bottom: 8px;
}
.tile .cat-label, .post-hero .cat-label {
	background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 99px; margin-bottom: 0;
}
.card-body { padding-top: 16px; }
.card-title { font-size: 1.35rem; margin: 0 0 10px; }
.card-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .3s, color .2s; }
.card-title a:hover { background-size: 100% 2px; }
.card-excerpt { color: var(--muted); font-size: .95rem; margin-bottom: 12px; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .8rem; color: var(--muted); }
.meta a:hover { color: var(--accent); }
.meta-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.meta-avatar { border-radius: 50%; }
.meta-sep { opacity: .5; }

.post-list .card-list { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: center; padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.post-list .card-list:last-child { border-bottom: 0; }
.post-list .card-body { padding-top: 0; }

.card-large .thumb { aspect-ratio: 16 / 9; }
.card-large .card-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* Phân trang */
.pagination { margin-top: 48px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers {
	min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--line); border-radius: 99px; font-weight: 600; font-size: .9rem;
}
.page-numbers.current, a.page-numbers:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-numbers.dots { border: 0; }

/* Tiêu đề trang lưu trữ */
.page-head { text-align: center; padding: 56px 0 8px; }
.page-head-left { text-align: left; }
.page-head-avatar img { margin: 0 auto 14px; border-radius: 50%; }
.page-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 12px; }
.page-title span { color: var(--accent); }
.page-desc { color: var(--muted); max-width: 640px; margin: 0 auto; }
.page-desc .search-form { max-width: 480px; margin: 18px auto 0; }
.no-results, .error-404 { text-align: center; padding: 40px 0 60px; }
.no-results .search-form, .error-404 .search-form { max-width: 480px; margin: 20px auto; }
.error-404 { padding: 80px 0; }
.error-code { font-family: var(--font-head); font-size: clamp(5rem, 16vw, 9rem); color: var(--accent); line-height: 1; margin: 0; opacity: .9; }

/* ==========================================================================
   6. Bài viết đơn
   ========================================================================== */
.entry-header { margin-bottom: 28px; }
.entry-title { font-size: clamp(1.9rem, 4.2vw, 3rem); margin: 6px 0 16px; letter-spacing: -.01em; }
.entry-figure { margin: 0 0 36px; }
.entry-figure img { width: 100%; border-radius: var(--radius); }
.entry-figure figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 10px; }

.entry-content { font-size: 1.08rem; line-height: 1.85; overflow-wrap: break-word; }
.entry-content > * { margin-top: 0; margin-bottom: 1.5em; }
.entry-content h2 { font-size: 1.8rem; margin-top: 1.8em; }
.entry-content h3 { font-size: 1.45rem; margin-top: 1.6em; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote {
	margin-left: 0; margin-right: 0; padding: 8px 0 8px 28px; border-left: 4px solid var(--accent);
	font-family: var(--font-head); font-size: 1.3rem; font-style: italic;
}
.entry-content img { border-radius: 8px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-caption-text { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content pre { background: var(--surface); padding: 18px; border-radius: 8px; overflow-x: auto; font-size: .9rem; }
.entry-content code { background: var(--surface); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.entry-content pre code { background: none; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.entry-content .alignleft { float: left; margin: 0 24px 16px 0; }
.entry-content .alignright { float: right; margin: 0 0 16px 24px; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
.entry-content .alignwide { margin-left: -60px; margin-right: -60px; max-width: none; width: auto; }
.page-links { margin-top: 20px; font-weight: 600; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }

.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 32px 0; }
.share-label { font-weight: 700; margin-right: 6px; }
.share-btn { padding: 7px 16px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: .84rem; font-weight: 600; transition: .2s; }
.share-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.author-box { display: flex; gap: 22px; align-items: flex-start; padding: 28px; background: var(--surface); border-radius: var(--radius); margin: 32px 0; }
.author-box img { border-radius: 50%; flex: none; }
.author-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; }
.author-bio { color: var(--muted); margin: 0; font-size: .95rem; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 32px 0; }
.post-nav a { display: block; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); transition: .2s; }
.post-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-nav-next { text-align: right; grid-column: 2; }
.post-nav-label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.post-nav-title { font-family: var(--font-head); font-weight: 700; line-height: 1.35; display: block; }

.related-posts { margin: 56px 0 40px; }

/* Layout cover */
.post-hero { position: relative; min-height: 560px; display: flex; align-items: flex-end; color: #fff; background: #23262c; overflow: hidden; }
.post-hero.no-image { min-height: 320px; background: linear-gradient(135deg, var(--accent), #23262c); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 9, 12, .85), rgba(8, 9, 12, .15) 70%); }
.hero-inner { position: relative; z-index: 2; padding-top: 80px; padding-bottom: 48px; max-width: 920px; margin-left: auto; margin-right: auto; text-align: center; }
.post-hero .entry-title { color: #fff; margin-top: 16px; }
.post-hero .meta, .post-hero .meta a, .post-hero .meta-author { color: rgba(255, 255, 255, .88); justify-content: center; }
.layout-cover, .layout-large { padding-top: 48px; }

/* Layout large */
.large-head { max-width: 900px; margin: 0 auto; text-align: center; padding: 56px 0 32px; }
.large-head .entry-title { font-size: clamp(2.2rem, 5.4vw, 3.8rem); }
.large-head .meta { justify-content: center; }
.large-figure { max-width: 1200px; margin: 0 auto 8px; }
.large-figure img { border-radius: var(--radius); }
.layout-large { padding-top: 40px; }

/* ==========================================================================
   7. Bình luận
   ========================================================================== */
.comments-area { margin: 48px 0; }
.comments-title, .comment-reply-title { font-size: 1.5rem; margin-bottom: 24px; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { padding-left: 32px; }
.comment-body { padding: 20px 0; border-bottom: 1px solid var(--line); position: relative; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .85rem; }
.comment-author { display: flex; align-items: center; gap: 12px; }
.comment-author img { border-radius: 50%; }
.comment-author .fn { font-weight: 700; font-style: normal; }
.comment-metadata a { color: var(--muted); }
.reply a { font-size: .82rem; font-weight: 700; color: var(--accent); }
.comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form p { margin-bottom: 16px; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }

/* ==========================================================================
   8. Footer
   ========================================================================== */
.site-footer { margin-top: 40px; background: var(--footer-bg); color: #b9bfca; }
.site-footer a:hover { color: #fff; }
.footer-widgets { padding: 64px 0 40px; }
.footer-cols { display: grid; gap: 40px; }
.footer-cols.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.footer-cols.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.site-footer .widget { margin-bottom: 28px; }
.site-footer .widget-title { color: #fff; }
.site-footer .widget li { border-color: rgba(255, 255, 255, .1); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); }
.footer-bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; font-size: .86rem; }
.footer-nav .menu { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-minimal-inner { text-align: center; padding: 72px 0 48px; }
.footer-brand { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; margin: 0 0 8px; }
.footer-brand a { color: #fff; }
.footer-desc { max-width: 520px; margin: 0 auto 24px; }
.footer-minimal-inner .social-links { justify-content: center; }
.footer-minimal .footer-bottom-inner { justify-content: center; text-align: center; }

.footer-light { background: var(--surface); color: var(--muted); }
.footer-light a:hover { color: var(--accent); }
.footer-light .widget-title, .footer-light .footer-brand a { color: var(--text); }
.footer-light .footer-bottom, .footer-light .widget li { border-color: var(--line); }
.footer-light .social-links a { border-color: var(--line); }

/* ==========================================================================
   9. Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	.main-grid.has-sidebar.sidebar-right { grid-template-columns: minmax(0, 1fr) 280px; }
	.main-grid.has-sidebar.sidebar-left { grid-template-columns: 280px minmax(0, 1fr); }
	.main-grid { gap: 32px; }
	.footer-cols.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mega-cols-5, .mega-cols-6 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
	/* Header gọn cho mobile */
	.menu-toggle { display: inline-flex; }
	.primary-nav { display: none; }
	.header-main { min-height: 64px; gap: 8px; }
	.brand { flex: 1; }
	.site-title { font-size: 1.5rem; }
	.header-btn { display: none; }
	.header-centered .header-main { padding-top: 0; }
	.header-centered .brand { width: auto; text-align: left; flex: 1; }
	.header-centered .site-title { font-size: 1.5rem; }
	.header-centered .site-tagline { display: none; }
	.header-centered .header-tools { position: static; }
	.header-minimal .brand { text-align: center; }
	.topbar-left .topbar-nav { display: none; }
	.header-main .header-tools { margin-left: 0; }

	.main-grid.has-sidebar.sidebar-right, .main-grid.has-sidebar.sidebar-left { grid-template-columns: minmax(0, 1fr); }
	.main-grid.has-sidebar.sidebar-left .sidebar { order: 0; }
	.sidebar { padding-top: 16px; }

	.featured-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 340px 220px; height: auto; }
	.featured-grid .tile:first-child { grid-row: auto; grid-column: 1 / -1; }
	.featured-slider { height: 440px; }
	.slider-btn { opacity: 1; width: 38px; height: 38px; }

	.no-sidebar .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.related-grid.cols-3, .related-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.entry-content .alignwide { margin-left: 0; margin-right: 0; }
	.post-hero { min-height: 440px; }
}

@media (max-width: 640px) {
	.container { padding: 0 16px; }
	.topbar-right { display: none; }
	.topbar-inner { justify-content: center; }

	.post-grid, .no-sidebar .post-grid, .related-grid.cols-2, .related-grid.cols-3, .related-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
	.post-list .card-list { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: start; padding-bottom: 20px; margin-bottom: 20px; }
	.post-list .card-list .card-title { font-size: 1.02rem; margin-bottom: 6px; }
	.post-list .card-list .card-excerpt { display: none; }
	.post-list .card-list .thumb { aspect-ratio: 1; }

	.featured { padding-top: 16px; }
	.featured-grid { grid-template-columns: 1fr; grid-template-rows: 300px 200px 200px; }
	.featured-slider { height: 380px; }
	.featured-slider .tile-body, .tile-body { padding: 20px; }
	.slider-dots { right: 16px; bottom: 16px; }

	.entry-content { font-size: 1.02rem; }
	.author-box { flex-direction: column; padding: 22px; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav-next { grid-column: auto; }
	.footer-cols.cols-4, .footer-cols.cols-3 { grid-template-columns: minmax(0, 1fr); }
	.footer-bottom-inner { justify-content: center; text-align: center; }
	.ticker-nav { display: none; }
	.ticker-label { font-size: .66rem; padding: 3px 20px 3px 10px; }
	.page-head { padding-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .ticker-bar, .site-footer, .sidebar, .share-bar, .post-nav, .related-posts, .comments-area, .back-to-top, .read-progress { display: none !important; }
}
