/*
Theme Name: NTC วิทยาลัยเทคนิคนราธิวาส
Description: Block theme สำหรับเว็บไซต์วิทยาลัยเทคนิคนราธิวาส มหาวิทยาลัยนราธิวาสราชนครินทร์ แก้ไขส่วนหัว ส่วนท้าย และหน้าแรกได้จาก ลักษณะ > ตัวแก้ไข
Version: 1.9.1
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: ntc
License: GPLv2 or later
*/

/* ส่วนที่ theme.json กำหนดไม่ได้ */

.ntc-topbar a { text-decoration: none; }
.ntc-topbar a:hover { text-decoration: underline; }

.ntc-header { position: sticky; top: 0; z-index: 50; border-bottom: 3px solid var(--wp--preset--color--accent); }
.admin-bar .ntc-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ntc-header { top: 0; position: relative; } }

/* ตรา + ชื่อวิทยาลัย */
.ntc-brand .custom-logo { height: 62px; width: auto; display: block; }
.ntc-brand__name {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.1rem, 1.6vw, 1.4rem);
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
}
.ntc-brand__name a { color: var(--wp--preset--color--primary-dark); text-decoration: none; }
.ntc-brand__sub {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.3;
	color: var(--wp--preset--color--accent);
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
@media (max-width: 480px) {
	.ntc-brand .custom-logo { height: 48px; }
	.ntc-brand__name { font-size: 1.05rem; }
	.ntc-brand__sub { font-size: 0.75rem; }
}

/* การ์ดข่าว */
.ntc-card {
	height: 100%;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ntc-card:hover { box-shadow: 0 6px 20px rgb(0 0 0 / 0.08); transform: translateY(-2px); }
.ntc-card .wp-block-post-featured-image img { aspect-ratio: 16 / 10; object-fit: cover; }
.ntc-card .wp-block-post-title a { text-decoration: none; }

/* ทางลัด */
.ntc-quicklink {
	height: 100%;
	transition: background-color 0.15s ease;
}
.ntc-quicklink a { text-decoration: none; }
.ntc-quicklink:hover { background-color: var(--wp--preset--color--surface); }

/* รายการประกาศ */
.ntc-notice-list .wp-block-post {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-block: 0.6rem;
}
.ntc-notice-list .wp-block-post:last-child { border-bottom: 0; }
.ntc-notice-list .wp-block-post > * { margin-block: 0; }
.ntc-notice-list .wp-block-post > * + * { margin-top: 0.15rem; }
.ntc-notice-list .wp-block-post-title a { text-decoration: none; }

/* ลิงก์ไฟล์ PDF ในเนื้อหา */
.wp-block-file { padding: 0.75rem 1rem; background: var(--wp--preset--color--surface); border-radius: 6px; }

/* เมนูย่อยให้อ่านง่ายบนพื้นสีเข้ม */
.ntc-header .wp-block-navigation__submenu-container {
	color: var(--wp--preset--color--contrast) !important;
	background: var(--wp--preset--color--base) !important;
	border: 1px solid var(--wp--preset--color--line) !important;
	min-width: 240px !important;
}

/* แถบรูปประชาสัมพันธ์ (assets/js/slider.js) */
.ntc-slider {
	position: relative;
	margin-top: var(--wp--preset--spacing--50);
	border-radius: 10px;
	overflow: hidden;
	background: var(--wp--preset--color--primary-dark);
}
.ntc-slider .wp-block-image {
	margin: 0;
	aspect-ratio: 16 / 9;
	max-height: 72vh; /* ไม่ให้สูงเกินจอแล็ปท็อป รูปจะย่อแบบไม่ตัดขอบ */
}
.ntc-slider .wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}
/* ก่อนสคริปต์โหลด แสดงแค่รูปแรก */
.ntc-slider:not(.is-ready) > .wp-block-image ~ .wp-block-image { display: none; }

.ntc-slider__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}
.ntc-slider__track::-webkit-scrollbar { display: none; }
.ntc-slider__track > .wp-block-image {
	flex: 0 0 100%;
	scroll-snap-align: start;
}

.ntc-slider__btn,
.ntc-slider__toggle,
.ntc-slider__dot {
	border: 0;
	cursor: pointer;
	padding: 0;
	font: inherit;
}
.ntc-slider__btn {
	position: absolute;
	top: calc(50% - 17px);
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.85);
	color: var(--wp--preset--color--primary-dark);
	font-size: 2rem;
	line-height: 1;
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.ntc-slider__btn--prev { left: 12px; }
.ntc-slider__btn--next { right: 12px; }
.ntc-slider:hover .ntc-slider__btn,
.ntc-slider:focus-within .ntc-slider__btn { opacity: 1; }
@media (hover: none) { .ntc-slider__btn { opacity: 1; width: 36px; height: 36px; font-size: 1.6rem; } }

/* จุดอยู่ในแถบใต้รูป ไม่ทับข้อความท้ายโปสเตอร์ */
.ntc-slider .ntc-slider__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 12px 56px;
}
.ntc-slider__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.55);
	transition: width 0.2s ease, background-color 0.2s ease;
}
.ntc-slider__dot[aria-current="true"] {
	width: 26px;
	border-radius: 5px;
	background: var(--wp--preset--color--accent);
}

