/**
 * PANGRUAY99 – main stylesheet
 */

:root {
	--color-header: #071a16;
	--color-bg: #ffffff;
	--color-bg-secondary: #f7f8fa;
	--color-gold: #d6b56d;
	--color-gold-dark: #b8944f;
	--color-green: #168a43;
	--color-text: #20252b;
	--color-text-muted: #737b84;
	--color-border: #e8eaed;
	--font-thai: "Noto Sans Thai", "Inter", system-ui, sans-serif;
	--font-sans: "Inter", "Noto Sans Thai", system-ui, sans-serif;
	--container: 1200px;
	--radius: 8px;
	--shadow: 0 2px 12px rgba(32, 37, 43, 0.06);
}

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

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

body {
	margin: 0;
	font-family: var(--font-thai);
	font-size: 16px;
	line-height: 1.65;
	color: var(--color-text);
	background: var(--color-bg);
}

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

a {
	color: var(--color-green);
	text-decoration: none;
	transition: color 0.2s ease, opacity 0.2s ease;
}

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

.site-container {
	width: min(100% - 2rem, var(--container));
	margin-inline: auto;
}

/* Header */
.site-header {
	background: var(--color-header);
	border-bottom: 1px solid rgba(214, 181, 109, 0.25);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 0;
}

.site-branding a,
.footer-branding a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--color-gold);
	font-weight: 700;
	font-size: 1.25rem;
	letter-spacing: 0.02em;
}

.site-branding .custom-logo,
.site-branding .site-logo,
.footer-branding .custom-logo,
.footer-branding .site-logo {
	max-height: 52px;
	width: auto;
	max-width: min(240px, 58vw);
	height: auto;
	object-fit: contain;
}

.primary-nav {
	display: flex;
	align-items: center;
}

.primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
}

.primary-nav a {
	color: #fff;
	font-size: 0.95rem;
	font-weight: 500;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
	color: var(--color-gold);
}

.primary-nav a.nav-link--brand,
.footer-nav a.nav-link--brand {
	display: inline-block;
	padding: 0.38rem 0.95rem;
	background: transparent;
	color: var(--color-gold) !important;
	border: 1.5px solid var(--color-gold);
	border-radius: 6px;
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
	line-height: 1.25;
	box-shadow: none;
	transition:
		color 0.25s ease,
		border-color 0.25s ease,
		box-shadow 0.35s ease,
		text-shadow 0.35s ease;
}

.primary-nav a.nav-link--brand:hover,
.primary-nav a.nav-link--brand:focus-visible,
.footer-nav a.nav-link--brand:hover,
.footer-nav a.nav-link--brand:focus-visible {
	color: #f5e6b8 !important;
	border-color: #e8cc82;
	box-shadow:
		0 0 6px rgba(214, 181, 109, 0.55),
		0 0 16px rgba(214, 181, 109, 0.35),
		0 0 28px rgba(214, 181, 109, 0.2),
		inset 0 0 12px rgba(214, 181, 109, 0.12);
	text-shadow: 0 0 12px rgba(232, 204, 130, 0.85);
	opacity: 1;
}

.menu-toggle {
	display: none;
	background: transparent;
	border: 1px solid rgba(214, 181, 109, 0.5);
	color: #fff;
	padding: 0.45rem 0.75rem;
	border-radius: var(--radius);
	cursor: pointer;
	font: inherit;
}

.menu-toggle__bar {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
	margin: 4px 0;
}

/* Hero */
.hero-section {
	padding: 1rem 0 0;
	background: var(--color-bg);
}

.hero-section__frame {
	width: 100%;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border);
}

.hero-section__image {
	width: 100%;
	height: auto;
	object-fit: contain;
}

.hero-section__fallback {
	padding: 3rem 1.5rem;
	text-align: center;
	color: var(--color-text-muted);
}

.home-intro {
	padding: 1.25rem 0 0.5rem;
}

.home-intro h1 {
	margin: 0;
	font-size: clamp(1.15rem, 2.5vw, 1.5rem);
	font-weight: 600;
	line-height: 1.4;
	color: var(--color-text);
}

.home-intro p {
	margin: 0.5rem 0 0;
	color: var(--color-text-muted);
	font-size: 0.95rem;
}

/* Layout */
.content-with-sidebar {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 2rem;
	padding: 1.5rem 0 2.5rem;
	align-items: start;
}

.section-heading {
	margin: 0 0 1.25rem;
}

.section-heading h2 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
}

.section-heading p {
	margin: 0.35rem 0 0;
	color: var(--color-text-muted);
	font-size: 0.95rem;
}

/* Article grid */
.article-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}

.article-card {
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	height: 100%;
}

.article-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(32, 37, 43, 0.1);
}

.article-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
}

.article-card__link:hover {
	color: inherit;
}

.article-card__thumb {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--color-bg-secondary);
}

.article-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.article-card__body {
	padding: 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.article-card__cat {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	color: #fff;
	background: var(--color-green);
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
	margin-bottom: 0.5rem;
	align-self: flex-start;
}

.article-card__title {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--color-text);
}

