/*
Theme Name: Nongmuang Hospital
Description: ธีมเว็บโรงพยาบาลหนองม่วง (ธีมลูกของ Twenty Twenty-Five) — โทนสีม่วงตามโลโก้, ฟอนต์ Sarabun, หน้าแรกมีทางลัด ITA/MOIT และข่าวล่าสุด
Template: twentytwentyfive
Version: 1.2.0
Requires at least: 6.7
Requires PHP: 7.4
Text Domain: nongmuang
License: GNU General Public License v2 or later
*/

/* =====================================================================
 * ค่ากลาง (ขนาด/สี/เงา) — ใช้ร่วมกันทุกหน้า
 * ความกว้าง: เนื้อหา 960px, กว้าง (wide) 1200px — ตั้งใน theme.json
 * ===================================================================== */
:root {
	--nm-radius: 14px;
	--nm-radius-sm: 10px;
	--nm-shadow: 0 1px 2px rgba(60, 20, 80, 0.06), 0 6px 18px rgba(60, 20, 80, 0.07);
	--nm-shadow-hover: 0 4px 10px rgba(60, 20, 80, 0.10), 0 14px 32px rgba(60, 20, 80, 0.14);
	--nm-gutter: clamp(1rem, 4vw, 2rem);
	--nm-section: clamp(2rem, 5vw, 3.25rem);
	--nm-grad: linear-gradient(120deg, var(--wp--preset--color--accent-3) 0%, #6A2E87 55%, var(--wp--preset--color--accent-1) 100%);
	--nm-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 30C180 52 360 8 600 18s420 34 600 22 200-26 240-22V48H0z' fill='%23FAF6FC'/%3E%3C/svg%3E");
	--nm-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='2' cy='2' r='1.6' fill='%23ffffff' fill-opacity='.16'/%3E%3C/svg%3E");
	--nm-ico-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8.6L20 7.4V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8 1.8V8h4.2zM7.5 12v1.6h9V12zm0 3.6v1.6h6.5v-1.6z'/%3E%3C/svg%3E");
	--nm-ico-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2zM5 9v11h14V9z'/%3E%3C/svg%3E");
	--nm-ico-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.2 5.3 19.9 12l-6.7 6.7-1.4-1.4 4.3-4.3H4v-2h12.1l-4.3-4.3z'/%3E%3C/svg%3E");
	--nm-ico-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5a2 2 0 0 1 2-2h5l2 2.5h7a2 2 0 0 1 2 2V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
}

/* ---------- ส่วนหัว ---------- */
.nm-topbar {
	background: var(--wp--preset--color--accent-3);
	color: #fff;
	font-size: 0.85rem;
	border-bottom: 3px solid var(--wp--preset--color--accent-7);
}
.nm-topbar p { margin-block: 0.35rem; }
.nm-topbar a { color: #fff; text-decoration: none; }
.nm-header {
	background: #fff;
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 2px 14px rgba(60, 20, 80, 0.08);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
.admin-bar .nm-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .nm-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .nm-header { top: 0; } } /* admin bar ไม่ fixed บนจอเล็ก */
.nm-header > .alignwide { padding-block: 0.55rem; }
.nm-header .wp-block-site-title { font-weight: 700; color: var(--wp--preset--color--accent-3); }
.nm-header .wp-block-site-title a { text-decoration: none; color: inherit; }
.nm-header .wp-block-site-tagline { font-size: 0.85rem; color: var(--wp--preset--color--accent-4); margin: 0; }
.nm-header .wp-block-navigation { font-weight: 600; }
.nm-header .wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0.35rem 0.15rem; border-bottom: 2px solid transparent; transition: border-color .15s, color .15s;
}
.nm-header .wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
.nm-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { border-bottom-color: var(--wp--preset--color--accent-7); }
.nm-header .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--accent-6) !important;
	border-top: 3px solid var(--wp--preset--color--accent-1) !important;
	border-radius: 0 0 var(--nm-radius-sm) var(--nm-radius-sm);
	box-shadow: var(--nm-shadow-hover);
	padding: 0.4rem 0;
	min-width: 270px !important;
}
.nm-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.5rem 1rem; }
.nm-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--accent-5); }
.nm-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent-1); }

/* =====================================================================
 * โครงหน้า: แถบหัวหน้า (nm-pagehead) + พื้นที่เนื้อหา (nm-body)
 * ===================================================================== */
