/* ===== UFA Portal (custom จาก Skeleton Portal) ===== */
:root {
	--accent: #2dd4bf;
	--bg: #0b1620;
	--on-accent: #06121a;
	--surface: color-mix(in srgb, var(--bg) 88%, #fff 8%);
	--surface-2: color-mix(in srgb, var(--bg) 94%, #fff 3%);
	--line: color-mix(in srgb, #fff 14%, transparent);
	--text: #eef2f6;
	--muted: #a9b4bf;
	--radius: 16px;
	--wrap: 1120px;
	--bar-h: 62px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.75 "Noto Sans Thai", "Sarabun", "Prompt", system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.center { text-align: center; }

/* ----- Topbar (18+) ----- */
.topbar { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; }
.topbar__age { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 12px; }
.topbar__close { background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; }
.topbar.is-hidden { display: none; }

/* ----- Nav ----- */
.site-nav { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 2px solid var(--accent); }
.site-nav__inner { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.site-nav__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.site-nav__brand:hover { text-decoration: none; }
.site-nav__mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); transform: rotate(45deg); }
.site-nav__logo { max-height: 44px; width: auto; }
.site-nav__name { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.site-nav__menu { margin-left: auto; }
.menu { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 8px 13px; border-radius: 999px; color: var(--muted); font-size: 15px; }
.menu a:hover, .menu .current-menu-item > a { color: var(--text); background: var(--surface); text-decoration: none; }
.menu li { position: relative; }
.menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { display: block; }
.site-nav__cta { padding: 9px 20px; font-size: 15px; white-space: nowrap; }

.burger { display: none; margin-left: auto; width: 46px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; padding: 11px 12px; flex-direction: column; justify-content: space-between; }
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* ----- Drawer ----- */
.drawer { position: fixed; inset: 0; z-index: 100; background: #000b; }
.drawer[hidden] { display: none; }
.drawer__panel { position: absolute; inset: 0 24% 0 0; background: var(--bg); border-right: 2px solid var(--accent); padding: 64px 24px 24px; overflow-y: auto; animation: slideIn .25s ease; }
.drawer__close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: var(--text); font-size: 32px; cursor: pointer; }
.drawer__menu { list-style: none; margin: 0; padding: 0; }
.drawer__menu a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.drawer__menu .sub-menu { list-style: none; padding-left: 16px; }
@keyframes slideIn { from { transform: translateX(-100%); } }

/* ----- Buttons ----- */
.btn { display: inline-block; text-align: center; padding: 14px 26px; border-radius: 12px; font-weight: 700; font-size: 17px; line-height: 1.3; transition: transform .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--solid { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 20px -8px var(--accent); }
.btn--ghost { border: 2px solid var(--line); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); }
.btn--inline { display: inline-block; margin-top: 8px; }

/* ----- Hero ----- */
.hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 64px 0 56px;
	background:
		radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
		linear-gradient(180deg, var(--bg), var(--surface-2));
}
.hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero--has-bg::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0009, var(--bg)); }
.hero__inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; }
.hero__eyebrow { margin: 0 0 8px; color: var(--accent); font-weight: 600; letter-spacing: .04em; font-size: 15px; }
.hero h1 { margin: 0 0 16px; font-size: clamp(28px, 4.6vw, 46px); line-height: 1.25; }
.hero__lead { margin: 0 0 24px; color: var(--muted); font-size: 18px; max-width: 60ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

.checklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 24px 60px -30px #000; }
.checklist__title { margin: 0 0 12px; font-weight: 700; font-size: 18px; }
.checklist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 34px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; }

