/*
Theme Name: HahaXGG
Theme URI: https://hahaxgg.xyz
Description: Landing page และบล็อกสำหรับเซิร์ฟ RO Thai 5.0 Classic
Author: hahaxgg.xyz
Version: 1.0.0
Requires PHP: 8.1
Text Domain: hahaxgg
*/

:root {
  --bg: #0b1426;
  --bg-2: #0f1b33;
  --surface: #13213d;
  --surface-2: #1a2b4d;
  --line: rgba(148, 170, 214, .16);
  --text: #eef2fa;
  --muted: #a3b0c8;
  --gold: #f2b53a;
  --gold-2: #ffd574;
  --blue: #5aa2ff;
  --green: #42d392;
  --radius: 14px;
  --wrap: 1160px;
  --head: "Kanit", "Sarabun", system-ui, sans-serif;
  --body: "Sarabun", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.75 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.25; margin: 0 0 .5em; font-weight: 600; text-wrap: balance; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--gold); color: #111; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; font: 600 16px/1.2 var(--head);
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #231703; box-shadow: 0 6px 24px rgba(242, 181, 58, .28); }
.btn-gold:hover { box-shadow: 0 10px 30px rgba(242, 181, 58, .4); }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: #fff; background: rgba(11, 20, 38, .35); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { padding: 8px 18px; font-size: 15px; }
.btn-lg { padding: 15px 32px; font-size: 18px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11, 20, 38, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand img { width: 40px; height: 40px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--head); }
.brand strong { font-size: 18px; font-weight: 600; }
.brand small { color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.nav-list { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: var(--muted); font: 500 15px var(--head); }
.nav-list a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line); display: none; }
  .site-nav.open { display: flex; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .site-nav .btn { margin-top: 14px; }
}

/* hero */
.hero { position: relative; min-height: min(88vh, 760px); display: grid; align-items: end; isolation: isolate; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11, 20, 38, .92) 0%, rgba(11, 20, 38, .55) 45%, rgba(11, 20, 38, 0) 75%), linear-gradient(0deg, var(--bg) 0%, rgba(11, 20, 38, 0) 35%); }
.hero-inner { padding: 120px 16px 80px; }
.hero-copy { max-width: 620px; }
.eyebrow { display: inline-block; color: var(--gold); font: 600 13px var(--head); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 700; margin-bottom: 16px; text-shadow: 0 2px 20px rgba(0, 0, 0, .45); }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero .lead { font-size: clamp(17px, 2.2vw, 20px); color: #dbe3f2; max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.hero-badges li { font-size: 14px; color: #e6ecf7; background: rgba(11, 20, 38, .55); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; backdrop-filter: blur(4px); }
@media (max-width: 700px) {
  .hero { min-height: 0; }
  .hero::after { background: linear-gradient(0deg, var(--bg) 8%, rgba(11, 20, 38, .72) 55%, rgba(11, 20, 38, .35) 100%); }
  .hero-inner { padding: 180px 16px 48px; }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: -8px; }
.stats div { background: var(--bg-2); padding: 20px; text-align: center; }
.stats strong { display: block; font: 700 28px var(--head); color: var(--gold-2); }
.stats span { color: var(--muted); font-size: 15px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } .stats strong { font-size: 24px; } }

/* sections */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { font-size: clamp(26px, 4vw, 38px); }
.section-head p { color: var(--muted); font-size: 18px; }
@media (max-width: 700px) { .section { padding: 56px 0; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 24px; transition: border-color .2s, transform .2s; }
.feature:hover { border-color: rgba(242, 181, 58, .45); transform: translateY(-2px); }
.feature .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, rgba(242, 181, 58, .22), rgba(90, 162, 255, .18)); margin-bottom: 14px; }
.feature h3 { font-size: 20px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 16px; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; overflow: visible; padding: 26px 24px 24px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; top: -16px; left: 22px; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #231703; font: 700 17px/34px var(--head); text-align: center; }
.steps h3 { font-size: 20px; margin-top: 6px; }
.steps p { color: var(--muted); margin: 0; font-size: 16px; }
.steps img { border-radius: 10px; margin-top: 16px; border: 1px solid var(--line); width: 100%; image-rendering: auto; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 30px; } }