.nm-main { min-height: 50vh; }
.nm-pagehead {
	position: relative;
	color: #fff;
	background: var(--nm-dots), var(--nm-grad);
	padding: clamp(1.6rem, 4vw, 2.6rem) var(--nm-gutter) clamp(2.6rem, 6vw, 3.6rem);
	overflow: hidden;
}
.nm-pagehead::before, .nm-pagehead::after { content: ""; position: absolute; pointer-events: none; }
.nm-pagehead::before { /* วงกลมตกแต่ง */
	width: 340px; height: 340px; right: -90px; top: -150px; border-radius: 50%;
	background: radial-gradient(circle, rgba(233, 162, 59, 0.35), rgba(233, 162, 59, 0) 70%);
}
.nm-pagehead::after { /* คลื่นด้านล่าง */
	left: 0; right: 0; bottom: -1px; height: 34px;
	background: var(--nm-wave) center bottom / 100% 100% no-repeat;
}
.nm-pagehead > * { position: relative; z-index: 1; }
.nm-pagehead h1, .nm-pagehead .wp-block-query-title, .nm-pagehead .wp-block-post-title {
	color: #fff; margin: 0.2rem 0 0; font-size: clamp(1.55rem, 3.2vw, 2.15rem); line-height: 1.35;
}
.nm-pagehead .wp-block-term-description, .nm-pagehead .nm-index-hint { color: rgba(255, 255, 255, 0.85); margin: 0.5rem 0 0; }
.nm-pagehead .wp-block-term-description p { margin: 0; }
.nm-pagehead a { color: #fff; }
.nm-pagehead .nm-meta { margin-top: 0.7rem; gap: 0.4rem 1rem; font-size: 0.92rem; color: rgba(255, 255, 255, 0.88); }
.nm-pagehead .nm-meta .wp-block-post-date, .nm-pagehead .nm-meta .wp-block-post-terms {
	display: inline-flex; align-items: center; gap: 0.35rem;
	background: rgba(255, 255, 255, 0.14); padding: 0.15rem 0.7rem; border-radius: 999px; margin: 0;
}
.nm-pagehead .nm-meta .wp-block-post-terms a { text-decoration: none; }

.nm-breadcrumb { font-size: 0.88rem; color: rgba(255, 255, 255, 0.78); margin-bottom: 0.4rem; }
.nm-breadcrumb a { text-decoration: none; color: rgba(255, 255, 255, 0.92); }
.nm-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.nm-breadcrumb .sep { margin: 0 0.45rem; opacity: 0.6; }
.nm-breadcrumb [aria-current] { color: #fff; font-weight: 600; }

.nm-body { padding: var(--nm-section) var(--nm-gutter) calc(var(--nm-section) + 0.5rem); }
.nm-body > * + * { margin-top: 1.5rem; }

/* การ์ดเนื้อหา (โพสต์ / หน้าทั่วไป) */
.nm-card {
	background: #fff; border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: var(--nm-radius); box-shadow: var(--nm-shadow);
	padding: clamp(1.25rem, 4vw, 2.5rem);
}
.nm-article { max-width: var(--wp--style--global--content-size) !important; }
.nm-article .wp-block-post-featured-image { margin: calc(-1 * clamp(1.25rem, 4vw, 2.5rem)) calc(-1 * clamp(1.25rem, 4vw, 2.5rem)) 1.5rem; }
.nm-article .wp-block-post-featured-image img { border-radius: var(--nm-radius) var(--nm-radius) 0 0; }
.nm-page-content > * { max-width: 100%; }

.nm-back { margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px dashed var(--wp--preset--color--accent-6); }
.nm-back a {
	display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; text-decoration: none;
	padding: 0.45rem 1rem; border-radius: 999px; background: var(--wp--preset--color--accent-2); color: var(--wp--preset--color--accent-3);
}
.nm-back a:hover { background: var(--wp--preset--color--accent-3); color: #fff; }

.nm-section-title { font-size: 1.3rem; margin: 0 0 1rem; }

/* หัวข้อ section: แถบสีทองใต้หัวข้อ (หน้าแรก + หน้ารวม) */
.nm-section-title, .nm-hub-title, .nm-fb-title,
.nm-home-section h2.wp-block-heading,
main > .wp-block-group:not(.nm-hero) .wp-block-column > h2.wp-block-heading,
main > .wp-block-group:not(.nm-hero) > h2.wp-block-heading {
	position: relative; padding-bottom: 0.55rem;
}
.nm-section-title::after, .nm-hub-title::after,
main > .wp-block-group:not(.nm-hero) .wp-block-column > h2.wp-block-heading::after,
main > .wp-block-group:not(.nm-hero) > h2.wp-block-heading::after {
	content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 4px; border-radius: 4px;
	background: linear-gradient(90deg, var(--wp--preset--color--accent-7), var(--wp--preset--color--accent-1));
}

/* =====================================================================
 * หน้าแรก
 * ===================================================================== */
.nm-hero {
	position: relative; overflow: hidden; color: #fff;
	background: var(--nm-dots), var(--nm-grad);
	padding-bottom: calc(var(--wp--preset--spacing--60) + 30px) !important;
}
.nm-hero::before {
	content: ""; position: absolute; width: 520px; height: 520px; left: -160px; bottom: -260px; border-radius: 50%;
	background: radial-gradient(circle, rgba(233, 162, 59, 0.28), rgba(233, 162, 59, 0) 70%); pointer-events: none;
}
.nm-hero::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 48px; pointer-events: none;
	background: var(--nm-wave) center bottom / 100% 100% no-repeat;
}
.nm-hero > * { position: relative; z-index: 1; }
.nm-hero h1, .nm-hero h2, .nm-hero p { color: #fff; }
.nm-hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.nm-hero h1::after {
	content: ""; display: block; width: 72px; height: 5px; margin-top: 0.8rem; border-radius: 5px;
	background: var(--wp--preset--color--accent-7);
}
.nm-hero img { border-radius: var(--nm-radius); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); border: 4px solid rgba(255, 255, 255, 0.85); }
.nm-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.nm-hero .is-style-outline .wp-block-button__link { border: 2px solid #fff; color: #fff; background: transparent; }
.nm-hero .is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--accent-3); }

/* ทางลัด: การ์ดสีขาว + วงกลมไอคอนหลากสี */
.nm-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 1rem; }
.nm-quick a {
	--c: var(--wp--preset--color--accent-1);
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
	min-height: 132px; padding: 1.1rem 1rem; text-align: center; text-decoration: none; font-weight: 600; line-height: 1.4;
	color: var(--wp--preset--color--accent-3);
	background: #fff;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-bottom: 4px solid var(--c);
	border-radius: var(--nm-radius);
	box-shadow: var(--nm-shadow);
	transition: transform .18s, box-shadow .18s;
}
.nm-quick a:nth-child(5n+2) { --c: var(--wp--preset--color--accent-7); }
.nm-quick a:nth-child(5n+3) { --c: #2E8B6E; }
.nm-quick a:nth-child(5n+4) { --c: #3D6FB6; }
.nm-quick a:nth-child(5n+5) { --c: #C2565B; }
.nm-quick a:hover { transform: translateY(-4px); box-shadow: var(--nm-shadow-hover); }
.nm-quick .nm-ico {
	display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
	font-size: 1.65rem; line-height: 1;
	background: color-mix(in srgb, var(--c) 14%, #fff);
	box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 30%, #fff);
}

/* ข่าว/ประกาศบนหน้าแรก */
.nm-news .wp-block-post {
	position: relative; overflow: hidden;
	background: #fff; border: 1px solid var(--wp--preset--color--accent-6); border-radius: var(--nm-radius);
	padding: 1.15rem 1.2rem 1.1rem; height: 100%; box-sizing: border-box;
	box-shadow: var(--nm-shadow); transition: transform .18s, box-shadow .18s;
}
.nm-news .wp-block-post::before {
	content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
	background: linear-gradient(90deg, var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-7));
}
.nm-news .wp-block-post:hover { transform: translateY(-3px); box-shadow: var(--nm-shadow-hover); }
.nm-news .wp-block-post-template:not(.is-layout-grid) { display: grid; gap: 0.75rem; }
.nm-news .wp-block-post-template:not(.is-layout-grid) .wp-block-post::before { right: auto; bottom: 0; width: 4px; height: auto; }
.nm-news .wp-block-post-title { font-size: 1.02rem; line-height: 1.55; margin: 0.35rem 0 0; }
.nm-news .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.nm-news .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.nm-news .wp-block-post-title a:hover { color: var(--wp--preset--color--accent-1); }

/* วันที่: ชิปพร้อมไอคอนปฏิทิน (ใช้ทั้งหน้าแรกและหน้ารายการ) */
.nm-news .wp-block-post-date, .nm-index .wp-block-post-date {
	display: inline-flex; align-items: center; gap: 0.35rem; margin: 0;
	font-size: 0.82rem; color: var(--wp--preset--color--accent-4); white-space: nowrap;
}
.nm-news .wp-block-post-date::before, .nm-index .wp-block-post-date::before {
	content: ""; width: 14px; height: 14px; background: var(--wp--preset--color--accent-1);
	-webkit-mask: var(--nm-ico-cal) center / contain no-repeat; mask: var(--nm-ico-cal) center / contain no-repeat;
}

/* ลิงก์ "ดูทั้งหมด →" */
main .wp-block-column > p > a[href*="/category/"]:only-child {
	display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; text-decoration: none;
	padding: 0.4rem 1rem; border-radius: 999px; border: 1.5px solid var(--wp--preset--color--accent-6); background: #fff;
}
main .wp-block-column > p > a[href*="/category/"]:only-child:hover { border-color: var(--wp--preset--color--accent-1); background: var(--wp--preset--color--accent-2); }

/* =====================================================================
 * หน้ารายการหัวข้อในหมวด (nm-index)
 * ===================================================================== */
.nm-index .wp-block-post-template {
	list-style: none; padding: 0; margin: 0;
	display: grid; gap: 0.85rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}
.nm-index.is-single-col .wp-block-post-template { grid-template-columns: 1fr; }
.nm-index .wp-block-post {
	position: relative; margin: 0;
	display: flex; flex-direction: column; justify-content: space-between; gap: 0.6rem;
	padding: 1rem 1.15rem 0.9rem;
	background: #fff; border: 1px solid var(--wp--preset--color--accent-6); border-radius: var(--nm-radius);
	box-shadow: var(--nm-shadow);
	transition: transform .18s, box-shadow .18s, border-color .18s;
}
.nm-index .wp-block-post:hover { transform: translateY(-3px); box-shadow: var(--nm-shadow-hover); border-color: var(--wp--preset--color--accent-1); }
.nm-index .wp-block-post-title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.55; }
.nm-index .wp-block-post-title a { display: flex; align-items: flex-start; gap: 0.75rem; text-decoration: none; color: var(--wp--preset--color--contrast); }
.nm-index .wp-block-post:hover .wp-block-post-title a { color: var(--wp--preset--color--accent-3); }
.nm-index .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; } /* ทั้งการ์ดกดได้ */
/* ไอคอนเอกสารหน้าหัวข้อ (ยกเว้น ITA/MOIT ที่มีป้ายรหัสแล้ว) */
.nm-index .wp-block-post-title a:not(:has(.nm-code))::before {
	content: ""; flex: none; width: 1.6rem; height: 1.6rem; margin-top: 0.05rem;
	background: linear-gradient(160deg, var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-3));
	-webkit-mask: var(--nm-ico-doc) center / contain no-repeat; mask: var(--nm-ico-doc) center / contain no-repeat;
}
.nm-index .wp-block-query-pagination { margin-top: 2rem; gap: 0.35rem; }
.nm-index .wp-block-query-pagination a, .nm-index .wp-block-query-pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 0.7rem;
	border-radius: 999px; background: #fff; border: 1px solid var(--wp--preset--color--accent-6); text-decoration: none;
}
.nm-index .wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--accent-3); border-color: var(--wp--preset--color--accent-3); color: #fff; }
.nm-index .nm-code {
	flex: none; min-width: 5.2em; text-align: center;
	padding: 0.15rem 0.55rem; border-radius: 8px; font-size: 0.85rem; font-weight: 700;
	background: var(--nm-grad); color: #fff; box-shadow: 0 2px 6px rgba(78, 36, 99, 0.25);
}
.nm-empty {
	background: #fff; border: 1px dashed var(--wp--preset--color--accent-6); border-radius: var(--nm-radius);
	padding: 2.5rem 1rem; text-align: center; color: var(--wp--preset--color--accent-4);
}