/* ----- Marquee ----- */
.marquee { overflow: hidden; background: var(--surface); border-block: 1px solid var(--line); color: var(--text); }
.marquee__track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee__track span { padding: 8px 48px; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ----- Sections ----- */
.band { padding: 60px 0; }
.band--steps, .band--faq, .band--2, .band--4 { background: var(--surface-2); }
.band--seo { border-block: 1px solid var(--line); }
.section-title { text-align: left; font-size: clamp(22px, 3vw, 30px); font-weight: 700; line-height: 1.35; margin: 0 0 24px; padding-left: 16px; border-left: 5px solid var(--accent); }
* + .section-title { margin-top: 44px; }
.band > .wrap > .section-title:first-child, .band .about > div > .section-title:first-child { margin-top: 0; }

.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.about p { color: var(--muted); }
.about__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.about__card-title { margin: 0 0 10px; font-weight: 700; color: var(--accent); }
.about__card ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); margin-top: 24px; }

/* ----- Steps ----- */
.steps { list-style: none; counter-reset: step; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps__item { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 56px 20px 22px; }
.steps__item::before { content: counter(step); position: absolute; top: 16px; left: 20px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.steps__title { margin: 0 0 8px; font-size: 18px; line-height: 1.4; }
.steps__item p { margin: 0; color: var(--muted); font-size: 15px; }

/* ----- Tiles ----- */
.tile { display: block; color: var(--text); border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); transition: transform .2s, border-color .2s; }
a.tile:hover { text-decoration: none; transform: translateY(-4px); border-color: var(--accent); }
.tile__media { display: block; aspect-ratio: 3 / 2; background: var(--surface-2); }
.tile__media img { width: 100%; height: 100%; object-fit: cover; }
.tile__ph { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
.tile__label { display: block; padding: 12px 14px; font-weight: 600; }
.tile--logo { background: none; border: 0; }
.tile--logo .tile__media { aspect-ratio: 5 / 2; background: none; }
.tile--logo img { object-fit: contain; }
.tile--feature { display: grid; grid-template-columns: 40% 1fr; }
.tile--feature .tile__media { aspect-ratio: auto; min-height: 140px; }
.tile__body { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.tile__body span { color: var(--muted); font-size: 14px; }
.tile__title { margin: 0; font-size: 17px; font-weight: 700; color: var(--accent); line-height: 1.4; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; }
	.marquee__track { animation: none; }
}

/* ----- Responsible / ticks ----- */
.band--responsible { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); border-block: 1px solid var(--line); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; color: var(--text); }
.ticks li::before { content: "!"; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 13px; line-height: 1; }

/* ----- FAQ ----- */
.faq { display: grid; gap: 12px; }
.faq__item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; }
.faq__item[open] { border-color: var(--accent); }
.faq__item summary { cursor: pointer; padding: 16px 28px 16px 0; font-weight: 600; list-style: none; position: relative; color: var(--text); }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%; color: var(--accent); font-size: 24px; }
.faq__item[open] summary::after { content: "–"; }
.faq__item p { margin: 0 0 18px; color: var(--muted); }

/* ----- CTA ----- */
.band--cta { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, var(--bg)), var(--bg)); border-top: 1px solid var(--line); }
.cta__title { margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); }
.band--cta p { color: var(--muted); margin: 0 0 16px; }