/* split */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.split.rev .split-media { order: -1; }
.split-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.split-media img { width: 100%; }
.checks { list-style: none; padding: 0; margin: 0 0 24px; }
.checks li { padding-left: 30px; position: relative; margin-bottom: 10px; color: #d5ddec; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } .split.rev .split-media { order: 0; } }

/* event banner */
.event { position: relative; border-radius: 20px; overflow: hidden; padding: 48px; background: radial-gradient(120% 140% at 100% 0%, rgba(220, 60, 40, .45), transparent 55%), linear-gradient(135deg, #2a1024, #16213f); border: 1px solid rgba(255, 140, 90, .3); display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.event h2 { font-size: clamp(26px, 4vw, 40px); }
.event .when { display: inline-flex; gap: 8px; align-items: center; background: rgba(0, 0, 0, .3); border-radius: 999px; padding: 6px 14px; font: 600 15px var(--head); color: #ffcf9e; margin-bottom: 14px; }
.event p { color: #e5d8e6; }
.event-art { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.event-art div { aspect-ratio: 1; border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .08); display: grid; place-items: center; font-size: 42px; text-align: center; }
.event-art small { display: block; font: 500 13px var(--head); color: #ffd9c2; margin-top: 4px; }
@media (max-width: 860px) { .event { grid-template-columns: 1fr; padding: 28px 20px; } }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery figcaption { padding: 8px 12px; font-size: 14px; color: var(--muted); }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* posts */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card { display: flex; flex-direction: column; transition: transform .2s, border-color .2s; }
.post-card:hover { transform: translateY(-3px); border-color: rgba(242, 181, 58, .4); }
.post-card .thumb { display: block; aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .thumb img { transform: scale(1.04); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 19px; margin: 8px 0; }
.card-body h3 a { color: var(--text); }
.card-body p { color: var(--muted); font-size: 15px; flex: 1; }
.meta { color: var(--muted); font-size: 14px; }
.tag { display: inline-block; align-self: flex-start; font: 600 12px var(--head); letter-spacing: .06em; color: var(--gold); background: rgba(242, 181, 58, .12); border-radius: 6px; padding: 3px 9px; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.more-link { text-align: center; margin-top: 32px; }

/* faq */
.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font: 500 18px var(--head); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 24px; color: var(--gold); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 16px; }

/* cta */
.final-cta { text-align: center; padding: 90px 16px; background: radial-gradient(60% 120% at 50% 0%, rgba(242, 181, 58, .18), transparent 70%); }
.final-cta h2 { font-size: clamp(28px, 5vw, 44px); }
.final-cta p { color: var(--muted); font-size: 18px; }
.final-cta .btn { margin-top: 12px; }

/* page / single */
.page-hero { padding: 64px 0 32px; background: radial-gradient(80% 140% at 0% 0%, rgba(90, 162, 255, .14), transparent 60%); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(30px, 5vw, 46px); }
.page-hero .lead { color: var(--muted); font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font: 500 14px var(--head); }
.chip:hover, .chip.on { color: #231703; background: var(--gold); border-color: var(--gold); text-decoration: none; }
.single-head { padding: 56px 0 24px; }
.single-head h1 { font-size: clamp(28px, 5vw, 44px); margin-top: 12px; }
.cover { margin-top: 0; margin-bottom: 36px; }
.cover img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.prose { font-size: 18px; }
.prose h2 { font-size: 27px; margin-top: 1.8em; }
.prose h3 { font-size: 21px; margin-top: 1.5em; }
.prose img { border-radius: 12px; border: 1px solid var(--line); margin-inline: auto; }
.prose figure { margin: 28px 0; }
.prose figcaption, .prose .wp-element-caption { text-align: center; color: var(--muted); font-size: 15px; margin-top: 8px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: .9em; color: var(--gold-2); }
.prose blockquote { margin: 24px 0; padding: 14px 20px; border-left: 4px solid var(--gold); background: var(--surface); border-radius: 0 10px 10px 0; color: #d9e1ef; }
.prose blockquote p:last-child { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); font-family: var(--head); font-weight: 500; }
.prose .wp-block-table { margin: 24px 0; }
.prose .wp-block-buttons { margin: 24px 0; }
.prose .wp-block-button__link { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #231703; border-radius: 999px; padding: 12px 26px; font: 600 16px var(--head); text-decoration: none; display: inline-block; }
.prose .wp-block-columns { display: flex; gap: 16px; flex-wrap: wrap; }
.prose .wp-block-column { flex: 1 1 200px; }
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 48px; margin-bottom: 20px; padding: 24px; border-radius: var(--radius); background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid rgba(242, 181, 58, .3); }
.cta-box p { margin: 4px 0 0; color: var(--muted); }
.cta-box strong { font: 600 20px var(--head); }
@media (max-width: 600px) { .cta-box { flex-direction: column; align-items: stretch; text-align: center; } }
.pager .nav-links { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pager .page-numbers { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.pager .current { background: var(--gold); color: #231703; border-color: var(--gold); }

/* footer */
.site-footer { background: #081020; border-top: 1px solid var(--line); padding: 56px 0 24px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h3 { font-size: 16px; color: var(--text); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer li a { color: var(--muted); }
.site-footer p { margin-top: 14px; max-width: 360px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* reveal */
.reveal.pre { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.pre.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