/* =====================================================================
 * หน้ารวม (hub): ITA/MOIT, สขร., ข้อมูลหน่วยงาน
 * ===================================================================== */
.nm-page-content > .nm-index-hint { color: var(--wp--preset--color--accent-4); margin: 0 0 0.5rem; font-size: 1.02rem; }
.nm-hub-title { font-size: 1.25rem; margin: 2.2rem 0 1rem; }
.nm-hub-title:first-of-type { margin-top: 0.5rem; }
.nm-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.nm-hub-card {
	position: relative; overflow: hidden;
	display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.9rem; row-gap: 0.15rem; align-items: center;
	min-height: 104px; padding: 1.1rem 1.2rem; text-decoration: none;
	background: #fff;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: var(--nm-radius); box-shadow: var(--nm-shadow);
	transition: transform .18s, box-shadow .18s, border-color .18s;
}
.nm-hub-card::before { /* ไอคอนโฟลเดอร์ในกล่องสี */
	content: ""; grid-row: 1 / span 2; width: 3rem; height: 3rem; border-radius: 12px;
	background: var(--nm-grad);
	box-shadow: 0 4px 10px rgba(78, 36, 99, 0.25);
}
.nm-hub-card::after { /* รูปโฟลเดอร์สีขาวซ้อนบนกล่อง */
	content: ""; position: absolute; left: calc(1.2rem + 0.75rem); top: 50%; width: 1.5rem; height: 1.5rem; transform: translateY(-50%);
	background: #fff; -webkit-mask: var(--nm-ico-folder) center / contain no-repeat; mask: var(--nm-ico-folder) center / contain no-repeat;
}
.nm-hub-card:hover { transform: translateY(-4px); box-shadow: var(--nm-shadow-hover); border-color: var(--wp--preset--color--accent-1); }
.nm-hub-name { font-weight: 700; color: var(--wp--preset--color--accent-3); line-height: 1.45; align-self: end; }
.nm-hub-sub {
	align-self: start; justify-self: start; font-size: 0.8rem; font-weight: 600;
	color: #8a5a12; background: var(--wp--preset--color--accent-8); padding: 0.05rem 0.6rem; border-radius: 999px;
}
.nm-hub-card.is-empty { box-shadow: none; background: var(--wp--preset--color--accent-5); }
.nm-hub-card.is-empty::before { background: var(--wp--preset--color--accent-6); box-shadow: none; }
.nm-hub-card.is-empty .nm-hub-sub { color: var(--wp--preset--color--accent-4); background: #fff; }

/* =====================================================================
 * Facebook
 * ===================================================================== */
.nm-fb { margin-top: 1.75rem; }
.wp-block-column > .nm-fb:first-child { margin-top: 0; }
.nm-fb-title { font-size: 1.15rem; margin: 0 0 1rem; display: flex; align-items: center; gap: 0.55rem; }
.nm-fb-title::before {
	content: "f"; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: none;
	background: #1877F2; color: #fff; font: 700 1.05rem/1 Arial, sans-serif; padding-top: 0.15rem; box-sizing: border-box;
}
.nm-fb-title::after { display: none; }
.nm-fb-frame {
	max-width: 100%; overflow: hidden; border-radius: var(--nm-radius);
	border: 1px solid var(--wp--preset--color--accent-6);
	background: #fff; box-shadow: var(--nm-shadow);
}
.nm-fb-frame iframe { display: block; border: 0; }
.nm-fb-link { margin: 0.75rem 0 0; font-size: 0.9rem; }
.nm-fb-link a { text-decoration: none; font-weight: 600; color: #1877F2; }

/* ค้นหา */
.nm-search .wp-block-search__inside-wrapper { background: #fff; border-radius: 999px; padding: 0.25rem; border: 1px solid var(--wp--preset--color--accent-6); max-width: 560px; }
.nm-search .wp-block-search__input { border: 0; border-radius: 999px; padding-inline: 1rem; background: transparent; }
.nm-search .wp-block-search__button { border-radius: 999px; margin-left: 0.25rem; }
.nm-pagehead .nm-search { margin-top: 1rem; }

/* ค้นหาภายในหัวข้อ (หน้ารวมหมวด / หน้ารวม hub) */
.nm-cat-search {
	display: flex; align-items: center; gap: 0.25rem; max-width: 560px; margin: 1rem 0 0;
	background: #fff; border-radius: 999px; padding: 0.25rem; border: 1px solid var(--wp--preset--color--accent-6);
	box-shadow: var(--nm-shadow);
}
.nm-cat-search input[type="search"] {
	flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.55rem 1rem;
	font: inherit; color: var(--wp--preset--color--contrast); outline: none;
}
.nm-cat-search:focus-within { border-color: var(--wp--preset--color--accent-1); box-shadow: 0 0 0 3px rgba(233, 162, 59, 0.35); }
.nm-cat-search button {
	flex: none; border: 0; border-radius: 999px; padding: 0.55rem 1.3rem; cursor: pointer;
	font: inherit; font-weight: 600; color: #fff; background: var(--wp--preset--color--accent-3);
}
.nm-cat-search button:hover { background: var(--wp--preset--color--accent-1); }
.nm-page-content > .nm-cat-search { margin: 0 0 1.5rem; }
.nm-cat-search-clear { margin: 0.6rem 0 0; font-size: 0.9rem; }
.nm-pagehead .nm-cat-search-clear a { color: rgba(255, 255, 255, 0.92); }

/* =====================================================================
 * ส่วนท้าย
 * ===================================================================== */
.nm-footer {
	position: relative;
	background: var(--nm-dots), linear-gradient(160deg, #3B1A4C, var(--wp--preset--color--accent-3));
	color: #f1e6f6;
	padding-top: calc(var(--wp--preset--spacing--50) + 36px) !important;
	margin-top: 0;
}
.nm-footer::before { /* คลื่นด้านบน (สีพื้นหลังเว็บ) */
	content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 36px; transform: scaleY(-1); pointer-events: none;
	background: var(--nm-wave) center bottom / 100% 100% no-repeat;
}
.nm-footer a { color: #fff; }
.nm-footer .wp-block-site-title, .nm-footer h2, .nm-footer h3 { color: #fff; }
.nm-footer h3 { position: relative; padding-bottom: 0.5rem; }
.nm-footer h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 40px; height: 3px; border-radius: 3px; background: var(--wp--preset--color--accent-7); }
.nm-footer ul { list-style: none; padding-left: 0; }
.nm-footer li { margin-bottom: 0.45rem; }
.nm-footer li a { text-decoration: none; opacity: 0.92; }
.nm-footer li a::before { content: "›"; margin-right: 0.5rem; color: var(--wp--preset--color--accent-7); font-weight: 700; }
.nm-footer li a:hover { opacity: 1; text-decoration: underline; }
.nm-copy { border-top: 1px solid rgba(255, 255, 255, 0.16); padding-top: 1rem; font-size: 0.85rem; opacity: 0.85; }

/* =====================================================================
 * เนื้อหาบทความ (รวมของเดิมจาก Joomla)
 * ===================================================================== */
.wp-block-post-content table { border-collapse: collapse; width: 100%; max-width: 100%; display: block; overflow-x: auto; }
.wp-block-post-content td, .wp-block-post-content th { border: 1px solid var(--wp--preset--color--accent-6); padding: 0.5rem 0.7rem; vertical-align: top; }
.wp-block-post-content th, .wp-block-post-content thead td { background: var(--wp--preset--color--accent-2); color: var(--wp--preset--color--accent-3); }
.wp-block-post-content tr:nth-child(even) td { background: var(--wp--preset--color--accent-5); }
.wp-block-post-content img { max-width: 100%; height: auto; border-radius: var(--nm-radius-sm); }
.wp-block-post-content a[href$=".pdf"], .wp-block-post-content a[href$=".PDF"] {
	display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.6rem 0.1rem 0.4rem; margin: 0.1rem 0;
	border-radius: 8px; background: #FDECEC; color: #A3262A; font-weight: 600; text-decoration: none;
}
.wp-block-post-content a[href$=".pdf"]::before, .wp-block-post-content a[href$=".PDF"]::before {
	content: "PDF"; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em;
	background: #D93A3F; color: #fff; padding: 0.05rem 0.35rem; border-radius: 4px;
}
.wp-block-post-content a[href$=".pdf"]:hover { background: #F9D7D8; }
.wp-block-file { background: var(--wp--preset--color--accent-5); border: 1px solid var(--wp--preset--color--accent-6); border-radius: var(--nm-radius-sm); padding: 0.75rem 1rem; }
.wp-block-post-content h2, .wp-block-post-content h3 { margin-top: 1.8em; }