/* ----- Video & banner ----- */
.video { aspect-ratio: 16 / 9; margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.video iframe, .video video, .video .wp-video { width: 100% !important; height: 100% !important; }
.banner img { width: 100%; }

/* ----- Carousel ----- */
.carousel { position: relative; }
.carousel__track { display: grid; grid-auto-flow: column; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 4px; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * { scroll-snap-align: start; }
.carousel__track--3 { grid-auto-columns: calc((100% - 32px) / 3); }
.carousel__track--6 { grid-auto-columns: calc((100% - 80px) / 6); }
.carousel__btn { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; }
.carousel__btn--prev { left: -12px; }
.carousel__btn--next { right: -12px; }

/* ----- Prose ----- */
.prose { max-width: 860px; color: var(--muted); }
.prose h1, .prose h2, .prose h3 { color: var(--text); }
.prose__thumb { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.entry-content a { color: var(--accent); }

/* ----- Footer ----- */
.site-footer { border-top: 2px solid var(--accent); background: var(--surface-2); padding: 44px 0 calc(28px + var(--bar-h)); font-size: 15px; color: var(--muted); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 28px; }
.site-footer__about p { margin: 0 0 6px; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-menu a { color: var(--muted); }
.footer-menu a:hover { color: var(--accent); }
.footer-title { margin: 0 0 10px; color: var(--text); font-weight: 700; }
.site-footer__logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 28px; }
.site-footer__logos img { height: 32px; width: auto; opacity: .85; }
.site-footer__legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.disclaimer { margin: 0 0 10px; font-size: 14px; line-height: 1.7; }
.disclaimer strong { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.copyright { margin: 0; font-size: 14px; }

/* ----- Mobile bar (pill ลอย) ----- */
.mobile-bar { display: none; position: fixed; inset: auto 10px 10px; z-index: 60; height: var(--bar-h); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px -10px #000; overflow: hidden; }
.mobile-bar__menu { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 100%; list-style: none; margin: 0; padding: 0; }
.mobile-bar__menu a { display: grid; place-items: center; height: 100%; color: var(--text); font-weight: 600; font-size: 14px; text-align: center; padding: 4px; line-height: 1.2; }
.mobile-bar__menu a:hover { text-decoration: none; }
.mobile-bar__menu .is-primary a, .mobile-bar__menu li:nth-child(2) a { background: var(--accent); color: var(--on-accent); }

/* ----- To top ----- */
.to-top { position: fixed; right: 16px; bottom: calc(var(--bar-h) + 24px); z-index: 55; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ----- Popup ----- */
.popup { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #000c; padding: 16px; }
.popup[hidden] { display: none; }
.popup__box { position: relative; max-width: 560px; background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px; text-align: center; }
.popup__close { position: absolute; top: -16px; right: -16px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: 22px; cursor: pointer; }

/* ----- Responsive ----- */
@media (max-width: 960px) {
	.site-nav__menu, .site-nav__cta { display: none; }
	.burger { display: flex; }
	.hero__inner, .about { grid-template-columns: 1fr; }
	.steps { grid-template-columns: repeat(2, 1fr); }
	.grid--4 { grid-template-columns: repeat(2, 1fr); }
	.carousel__track--6 { grid-auto-columns: calc((100% - 32px) / 3); }
	.site-footer__grid { grid-template-columns: repeat(2, 1fr); }
	.mobile-bar { display: block; }
}
@media (min-width: 961px) {
	.site-footer { padding-bottom: 32px; }
	.to-top { bottom: 24px; }
}
@media (max-width: 600px) {
	body { font-size: 16px; }
	.grid--3, .grid--2, .steps { grid-template-columns: 1fr; }
	.tile--feature { grid-template-columns: 1fr; }
	.carousel__track--3 { grid-auto-columns: 85%; }
	.site-footer__grid { grid-template-columns: 1fr; }
	.hero { padding: 40px 0 36px; }
	.hero__cta .btn { flex: 1 1 100%; }
}

/* ----- SEO / a11y helpers ----- */
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }
.skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; margin: 0; padding: 10px 16px; top: 8px; left: 8px; z-index: 1000; background: var(--accent); color: var(--on-accent); border-radius: 8px; }
.breadcrumbs { padding: 14px 0 0; font-size: 14px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .separator { margin: 0 6px; opacity: .6; }
.is-placeholder { opacity: .6; font-style: italic; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: -8px 0 24px; font-size: 14px; color: var(--muted); }
.error-404 { text-align: center; padding: 80px 0; }
.error-404 .search-form { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.search-field { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.search-submit { padding: 10px 18px; border-radius: 10px; border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer; font-weight: 700; }
.pagination { margin-top: 28px; }
.pagination .page-numbers { display: inline-block; padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.pagination .current { background: var(--accent); color: var(--on-accent); }
