:root {
	--primary: #7a1f1f;
	--secondary: #0f5c6b;
	--accent: #c89b3c;
	--ink: #18202a;
	--muted: #5c6675;
	--line: #d9dee7;
	--soft: #f6f8fb;
	--paper: #fff;
	--wrap: min(1120px, calc(100% - 32px));
	--radius: 8px;
	--shadow: 0 10px 24px rgba(24, 32, 42, 0.07);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: "Sarabun", "Noto Sans Thai", "IBM Plex Sans Thai", Tahoma, sans-serif;
	font-size: 16px;
	line-height: 1.7;
}

body.font-large {
	font-size: 18px;
}

body.font-small {
	font-size: 14px;
}

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

a {
	color: var(--secondary);
	text-underline-offset: 0.18em;
}

a:hover,
a:focus {
	color: var(--primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
}

h1,
h2,
h3 {
	line-height: 1.28;
	margin: 0 0 0.65rem;
}

h1 {
	font-size: 2.35rem;
}

h2 {
	font-size: 1.55rem;
}

h3 {
	font-size: 1.05rem;
}

p {
	margin: 0 0 1rem;
}

.wrap {
	margin-inline: auto;
	width: var(--wrap);
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.skip-link {
	background: var(--ink);
	color: #fff;
	left: 1rem;
	padding: 0.6rem 0.8rem;
	position: absolute;
	top: -100px;
	z-index: 1000;
}

.skip-link:focus {
	top: 1rem;
}

.topbar {
	background: var(--ink);
	color: #fff;
	font-size: 0.9rem;
}

.topbar a {
	color: #fff;
}

.topbar__inner {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
	justify-content: flex-end;
	min-height: 36px;
}

.site-header {
	background: rgba(255, 255, 255, 0.98);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 50;
}

.header-main {
	align-items: center;
	display: flex;
	gap: 1.25rem;
	justify-content: space-between;
	min-height: 84px;
	white-space: nowrap;
}

.brand {
	align-items: center;
	color: var(--ink);
	display: flex;
	flex: 0 0 auto;
	gap: 0.8rem;
	max-width: 360px;
	min-width: 230px;
	overflow: hidden;
	text-decoration: none;
}

.brand span {
	min-width: 0;
	overflow: hidden;
}

.brand img,
.custom-logo {
	border-radius: 50%;
	height: 58px;
	width: 58px;
}

.brand strong,
.brand small {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brand strong {
	font-size: 0.98rem;
}

.brand small {
	color: var(--muted);
	font-size: 0.86rem;
	line-height: 1.35;
}

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

.primary-nav > ul,
.primary-nav .menu {
	align-items: center;
	display: flex;
	flex-wrap: nowrap;
	gap: 0.05rem;
	justify-content: flex-end;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-nav li {
	position: relative;
}

.primary-nav a {
	border-radius: var(--radius);
	color: var(--ink);
	display: block;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.35;
	padding: 0.42rem 0.5rem;
	text-decoration: none;
	white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a:focus {
	background: var(--soft);
	color: var(--primary);
}

.primary-nav .sub-menu,
.primary-nav .children {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: none;
	left: 0;
	list-style: none;
	margin: 0;
	min-width: 240px;
	padding: 0.35rem;
	position: absolute;
	top: 100%;
	z-index: 100;
}

.primary-nav .sub-menu .sub-menu,
.primary-nav .children .children {
	left: 100%;
	top: 0;
}

.primary-nav > ul > li:nth-last-child(-n+2) > .sub-menu,
.primary-nav .menu > li:nth-last-child(-n+2) > .sub-menu,
.primary-nav > ul > li:nth-last-child(-n+2) > .children,
.primary-nav .menu > li:nth-last-child(-n+2) > .children {
	left: auto;
	right: 0;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu,
.primary-nav li:hover > .children,
.primary-nav li:focus-within > .children {
	display: grid;
}

.primary-nav .sub-menu a,
.primary-nav .children a {
	border-radius: 6px;
	line-height: 1.45;
	padding: 0.55rem 0.65rem;
	white-space: normal;
}

.menu-toggle {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	display: none;
	height: 42px;
	padding: 0.6rem;
	width: 42px;
}

.menu-toggle span:not(.screen-reader-text) {
	background: var(--ink);
	display: block;
	height: 2px;
	margin: 5px 0;
	width: 20px;
}

.accessibility-bar {
	background: var(--soft);
	border-top: 1px solid var(--line);
}

.accessibility-bar__inner {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	justify-content: flex-end;
	min-height: 48px;
}

button,
.button,
.search-form button {
	align-items: center;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 700;
	min-height: 40px;
	padding: 0.48rem 0.78rem;
	text-decoration: none;
}

.button--primary,
.search-form button,
.contact-form button {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

.button:hover,
.button:focus,
button:hover,
button:focus {
	box-shadow: var(--shadow);
}

.search-form {
	display: flex;
	gap: 0.35rem;
}

.search-field,
input,
textarea {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font: inherit;
	min-height: 40px;
	padding: 0.5rem 0.65rem;
	width: 100%;
}

.hero {
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
		url("../images/hero-audit.svg") center/cover no-repeat;
	border-bottom: 1px solid #e8dfcd;
}

.hero__grid {
	align-items: center;
	display: grid;
	gap: 2rem;
	grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
	padding-block: 3.25rem;
}

.hero__content {
	max-width: 760px;
}

.hero h1 {
	color: var(--primary);
	max-width: 740px;
}

.lead {
	color: #2d3745;
	font-size: 1.13rem;
	max-width: 720px;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 1.2rem;
}

.fact-panel {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	margin: 0;
	padding: 0.35rem 1.15rem;
}

.fact-panel div {
	border-bottom: 1px solid var(--line);
	padding: 0.85rem 0;
}

.fact-panel div:last-child {
	border-bottom: 0;
}

.fact-panel dt {
	color: var(--muted);
	font-size: 0.86rem;
	font-weight: 700;
	margin: 0 0 0.2rem;
}

.fact-panel dd {
	margin: 0;
}

.eyebrow {
	color: var(--secondary);
	font-size: 0.84rem;
	font-weight: 800;
	margin-bottom: 0.4rem;
	text-transform: uppercase;
}

.section,
.page-shell {
	padding-block: 3rem;
}

.section--soft {
	background: var(--soft);
	border-block: 1px solid var(--line);
}

.page-shell.narrow {
	max-width: 880px;
}

.page-header,
.section-heading {
	margin-bottom: 1.4rem;
	max-width: 780px;
}

.mission-grid,
.card-grid,
.staff-grid,
.oit-grid {
	display: grid;
	gap: 0.9rem;
}

.mission-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mission-grid article {
	background: #fff;
	border: 1px solid var(--line);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius);
	padding: 1rem;
}

.home-grid,
.contact-grid,
.two-col {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.document-list,
.plain-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.document-list {
	counter-reset: docs;
}

.document-list li {
	align-items: flex-start;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	display: grid;
	gap: 0.75rem;
	grid-template-columns: 2.2rem 1fr;
	margin-bottom: 0.55rem;
	padding: 0.78rem 0.85rem;
}

.document-list li::before {
	background: #f2e8d6;
	border-radius: 50%;
	color: var(--primary);
	content: counter(docs);
	counter-increment: docs;
	display: inline-grid;
	font-weight: 800;
	height: 1.8rem;
	place-items: center;
	width: 1.8rem;
}

.document-list--large li {
	display: block;
}

.document-list--large li::before {
	margin-right: 0.65rem;
}

.document-list small,
.meta,
.source-note,
.staff-row p,
.staff-card p {
	color: var(--muted);
}

.staff-list {
	display: grid;
	gap: 0.55rem;
}

.staff-row,
.content-card,
.staff-card,
.oit-item,
.contact-panel {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 1px 0 rgba(24, 32, 42, 0.03);
}

.staff-row {
	padding: 0.85rem 1rem;
}

.staff-row h3 {
	margin-bottom: 0.2rem;
}

.staff-row p {
	margin-bottom: 0.25rem;
}

.oit-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.oit-grid a {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	display: grid;
	gap: 0.35rem;
	min-height: 96px;
	padding: 0.85rem;
	text-decoration: none;
}

.oit-grid strong,
.oit-item span {
	color: var(--primary);
	display: block;
	font-size: 0.9rem;
}

.oit-grid span {
	color: var(--ink);
	font-size: 0.94rem;
	line-height: 1.5;
}

.oit-list {
	display: grid;
	gap: 0.75rem;
}

.oit-item,
.content-card__body,
.contact-panel,
.staff-card {
	padding: 1.05rem;
}

.card-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-card {
	overflow: hidden;
}

.content-card__image {
	aspect-ratio: 16 / 9;
	display: block;
	overflow: hidden;
}

.content-card__image img {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.content-card--empty {
	grid-column: span 2;
}

.entry-content > * {
	max-width: 760px;
}

.entry-content > .alignwide {
	max-width: 1120px;
}

.entry-content table {
	border-collapse: collapse;
	margin: 1rem 0 1.5rem;
	width: 100%;
}

.entry-content th,
.entry-content td {
	border: 1px solid var(--line);
	padding: 0.7rem 0.8rem;
	text-align: left;
	vertical-align: top;
}

.entry-content th {
	background: var(--soft);
	font-weight: 800;
}

.wp-block-columns {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wp-block-column {
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1rem;
}

.featured-image {
	margin-bottom: 1.5rem;
}

.staff-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.staff-card {
	text-align: center;
}

.avatar {
	align-items: center;
	background: var(--primary);
	border-radius: 50%;
	color: #fff;
	display: inline-flex;
	font-size: 1.45rem;
	font-weight: 800;
	height: 64px;
	justify-content: center;
	margin-bottom: 0.9rem;
	width: 64px;
}

.contact-form {
	display: grid;
	gap: 0.8rem;
}

.contact-form label {
	display: grid;
	font-weight: 700;
	gap: 0.25rem;
}

.notice {
	border-radius: var(--radius);
	font-weight: 700;
	padding: 0.7rem 0.9rem;
}

.notice.success {
	background: #eaf7ef;
	color: #135c35;
}

.notice.error {
	background: #fff0ed;
	color: #9f1f13;
}

.site-footer {
	background: var(--ink);
	color: #fff;
}

.site-footer a {
	color: #ffe2a3;
}

.footer-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1.2fr 0.8fr 1fr;
	padding-block: 2.3rem;
}

.footer-grid h2 {
	font-size: 1.05rem;
}

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.18);
	padding-block: 0.9rem;
}

.cookie-banner {
	align-items: center;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	bottom: 1rem;
	box-shadow: var(--shadow);
	display: flex;
	gap: 1rem;
	left: 50%;
	max-width: min(720px, calc(100% - 32px));
	padding: 1rem;
	position: fixed;
	transform: translateX(-50%);
	z-index: 100;
}

.cookie-banner[hidden] {
	display: none;
}

.text-link {
	font-weight: 800;
}

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

	.primary-nav {
		background: #fff;
		border-top: 1px solid var(--line);
		box-shadow: var(--shadow);
		display: none;
		left: 0;
		padding: 0.9rem 1rem;
		position: absolute;
		right: 0;
		top: 100%;
	}

	.header-main {
		white-space: normal;
	}

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

	.primary-nav > ul,
	.primary-nav .menu {
		align-items: stretch;
		display: grid;
		justify-content: stretch;
	}

	.primary-nav a {
		font-size: 1rem;
		white-space: normal;
	}

	.primary-nav .sub-menu,
	.primary-nav .children {
		background: transparent;
		border: 0;
		box-shadow: none;
		display: grid;
		margin-left: 0.8rem;
		min-width: 0;
		padding: 0.15rem 0 0.25rem 0.8rem;
		position: static;
	}

	.primary-nav .sub-menu .sub-menu,
	.primary-nav .children .children {
		left: auto;
		top: auto;
	}

	.hero__grid,
	.home-grid,
	.contact-grid,
	.two-col,
	.footer-grid {
		grid-template-columns: 1fr;
	}

	.mission-grid,
	.card-grid,
	.oit-grid,
	.staff-grid,
	.wp-block-columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	h1 {
		font-size: 1.85rem;
	}

	h2 {
		font-size: 1.35rem;
	}

	.topbar__inner {
		justify-content: flex-start;
	}

	.header-main {
		min-height: 78px;
	}

	.brand {
		min-width: 0;
	}

	.brand img,
	.custom-logo {
		height: 50px;
		width: 50px;
	}

	.brand small {
		display: none;
	}

	.accessibility-bar__inner {
		justify-content: flex-start;
	}

	.search-form {
		width: 100%;
	}

	.hero__grid,
	.section,
	.page-shell {
		padding-block: 2.2rem;
	}

	.mission-grid,
	.card-grid,
	.oit-grid,
	.staff-grid,
	.wp-block-columns {
		grid-template-columns: 1fr;
	}

	.content-card--empty {
		grid-column: auto;
	}

	.cookie-banner {
		align-items: stretch;
		flex-direction: column;
	}
}