/* ปุ่มหยุด/เล่น: ขีดคู่ = กำลังเล่น, สามเหลี่ยม = หยุดอยู่ */
.ntc-slider__toggle {
	position: absolute;
	right: 12px;
	bottom: 2px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.15);
}
.ntc-slider__toggle::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 10px;
	height: 12px;
	border-left: 3px solid #fff;
	border-right: 3px solid #fff;
	box-sizing: border-box;
}
.ntc-slider__toggle.is-paused::before {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #fff;
	margin-left: 12px;
}
.ntc-slider button:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.ntc-slider__btn, .ntc-slider__dot { transition: none; }
}

/* ไทม์ไลน์ประวัติวิทยาลัย (patterns/page-history.php) */
.ntc-timeline {
	border-left: 3px solid var(--wp--preset--color--accent);
	margin-left: 0.5rem;
	padding-left: 1.5rem;
}
.ntc-timeline__item { position: relative; margin-block: 0 1.5rem; }
.ntc-timeline__item:last-child { margin-bottom: 0; }
.ntc-timeline__item::before {
	content: "";
	position: absolute;
	left: calc(-1.5rem - 9px);
	top: 0.55rem;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	border: 3px solid var(--wp--preset--color--primary);
}
.ntc-timeline__item > * { margin-block: 0; }
.ntc-timeline__year { color: var(--wp--preset--color--primary); }

/* แผนภูมิในหน้าเนื้อหา: กรอบบาง ๆ ให้แยกจากพื้นขาว */
.ntc-chart img {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	background: #fff;
}
.ntc-chart figcaption { text-align: center; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }

