/* ==========================================================================
   Newyoufah – components (buttons, pills, badges, menus)
   ========================================================================== */

/* ---------- Buttons ---------- */
.nyf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45em;
	min-height: 44px;
	padding: .55em 1.25em;
	border: 1px solid transparent;
	border-radius: var(--nyf-radius-pill);
	font-family: var(--nyf-font-head);
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: transform .2s var(--nyf-ease), background-color .2s, border-color .2s, color .2s;
}

.nyf-btn:active { transform: translateY(1px); }

.nyf-btn > span { position: relative; z-index: 2; }
.nyf-btn > .nyf-icon { position: relative; z-index: 2; width: 1.1em; height: 1.1em; }

.nyf-btn--gold {
	color: #000;
	border-color: rgba(255, 243, 196, .5);
}

.nyf-btn--gold:hover,
.nyf-btn--gold:focus-visible { color: #000; }

.nyf-btn--ghost {
	color: var(--nyf-text);
	background: rgba(255, 255, 255, .03);
	border-color: var(--nyf-border-gold);
}

.nyf-btn--ghost:hover,
.nyf-btn--ghost:focus-visible {
	color: var(--nyf-gold-2);
	border-color: var(--nyf-gold-4);
	background: rgba(217, 170, 63, .08);
}

.nyf-section--light .nyf-btn--ghost { color: var(--nyf-text); background: #fff; }

.nyf-btn--block { display: flex; width: 100%; }

/* ---------- Pill / badge ---------- */
.nyf-pill {
	display: inline-flex;
	align-items: center;
	gap: .35em;
	min-height: 32px;
	padding: .25em .9em;
	border-radius: var(--nyf-radius-pill);
	border: 1px solid var(--nyf-border-gold);
	color: var(--nyf-text-soft);
	font-size: .85rem;
	line-height: 1.3;
	text-decoration: none;
}

a.nyf-pill:hover { color: var(--nyf-gold-2); border-color: var(--nyf-gold-4); }

/* ---------- Primary menu (desktop row) ---------- */
.nyf-menu {
	display: flex;
	align-items: stretch;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.nyf-menu::-webkit-scrollbar { display: none; }

.nyf-menu > li > a {
	display: flex;
	align-items: center;
	gap: .5em;
	min-height: 50px;
	padding: 0 1rem;
	border-bottom: 2px solid transparent;
	color: var(--nyf-text-soft);
	font-family: var(--nyf-font-head);
	font-weight: 500;
	font-size: .975rem;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 8px 8px 0 0;
	transition: color .2s, background-color .2s, box-shadow .2s;
}

.nyf-menu .nyf-menu__icon { color: var(--nyf-gold-4); }

.nyf-menu > li > a:hover,
.nyf-menu > li > a:focus-visible {
	color: var(--nyf-gold-2);
	background: rgba(217, 170, 63, .06);
}

.nyf-menu > .current-menu-item > a,
.nyf-menu > .current-menu-ancestor > a,
.nyf-menu > .current_page_item > a {
	color: var(--nyf-gold-2);
	background: linear-gradient(180deg, rgba(217, 170, 63, 0), rgba(217, 170, 63, .14));
	border-bottom-color: var(--nyf-gold-2);
}

/* ---------- Drawer menu ---------- */
.nyf-drawer__menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nyf-drawer__menu a {
	display: flex;
	align-items: center;
	gap: .75em;
	min-height: 48px;
	padding: .5em .75em;
	border-radius: 10px;
	color: var(--nyf-text);
	font-family: var(--nyf-font-head);
	font-weight: 500;
	text-decoration: none;
}

.nyf-drawer__menu .nyf-menu__icon { color: var(--nyf-gold-4); }

.nyf-drawer__menu a:hover,
.nyf-drawer__menu .current-menu-item > a {
	background: rgba(217, 170, 63, .1);
	color: var(--nyf-gold-2);
}

.nyf-drawer__menu .sub-menu {
	list-style: none;
	margin: 0 0 0 2.25rem;
	padding: 0;
}

/* ---------- Footer menus ---------- */
.nyf-footer-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nyf-footer-menu a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	color: var(--nyf-muted);
	text-decoration: none;
}

.nyf-footer-menu a:hover { color: var(--nyf-gold-2); }

/* ---------- Widgets ---------- */
.nyf-widget { margin-bottom: 1.5rem; }
.nyf-widget ul { list-style: none; margin: 0; padding: 0; }
.nyf-widget li { padding: .25em 0; }
.nyf-widget__title { font-size: 1.1rem; }

/* ---------- Entry (generic content) ---------- */
.nyf-entry { margin-bottom: 2.5rem; }
.nyf-entry__title a { color: inherit; text-decoration: none; }
.nyf-entry__title a:hover { color: var(--nyf-gold-2); }
.nyf-entry__meta { color: var(--nyf-muted); font-size: .875rem; margin-bottom: 1rem; }
.nyf-entry__content > *:last-child { margin-bottom: 0; }

.nyf-pagination { margin-top: 28px; }
.nyf-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	justify-content: center;
}

.nyf-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 .9em;
	border: 1px solid var(--nyf-border-gold, var(--nyf-border));
	border-radius: var(--nyf-radius-pill);
	color: var(--nyf-text-soft);
	background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(0, 0, 0, .25)), var(--nyf-surface);
	font-family: var(--nyf-font-head);
	font-weight: 600;
	text-decoration: none;
	transition: border-color .2s, color .2s, box-shadow .2s;
}
.nyf-pagination a.page-numbers:hover,
.nyf-pagination a.page-numbers:focus-visible {
	border-color: var(--nyf-gold-4);
	color: var(--nyf-gold-2);
	box-shadow: 0 0 0 1px rgba(217, 170, 63, .35), 0 6px 18px rgba(217, 170, 63, .15);
}
.nyf-pagination a.page-numbers:focus-visible { outline: 2px solid var(--nyf-gold-2); outline-offset: 2px; }
/* Current page: solid gold, dark text – clearly different from the links around it */
.nyf-pagination .page-numbers.current {
	border-color: transparent;
	color: #1A1206;
	background: linear-gradient(135deg, #F7E3A3 0%, #E2B85A 45%, #B8862B 100%);
	box-shadow: 0 4px 16px rgba(217, 170, 63, .35);
	font-weight: 700;
}
.nyf-pagination .page-numbers.dots { min-width: auto; padding: 0 .3em; border: 0; background: none; }
.nyf-pagination .prev,
.nyf-pagination .next { gap: 6px; padding: 0 1.1em; color: var(--nyf-gold-2); }
.nyf-pagination .prev .nyf-icon,
.nyf-pagination .next .nyf-icon { width: 16px; height: 16px; }
@media (max-width: 479px) {
	.nyf-pagination .nav-links { gap: 6px; }
	.nyf-pagination .page-numbers { min-width: 40px; min-height: 40px; padding: 0 .7em; }
	.nyf-pagination .prev,
	.nyf-pagination .next { padding: 0 .9em; }
}

/* ==========================================================================
   Block patterns (หมวด Newyoufah)
   ========================================================================== */

/* ปุ่มทองใน block editor */
.wp-block-button.nyf-btn-gold .wp-block-button__link {
	min-height: 44px;
	padding: .7em 1.6em;
	border-radius: var(--nyf-radius-pill);
	background: linear-gradient(110deg, var(--nyf-gold-4), var(--nyf-gold-2) 30%, var(--nyf-gold-3) 50%, var(--nyf-gold-2) 70%, var(--nyf-gold-1));
	color: #000;
	font-family: var(--nyf-font-head);
	font-weight: 600;
	text-decoration: none;
}

/* ขั้นตอน 3 ขั้น */
.nyf-steps { margin-block: 2rem; }

.nyf-steps__list { gap: 20px; }

.nyf-step {
	position: relative;
	padding: 28px 22px 22px;
	text-align: center;
	background: var(--nyf-card);
	border: 1px solid var(--nyf-border);
	border-radius: var(--nyf-radius);
}

.nyf-step__num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0 auto 14px;
	border: 2px solid var(--nyf-gold-4);
	border-radius: 50%;
	box-shadow: inset 0 0 0 4px rgba(217, 170, 63, .12), 0 0 18px -6px rgba(217, 170, 63, .7);
	color: var(--nyf-gold-2);
	font-family: var(--nyf-font-head);
	font-weight: 700;
	font-size: 1.6rem;
	line-height: 1;
}

