/*
Theme Name: Uthain News
Theme URI: https://uthain.com
Author: UTHAIN
Description: ธีมข่าวและนิตยสารสำหรับ WordPress เขียนขึ้นใหม่ทั้งหมด เบา เร็ว รองรับภาษาไทย มือถือ และโหมดมืด ปรับสี ฟอนต์ และบล็อกข่าวของหน้าแรกได้จากเมนู รูปแบบ > ปรับแต่ง โดยไม่ต้องใช้ปลั๊กอินเสริม
Version: 1.4.5
Requires at least: 6.3
Tested up to: 6.8
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: uthain-news
Tags: news, blog, two-columns, right-sidebar, custom-colors, custom-logo, custom-menu, featured-images, sticky-post, threaded-comments, translation-ready
*/

/* ---------------------------------------------------------------
   1. ตัวแปรและค่าพื้นฐาน
--------------------------------------------------------------- */
:root {
	--un-accent: #c62828;
	--un-font-body: "Sarabun", system-ui, sans-serif;
	--un-font-head: "Prompt", system-ui, sans-serif;

	--un-bg: #ffffff;
	--un-surface: #f4f3f1;
	--un-text: #1d1b19;
	--un-muted: #6c6862;
	--un-border: #e4e1dc;
	--un-ink: #141414;
	--un-on-ink: #f3f1ee;
	--un-on-ink-muted: #a9a59f;
	--un-radius: 6px;
	--un-width: 1200px;
	--un-gap: 28px;
}

:root[data-mode="dark"] {
	--un-bg: #131313;
	--un-surface: #1e1e1e;
	--un-text: #ecebe8;
	--un-muted: #a09c96;
	--un-border: #2e2e2e;
	--un-ink: #0b0b0b;
	color-scheme: dark;
}

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

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

body {
	margin: 0;
	background: var(--un-bg);
	color: var(--un-text);
	font-family: var(--un-font-body);
	font-size: 17px;
	line-height: 1.75;
	overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--un-font-head);
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 0.6em;
}

p {
	margin: 0 0 1.2em;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--un-accent);
}

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

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--un-accent);
	outline-offset: 2px;
}

.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;
	top: 8px;
	left: 8px;
	z-index: 1000;
	padding: 10px 16px;
	background: var(--un-accent);
	color: #fff;
	border-radius: var(--un-radius);
}

.container {
	width: 100%;
	max-width: var(--un-width);
	margin-inline: auto;
	padding-inline: 20px;
}

/* ---------------------------------------------------------------
   2. ส่วนหัว
--------------------------------------------------------------- */
.topbar {
	background: var(--un-ink);
	color: var(--un-on-ink-muted);
	font-size: 13px;
}

.topbar-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 36px;
}

.topbar-nav {
	margin-left: auto;
}

.topbar-nav ul,
.footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.topbar a:hover {
	color: #fff;
}

.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
}

.topbar-date + .social-links {
	margin-left: auto;
}

.branding-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-block: 22px;
}

.site-title {
	font-size: 34px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
	letter-spacing: -0.01em;
}

.site-title a:hover {
	color: inherit;
}

.site-title a::after {
	content: "";
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-left: 4px;
	border-radius: 50%;
	background: var(--un-accent);
}

.site-description {
	margin: 2px 0 0;
	color: var(--un-muted);
	font-size: 14px;
}

.custom-logo {
	max-height: 80px;
	width: auto;
}

.site-brand {
	min-width: 0;
}

.brand-logo-text .site-brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.brand-logo-text .custom-logo-link {
	flex: none;
	line-height: 0;
}

.brand-logo-text .site-brand-text {
	min-width: 0;
	text-align: left;
}

.header-ad {
	max-width: 728px;
	flex: 1;
}

.header-ad .widget {
	margin: 0;
}

.navbar {
	background: var(--un-ink);
	color: var(--un-on-ink);
	border-bottom: 3px solid var(--un-accent);
	position: relative;
	z-index: 50;
}

/* ให้แถบเมนูยึดกับทั้งหน้า ไม่ใช่แค่ภายในส่วนหัว */
.has-sticky-nav .site-header {
	display: contents;
}