.article-card__excerpt {
	margin: 0;
	font-size: 0.9rem;
	color: var(--color-text-muted);
	flex: 1;
}

.article-card__date {
	margin-top: 0.75rem;
	font-size: 0.8rem;
	color: var(--color-text-muted);
}

.btn-view-all {
	display: inline-block;
	margin-top: 1.5rem;
	padding: 0.65rem 1.25rem;
	border: 1px solid var(--color-gold);
	color: var(--color-header);
	background: transparent;
	border-radius: var(--radius);
	font-weight: 600;
	font-size: 0.95rem;
}

.btn-view-all:hover {
	background: var(--color-gold);
	color: var(--color-header);
}

/* Sidebar */
.category-sidebar {
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 1.25rem;
}

.category-sidebar h3 {
	margin: 0 0 1rem;
	font-size: 1.1rem;
}

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

.category-sidebar li {
	border-bottom: 1px solid var(--color-border);
}

.category-sidebar li:last-child {
	border-bottom: none;
}

.category-sidebar a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 0;
	color: var(--color-text);
	font-size: 0.92rem;
}

.category-sidebar a:hover {
	color: var(--color-green);
}

.category-sidebar .count {
	font-size: 0.8rem;
	color: var(--color-text-muted);
}

.category-sidebar__label {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
}

.category-sidebar__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 1.35rem;
	height: 1.35rem;
	color: var(--color-gold-dark);
}

.category-sidebar__svg {
	width: 100%;
	height: 100%;
	display: block;
}

.category-sidebar a:hover .category-sidebar__icon {
	color: var(--color-green);
}

/* Featured */
.featured-section {
	padding: 2rem 0 3rem;
	background: var(--color-bg-secondary);
	border-top: 1px solid var(--color-border);
}

.featured-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}

/* Footer */
.site-footer {
	background: var(--color-header);
	color: rgba(255, 255, 255, 0.85);
	padding: 2.5rem 0 1.5rem;
}

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

.site-footer a:hover {
	color: var(--color-gold);
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: 2rem;
}

.footer-brand .custom-logo,
.footer-brand .site-title {
	color: var(--color-gold);
	font-weight: 700;
}

.footer-desc {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.75);
	max-width: 36rem;
}

.footer-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.footer-copy {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(214, 181, 109, 0.2);
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.65);
	text-align: center;
}

/* Archive / single */
.page-header {
	padding: 2rem 0 1rem;
}

.page-header h1 {
	margin: 0;
	font-size: 1.75rem;
}

.archive-description {
	color: var(--color-text-muted);
	margin-top: 0.5rem;
	max-width: 52rem;
	line-height: 1.65;
}

.archive-posts-heading {
	margin: 0 0 1.25rem;
	font-size: 1.15rem;
	color: var(--color-green-dark);
}

.archive-empty {
	padding: 2rem 1.25rem;
	background: var(--color-bg-secondary);
	border-radius: var(--radius);
	border: 1px solid var(--color-border);
	text-align: center;
	color: var(--color-text-muted);
}

.article-card__more {
	display: inline-block;
	margin-top: 0.65rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--color-gold-dark);
}

.article-card:hover .article-card__more {
	text-decoration: underline;
}

.pangruay99-breadcrumbs {
	font-size: 0.85rem;
	color: var(--color-text-muted);
	margin-bottom: 1rem;
}

.pangruay99-breadcrumbs a {
	color: var(--color-text-muted);
}

.pangruay99-breadcrumbs .sep {
	margin: 0 0.35rem;
	opacity: 0.6;
}

.single-article {
	max-width: 760px;
	margin: 0 auto 3rem;
	padding: 0 0 2rem;
}

.single-article__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	font-size: 0.9rem;
	color: var(--color-text-muted);
	margin-bottom: 1rem;
}

.single-article__cat {
	color: var(--color-green);
	font-weight: 600;
}

.single-article h1 {
	margin: 0 0 1rem;
	font-size: clamp(1.5rem, 3vw, 2rem);
	line-height: 1.3;
}

.single-article__featured {
	margin: 1.25rem 0;
	border-radius: var(--radius);
	overflow: hidden;
}

.single-article__content {
	font-size: 1.05rem;
}

.single-article__content h2,
.single-article__content h3 {
	margin-top: 1.75rem;
}

.single-article__content p {
	margin: 0 0 1.1rem;
}

.single-article__content .pangruay99-about-note {
	margin-top: 2rem;
	padding: 1rem 1.15rem;
	background: var(--color-bg-secondary);
	border-left: 3px solid var(--color-green);
	border-radius: 0 var(--radius) var(--radius) 0;
	font-size: 0.95rem;
	color: var(--color-text-muted);
}

.single-article__content ul {
	margin: 0 0 1rem;
	padding-left: 1.35rem;
}

.single-article__content li {
	margin-bottom: 0.5rem;
}

.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--color-border);
}

.related-posts {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border);
}

.related-posts h2 {
	font-size: 1.25rem;
	margin-bottom: 1rem;
}

.pagination {
	margin: 2rem 0;
	text-align: center;
}

.pagination .nav-links {
	display: inline-flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	justify-content: center;
}