.nyf-step__title { margin-bottom: .4em; }
.nyf-step p:last-child { margin-bottom: 0; color: var(--nyf-text-soft); }

/* กล่องโปร */
.nyf-promo-box {
	margin-block: 2rem;
	padding: 28px;
	text-align: center;
	background: radial-gradient(120% 140% at 50% 0%, rgba(217, 170, 63, .16), transparent 60%), var(--nyf-card);
	border: 1px solid var(--nyf-border-gold);
	border-radius: var(--nyf-radius);
}

.nyf-promo-box__highlight {
	margin: 0;
	color: var(--nyf-gold-2);
	font-family: var(--nyf-font-head);
	font-weight: 700;
	font-size: clamp(2.5rem, 2rem + 3vw, 4rem);
	line-height: 1.1;
}

.nyf-promo-box .wp-block-buttons { justify-content: center; }

/* ตาราง VIP */
.nyf-vip-table table { border-radius: var(--nyf-radius); overflow: hidden; }
.nyf-vip-table thead th { background: rgba(217, 170, 63, .14); color: var(--nyf-gold-2); border-color: var(--nyf-border-gold); }
.nyf-vip-table td:first-child { font-family: var(--nyf-font-head); font-weight: 600; color: var(--nyf-gold-2); }

/* FAQ */
.nyf-faq { margin-block: 2rem; }

