/* ==========================================================================
   Newyoufah – base: design tokens, reset, typography, utilities
   ค่าใน :root ถูกเขียนทับได้จาก Customizer (inline style หลังไฟล์นี้)
   ========================================================================== */

:root {
	/* พื้น (ดำ) */
	--nyf-bg: #0C0904;
	--nyf-surface: #140F07;
	--nyf-card: #1A1409;
	--nyf-border: #3D2E14;
	--nyf-border-gold: #7A5D26;

	/* ตัวอักษร (ขาว) */
	--nyf-text: #F7EDD6;
	--nyf-text-soft: #D9C8A0;
	--nyf-muted: #BFA97C;

	/* ทอง */
	--nyf-gold-1: #9A6E22;
	--nyf-gold-2: #F3D27A;
	--nyf-gold-3: #FFF3C4;
	--nyf-gold-4: #D9AA3F;
	--nyf-accent: #D9AA3F;

	/* ทองสำหรับตัวอักษร (โหมดสว่างจะเขียนทับให้เข้มขึ้น) */
	--nyf-gt-1: var(--nyf-gold-4);
	--nyf-gt-2: var(--nyf-gold-2);
	--nyf-gt-3: var(--nyf-gold-3);
	--nyf-gt-4: var(--nyf-gold-4);
	--nyf-link: var(--nyf-gold-2);

	/* อื่นๆ */
	--nyf-radius: 14px;
	--nyf-radius-pill: 999px;
	--nyf-font-head: 'Kanit', sans-serif;
	--nyf-font-body: 'IBM Plex Sans Thai', sans-serif;

	--nyf-container: 1280px;
	--nyf-gutter: clamp(16px, 3vw, 24px);
	--nyf-header-h: 64px;
	--nyf-bottom-nav-h: 64px;
	--nyf-header-bg: #0F0B05;
	--nyf-line: #2E2310;
	--nyf-border-strong: #4A3817;
	--nyf-shadow-gold: 0 10px 30px -10px rgba(217, 170, 63, .45);
	--nyf-ease: cubic-bezier(.22, .61, .36, 1);
}

/* Section สีขาว (เลือกได้ต่อ section) – ทองเข้ม #9A6E22 เพื่อให้คอนทราสต์ผ่าน AA */
.nyf-section--light {
	--nyf-bg: #FFFFFF;
	--nyf-surface: #F6F6F6;
	--nyf-card: #FFFFFF;
	--nyf-border: #E4E4E4;
	--nyf-border-gold: #C9A55A;
	--nyf-text: #111111;
	--nyf-text-soft: #2B2B2B;
	--nyf-muted: #555555;
	--nyf-accent: #9A6E22;
	--nyf-gt-1: #7A5418;
	--nyf-gt-2: #9A6E22;
	--nyf-gt-3: #B0812A;
	--nyf-gt-4: #7A5418;
	--nyf-link: #7A5418;
	background: var(--nyf-bg);
	color: var(--nyf-text);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

html.nyf-lock { overflow: hidden; }

body {
	margin: 0;
	background: var(--nyf-bg);
	color: var(--nyf-text);
	font-family: var(--nyf-font-body);
	font-size: 1rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe { max-width: 100%; height: auto; display: block; }

img { border-style: none; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--nyf-font-head);
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 .6em;
	color: var(--nyf-text);
}

h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); font-weight: 700; }
h2 { font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 1rem + .6vw, 1.375rem); }
h4 { font-size: 1.125rem; }

p,
ul,
ol,
figure,
blockquote,
table { margin: 0 0 1.1em; }

a {
	color: var(--nyf-link);
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

a:hover { color: var(--nyf-gold-3); }
.nyf-section--light a:hover { color: #5A3D0E; }

strong, b { font-weight: 600; }

hr {
	border: 0;
	height: 1px;
	margin: 2rem 0;
	background: linear-gradient(90deg, transparent, var(--nyf-border-gold), transparent);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: .6em .8em; border: 1px solid var(--nyf-border); text-align: left; }
th { background: var(--nyf-surface); font-family: var(--nyf-font-head); font-weight: 500; }

/* Table block in posts / pages: black-gold (core "stripes" style uses a light grey row that hides light text) */
.wp-block-table { margin: 0 0 1.4em; overflow-x: auto; }
.wp-block-table table { min-width: 100%; border: 1px solid var(--nyf-border-gold, var(--nyf-border)); border-radius: var(--nyf-radius, 12px); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.wp-block-table th,
.wp-block-table td { border: 0; border-bottom: 1px solid var(--nyf-border); color: var(--nyf-text); vertical-align: top; }
.wp-block-table thead th { background: rgba(217, 170, 63, .14); color: var(--nyf-gold-2); border-bottom: 1px solid var(--nyf-border-gold, var(--nyf-border)); font-weight: 600; }
.wp-block-table tbody tr:last-child td { border-bottom: 0; }
.wp-block-table.is-style-stripes { border-bottom: 0; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: rgba(255, 255, 255, .035); }
.wp-block-table.is-style-stripes tbody tr:nth-child(even) { background: transparent; }
.wp-block-table td:first-child { color: var(--nyf-gold-2); font-weight: 600; }
.wp-block-table figcaption,
.wp-block-table .wp-element-caption { margin-top: .5em; color: var(--nyf-muted); font-size: .8125rem; text-align: center; }
@media (max-width: 599px) {
	.wp-block-table th,
	.wp-block-table td { padding: .55em .6em; font-size: .875rem; }
}

/* ---------- Focus ---------- */
/* Clear gold focus ring for keyboard users (dark halo keeps it visible on gold buttons too). */
:focus-visible {
	outline: 3px solid var(--nyf-gold-2);
	outline-offset: 3px;
	box-shadow: 0 0 0 6px rgba(12, 9, 4, .85);
}

:focus:not(:focus-visible) { outline: none; }

.nyf-section--light :focus-visible { outline-color: #7A5418; }

/* ---------- Utilities ---------- */
.screen-reader-text,
.nyf-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.nyf-skip-link {
	position: absolute;
	left: 12px;
	top: -100px;
	z-index: 1000;
	padding: 10px 16px;
	border-radius: var(--nyf-radius-pill);
	background: var(--nyf-gold-2);
	color: #000;
	font-weight: 600;
	text-decoration: none;
}

.nyf-skip-link:focus { top: 12px; }

.nyf-icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	display: inline-block;
	vertical-align: middle;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text,
figcaption { color: var(--nyf-muted); font-size: .875rem; }
.sticky,
.bypostauthor,
.gallery-caption { /* required by Theme Check */ }