.has-sticky-nav .navbar {
	position: sticky;
	top: 0;
}

.admin-bar.has-sticky-nav .navbar {
	top: 32px;
}

.navbar-inner {
	display: flex;
	align-items: center;
	min-height: 50px;
}

.primary-nav {
	flex: 1;
	min-width: 0;
}

.primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-nav .menu {
	display: flex;
	flex-wrap: wrap;
}

.primary-nav li {
	position: relative;
}

.primary-nav a {
	display: block;
	padding: 12px 16px;
	font-family: var(--un-font-head);
	font-size: 15px;
	font-weight: 500;
	line-height: 26px;
	white-space: nowrap;
}

.primary-nav .menu > li > a:hover,
.primary-nav .menu > .current-menu-item > a,
.primary-nav .menu > .current-cat > a,
.primary-nav .menu > .current-menu-ancestor > a {
	background: var(--un-accent);
	color: #fff;
}

.primary-nav .sub-menu,
.primary-nav .children {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	background: var(--un-ink);
	border-top: 3px solid var(--un-accent);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.primary-nav .sub-menu .sub-menu {
	top: -3px;
	left: 100%;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.primary-nav .sub-menu a {
	padding: 9px 16px;
	font-weight: 400;
	white-space: normal;
}

.primary-nav .sub-menu a:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.submenu-toggle {
	display: none;
}

.navbar-tools {
	display: flex;
	margin-left: auto;
}

.tool-btn,
.nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 50px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.tool-btn:hover,
.nav-toggle:hover {
	background: rgba(255, 255, 255, 0.1);
}

.nav-toggle {
	display: none;
	margin-left: -12px;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
	display: block;
	width: 20px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s;
}

.nav-toggle-bars {
	position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle-bars::before {
	top: -6px;
}

.nav-toggle-bars::after {
	top: 6px;
}

.nav-open .nav-toggle-bars {
	background: transparent;
}

.nav-open .nav-toggle-bars::before {
	transform: translateY(6px) rotate(45deg);
}

.nav-open .nav-toggle-bars::after {
	transform: translateY(-6px) rotate(-45deg);
}

.icon-sun,
[data-mode="dark"] .icon-moon {
	display: none;
}

[data-mode="dark"] .icon-sun {
	display: block;
}

.header-search {
	background: var(--un-ink);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-block: 14px;
}

/* ---------------------------------------------------------------
   3. แบบฟอร์มและปุ่ม
--------------------------------------------------------------- */
.search-form {
	display: flex;
	gap: 8px;
}

.search-field,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
	width: 100%;
	padding: 10px 14px;
	background: var(--un-bg);
	color: var(--un-text);
	border: 1px solid var(--un-border);
	border-radius: var(--un-radius);
}

.button,
.search-submit,
input[type="submit"],
.wp-block-button__link,
.wp-block-search__button {
	display: inline-block;
	padding: 10px 22px;
	background: var(--un-accent);
	color: #fff;
	border: 0;
	border-radius: var(--un-radius);
	font-family: var(--un-font-head);
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
}

.button:hover,
.search-submit:hover,
input[type="submit"]:hover {
	color: #fff;
	filter: brightness(0.9);
}

/* ---------------------------------------------------------------
   4. โครงหน้า
--------------------------------------------------------------- */
.site-main {
	padding-block: 28px 56px;
}

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--un-sidebar, 320px);
	gap: 44px;
	align-items: start;
}

.no-sidebar .layout {
	grid-template-columns: minmax(0, 820px);
	justify-content: center;
}

/* ---------------------------------------------------------------
   5. แถบข่าววิ่ง
--------------------------------------------------------------- */
.ticker {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 22px;
	padding-right: 14px;
	background: var(--un-surface);
	border-radius: var(--un-radius);
	overflow: hidden;
	font-size: 15px;
}

.ticker-label {
	flex: none;
	padding: 7px 14px;
	background: var(--un-accent);
	color: #fff;
	font-family: var(--un-font-head);
	font-size: 14px;
	font-weight: 500;
}