.pagination a,
.pagination span {
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	color: var(--color-text);
}

.pagination .current {
	background: var(--color-green);
	border-color: var(--color-green);
	color: #fff;
}

.page-content {
	padding: 2rem 0 3rem;
}

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

.page-content .entry-content h2 {
	margin: 2rem 0 0.85rem;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--color-text);
	line-height: 1.35;
}

.page-content .entry-content h3 {
	margin: 1.5rem 0 0.65rem;
	font-size: 1.1rem;
	font-weight: 600;
}

.page-content .entry-content h3 a {
	color: var(--color-text);
}

.page-content .entry-content h3 a:hover {
	color: var(--color-green);
}

.page-content .entry-content p {
	margin: 0 0 1rem;
}

.page-content .entry-content a {
	color: var(--color-green);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.page-content .entry-content a:hover {
	color: var(--color-gold);
}

.page-content .entry-content .pangruay99-about-note {
	margin-top: 2rem;
	padding: 1rem 1.15rem;
	background: var(--color-bg-secondary);
	border-left: 3px solid var(--color-green);
	border-radius: 0 var(--radius) var(--radius) 0;
	font-size: 0.95rem;
	color: var(--color-text-muted);
}

.page-editorial .page-header h1,
.page-about .page-header h1 {
	font-size: clamp(1.35rem, 3.2vw, 1.75rem);
	line-height: 1.35;
	max-width: 760px;
	color: #0d5c2e;
}

.page-editorial .entry-content h2,
.page-about .entry-content h2 {
	color: var(--color-green);
	border-bottom: 2px solid rgba(22, 138, 67, 0.22);
	padding-bottom: 0.4rem;
}

.page-editorial .entry-content h3,
.page-about .entry-content h3 {
	color: var(--color-green);
}

.page-editorial .entry-content h3 a,
.page-about .entry-content h3 a {
	color: var(--color-green);
	text-decoration: none;
}

.page-editorial .entry-content h3 a:hover,
.page-about .entry-content h3 a:hover {
	color: #0f6d34;
	text-decoration: underline;
}

.page-editorial .entry-content ul {
	margin: 0 0 1rem;
	padding-left: 1.35rem;
}

.page-editorial .entry-content li {
	margin-bottom: 0.55rem;
}

.pangruay99-contact-form-wrap {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border);
}

.pangruay99-contact-form__title {
	margin: 0 0 1.25rem;
	font-size: 1.35rem;
	color: var(--color-green);
	border-bottom: 2px solid rgba(22, 138, 67, 0.22);
	padding-bottom: 0.4rem;
}

.pangruay99-contact-notice {
	padding: 0.85rem 1rem;
	border-radius: var(--radius);
	margin: 0 0 1.25rem;
	font-size: 0.95rem;
}

.pangruay99-contact-notice--success {
	background: #e8f6ee;
	border: 1px solid rgba(22, 138, 67, 0.35);
	color: #0d5c2e;
}

.pangruay99-contact-notice--error {
	background: #fef2f2;
	border: 1px solid #f5c2c2;
	color: #7f1d1d;
}

.pangruay99-contact-form .pangruay99-form-field {
	margin: 0 0 1.1rem;
}

.pangruay99-contact-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
	font-size: 0.95rem;
}

.pangruay99-contact-form .required {
	color: var(--color-green);
}

.pangruay99-contact-form input[type="text"],
.pangruay99-contact-form input[type="email"],
.pangruay99-contact-form input[type="file"],
.pangruay99-contact-form select,
.pangruay99-contact-form textarea {
	width: 100%;
	max-width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	font: inherit;
	background: #fff;
}

.pangruay99-contact-form textarea {
	resize: vertical;
	min-height: 140px;
}

.pangruay99-form-hint {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.8rem;
	color: var(--color-text-muted);
}

.pangruay99-form-field--honeypot {
	position: absolute;
	left: -9999px;
	height: 0;
	overflow: hidden;
}

.pangruay99-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400;
	cursor: pointer;
}

.pangruay99-checkbox-label input {
	margin-top: 0.25rem;
	flex-shrink: 0;
}

.pangruay99-form-submit {
	cursor: pointer;
	border: none;
	margin-top: 0.25rem;
}

.error-404 {
	text-align: center;
	padding: 4rem 1rem;
}

/* Responsive */
@media (max-width: 992px) {
	.article-grid,
	.featured-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.content-with-sidebar {
		grid-template-columns: 1fr;
	}

	.category-sidebar {
		order: 2;
	}
}

@media (max-width: 768px) {
	.menu-toggle {
		display: block;
	}

	.primary-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--color-header);
		padding: 0 1rem;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
		z-index: 100;
	}

	.site-header {
		position: relative;
	}

	.site-header.is-nav-open .primary-nav {
		max-height: 320px;
		padding: 1rem;
		border-top: 1px solid rgba(214, 181, 109, 0.2);
	}

	.primary-nav ul {
		flex-direction: column;
		gap: 0.75rem;
	}

	.article-grid,
	.featured-grid {
		grid-template-columns: 1fr;
	}

	.footer-grid {
		grid-template-columns: 1fr;
	}
}