.nyf-faq__item {
	margin-bottom: 10px;
	background: var(--nyf-card);
	border: 1px solid var(--nyf-border);
	border-radius: 12px;
}

.nyf-faq__item[open] { border-color: var(--nyf-border-gold); }

.nyf-faq__item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 12px 18px;
	cursor: pointer;
	list-style: none;
	font-family: var(--nyf-font-head);
	font-weight: 500;
}

.nyf-faq__item summary::-webkit-details-marker { display: none; }

.nyf-faq__item summary::after {
	content: "+";
	flex: none;
	color: var(--nyf-gold-2);
	font-size: 1.4rem;
	line-height: 1;
	transition: transform .2s;
}

.nyf-faq__item[open] summary::after { transform: rotate(45deg); }
.nyf-faq__item > :not(summary) { padding: 0 18px 14px; margin: 0; color: var(--nyf-text-soft); }

/* CTA */
.nyf-cta {
	margin-block: 2rem;
	padding: clamp(24px, 4vw, 44px);
	text-align: center;
	background: linear-gradient(135deg, rgba(217, 170, 63, .18), rgba(10, 10, 10, 0) 60%), var(--nyf-surface);
	border: 1px solid var(--nyf-border-gold);
	border-radius: var(--nyf-radius);
}

.nyf-cta .wp-block-buttons { justify-content: center; }

/* ==========================================================================
   Shared UI (design-home-gold-v2 / design-slot-page)
   ========================================================================== */

/* Ratios */
.nyf-ratio-11 { aspect-ratio: 1 / 1; }
.nyf-ratio-34 { aspect-ratio: 3 / 4; }
.nyf-ratio-45 { aspect-ratio: 4 / 5; }
.nyf-ratio-21 { aspect-ratio: 2 / 1; }
.nyf-ratio-169 { aspect-ratio: 16 / 9; }

[class*="nyf-ratio-"] { position: relative; display: block; overflow: hidden; }
[class*="nyf-ratio-"] > img { width: 100%; height: 100%; object-fit: cover; }

.nyf-gcard__ph {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--nyf-border-gold);
	background: radial-gradient(circle at 50% 40%, #2B200B, var(--nyf-surface));
}
.nyf-gcard__ph .nyf-icon { width: 40%; height: 40%; }

/* Section header */
.nyf-sec-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
	padding: 10px 16px;
	border-radius: 10px;
	border-bottom: 1px solid var(--nyf-border);
	background: linear-gradient(90deg, rgba(217, 170, 63, .18), rgba(217, 170, 63, 0) 70%);
}