.ticker-list {
	position: relative;
	flex: 1;
	min-width: 0;
	height: 26px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ticker-list li {
	position: absolute;
	inset: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.35s, transform 0.35s;
	pointer-events: none;
}

.ticker-list li.is-active,
.ticker:not(.is-ready) .ticker-list li:first-child {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

/* ---------------------------------------------------------------
   6. การ์ดข่าว
--------------------------------------------------------------- */
.card {
	position: relative;
	min-width: 0;
}

.card-thumb {
	display: block;
	overflow: hidden;
	border-radius: var(--un-radius);
	background: var(--un-surface);
	aspect-ratio: 16 / 10;
}

.card-thumb img,
.thumb-fallback {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.thumb-fallback {
	display: block;
	background:
		linear-gradient(135deg, color-mix(in srgb, var(--un-accent) 22%, transparent), transparent 60%),
		var(--un-surface);
}

.card:hover .card-thumb img {
	transform: scale(1.04);
}

.card-title {
	margin: 0;
	font-size: 18px;
	line-height: 1.45;
}

.card-excerpt {
	margin: 8px 0 0;
	color: var(--un-muted);
	font-size: 15px;
	line-height: 1.65;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 14px;
	margin-top: 8px;
	color: var(--un-muted);
	font-size: 13px;
}

.post-meta a {
	color: var(--un-text);
	font-weight: 500;
}

.cat-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.cat-badge {
	display: inline-block;
	padding: 2px 9px;
	background: var(--cat-color, var(--un-accent));
	color: var(--cat-on, #fff);
	border-radius: 3px;
	font-family: var(--un-font-head);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.7;
}

.cat-badge:hover {
	color: var(--cat-on, #fff);
	filter: brightness(0.88);
}

/* แนวตั้ง */
.card-vertical .card-body {
	padding-top: 12px;
}

/* แนวนอน */
.card-horizontal {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.card-horizontal .card-title {
	font-size: 20px;
}

/* ย่อ */
.card-mini {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}

.card-mini .card-thumb {
	aspect-ratio: 3 / 2;
}

.card-mini .card-title {
	font-size: 15px;
	font-weight: 500;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-mini .post-meta {
	margin-top: 4px;
	font-size: 12px;
}

/* ทับบนรูป */
.card-overlay {
	overflow: hidden;
	border-radius: var(--un-radius);
	background: #222;
	color: #fff;
}

.card-overlay .card-thumb {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
	border-radius: 0;
}

.card-overlay .card-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 75%);
}

.card-overlay .card-body {
	position: absolute;
	inset: auto 0 0 0;
	padding: 18px;
	pointer-events: none;
}

.card-overlay .card-body a {
	pointer-events: auto;
}

.card-overlay .card-title a:hover {
	color: #fff;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.card-overlay .post-meta {
	color: rgba(255, 255, 255, 0.78);
}

/* ---------------------------------------------------------------
   7. ข่าวเด่น
--------------------------------------------------------------- */
.hero {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-auto-rows: 216px;
	gap: 6px;
	margin-bottom: 36px;
}

.hero .card:first-child {
	grid-column: 1;
	grid-row: span 2;
}

.hero .card:first-child .card-title {
	font-size: 28px;
	line-height: 1.35;
}

.hero .card:first-child .card-body {
	padding: 26px;
}

.hero .card-title {
	font-size: 16px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hero-count-1 {
	grid-template-columns: 1fr;
}

.hero-count-2 {
	grid-template-columns: 2fr 1fr;
}

.hero-count-2 .card:nth-child(2) {
	grid-row: span 2;
}

.hero-count-3 {
	grid-template-columns: 2fr 1fr;
}

.hero-count-4 .card:nth-child(4) {
	grid-column: span 2;
}

.home-top-widgets {
	margin-bottom: 36px;
}

/* ---------------------------------------------------------------
   8. บล็อกข่าวตามหมวด
--------------------------------------------------------------- */
.section-head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
	border-bottom: 2px solid var(--section-color, var(--un-text));
}

.section-title,
.widget-title,
.archive-title {
	margin: 0;
	font-size: 17px;
	line-height: 1.5;
}

.section-title span,
.widget-title span {
	display: inline-block;
	padding: 6px 16px 4px;
	background: var(--section-color, var(--un-text));
	color: var(--section-on, var(--un-bg));
	border-radius: 4px 4px 0 0;
}

.section-more {
	margin-left: auto;
	color: var(--un-muted);
	font-size: 14px;
}

.section-more::after {
	content: " ›";
}

.home-section {
	margin-bottom: 44px;
}

.layout-feature .section-body {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: var(--un-gap);
}

.feature-main .card-title {
	font-size: 22px;
}

.feature-side {
	display: grid;
	gap: 18px;
	align-content: start;
}

.layout-grid .section-body,
.card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--un-gap) 22px;
}

.layout-grid .card-title,
.card-grid .card-title {
	font-size: 16px;
}

.layout-list .section-body,
.post-list {
	display: grid;
	gap: 24px;
}

.layout-list .card + .card,
.post-list .card + .card {
	padding-top: 24px;
	border-top: 1px solid var(--un-border);
}

/* ---------------------------------------------------------------
   9. แถบข้างและวิดเจ็ต
--------------------------------------------------------------- */
.sidebar {
	position: sticky;
	top: 76px;
}

.widget {
	margin-bottom: 36px;
	font-size: 15px;
}

.widget-title {
	margin-bottom: 18px;
	border-bottom: 2px solid var(--section-color, var(--un-text));
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget li {
	padding: 9px 0;
	border-bottom: 1px solid var(--un-border);
}

.widget li:last-child {
	border-bottom: 0;
}

.widget ul ul {
	margin: 9px 0 -9px 16px;
	border-top: 1px solid var(--un-border);
}

.widget-posts {
	display: grid;
	gap: 16px;
}

.widget .tagcloud,
.wp-block-tag-cloud,
.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.widget .tagcloud a,
.wp-block-tag-cloud a,
.entry-tags a {
	padding: 3px 12px;
	background: var(--un-surface);
	border-radius: 999px;
	font-size: 14px !important;
}

.widget .tagcloud a:hover,
.wp-block-tag-cloud a:hover,
.entry-tags a:hover {
	background: var(--un-accent);
	color: #fff;
}

/* ---------------------------------------------------------------
   10. หน้ารวมข่าว
--------------------------------------------------------------- */
.breadcrumbs {
	margin-bottom: 16px;
	color: var(--un-muted);
	font-size: 13px;
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}

.crumb-sep {
	margin-inline: 8px;
}

.breadcrumbs li:last-child {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.archive-header {
	margin-bottom: 28px;
	padding-bottom: 14px;
	border-bottom: 2px solid var(--section-color, var(--un-text));
}

.archive-title {
	font-size: 28px;
}

.archive-title span {
	box-shadow: inset 0 -0.4em 0 color-mix(in srgb, var(--section-color, var(--un-accent)) 28%, transparent);
}

.archive-description {
	margin: 8px 0 0;
	color: var(--un-muted);
}

.archive-description p:last-child {
	margin-bottom: 0;
}

.pagination,
.comments-pagination {
	margin-top: 36px;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.page-numbers {
	min-width: 42px;
	padding: 6px 13px;
	border: 1px solid var(--un-border);
	border-radius: var(--un-radius);
	text-align: center;
	font-family: var(--un-font-head);
	font-size: 15px;
}

.page-numbers.current,
a.page-numbers:hover {
	background: var(--un-accent);
	border-color: var(--un-accent);
	color: #fff;
}

.no-results,
.error-404 {
	max-width: 560px;
	margin: 24px auto 48px;
	text-align: center;
}

.error-code {
	margin: 0;
	font-family: var(--un-font-head);
	font-size: 96px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--un-accent);
}

.error-404 .search-form,
.no-results .search-form {
	margin-block: 20px;
}

/* ---------------------------------------------------------------
   11. หน้าบทความ
--------------------------------------------------------------- */
.entry-header {
	margin-bottom: 22px;
}

.entry-title {
	margin: 0 0 12px;
	font-size: 36px;
	line-height: 1.35;
	letter-spacing: -0.005em;
}

.entry-lead {
	margin: 0 0 12px;
	color: var(--un-muted);
	font-size: 20px;
	line-height: 1.65;
}

.entry-header .post-meta {
	margin: 0 0 16px;
	font-size: 14px;
}

.entry-thumb {
	margin: 0 0 26px;
}

.entry-thumb img {
	width: 100%;
	border-radius: var(--un-radius);
}

figcaption,
.wp-caption-text {
	margin-top: 8px;
	color: var(--un-muted);
	font-size: 14px;
	text-align: center;
}

.entry-content {
	font-size: 18.5px;
	line-height: 1.9;
}

.entry-content > * {
	margin-block: 0 1.3em;
}

.entry-content h2 {
	margin-top: 1.8em;
	font-size: 26px;
}

.entry-content h3 {
	margin-top: 1.6em;
	font-size: 22px;
}

.entry-content h4 {
	font-size: 19px;
}

.entry-content a {
	color: var(--un-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.entry-content img {
	border-radius: var(--un-radius);
}

.entry-content blockquote {
	margin-inline: 0;
	padding: 4px 0 4px 22px;
	border-left: 4px solid var(--un-accent);
	font-size: 20px;
	font-style: normal;
}

.entry-content blockquote cite {
	color: var(--un-muted);
	font-size: 15px;
	font-style: normal;
}

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

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
}

.entry-content th,
.entry-content td {
	padding: 9px 12px;
	border: 1px solid var(--un-border);
	text-align: left;
}

.entry-content th {
	background: var(--un-surface);
}

.entry-content pre {
	padding: 16px;
	background: var(--un-surface);
	border-radius: var(--un-radius);
	overflow-x: auto;
	font-size: 15px;
	line-height: 1.6;
}

.entry-content .alignwide {
	margin-inline: -40px;
	max-width: calc(100% + 80px);
}

.alignleft {
	float: left;
	margin: 6px 24px 16px 0;
}

.alignright {
	float: right;
	margin: 6px 0 16px 24px;
}

.aligncenter {
	margin-inline: auto;
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

.entry-footer {
	display: grid;
	gap: 18px;
	margin-top: 32px;
	padding-top: 22px;
	border-top: 1px solid var(--un-border);
}

.entry-tags span,
.share-label {
	margin-right: 4px;
	color: var(--un-muted);
	font-size: 14px;
	align-self: center;
}

.share-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.share-btn {
	padding: 5px 14px;
	background: none;
	border: 1px solid var(--un-border);
	border-radius: 999px;
	font-size: 14px;
	line-height: 1.6;
	cursor: pointer;
}

.share-btn:hover {
	border-color: var(--un-accent);
	color: var(--un-accent);
}

.author-box {
	display: flex;
	gap: 18px;
	margin-top: 32px;
	padding: 22px;
	background: var(--un-surface);
	border-radius: var(--un-radius);
}

.author-box img {
	border-radius: 50%;
	flex: none;
}

.author-name {
	margin: 0 0 4px;
	font-family: var(--un-font-head);
	font-weight: 600;
}

.author-bio {
	margin: 0;
	color: var(--un-muted);
	font-size: 15px;
}

.post-navigation {
	margin-top: 32px;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.post-navigation .nav-next {
	grid-column: 2;
	text-align: right;
}

.post-navigation a {
	display: block;
	height: 100%;
	padding: 16px 18px;
	border: 1px solid var(--un-border);
	border-radius: var(--un-radius);
}

.post-navigation a:hover {
	border-color: var(--un-accent);
}

.nav-label {
	display: block;
	color: var(--un-muted);
	font-size: 13px;
}

.nav-title {
	font-family: var(--un-font-head);
	font-weight: 500;
	line-height: 1.5;
}

.related-posts,
.comments-area,
.after-content-widgets {
	margin-top: 44px;
}

/* ---------------------------------------------------------------
   12. ความคิดเห็น
--------------------------------------------------------------- */
.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children {
	margin-left: 28px;
}

.comment-body {
	padding: 18px 0;
	border-bottom: 1px solid var(--un-border);
	font-size: 16px;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
}

.comment-author img {
	border-radius: 50%;
}

.comment-author .says {
	display: none;
}

.comment-metadata {
	margin: 2px 0 10px;
	color: var(--un-muted);
	font-size: 13px;
}

.comment-content p:last-child {
	margin-bottom: 8px;
}

.reply a {
	color: var(--un-accent);
	font-size: 14px;
}

.comment-respond {
	margin-top: 32px;
}

.comment-reply-title {
	font-size: 20px;
}

.comment-form p {
	margin-bottom: 14px;
}

.comment-form label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
}

.comment-form-cookies-consent label {
	display: inline;
}

/* ---------------------------------------------------------------
   13. ท้ายเว็บ
--------------------------------------------------------------- */
.site-footer {
	background: var(--un-ink);
	color: var(--un-on-ink-muted);
	font-size: 15px;
}

.site-footer a:hover {
	color: #fff;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px;
	padding-block: 48px 12px;
}

.site-footer .widget-title {
	border-color: rgba(255, 255, 255, 0.18);
}

.site-footer .widget-title span {
	padding-left: 0;
	background: none;
	color: #fff;
}

.site-footer .widget li {
	border-color: rgba(255, 255, 255, 0.1);
}

.site-footer .card-title a {
	color: var(--un-on-ink);
}

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 14px;
}

.footer-bottom-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 24px;
	padding-block: 18px;
}

.copyright {
	margin: 0 auto 0 0;
}

.back-to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 40;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: var(--un-accent);
	color: #fff;
	border: 0;
	border-radius: 50%;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.back-to-top[hidden] {
	display: none;
}

/* ---------------------------------------------------------------
   14. จอขนาดกลางและมือถือ
--------------------------------------------------------------- */
@media (max-width: 1024px) {
	.layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar {
		position: static;
	}

	.header-ad {
		display: none;
	}

	.hero {
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: 190px;
	}

	.hero .card:first-child {
		grid-column: span 2;
		grid-row: span 2;
	}

	.hero-count-2 .card:nth-child(2),
	.hero-count-3 .card:nth-child(n+2):nth-child(-n+2):last-child {
		grid-column: span 2;
		grid-row: auto;
	}

	.hero-count-4 .card:nth-child(4) {
		grid-column: span 2;
	}

	.entry-content .alignwide {
		margin-inline: 0;
		max-width: 100%;
	}
}

@media (max-width: 860px) {
	.nav-toggle {
		display: inline-flex;
	}

	.primary-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		max-height: calc(100vh - 60px);
		overflow-y: auto;
		background: var(--un-ink);
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
	}

	.nav-open .primary-nav {
		display: block;
	}

	.primary-nav .menu {
		display: block;
		padding-block: 6px;
	}

	.primary-nav a {
		padding: 11px 20px;
		white-space: normal;
	}

	.primary-nav .sub-menu,
	.primary-nav .children,
	.primary-nav .sub-menu .sub-menu {
		position: static;
		display: none;
		min-width: 0;
		border-top: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: rgba(255, 255, 255, 0.05);
	}

	.primary-nav li.is-open > .sub-menu {
		display: block;
	}

	.primary-nav .sub-menu a {
		padding-left: 36px;
	}

	.submenu-toggle {
		position: absolute;
		top: 0;
		right: 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		padding: 0;
		background: none;
		border: 0;
		color: inherit;
		cursor: pointer;
	}

	.submenu-toggle::before {
		content: "";
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg) translate(-2px, -2px);
		transition: transform 0.2s;
	}

	.is-open > .submenu-toggle::before {
		transform: rotate(-135deg) translate(-2px, -2px);
	}

	.topbar-nav {
		display: none;
	}

	.topbar-date {
		margin-right: auto;
	}

	.branding-inner {
		padding-block: 16px;
		justify-content: center;
		text-align: center;
	}

	.site-title {
		font-size: 28px;
	}

	.layout-grid .section-body,
	.card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.footer-widgets {
		grid-template-columns: 1fr;
		gap: 8px;
		padding-top: 36px;
	}

	.entry-title {
		font-size: 28px;
	}

	.entry-content {
		font-size: 18px;
	}
}

@media (max-width: 600px) {
	body {
		font-size: 16px;
	}

	.container {
		padding-inline: 16px;
	}

	.admin-bar.has-sticky-nav .navbar {
		top: 0;
	}

	.site-main {
		padding-block: 18px 40px;
	}

	.topbar .social-links {
		display: none;
	}

	.hero {
		grid-auto-rows: 150px;
		margin-bottom: 28px;
	}

	.hero .card:first-child .card-title {
		font-size: 21px;
	}

	.hero .card:first-child .card-body {
		padding: 16px;
	}

	.hero .card-body {
		padding: 12px;
	}

	.hero .card:not(:first-child) .card-title {
		font-size: 14px;
	}

	.hero .card:not(:first-child) .post-meta,
	.hero .card:not(:first-child) .cat-badges {
		display: none;
	}

	.layout-feature .section-body {
		grid-template-columns: 1fr;
	}

	.card-horizontal {
		grid-template-columns: 124px minmax(0, 1fr);
		gap: 14px;
	}

	.card-horizontal .card-title {
		font-size: 16px;
	}

	.card-horizontal .card-excerpt,
	.card-horizontal .cat-badges {
		display: none;
	}

	.card-horizontal .card-thumb {
		aspect-ratio: 4 / 3;
	}

	.layout-list .section-body,
	.post-list {
		gap: 16px;
	}

	.layout-list .card + .card,
	.post-list .card + .card {
		padding-top: 16px;
	}

	.layout-grid .section-body,
	.card-grid {
		gap: 20px 14px;
	}

	.layout-grid .card-title,
	.card-grid .card-title {
		font-size: 15px;
	}

	.entry-title {
		font-size: 24px;
	}

	.entry-lead {
		font-size: 17px;
	}

	.entry-content {
		font-size: 17px;
		line-height: 1.85;
	}

	.entry-content h2 {
		font-size: 22px;
	}

	.entry-content h3 {
		font-size: 19px;
	}

	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		grid-column: 1;
		text-align: left;
	}

	.footer-bottom-inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.error-code {
		font-size: 72px;
	}
}

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

@media print {
	.topbar,
	.navbar,
	.sidebar,
	.site-footer,
	.share-links,
	.related-posts,
	.post-navigation,
	.comments-area,
	.back-to-top,
	.ticker {
		display: none !important;
	}

	.layout {
		display: block;
	}
}

/* ---------------------------------------------------------------
   15. วิดเจ็ตแบบบล็อก (หัวข้อที่ไม่ได้ใช้ .widget-title)
--------------------------------------------------------------- */
.widget .wp-block-heading,
.widget .wp-block-search__label {
	display: block;
	margin: 0 0 16px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--section-color, var(--un-text));
	font-family: var(--un-font-head);
	font-size: 17px;
	font-weight: 600;
}

.site-footer .widget .wp-block-heading {
	border-color: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.wp-block-search__inside-wrapper {
	display: flex;
	gap: 8px;
}

.widget ol {
	margin: 0;
	padding-left: 1.2em;
}

/* ---------------------------------------------------------------
   16. พื้นหลังของเว็บ (ตั้งค่าได้ใน ปรับแต่ง > พื้นหลัง)
--------------------------------------------------------------- */
body.has-site-bg::before,
body.has-site-bg::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
}

body.has-site-bg::before {
	z-index: -2;
}

body.has-site-bg::after {
	z-index: -1;
}

.layout-boxed .site-wrap,
.layout-framed .site-wrap {
	max-width: calc(var(--un-width) + 40px);
	margin-inline: auto;
	background: var(--un-bg);
	box-shadow: 0 0 44px rgba(0, 0, 0, 0.28);
}

body.layout-boxed:not(.has-site-bg),
body.layout-framed:not(.has-site-bg) {
	background: var(--un-surface);
}

.layout-boxed:not(.has-site-bg) .site-wrap,
.layout-framed:not(.has-site-bg) .site-wrap {
	box-shadow: 0 0 0 1px var(--un-border);
}

.layout-framed .site-wrap {
	margin-block: 30px;
	border-radius: 10px;
	overflow: clip;
}

/* กรอบรอบจอ */
body.layout-bordered {
	--un-frame-w: 22px;
}

body.layout-bordered::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 90;
	border: var(--un-frame-w) solid var(--un-frame, #d9d5cf);
	pointer-events: none;
}

.layout-bordered .site-wrap {
	margin: var(--un-frame-w);
}

.layout-bordered.has-sticky-nav .navbar {
	top: var(--un-frame-w);
}

.layout-bordered .back-to-top {
	right: calc(20px + var(--un-frame-w));
	bottom: calc(20px + var(--un-frame-w));
}

.admin-bar.layout-bordered::after {
	top: 32px;
}

.admin-bar.layout-bordered.has-sticky-nav .navbar {
	top: calc(32px + var(--un-frame-w));
}

@media (max-width: 782px) {
	body.layout-bordered {
		--un-frame-w: 8px;
	}

	.layout-framed .site-wrap {
		margin-block: 0;
		border-radius: 0;
	}

	.admin-bar.layout-bordered::after {
		top: 46px;
	}

	.admin-bar.layout-bordered.has-sticky-nav .navbar {
		top: calc(46px + var(--un-frame-w));
	}
}

@media (max-width: 600px) {
	.admin-bar.layout-bordered::after {
		top: 0;
	}

	.admin-bar.layout-bordered.has-sticky-nav .navbar {
		top: var(--un-frame-w);
	}
}

@media print {
	body.has-site-bg::before,
	body.has-site-bg::after {
		display: none;
	}
}

/* ---------------------------------------------------------------
   17. ไอคอนโหลดหน้า
--------------------------------------------------------------- */
.site-loader {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--un-bg);
	/* ถ้าสคริปต์ไม่ทำงาน ให้หายเองภายใน 4 วินาที */
	animation: un-loader-out 0.3s ease 4s forwards;
}