/* ตาราง ITA (patterns/page-ita.php) */
.ntc-ita-table table { border-collapse: collapse; width: 100%; font-size: var(--wp--preset--font-size--small); }
.ntc-ita-table th, .ntc-ita-table td { border: 1px solid var(--wp--preset--color--line); padding: 0.5rem 0.75rem; vertical-align: top; }
.ntc-ita-table thead th { background: var(--wp--preset--color--surface); text-align: left; }
.ntc-ita-table td:first-child { width: 3.5rem; font-weight: 600; color: var(--wp--preset--color--primary); white-space: nowrap; }
.ntc-ita-table td:last-child { width: 7rem; white-space: nowrap; }
.ntc-pending { background: #fbf0d6; color: #7a5600; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; }

/* รายการดาวน์โหลด (หน้า ดาวน์โหลดเอกสาร) */
.wp-block-file.ntc-download {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-block: 0.5rem;
}
.wp-block-file.ntc-download > a:first-child { text-decoration: none; min-width: 0; }
.wp-block-file.ntc-download .wp-block-file__button { flex: none; font-size: 0.85rem; padding: 0.35rem 0.9rem; }
.ntc-file-meta { color: var(--wp--preset--color--muted); font-size: 0.8rem; margin-left: 0.4rem; white-space: nowrap; }

/* เมนูหลัก: ให้อยู่แถวเดียวบนจอคอมพิวเตอร์ */
.ntc-header .wp-block-navigation { font-size: 0.95rem; gap: 0.25rem 1rem; }
.ntc-header .wp-block-navigation__container { flex-wrap: nowrap; gap: 0.25rem 1rem; }
.ntc-header .wp-block-navigation-item__content { white-space: nowrap; }
@media (max-width: 1280px) {
	.ntc-header .wp-block-navigation,
	.ntc-header .wp-block-navigation__container { font-size: 0.875rem; gap: 0.25rem 0.75rem; }
}
/* จอแคบกว่า 1240px (แท็บเล็ต/แล็ปท็อปเล็ก): ใช้ปุ่มเมนูแบบมือถือแทน ไม่ให้เมนูเบียดโลโก้ */
@media (min-width: 600px) and (max-width: 1239px) {
	.ntc-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.ntc-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* หน้าหน่วยงานภายใน (patterns/page-units.php) และหน้าของแต่ละฝ่าย (patterns/page-unit-*.php) */
.ntc-unit + .ntc-unit { margin-top: var(--wp--preset--spacing--50); }
.ntc-unit > h2 { margin-bottom: 0; padding-bottom: 0.4rem; border-bottom: 3px solid var(--wp--preset--color--accent); }
.ntc-unit > h2 a { color: inherit; text-decoration: none; }
.ntc-unit > h2 a:hover { color: var(--wp--preset--color--primary); }
.ntc-unit__more { font-size: var(--wp--preset--font-size--small); }
.ntc-unit__head { margin-top: 0.4rem; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
.ntc-unit__jobs { columns: 2 260px; column-gap: var(--wp--preset--spacing--50); }
.ntc-unit__jobs > li { break-inside: avoid; }
.ntc-unit__groups { font-size: var(--wp--preset--font-size--small); }
.ntc-unit h3 { margin-top: var(--wp--preset--spacing--40); color: var(--wp--preset--color--primary); }
.ntc-missions > li + li { margin-top: 0.5rem; }
.ntc-activity__title { margin-top: 1.5rem; margin-bottom: 0.5rem; line-height: 1.6; }
.ntc-photo-grid { gap: 0.5rem; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; /* กิจกรรมละ 4 รูป ให้อยู่แถวเดียว */ }
@media (max-width: 600px) { .ntc-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
.ntc-photo-grid .wp-block-image { margin: 0; }
.ntc-photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.ntc-photo-grid.ntc-photo-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 600px) { .ntc-photo-grid.ntc-photo-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
/* อินโฟกราฟิก/เอกสาร: แสดงเต็มรูปไม่ตัดขอบ */
.ntc-doc-grid { gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)) !important; align-items: start; }
.ntc-doc-grid .wp-block-image { margin: 0; }
.ntc-doc-grid img { width: 100%; height: auto; display: block; border: 1px solid var(--wp--preset--color--line); border-radius: 6px; }
.ntc-doc-grid--single { grid-template-columns: minmax(0, 32rem) !important; }
.ntc-unit .ntc-chart img { border-radius: 6px; }
/* ตาราง (ปฏิทิน แผนงาน ทุน) */
.ntc-table table { border-collapse: collapse; width: 100%; font-size: var(--wp--preset--font-size--small); }
.ntc-table th, .ntc-table td { border: 1px solid var(--wp--preset--color--line); padding: 0.45rem 0.7rem; vertical-align: top; }
.ntc-table thead th { background: var(--wp--preset--color--surface); text-align: left; }
.ntc-table tfoot td { font-weight: 600; background: var(--wp--preset--color--surface); }
@media (max-width: 600px) { .ntc-table { overflow-x: auto; } }
/* งานหลัก 8 งาน */
.ntc-job-cards { gap: 0.75rem; }
.ntc-job-card { border: 1px solid var(--wp--preset--color--line); border-top: 3px solid var(--wp--preset--color--primary); border-radius: 8px; padding: 0.75rem 1rem; }
.ntc-job-card > * { margin-block: 0; }
.ntc-job-card__title { font-weight: 600; color: var(--wp--preset--color--primary-dark); margin-bottom: 0.35rem !important; }
.ntc-job-card__title span { color: var(--wp--preset--color--accent); }
.ntc-job-card ul { font-size: var(--wp--preset--font-size--small); padding-left: 1.1rem; }
/* บุคลากรของฝ่าย: การ์ดขนาดเท่ากัน แถวละ 4 ใบบนจอคอมพิวเตอร์ */
.ntc-people-grid.ntc-staff-grid { gap: 1.75rem 1.25rem !important; margin-top: 1.25rem; align-items: stretch !important; }
.ntc-people-grid > .ntc-person.ntc-person--small {
	flex: 0 0 172px;
	padding: 0.6rem 0.6rem 0.9rem;
	background: #fff;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	box-shadow: 0 2px 10px rgba(16, 42, 84, 0.07);
	justify-content: flex-start !important;
}
.ntc-person--small .ntc-person__photo { margin: 0 0 0.7rem; width: 100%; }
.ntc-person--small .ntc-person__photo img { aspect-ratio: 3 / 4; object-position: center top; border-radius: 8px; border-bottom-width: 3px; background: #f3f5f8; }
.ntc-person--small .ntc-person__name { font-size: 0.95rem; line-height: 1.45; }
.ntc-person--small .ntc-person__fullname { white-space: normal; }
.ntc-person__fullname .ntc-word { white-space: nowrap; } /* ห่อโดย ntc_person_name_words() ใน functions.php */ /* ชื่อยาวขึ้นบรรทัดใหม่ที่ช่องว่าง การ์ดจะได้กว้างเท่ากัน */
.ntc-person--small .ntc-person__title { font-size: 0.8rem; font-weight: 400; color: var(--wp--preset--color--muted); margin-bottom: 0.1rem; }
.ntc-person--small .ntc-person__role { margin-top: 0.35rem !important; padding-top: 0.35rem; border-top: 1px solid var(--wp--preset--color--line); width: 100%; font-size: 0.82rem; }
@media (max-width: 480px) {
	.ntc-staff-grid { gap: 1rem 0.75rem !important; }
	.ntc-people-grid > .ntc-person.ntc-person--small { flex: 0 0 calc(50% - 0.4rem); max-width: none; }
}
.ntc-person__degree { display: block; font-size: 0.75rem; line-height: 1.4; margin-top: 0.15rem; }
/* ฝ่ายอุตสาหกรรมสมัยใหม่: สไลด์รายงาน หลักสูตร ห้องปฏิบัติการ */
.ntc-doc-grid.ntc-slide-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)) !important; }
.ntc-doc-grid--award { grid-template-columns: minmax(0, 16rem) !important; }
.ntc-doc-grid--qr { grid-template-columns: minmax(0, 11rem) !important; }
.ntc-program__title { margin-top: var(--wp--preset--spacing--50) !important; padding: 0.5rem 0.9rem; background: var(--wp--preset--color--surface); border-left: 4px solid var(--wp--preset--color--accent); border-radius: 4px; font-size: 1.15rem; }
.ntc-plan { margin-block: 0.5rem; border: 1px solid var(--wp--preset--color--line); border-radius: 8px; padding: 0.6rem 1rem; }
.ntc-plan > summary { cursor: pointer; font-weight: 600; color: var(--wp--preset--color--primary); }
.ntc-plan[open] > summary { margin-bottom: 0.5rem; }
.ntc-plan__term { margin: 1rem 0 0.35rem; font-weight: 600; }
.ntc-plan .ntc-table td:first-child { white-space: nowrap; width: 7rem; }
.ntc-plan .ntc-table td:last-child { white-space: nowrap; width: 6rem; }
.ntc-lab-grid { gap: 1rem; }
.ntc-lab { margin: 0; border: 1px solid var(--wp--preset--color--line); border-radius: 10px; overflow: hidden; background: #fff; }
.ntc-lab img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ntc-lab figcaption { margin: 0; padding: 0.6rem 0.75rem 0.75rem; text-align: left; font-size: 0.8rem; line-height: 1.5; color: var(--wp--preset--color--muted); }
.ntc-lab figcaption strong { color: var(--wp--preset--color--primary-dark); font-size: 0.9rem; }
/* ข่าวกิจกรรม */
.ntc-news-item + .ntc-news-item { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--wp--preset--color--line); }
.ntc-news-item__date { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
.ntc-forms__cat { margin-top: 1rem; margin-bottom: 0.25rem; }
.ntc-download--pending { margin-block: 0.5rem; color: var(--wp--preset--color--muted); }

/* หน้าผู้บริหาร (patterns/page-executives.php) */
.ntc-person { text-align: center; }
.ntc-person > * { margin-block: 0; }
.ntc-person__photo { margin: 0 0 0.5rem; }
.ntc-person__photo img { width: 100%; aspect-ratio: 720 / 830; object-fit: cover; border-radius: 10px; border-bottom: 4px solid var(--wp--preset--color--accent); }
.ntc-person__name { font-family: var(--wp--preset--font-family--heading); font-weight: 600; color: var(--wp--preset--color--primary-dark); line-height: 1.4; }
.ntc-person__role { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); line-height: 1.5; }
.ntc-people-grid { gap: var(--wp--preset--spacing--40); }
.ntc-people-grid > .ntc-person { flex: 0 1 220px; }
.ntc-person__name { text-wrap: balance; }
@media (max-width: 480px) { .ntc-people-grid > .ntc-person { flex-basis: 100%; max-width: 280px; } }
.ntc-people-grid { align-items: flex-start !important; }
.ntc-person__title { display: block; font-weight: 500; font-size: 0.9em; }
.ntc-person__fullname { display: block; white-space: nowrap; }