.nyf-sec-head__icon { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #1A1205; }
.nyf-sec-head__icon .nyf-icon { width: 17px; height: 17px; stroke-width: 2.2; }
.nyf-sec-head__text { min-width: 0; }
.nyf-sec-head__title { margin: 0; font-size: clamp(1.15rem, 1rem + .5vw, 1.3rem); font-weight: 600; line-height: 1.35; }
.nyf-sec-head__sub { margin: 2px 0 0; color: var(--nyf-muted); font-size: .875rem; }

.nyf-sec-head__link {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 2px;
	min-height: 44px;
	margin-left: auto;
	color: var(--nyf-gold-2);
	font-size: .875rem;
	font-weight: 600;
	text-decoration: none;
}
.nyf-sec-head__link .nyf-icon { width: 16px; height: 16px; }
.nyf-section--light .nyf-sec-head { border-bottom-color: #E4E4E4; }
.nyf-section--light .nyf-sec-head__link { color: #7A5418; }

/* Grids */
.nyf-grid { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
/* Home rows: always full rows – 6 per row on desktop, 4 on tablet, 2×2 on mobile. */
.nyf-grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nyf-grid--cards > li:nth-child(n+5) { display: none; }
@media (min-width: 600px) {
	.nyf-grid--cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
	.nyf-grid--cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.nyf-grid--cards > li:nth-child(n+5) { display: block; }
	.nyf-grid--cards > li:nth-child(n+7) { display: none; }
}
/* Customizer › ธีม Newyoufah › แบรนด์ › "จำนวนการ์ดต่อแถว (หน้าแรก, จอคอม)" = 4 or 5 */
@media (min-width: 1200px) {
	.nyf-cols-4 .nyf-grid--cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.nyf-cols-4 .nyf-grid--cards > li:nth-child(n+5) { display: none; }
	.nyf-cols-5 .nyf-grid--cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.nyf-cols-5 .nyf-grid--cards > li:nth-child(n+6) { display: none; }
}
/* Rows that show every item (count chosen in multiples of 2/4/6 → always full rows) */
.nyf-grid--cards.nyf-grid--all > li { display: block !important; }
/* Promotion lists (home, archive, "โปรโมชั่นอื่น"): 3 per row by default (2 optional), last row centred.
   Becomes a swipe slider on phones (< 768 px, 1.15 cards visible) and – via a container query – wherever a
   card would be narrower than 220 px (e.g. the home main column next to the VIP box on a 1024 px tablet). */
.nyf-promos { container-type: inline-size; }
.nyf-grid--promos {
	--nyf-pc: 3;
	--nyf-pg: 16px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--nyf-pg);
}
.nyf-promo-cols-2 .nyf-grid--promos { --nyf-pc: 2; }
.nyf-grid--promos > li { flex: 0 0 calc((100% - (var(--nyf-pc) - 1) * var(--nyf-pg)) / var(--nyf-pc)); min-width: 0; }
.nyf-promos .nyf-hscroll__btn { display: none; }
@container (max-width: 695px) {
	.nyf-promo-cols-3 .nyf-grid--promos { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.nyf-promo-cols-3 .nyf-grid--promos > li { flex: 0 0 max(220px, calc((100% - 2 * var(--nyf-pg)) / 2.4)); scroll-snap-align: start; }
}
@container (max-width: 457px) {
	.nyf-grid--promos { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.nyf-grid--promos > li { flex: 0 0 max(220px, calc((100% - var(--nyf-pg)) / 1.6)); scroll-snap-align: start; }
}
/* Home "สไลด์เลื่อน": always a slider (desktop: one row of cards per the column setting + a peek of the next). */
.nyf-promos--slider .nyf-grid--promos { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.nyf-promos--slider .nyf-grid--promos > li { flex: 0 0 max(220px, calc((100% - var(--nyf-pc) * var(--nyf-pg)) / (var(--nyf-pc) + .2))); scroll-snap-align: start; }
.nyf-grid--promos::-webkit-scrollbar { display: none; }
/* Phones: swipe one card at a time, 1.15 cards visible (no arrows – swipe). */
@media (max-width: 767px) {
	.nyf-grid--promos,
	.nyf-promo-cols-3 .nyf-grid--promos { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.nyf-grid--promos > li,
	.nyf-promo-cols-3 .nyf-grid--promos > li,
	.nyf-promos--slider .nyf-grid--promos > li { flex: 0 0 calc((100% - var(--nyf-pg)) / 1.15); scroll-snap-align: start; scroll-snap-stop: always; }
}
@media (min-width: 768px) {
	.nyf-promos.is-scrollable .nyf-hscroll__btn { display: grid; }
}
.nyf-grid--posts { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }



/* Badges */
.nyf-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 3;
	padding: 2px 8px;
	border-radius: var(--nyf-radius-pill);
	color: #000;
	font-family: var(--nyf-font-head);
	font-weight: 600;
	font-size: .6875rem;
	line-height: 1.5;
}
.nyf-badge--new { background: #3DD68C; color: #04210F; }

/* Tile (home rows) */
.nyf-gtile { display: flex; flex-direction: column; gap: 8px; color: var(--nyf-text); text-align: center; text-decoration: none; }
.nyf-gtile__media { border-radius: 12px; border-color: var(--nyf-border-strong); background: #241B0C; }
.nyf-gtile__text { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.nyf-gtile__prov { color: var(--nyf-muted); font-size: .6875rem; font-weight: 600; line-height: 1.3; }
.nyf-gtile__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: .8125rem;
	font-weight: 500;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}
.nyf-gtile:hover .nyf-gtile__name { color: var(--nyf-gold-2); }

.nyf-ptile__media {
	display: grid;
	place-items: center;
	padding: 12px;
	background: radial-gradient(120% 80% at 50% 0%, rgba(217, 170, 63, .22), transparent 60%), linear-gradient(180deg, #241B0C, #120D06);
}
.nyf-ptile__media > img.nyf-ptile__logo { width: 100%; height: auto; max-height: 60%; object-fit: contain; }
.nyf-ptile__text { font-family: var(--nyf-font-head); font-weight: 700; font-size: 1rem; text-align: center; }

/* Promo card */
.nyf-promo { display: flex; flex-direction: column; height: 100%; border-color: var(--nyf-border-strong); }
/* Image frame: 16:7 (1920×840, same file as the home slides) by default; the whole image is shown on black,
   never cropped, so text in the artwork is never cut. Ratio: Customizer › โปรโมชั่น › สัดส่วนภาพการ์ด. */
.nyf-promo__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1920 / 840;
	background: #000;
}
.nyf-promo-r-2-1 .nyf-promo__media { aspect-ratio: 2 / 1; }
.nyf-promo-r-16-9 .nyf-promo__media { aspect-ratio: 16 / 9; }
.nyf-promo-r-1-1 .nyf-promo__media { aspect-ratio: 1 / 1; }
.nyf-promo__media > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.nyf-promo-r-auto .nyf-promo__media:has(> img) { aspect-ratio: auto; }
.nyf-promo-r-auto .nyf-promo__media > img { height: auto; }
.nyf-promo__media .nyf-badge { left: 10px; right: auto; top: 10px; }
.nyf-promo__body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.nyf-promo--image .nyf-promo__body { flex: 0 0 auto; gap: 0; padding: 12px 14px 14px; }
.nyf-promo--image .nyf-promo__actions { margin-top: 0; padding-top: 0; }
.nyf-promo__hl { margin: 0; font-family: var(--nyf-font-head); font-weight: 700; font-size: 2rem; line-height: 1.1; }
.nyf-promo__title { margin: 0; font-size: 1.125rem; }
.nyf-promo__title a { color: inherit; text-decoration: none; }
.nyf-promo__title a:hover { color: var(--nyf-gold-2); }
.nyf-promo__desc { margin: 0; color: var(--nyf-text-soft); font-size: .9rem; }
.nyf-promo__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.nyf-promo__actions .nyf-btn { flex: 1 1 0; min-width: 0; }

/* Horizontal slider (home promotions "สไลด์เลื่อน"): swipe / scroll-snap, arrows, 1.2 cards visible */
.nyf-hscroll { position: relative; }
.nyf-hscroll__track {
	display: flex;
	gap: 16px;
	margin: 0;
	padding: 0 0 4px;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.nyf-hscroll__track::-webkit-scrollbar { display: none; }
.nyf-hscroll__track > li { flex: 0 0 calc((100% - 16px) / 1.2); scroll-snap-align: start; }
.nyf-hscroll__btn {
	position: absolute;
	top: calc(50% - 22px);
	z-index: 4;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--nyf-border-gold);
	border-radius: 50%;
	color: var(--nyf-gold-2);
	background: rgba(10, 8, 4, .82);
	cursor: pointer;
	transition: opacity .2s;
}
.nyf-hscroll__btn .nyf-icon { width: 20px; height: 20px; }
.nyf-hscroll__btn--prev { left: 8px; }
.nyf-hscroll__btn--next { right: 8px; }
.nyf-hscroll__btn:disabled { opacity: 0; pointer-events: none; }
.nyf-hscroll__btn:focus-visible { outline: 2px solid var(--nyf-gold-2); outline-offset: 2px; }

/* Post card */
.nyf-post-card { display: flex; flex-direction: column; height: 100%; }
/* Post covers (cards + single): ratio from Customizer › บทความ › สัดส่วนภาพปก, image fills the frame (cover). */
.nyf-post-cover { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--nyf-surface); }
.nyf-post-r-191-1 .nyf-post-cover { aspect-ratio: 1.91 / 1; }
.nyf-post-r-4-3 .nyf-post-cover { aspect-ratio: 4 / 3; }
.nyf-post-r-1-1 .nyf-post-cover { aspect-ratio: 1 / 1; }
.nyf-post-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.nyf-post-card__body { padding: 14px 16px 18px; }
.nyf-post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--nyf-muted); font-size: .8125rem; }
.nyf-pill--sm { min-height: 24px; padding: 0 10px; font-size: .75rem; }
.nyf-post-card__title { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.45; }
.nyf-post-card__title a { color: var(--nyf-text); text-decoration: none; }
.nyf-post-card__title a:hover { color: var(--nyf-gold-2); }
.nyf-post-card__excerpt { margin: 0; color: var(--nyf-text-soft); font-size: .9rem; }

/* VIP card */
.nyf-vip { overflow: hidden; border: 1px solid var(--nyf-border-gold); border-radius: 16px; background: var(--nyf-surface); box-shadow: 0 0 30px -14px rgba(243, 210, 122, .5); }
.nyf-vip__head { padding: 18px 18px 14px; text-align: center; background: linear-gradient(180deg, rgba(217, 170, 63, .16), rgba(217, 170, 63, 0)); }
.nyf-vip__kicker { margin: 0; color: var(--nyf-gold-4); font-size: .6875rem; font-weight: 600; letter-spacing: 3px; }
.nyf-vip__title { margin: 4px 0 0; font-size: 1.25rem; font-weight: 700; }
.nyf-vip__tabs { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 6px; padding: 0 12px 12px; }

.nyf-vip__tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-height: 60px;
	padding: 10px 2px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: var(--nyf-muted);
	font-size: .6875rem;
	font-weight: 600;
	line-height: 1.2;
}
.nyf-vip__tab .nyf-icon { width: 20px; height: 20px; }
.nyf-vip__tab:hover { color: var(--nyf-gold-2); }
.nyf-vip__tab[aria-selected="true"] { border-color: var(--nyf-gold-4); background: rgba(217, 170, 63, .16); color: var(--nyf-gold-2); }
.nyf-vip__panel { padding: 0 12px 14px; }
.nyf-vip__text { padding: 0 4px; color: var(--nyf-text-soft); font-size: .875rem; }
.nyf-vip__text p:last-child { margin-bottom: 10px; }

.nyf-tiers { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nyf-tier { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.nyf-tier__icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; color: #1A1205; font-family: var(--nyf-font-head); font-weight: 700; }
.nyf-tier__icon img { width: 36px; height: 36px; object-fit: contain; }
.nyf-tier__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.nyf-tier__name { font-weight: 600; font-size: .875rem; }
.nyf-tier__cond { color: var(--nyf-muted); font-size: .75rem; }
.nyf-tier__pct { font-family: var(--nyf-font-head); font-weight: 700; font-size: .95rem; }

/* Contact box */
.nyf-contact { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; text-align: center; }
.nyf-contact__title { margin: 0; font-size: 1.125rem; }
.nyf-contact .nyf-btn { border-radius: 12px; }
.nyf-contact__id { margin: 0; color: var(--nyf-gold-2); font-family: var(--nyf-font-head); }
.nyf-contact__hours { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--nyf-muted); font-size: .8125rem; }

.nyf-widgets { display: flex; flex-direction: column; gap: 16px; }
.nyf-widgets .nyf-widget,
.nyf-sidebar .nyf-widget { margin: 0; padding: 16px; border: 1px solid var(--nyf-border); border-radius: var(--nyf-radius); background: var(--nyf-surface); }
.nyf-widget h2,
.nyf-widget .wp-block-heading { font-size: 1.05rem; color: var(--nyf-gold-2); }
.nyf-widget a { text-decoration: none; }

/* Breadcrumbs + page head */
.nyf-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 4px; padding: 0; list-style: none; color: var(--nyf-muted); font-size: .8125rem; }
.nyf-breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: var(--nyf-border-gold); }
.nyf-breadcrumbs a { color: var(--nyf-muted); text-decoration: none; }
.nyf-breadcrumbs a:hover { color: var(--nyf-gold-2); }

.nyf-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.nyf-page-head__title { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.125rem); font-weight: 700; }
.nyf-page-head__intro { max-width: 70ch; margin-top: 6px; color: var(--nyf-text-soft); }
.nyf-page-head__intro p:last-child { margin: 0; }

/* Floating LINE – "typing" button (v1.8.0). 20px from the bottom-right corner (above the bottom nav on phones);
   body gets matching bottom padding so nothing is covered. Inline SVG + CSS animation only. */
.nyf-line-float {
	--nyf-lf-size: 64px;
	position: fixed;
	right: 20px;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	z-index: 80;
	display: flex;
	align-items: center;
	gap: 12px;
	pointer-events: none; /* only the button and a visible bubble take clicks */
}
body.nyf-has-line-float { padding-bottom: calc(64px + 40px + env(safe-area-inset-bottom, 0px)); }

.nyf-line-float__bob { pointer-events: auto; }
.nyf-line-float__btn {
	display: grid;
	place-items: center;
	width: var(--nyf-lf-size);
	height: var(--nyf-lf-size);
	border-radius: 50%;
	background: #06C755;
	color: #fff;
	box-shadow: 0 12px 26px -8px rgba(6, 199, 85, .65), 0 0 0 3px rgba(0, 0, 0, .35);
	transition: transform .2s ease, box-shadow .2s ease;
}
.nyf-line-float__btn:hover,
.nyf-line-float__btn:focus-visible { transform: scale(1.08); color: #fff; }
.nyf-line-float__btn:focus-visible { outline: 3px solid var(--nyf-gold-2); outline-offset: 4px; box-shadow: 0 0 0 7px rgba(12, 9, 4, .85); }
.nyf-line-float__icon { display: block; width: 58%; height: auto; overflow: visible; }
.nyf-line-float__dot { transform-box: fill-box; transform-origin: center; }

/* Speech bubble on the left: white, rounded, bottom-right corner square, pointing at the button. */
.nyf-line-float__bubble {
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: calc(100vw - var(--nyf-lf-size) - 20px - 12px - 16px);
	padding: 9px 8px 9px 14px;
	border-radius: 16px 16px 4px 16px;
	background: #fff;
	color: #111;
	box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .55);
	opacity: 0;
	visibility: hidden;
	pointer-events: auto;
	align-self: flex-end;
	margin-bottom: 6px;
}
.nyf-line-float__say { overflow: hidden; color: #111; font-family: var(--nyf-font-head); font-size: .9375rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; }
.nyf-line-float__say:hover { color: #06C755; }
.nyf-line-float__close {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #F0F0F0;
	color: #555;
	cursor: pointer;
}
.nyf-line-float__close:hover { background: #E2E2E2; color: #111; }
.nyf-line-float__close:focus-visible { outline: 3px solid var(--nyf-gold-2); outline-offset: 2px; }

/* Animation (Customizer › ติดต่อ / LINE › แอนิเมชันปุ่มลอย): float 6px / 2.4s, dots 1.2s 0.2s apart,
   bubble in–stay–out every 6s after the first-show delay. */
.nyf-line-float.is-anim .nyf-line-float__bob { animation: nyf-lf-bob 2.4s ease-in-out infinite; }
.nyf-line-float.is-anim .nyf-line-float__dot { animation: nyf-lf-dot 1.2s ease-in-out infinite; }
.nyf-line-float.is-anim .nyf-line-float__dot:nth-of-type(2) { animation-delay: .2s; }
.nyf-line-float.is-anim .nyf-line-float__dot:nth-of-type(3) { animation-delay: .4s; }
.nyf-line-float.is-anim .nyf-line-float__bubble { animation: nyf-lf-bubble 6s ease-in-out var(--nyf-bubble-delay, 3s) infinite both; }
/* Animation off: the bubble just appears after the delay and stays. */
.nyf-line-float.is-still .nyf-line-float__bubble { animation: nyf-lf-show .01s linear var(--nyf-bubble-delay, 3s) both; }
/* Hover / keyboard focus: the bubble stays visible. */
.nyf-line-float:hover .nyf-line-float__bubble,
.nyf-line-float:focus-within .nyf-line-float__bubble { animation: none; opacity: 1; visibility: visible; }
.nyf-line-float.is-closed .nyf-line-float__bubble { display: none; }

@keyframes nyf-lf-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nyf-lf-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-3.5px); } }
@keyframes nyf-lf-bubble {
	0% { opacity: 0; visibility: hidden; transform: translateX(6px); }
	8%, 58% { opacity: 1; visibility: visible; transform: none; }
	66%, 100% { opacity: 0; visibility: hidden; transform: translateX(6px); }
}
@keyframes nyf-lf-show { from { opacity: 0; visibility: hidden; } to { opacity: 1; visibility: visible; } }

@media (prefers-reduced-motion: reduce) {
	.nyf-line-float .nyf-line-float__bob,
	.nyf-line-float .nyf-line-float__dot { animation: none !important; }
	.nyf-line-float .nyf-line-float__bubble { animation: none !important; opacity: 1; visibility: visible; transform: none; }
	.nyf-line-float__btn { transition: none; }
	.nyf-line-float__btn:hover,
	.nyf-line-float__btn:focus-visible { transform: none; }
}

@media (max-width: 899px) {
	.nyf-line-float { --nyf-lf-size: 56px; }
	.nyf-has-bottom-nav .nyf-line-float { bottom: calc(var(--nyf-bottom-nav-h) + 20px + env(safe-area-inset-bottom, 0px)); }
	body.nyf-has-line-float { padding-bottom: calc(56px + 40px + env(safe-area-inset-bottom, 0px)); }
	body.nyf-has-bottom-nav.nyf-has-line-float { padding-bottom: calc(var(--nyf-bottom-nav-h) + 56px + 40px + env(safe-area-inset-bottom, 0px)); }
	.nyf-line-float__say { font-size: .875rem; }
}

/* Search form */
.nyf-search { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 6px 0 18px; border: 1px solid var(--nyf-border-strong); border-radius: var(--nyf-radius-pill); background: var(--nyf-surface); }
.nyf-search .nyf-icon { color: var(--nyf-gold-4); }
.nyf-search input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: none; background: transparent; color: var(--nyf-text); font-size: .95rem; }
.nyf-search input::placeholder { color: #93805A; }
.nyf-search input:focus-visible { outline: none; }
.nyf-search:focus-within { border-color: var(--nyf-gold-4); box-shadow: 0 0 0 2px rgba(243, 210, 122, .35); }
.nyf-search .nyf-btn { min-height: 36px; padding-inline: 1em; }

/* ---------- Widgets (classic + block) in every sidebar ---------- */
.nyf-widget .wp-block-search__label { display: block; margin-bottom: 8px; color: var(--nyf-gold-2); font-family: var(--nyf-font-head); font-weight: 600; }
.nyf-widget .wp-block-search__inside-wrapper { display: flex; gap: 6px; }
.nyf-widget .wp-block-search__input,
.nyf-widget input[type="search"] { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--nyf-border-strong); border-radius: var(--nyf-radius-pill); background: var(--nyf-bg); color: var(--nyf-text); }
.nyf-widget .wp-block-search__button,
.nyf-widget button[type="submit"] { min-height: 44px; margin: 0; padding: 0 16px; border: 0; border-radius: var(--nyf-radius-pill); background: linear-gradient(110deg, var(--nyf-gold-4), var(--nyf-gold-2)); color: #1A1205; font-weight: 600; }
.nyf-widget ul,
.nyf-widget ol { margin: 0; padding: 0; list-style: none; }
.nyf-widget li { padding: 7px 0; border-bottom: 1px dashed var(--nyf-border); }
.nyf-widget li:last-child { border-bottom: 0; }
.nyf-widget li a { color: var(--nyf-text-soft); }
.nyf-widget li a:hover { color: var(--nyf-gold-2); }
.nyf-widget .wp-block-group > :last-child,
.nyf-widget > :last-child { margin-bottom: 0; }
.nyf-widget .no-comments,
.nyf-widget .wp-block-latest-comments { color: var(--nyf-muted); font-size: .875rem; }

/* ---------- Comments ---------- */
.nyf-comments { margin-top: 32px; padding: 22px; }
.nyf-comments__list { margin: 0 0 20px; padding: 0; list-style: none; }
.nyf-comments .comment-body { padding: 12px 0; border-bottom: 1px solid var(--nyf-border); }
.nyf-comments textarea,
.nyf-comments input[type="text"],
.nyf-comments input[type="email"],
.nyf-comments input[type="url"] { width: 100%; padding: 10px 14px; border: 1px solid var(--nyf-border-strong); border-radius: 12px; background: var(--nyf-bg); color: var(--nyf-text); }
.nyf-comments label { display: block; margin-bottom: 4px; color: var(--nyf-muted); font-size: .875rem; }