.site-loader.is-done {
	animation: un-loader-out 0.3s ease forwards;
}

@keyframes un-loader-out {
	to {
		opacity: 0;
		visibility: hidden;
	}
}

.loader-spinner .loader-icon {
	width: 46px;
	height: 46px;
	border: 4px solid var(--un-border);
	border-top-color: var(--un-accent);
	border-radius: 50%;
	animation: un-spin 0.8s linear infinite;
}

@keyframes un-spin {
	to {
		transform: rotate(360deg);
	}
}

.loader-dots .loader-icon {
	display: flex;
	gap: 10px;
}

.loader-dots i {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--un-accent);
	animation: un-dot 0.9s ease-in-out infinite;
}

.loader-dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.loader-dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes un-dot {
	0%, 80%, 100% {
		transform: scale(0.5);
		opacity: 0.5;
	}

	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* ---------------------------------------------------------------
   18. Lightbox
--------------------------------------------------------------- */
.un-lightbox-open {
	overflow: hidden;
}

.un-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 64px;
	background: rgba(8, 8, 8, 0.93);
	color: #fff;
}

.un-lightbox[hidden] {
	display: none;
}

.un-lightbox-light {
	background: rgba(250, 250, 249, 0.96);
	color: #1d1b19;
}

.un-lightbox-figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
}