/* โครงสร้างบุคลากรในหน้าฝ่าย (inc/units/academic.php) จัดแบบหน้าผู้บริหาร */
.ntc-org__label { margin-top: var(--wp--preset--spacing--40) !important; font-family: var(--wp--preset--font-family--heading); font-weight: 600; color: var(--wp--preset--color--primary); }
.ntc-org__label::after { content: ""; display: block; width: 48px; height: 3px; margin: 0.4rem auto 0; background: var(--wp--preset--color--accent); border-radius: 2px; }
.ntc-org__head { margin-top: 1rem !important; }
.ntc-org__team { margin-top: 1rem !important; }
.ntc-org__team > .ntc-person { flex: 0 1 165px; }
@media (max-width: 480px) { .ntc-org__team > .ntc-person { flex: 0 0 calc(50% - 0.75rem); max-width: none; } .ntc-org__team { gap: 1.25rem 1rem !important; } }

/* หน้าจัดซื้อจัดจ้าง (templates/category-procurement.html, patterns/procurement-list.php) */
.ntc-proc { margin-top: 0 !important; }
.ntc-proc__list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--wp--preset--color--line); border-radius: 10px; overflow: hidden; background: #fff; }
.ntc-proc__list > li { margin: 0; border-top: 1px solid var(--wp--preset--color--line); transition: background-color 0.15s; }
.ntc-proc__list > li:first-child { border-top: 0; }
.ntc-proc__list > li:hover { background: var(--wp--preset--color--surface); }
.ntc-proc__item { gap: 1.1rem !important; padding: 0.9rem 1.1rem; align-items: center !important; }
.ntc-proc__date { flex: 0 0 4.2rem; gap: 0 !important; padding: 0.4rem 0; text-align: center; background: var(--wp--preset--color--primary); color: #fff; border-radius: 8px; line-height: 1.2; }
.ntc-proc__date > *, .ntc-proc__date a { margin: 0; color: #fff !important; text-decoration: none; }
.ntc-proc__day { font-family: var(--wp--preset--font-family--heading); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.ntc-proc__month { font-size: 0.75rem; opacity: 0.9; }
.ntc-proc__body { flex: 1 1 auto; min-width: 0; gap: 0.3rem !important; align-items: flex-start !important; }
.ntc-proc__title { margin: 0; font-size: 1rem; font-weight: 500; line-height: 1.55; }
.ntc-proc__title a { color: var(--wp--preset--color--primary-dark); text-decoration: none; }
.ntc-proc__title a:hover, .ntc-proc__title a:focus { color: var(--wp--preset--color--primary); text-decoration: underline; }
.ntc-proc__badge { display: inline-block; padding: 0.1rem 0.6rem; font-size: 0.75rem; font-weight: 600; line-height: 1.6; border-radius: 999px; color: var(--wp--preset--color--muted); background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); }
.ntc-proc__badge--winner { color: #1f6b2a; background: #e8f5ea; border-color: #bfe0c4; }
.ntc-proc__badge--tor { color: #6b3fa0; background: #f2ecfa; border-color: #dccdf0; }
.ntc-proc__badge--plan { color: #8a5a00; background: #fdf4dd; border-color: #f0dca6; }
.ntc-proc__badge--bid { color: var(--wp--preset--color--primary); background: #e8f0fa; border-color: #c6d8ee; }
.ntc-proc__badge--cancel { color: #a12a2a; background: #fbeaea; border-color: #f0c8c8; }
.ntc-proc__pages { margin-top: var(--wp--preset--spacing--40) !important; gap: 0.4rem; }
.ntc-proc__pages .page-numbers, .ntc-proc__pages a { display: inline-block; min-width: 2.2rem; padding: 0.3rem 0.6rem; text-align: center; text-decoration: none; border: 1px solid var(--wp--preset--color--line); border-radius: 6px; }
.ntc-proc__pages .page-numbers.current { color: #fff; background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }
.ntc-proc__pages .page-numbers.dots { border: 0; min-width: 0; }
@media (max-width: 600px) {
	.ntc-proc__item { gap: 0.8rem !important; padding: 0.8rem; align-items: flex-start !important; }
	.ntc-proc__date { flex-basis: 3.4rem; }
	.ntc-proc__day { font-size: 1.2rem; }
	.ntc-proc__title { font-size: 0.95rem; }
}
/* หน้าแรก: ข่าวประชาสัมพันธ์ (patterns/front-news.php) ข่าวเด่น + ข่าวถัดมา 4 เรื่อง + กล่องประกาศ/จัดซื้อจัดจ้าง */
.ntc-news > * { margin-block: 0; }
.ntc-news__head { gap: 1rem !important; margin-bottom: 1.25rem !important; }
.ntc-news__heading { gap: 0.2rem !important; }
.ntc-news__heading > * { margin: 0; }
.ntc-eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; color: var(--wp--preset--color--accent); }
.ntc-news__heading h2 { position: relative; padding-bottom: 0.5rem; }
.ntc-news__heading h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 2px; background: var(--wp--preset--color--accent); }
.ntc-news__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.ntc-news__tabs a { padding: 0.35rem 1rem; font-size: var(--wp--preset--font-size--small); font-weight: 600; text-decoration: none; color: var(--wp--preset--color--primary); background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 999px; transition: background-color 0.15s, color 0.15s; }
.ntc-news__tabs a:hover, .ntc-news__tabs a:focus-visible { color: #fff; background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }

.ntc-news__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.5rem; }
.ntc-news__grid > * { margin: 0 !important; }
.ntc-news__lead .wp-block-post-template, .ntc-news__list { margin: 0; padding: 0; list-style: none; }

.ntc-feature { position: relative; height: 100%; min-height: 360px; overflow: hidden; border-radius: 14px; background: var(--wp--preset--color--primary-dark); box-shadow: 0 10px 30px rgba(16, 42, 84, 0.15); }
.ntc-news__lead, .ntc-news__lead .wp-block-post-template, .ntc-news__lead .wp-block-post { height: 100%; }
.ntc-feature__image { position: absolute !important; inset: 0; margin: 0 !important; height: 100% !important; }
.ntc-feature__image a, .ntc-feature__image img { display: block; width: 100%; height: 100% !important; aspect-ratio: auto !important; object-fit: cover; transition: transform 0.5s ease; }
.ntc-feature:hover .ntc-feature__image img { transform: scale(1.04); }
.ntc-feature__body { position: absolute; inset: auto 0 0 0; gap: 0.45rem !important; padding: 4.5rem 1.5rem 1.4rem; background: linear-gradient(to top, rgba(10, 30, 60, 0.97) 0%, rgba(10, 30, 60, 0.9) 50%, rgba(10, 30, 60, 0.55) 78%, rgba(10, 30, 60, 0) 100%); color: #fff; pointer-events: none; }
.ntc-feature__body > * { margin: 0; }
.ntc-feature__body a { pointer-events: auto; }
.ntc-feature__label { align-self: flex-start; padding: 0.15rem 0.7rem; font-size: 0.75rem; font-weight: 700; color: var(--wp--preset--color--primary-dark); background: var(--wp--preset--color--accent); border-radius: 999px; }
.ntc-feature__title { font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.4; }
.ntc-feature__title a { color: #fff; text-decoration: none; }
.ntc-feature__title a:hover, .ntc-feature__title a:focus-visible { text-decoration: underline; }
.ntc-feature__excerpt { font-size: 0.95rem; line-height: 1.6; opacity: 0.9; }
.ntc-feature__excerpt .wp-block-post-excerpt__excerpt { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ntc-feature__excerpt .wp-block-post-excerpt__more-text { display: none; }
.ntc-feature__date { font-size: 0.85rem; opacity: 0.85; }

.ntc-news__list { display: flex; flex-direction: column; gap: 0.75rem; height: 100%; }
.ntc-news__list > li { flex: 1 1 0; margin: 0; }
.ntc-news-row { gap: 0.9rem !important; height: 100%; padding: 0.6rem; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; }
.ntc-news-row:hover { border-color: transparent; box-shadow: 0 8px 22px rgba(16, 42, 84, 0.12); transform: translateY(-2px); }
.ntc-news-row__thumb { flex: 0 0 132px; margin: 0 !important; overflow: hidden; border-radius: 8px; background: var(--wp--preset--color--surface); }
.ntc-news-row__thumb img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ntc-news-row__body { flex: 1 1 auto; min-width: 0; gap: 0.25rem !important; padding-top: 0.15rem; }
.ntc-news-row__body > * { margin: 0; }
.ntc-news-row__date { font-size: 0.8rem; color: var(--wp--preset--color--muted); }
.ntc-news-row__title { font-size: 1rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ntc-news-row__title a { color: var(--wp--preset--color--primary-dark); text-decoration: none; }
.ntc-news-row__title a:hover, .ntc-news-row__title a:focus-visible { color: var(--wp--preset--color--primary); }
/* ข่าวที่ไม่มีรูปประจำเรื่อง: ช่องรูปเป็นสีพื้นแทน */
.ntc-news-row:not(:has(.ntc-news-row__thumb)) .ntc-news-row__body { padding-left: 0.4rem; }

.ntc-news__all { margin-top: 1rem !important; text-align: right; font-weight: 600; }
.ntc-news__all a { text-decoration: none; }
.ntc-news__all a:hover { text-decoration: underline; }

.ntc-boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: var(--wp--preset--spacing--50) !important; }
.ntc-boards > * { margin: 0 !important; }
.ntc-board { padding: 1.1rem 1.25rem 0.6rem; background: var(--wp--preset--color--surface); border-radius: 14px; border-top: 4px solid var(--wp--preset--color--primary); }
.ntc-board + .ntc-board { border-top-color: var(--wp--preset--color--accent); }
.ntc-board > * { margin-block: 0; }
.ntc-board__head { margin-bottom: 0.5rem !important; }
.ntc-board__head > * { margin: 0; }
.ntc-board__head h3 { font-size: 1.2rem; }
.ntc-board__head p { font-size: var(--wp--preset--font-size--small); font-weight: 600; }
.ntc-board__head a { text-decoration: none; }
.ntc-board__list { margin: 0; padding: 0; list-style: none; }
.ntc-board__list > li { margin: 0; border-top: 1px solid var(--wp--preset--color--line); }
.ntc-board__list > li:first-child { border-top: 0; }
.ntc-board__item { gap: 0.9rem !important; padding: 0.7rem 0; }
.ntc-board__item .ntc-proc__date { flex-basis: 3.4rem; }
.ntc-board__item .ntc-proc__day { font-size: 1.2rem; }
.ntc-board__title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 0.95rem; font-weight: 500; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ntc-board__title a { color: var(--wp--preset--color--primary-dark); text-decoration: none; }
.ntc-board__title a:hover, .ntc-board__title a:focus-visible { color: var(--wp--preset--color--primary); text-decoration: underline; }
/* ป้ายประเภทจัดซื้อ (ntc_procurement_badge) อยู่นอก h4 วางไว้บนชื่อเรื่อง */
.ntc-board__item:has(.ntc-proc__badge) { align-items: flex-start !important; }
.ntc-board__item .ntc-proc__badge { display: none; } /* กล่องหน้าแรกแคบ ซ่อนป้ายไว้ให้ชื่อเรื่องอ่านง่าย */

@media (max-width: 900px) {
	.ntc-news__grid, .ntc-boards { grid-template-columns: minmax(0, 1fr); }
	.ntc-feature { min-height: 300px; }
}
@media (max-width: 480px) {
	.ntc-feature { min-height: 260px; }
	.ntc-feature__body { padding: 2.5rem 1rem 1rem; }
	.ntc-feature__excerpt { display: none; }
	.ntc-news-row__thumb { flex-basis: 104px; }
	.ntc-news-row__title { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
	.ntc-feature__image img, .ntc-news-row { transition: none; }
}
/* ===== รูปแบบกลางทุกหน้า (ยกเว้นหน้าแรก) =====
   แถบหัวเรื่อง .ntc-page-hero + เส้นทาง [ntc_breadcrumb] อยู่ในทุกเทมเพลต (page, single, archive, index, search, 404, category-procurement)
   เนื้อหาหน้า/ข่าวกว้าง 960px หน้ารวมข่าว 1200px หัวข้อ รูป ตาราง การ์ดข่าว ใช้สไตล์ชุดเดียวกันด้านล่าง */
.ntc-page-hero {
	position: relative;
	overflow: hidden;
	margin-top: 0 !important;
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--50);
	background: linear-gradient(120deg, var(--wp--preset--color--primary-dark) 0%, var(--wp--preset--color--primary) 100%);
	color: #fff;
}
.ntc-page-hero::after { /* วงกลมตกแต่งมุมขวา */
	content: "";
	position: absolute;
	right: -80px;
	top: -120px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	border: 40px solid rgba(217, 163, 33, 0.18);
	pointer-events: none;
}
.ntc-page-hero > * { position: relative; z-index: 1; margin-block: 0; }
.ntc-page-hero > p:empty { display: none; }
.ntc-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.ntc-breadcrumb li + li::before { content: "›"; margin-right: 0.5rem; color: var(--wp--preset--color--accent); font-weight: 700; }
.ntc-breadcrumb a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.ntc-breadcrumb a:hover, .ntc-breadcrumb a:focus-visible { color: #fff; text-decoration: underline; }
.ntc-breadcrumb [aria-current] { color: rgba(255, 255, 255, 0.65); }
.ntc-page-hero__title { margin-top: 0.6rem !important; color: #fff; font-size: var(--wp--preset--font-size--xx-large); line-height: 1.3; }
.ntc-page-hero__title::after { content: ""; display: block; width: 56px; height: 4px; margin-top: 0.7rem; border-radius: 2px; background: var(--wp--preset--color--accent); }
.ntc-page-hero__lead { margin-top: 0.9rem !important; max-width: 52rem; line-height: 1.7; color: rgba(255, 255, 255, 0.9); }
.ntc-page-hero__lead p { margin: 0; }
.ntc-page-hero__meta { margin-top: 0.9rem !important; gap: 0.75rem !important; font-size: var(--wp--preset--font-size--small); color: rgba(255, 255, 255, 0.85); }
.ntc-page-hero__meta > * { margin: 0; }
.ntc-chips a { display: inline-block; margin: 0 0.3rem 0.3rem 0; padding: 0.1rem 0.75rem; font-size: 0.8rem; color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; }
.ntc-chips a:hover { background: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--primary-dark); }
.ntc-chips .wp-block-post-terms__separator { display: none; }
.ntc-page-hero__links { margin-top: 1.1rem !important; gap: 0.6rem; }
.ntc-page-hero .is-style-outline .wp-block-button__link { padding: 0.45rem 1.1rem; font-size: var(--wp--preset--font-size--small); color: #fff; background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.7); border-radius: 999px; }
.ntc-page-hero .is-style-outline .wp-block-button__link:hover { color: var(--wp--preset--color--primary-dark); background: #fff; border-color: #fff; }
.ntc-page-hero__search { margin-top: 1rem !important; max-width: 36rem; }
.ntc-page-hero__search .wp-block-search__input { border: 0; border-radius: 8px 0 0 8px; padding: 0.6rem 0.9rem; }
.ntc-page-hero__search .wp-block-search__button { margin-left: 0; border-radius: 0 8px 8px 0; background: var(--wp--preset--color--accent); color: var(--wp--preset--color--primary-dark); }

/* กลุ่มที่ห่อเนื้อหาข้างใน (เช่น .ntc-unit ของหน้าฝ่าย/สาขา) ใช้ความกว้าง 960px เท่ากับแถบหัวเรื่อง */
.ntc-content { --wp--style--global--content-size: 960px; }
.ntc-main { margin-top: 0 !important; padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--60); }
.ntc-main > .ntc-content > :first-child, .ntc-content > .wp-block-group:first-child > :first-child { margin-top: 0; }

/* หัวข้อในเนื้อหา: h2 = ขีดทองใต้หัวข้อ, h3 และหัวข้อสาขา = แถบซ้ายสีทองบนพื้นอ่อน */
.ntc-content > h2,
.ntc-content > .wp-block-group > h2 {
	margin-top: var(--wp--preset--spacing--50);
	padding-bottom: 0;
	border-bottom: 0;
	color: var(--wp--preset--color--primary-dark);
}
.ntc-content > h2::after,
.ntc-content > .wp-block-group > h2::after { content: ""; display: block; width: 56px; height: 4px; margin-top: 0.55rem; border-radius: 2px; background: var(--wp--preset--color--accent); }
.ntc-content > h2.has-text-align-center::after,
.ntc-content > .wp-block-group > h2.has-text-align-center::after { margin-inline: auto; }
.ntc-content > h3,
.ntc-content > .wp-block-group > h3,
.ntc-content .ntc-program__title {
	margin-top: var(--wp--preset--spacing--50) !important;
	padding: 0.55rem 1rem;
	font-size: 1.15rem;
	line-height: 1.45;
	color: var(--wp--preset--color--primary-dark);
	background: var(--wp--preset--color--surface);
	border-left: 4px solid var(--wp--preset--color--accent);
	border-radius: 0 8px 8px 0;
}
.ntc-content > .wp-block-group > h2 + h3 { margin-top: var(--wp--preset--spacing--40) !important; }

/* รูปในเนื้อหา: มุมโค้งเท่ากัน มีเงาบาง ๆ (ยกเว้นรูปบุคลากรที่มีกรอบของตัวเอง) */
.ntc-content .wp-block-image:not(.ntc-person__photo) img { border-radius: 10px; }
.ntc-content > .wp-block-image:not(.ntc-person__photo) img,
.ntc-content .ntc-chart img { box-shadow: 0 4px 18px rgba(16, 42, 84, 0.1); }
.ntc-content .ntc-photo-grid img,
.ntc-content .ntc-doc-grid img { border-radius: 10px; box-shadow: 0 2px 10px rgba(16, 42, 84, 0.08); transition: transform 0.2s, box-shadow 0.2s; }
.ntc-content .ntc-photo-grid a:hover img,
.ntc-content .ntc-doc-grid a:hover img { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(16, 42, 84, 0.16); }
.ntc-content .ntc-photo-grid { gap: 0.75rem; }
.ntc-content figcaption,
.ntc-content .wp-element-caption { margin-top: 0.5rem; text-align: center; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }

/* ตารางทุกตาราง (ntc-table, ntc-ita-table, ตารางทั่วไป) หัวตารางสีน้ำเงิน แถวสลับสี กรอบมุมโค้ง */
.ntc-content .wp-block-table { overflow-x: auto; border: 1px solid var(--wp--preset--color--line); border-radius: 10px; background: #fff; }
.ntc-content .wp-block-table table { width: 100%; border-collapse: collapse; font-size: var(--wp--preset--font-size--small); }
.ntc-content .wp-block-table th,
.ntc-content .wp-block-table td { padding: 0.6rem 0.8rem; border: 0; border-bottom: 1px solid var(--wp--preset--color--line); vertical-align: top; text-align: left; }
.ntc-content .wp-block-table thead { border: 0; }
.ntc-content .wp-block-table thead th { color: #fff; font-weight: 600; background: var(--wp--preset--color--primary-dark); border-bottom: 0; }
.ntc-content .wp-block-table tbody tr:nth-child(even) td { background: #f7f9fc; }
.ntc-content .wp-block-table tbody tr:last-child td { border-bottom: 0; }
.ntc-content .wp-block-table tfoot td { font-weight: 600; background: var(--wp--preset--color--surface); border-top: 2px solid var(--wp--preset--color--line); border-bottom: 0; }

/* การ์ดข่าวในหน้ารวมข่าว/หมวด/ค้นหา (patterns/post-grid.php) แบบเดียวกับข่าวหน้าแรก */
.ntc-card { overflow: hidden; border-radius: 12px !important; background: #fff; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; }
.ntc-card:hover { border-color: transparent !important; box-shadow: 0 10px 26px rgba(16, 42, 84, 0.14); transform: translateY(-3px); }
.ntc-card .wp-block-post-featured-image { overflow: hidden; margin: 0; border-radius: 0 !important; }
.ntc-card .wp-block-post-featured-image img { border-radius: 0 !important; transition: transform 0.4s ease; }
.ntc-card:hover .wp-block-post-featured-image img { transform: scale(1.05); }
.ntc-card .wp-block-post-date { font-size: 0.8rem; color: var(--wp--preset--color--muted); }
.ntc-card .wp-block-post-title { font-size: 1rem !important; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ntc-card .wp-block-post-title a { color: var(--wp--preset--color--primary-dark); }
.ntc-card .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.ntc-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); }
.ntc-card .wp-block-post-excerpt__excerpt { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ntc-card .wp-block-post-excerpt__more-text { display: none; }
.ntc-main .wp-block-query-pagination { gap: 0.4rem; }
.ntc-main .wp-block-query-pagination .page-numbers,
.ntc-main .wp-block-query-pagination > a { display: inline-block; min-width: 2.2rem; padding: 0.3rem 0.7rem; text-align: center; text-decoration: none; border: 1px solid var(--wp--preset--color--line); border-radius: 8px; }
.ntc-main .wp-block-query-pagination .page-numbers.current { color: #fff; background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }
.ntc-main .wp-block-query-pagination .page-numbers.dots { border: 0; min-width: 0; }

/* ลิงก์เรื่องก่อนหน้า/ถัดไปท้ายข่าว */
.ntc-post-nav { margin-top: var(--wp--preset--spacing--50) !important; padding-top: var(--wp--preset--spacing--30); border-top: 1px solid var(--wp--preset--color--line); gap: 1rem !important; }
.ntc-post-nav > * { flex: 1 1 18rem; margin: 0; padding: 0.8rem 1rem; font-size: var(--wp--preset--font-size--small); background: var(--wp--preset--color--surface); border-radius: 10px; }
.ntc-post-nav .post-navigation-link-next { text-align: right; }
.ntc-post-nav a { font-weight: 600; text-decoration: none; }

@media (max-width: 600px) {
	.ntc-page-hero { padding-top: var(--wp--preset--spacing--40); padding-bottom: var(--wp--preset--spacing--40); }
	.ntc-page-hero::after { width: 200px; height: 200px; border-width: 28px; right: -70px; top: -90px; }
	.ntc-page-hero__title { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
	.ntc-card, .ntc-card .wp-block-post-featured-image img, .ntc-content .ntc-photo-grid img, .ntc-content .ntc-doc-grid img { transition: none; }
}