/* ==========================================================================
   Newyoufah – layout: container, header, drawer, footer, bottom nav
   ========================================================================== */

.nyf-container {
	width: 100%;
	max-width: var(--nyf-container);
	margin-inline: auto;
	padding-inline: var(--nyf-gutter);
}

.nyf-main {
	display: block;
	min-height: 50vh;
	outline: none;
}

.nyf-page {
	padding-block: clamp(24px, 4vw, 48px);
}

/* ---------- Top bar ---------- */
.nyf-topbar {
	background: #070502;
	border-bottom: 1px solid var(--nyf-border);
	color: var(--nyf-muted);
	font-size: .8125rem;
}

.nyf-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	text-align: center;
}

.nyf-topbar__text { margin: 0; }

/* ---------- Header (2 ชั้น) ---------- */
.nyf-header {
	position: relative;
	z-index: 100;
	background: rgba(15, 11, 5, .97);
	transition: box-shadow .25s, background-color .25s;
}

@supports (backdrop-filter: blur(8px)) {
	.nyf-header {
		background: rgba(15, 11, 5, .86);
		backdrop-filter: saturate(140%) blur(10px);
	}
}

.nyf-sticky-header .nyf-header {
	position: sticky;
	top: 0;
}

.admin-bar.nyf-sticky-header .nyf-header { top: 32px; }

@media (max-width: 782px) {
	.admin-bar.nyf-sticky-header .nyf-header { top: 46px; }
}

@media (max-width: 600px) {
	.admin-bar.nyf-sticky-header .nyf-header { top: 0; }
}

.nyf-header.is-scrolled { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .9); }

/* เส้นทอง hairline จางที่ปลาย */
.nyf-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--nyf-gold-1) 15%, var(--nyf-gold-2) 50%, var(--nyf-gold-1) 85%, transparent);
	opacity: .7;
	pointer-events: none;
}

.nyf-header__row {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
	min-height: var(--nyf-header-h);
}

.nyf-header__burger,
.nyf-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--nyf-border);
	border-radius: 12px;
	background: var(--nyf-surface);
	color: var(--nyf-gold-2);
}

.nyf-header__burger:hover,
.nyf-drawer__close:hover { border-color: var(--nyf-border-gold); }

.nyf-header__burger .nyf-icon,
.nyf-drawer__close .nyf-icon { width: 22px; height: 22px; }

.nyf-brand { display: flex; align-items: center; min-width: 0; }

.nyf-brand .custom-logo-link { display: inline-flex; }

.nyf-brand .custom-logo {
	width: auto;
	max-height: 44px;
}

.nyf-brand--footer .custom-logo { max-height: 56px; }

.nyf-brand__text {
	font-family: var(--nyf-font-head);
	font-weight: 700;
	font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
	letter-spacing: .02em;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nyf-auth {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nyf-header__nav {
	border-top: 1px solid var(--nyf-line);
	background: #120D06;
}

.nyf-header__nav .nyf-menu { justify-content: center; }

@media (max-width: 899px) {
	.nyf-header__nav { display: none; }

	.nyf-auth--header .nyf-btn {
		padding-inline: .9em;
		font-size: .875rem;
	}

	.nyf-auth--header .nyf-btn > .nyf-icon { display: none; }
}

@media (max-width: 400px) {
	.nyf-header__row { gap: 8px; }
	.nyf-auth--header { gap: 6px; }
	.nyf-auth--header .nyf-btn { padding-inline: .7em; font-size: .8125rem; }
}

/* ---------- Drawer ---------- */
.nyf-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
}

.nyf-drawer[hidden] { display: none; }

.nyf-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .7);
	opacity: 0;
	transition: opacity .25s;
}

.nyf-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	width: min(340px, 86vw);
	padding: 16px;
	overflow-y: auto;
	background: var(--nyf-surface);
	border-right: 1px solid var(--nyf-border-gold);
	transform: translateX(-100%);
	transition: transform .28s var(--nyf-ease);
}

.nyf-drawer.is-open .nyf-drawer__backdrop { opacity: 1; }
.nyf-drawer.is-open .nyf-drawer__panel { transform: none; }

.nyf-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--nyf-border);
}

.nyf-auth--drawer { flex-direction: column; align-items: stretch; }
.nyf-auth--drawer .nyf-btn { width: 100%; }

/* ---------- Footer ---------- */
.nyf-footer {
	position: relative;
	margin-top: clamp(32px, 6vw, 64px);
	background: #070502;
	color: var(--nyf-muted);
	font-size: .9375rem;
}

.nyf-footer::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--nyf-gold-1) 15%, var(--nyf-gold-2) 50%, var(--nyf-gold-1) 85%, transparent);
}

.nyf-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
	padding-block: 40px 28px;
}

@media (min-width: 768px) {
	.nyf-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
	.nyf-footer__grid.has-widgets { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
}

.nyf-footer__desc { margin-top: 1rem; max-width: 46ch; }
.nyf-footer__desc p:last-child { margin-bottom: 0; }

.nyf-footer__heading {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: .75rem;
	color: var(--nyf-gold-2);
}

.nyf-footer__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0 0 24px;
	list-style: none;
}

.nyf-footer__badges img { max-height: 40px; width: auto; }

.nyf-footer__bottom {
	border-top: 1px solid var(--nyf-border);
	padding-block: 18px;
	font-size: .875rem;
}

.nyf-footer__bottom .nyf-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
}

.nyf-footer__bottom p { margin: 0; }

.nyf-age-notice {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	color: var(--nyf-text-soft);
	font-weight: 500;
}

.nyf-age-notice .nyf-icon { color: var(--nyf-gold-4); }

.nyf-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
}

.nyf-footer__responsible { color: var(--nyf-gold-2); }

/* ---------- Mobile bottom nav ---------- */
.nyf-bottom-nav { display: none; }

@media (max-width: 899px) {
	.nyf-has-bottom-nav { padding-bottom: calc(var(--nyf-bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }

	.nyf-bottom-nav {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		background: rgba(10, 10, 10, .97);
		border-top: 1px solid var(--nyf-border-gold);
	}

	.nyf-bottom-nav__list {
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: 1fr;
		margin: 0;
		padding: 0;
		list-style: none;
		height: var(--nyf-bottom-nav-h);
	}

	.nyf-bottom-nav__list a {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		height: 100%;
		min-height: 44px;
		color: var(--nyf-muted);
		font-size: .75rem;
		line-height: 1.2;
		text-decoration: none;
	}

	.nyf-bottom-nav__list .nyf-menu__icon { width: 24px; height: 24px; color: var(--nyf-gold-4); }

	.nyf-bottom-nav__list .current-menu-item > a,
	.nyf-bottom-nav__list a:hover { color: var(--nyf-gold-2); }
}