.un-lightbox-figure img {
	max-width: 100%;
	max-height: calc(100% - 40px);
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.un-lightbox-figure figcaption {
	margin-top: 12px;
	color: inherit;
	opacity: 0.85;
	font-size: 15px;
}

.un-lightbox-counter {
	position: absolute;
	top: 18px;
	left: 22px;
	font-size: 14px;
	opacity: 0.8;
}

.un-lightbox-btn {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	background: rgba(127, 127, 127, 0.22);
	color: inherit;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.un-lightbox-btn:hover {
	background: var(--un-accent);
	color: #fff;
}

.un-lightbox-close {
	top: 10px;
	right: 14px;
}

.un-lightbox-prev {
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
}

.un-lightbox-next {
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
}

@media (max-width: 600px) {
	.un-lightbox {
		padding: 56px 8px;
	}

	.un-lightbox-prev,
	.un-lightbox-next {
		top: auto;
		bottom: 8px;
		transform: none;
	}
}

/* ---------------------------------------------------------------
   19. ปุ่มบัญชีผู้ใช้ในแถบเมนู
--------------------------------------------------------------- */
.account-btn:hover {
	color: inherit;
}

.account-btn.is-logged-in {
	position: relative;
}

/* จุดเล็กบอกว่าล็อกอินอยู่ */
.account-btn.is-logged-in::after {
	content: "";
	position: absolute;
	top: 14px;
	right: 10px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #43a047;
	box-shadow: 0 0 0 2px var(--un-ink);
}
