:root {
  --green-950: #012d13;
  --green-900: #063c1e;
  --green-800: #09502a;
  --green-700: #0e6634;
  --green-100: #dff3df;
  --gold-100: #fff4c7;
  --gold-300: #efd875;
  --gold-500: #c99b42;
  --gold-700: #9b6e25;
  --red-500: #e51b23;
  --ink: #171717;
  --muted: #647067;
  --surface: #ffffff;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(0, 25, 8, 0.18);
  font-family: "Noto Sans Thai", "Kanit", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--green-950);
  color: #fff;
}

body.admin-mode { background: #f3f6f3; color: #172219; }

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: #111;
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.section { padding: 72px 0; }
.section--tight { padding: 42px 0; }
.surface-section { background: #f6f8f4; color: var(--ink); }

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: radial-gradient(circle at 50% 20%, #0b6330, var(--green-950) 60%);
}
.loading-screen img { width: 120px; }
.loading-screen p { margin: 0; color: #e9d48a; }
.loader { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.22); border-top-color: #f1d777; border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  position: relative;
  z-index: 30;
  background: linear-gradient(100deg, #b7893f 0%, #f0d978 48%, #bb8b3d 100%);
  min-height: 76px;
  border-bottom: 1px solid rgba(255,255,255,.35);
}
.topbar__inner { display: flex; justify-content: flex-end; align-items: stretch; min-height: 76px; }
.brand {
  position: absolute;
  left: max(18px, calc((100vw - 1180px) / 2));
  top: 10px;
  z-index: 32;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand img { width: 146px; filter: drop-shadow(0 10px 8px rgba(0,0,0,.35)); }
.brand__word { display: none; margin-left: 12px; font: 700 24px "Kanit"; color: #fff; text-shadow: 0 2px 4px #3d2810; }
.nav { display: flex; align-items: stretch; }
.nav a { display: grid; place-items: center; padding: 0 22px; text-decoration: none; color: #fff; font-weight: 700; transition: .2s ease; }
.nav a:hover, .nav a[aria-current="page"] { background: #060606; }
.mobile-toggle { display: none; }

.login-ribbon { background: #050505; min-height: 96px; border-bottom: 9px solid var(--green-800); }
.login-ribbon__inner { padding-left: 180px; display: flex; justify-content: flex-end; gap: 14px; align-items: center; min-height: 88px; }
.login-title { font: 700 18px "Kanit"; white-space: nowrap; }
.pill-button { border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; white-space: nowrap; transition: transform .2s ease, box-shadow .2s ease; }
.pill-button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.pill-button--gold { color: #fff; background: linear-gradient(90deg, #f2db72, #b9893f, #efd875); outline: 3px solid #62d53d; }
.pill-button--red { color: #fff; background: linear-gradient(90deg, #c90208, #ef292f, #bd0006); outline: 3px solid #ed3438; }

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 10%, rgba(25,136,62,.35), transparent 28%),
    linear-gradient(140deg, #0a592d 0%, #064520 48%, #012b11 100%);
  padding: 78px 0 82px;
}
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(120deg, transparent 46%, rgba(255,255,255,.025) 46%, rgba(255,255,255,.025) 53%, transparent 53%); background-size: 220px 220px; }
.hero__content { position: relative; display: grid; grid-template-columns: .82fr 1.18fr; gap: 52px; align-items: center; }
.eyebrow { margin: 0 0 8px; color: #f2d56e; font: 600 15px "Kanit"; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 0; font: 700 clamp(38px, 6vw, 76px)/1.03 "Kanit"; letter-spacing: -.035em; }
.hero h1 span { color: #f2ad20; white-space: nowrap; }
.hero__lead { max-width: 580px; margin: 20px 0; color: #dce9de; font-size: 18px; line-height: 1.8; }
.benefits { list-style: none; margin: 24px 0 32px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 18px; }
.benefits li { font: 600 20px "Kanit"; }
.benefits li::before { content: "✓"; color: #f5a51c; font-size: 24px; margin-right: 10px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__actions .pill-button { min-width: 150px; }
.hero__art { position: relative; }
.hero__art img { display: block; width: 100%; border-radius: 18px; border: 3px solid #b58c45; box-shadow: 0 28px 70px rgba(0,0,0,.45); }
.hero__art::after { content: "สำหรับผู้มีอายุ 20 ปีขึ้นไป"; position: absolute; right: 14px; bottom: 14px; border-radius: 999px; padding: 8px 14px; color: #fff; background: rgba(0,0,0,.72); font-size: 12px; }

.stats-strip { position: relative; margin-top: -32px; z-index: 4; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); background: #fff; color: var(--ink); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.stat { padding: 23px 26px; border-right: 1px solid #e5e9e4; }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font: 800 31px "Kanit"; color: var(--green-700); }
.stat span { color: var(--muted); font-size: 13px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font: 700 clamp(28px,4vw,44px)/1.15 "Kanit"; color: inherit; }
.section-heading p { max-width: 620px; margin: 7px 0 0; color: var(--muted); line-height: 1.7; }
.section-heading--light p { color: #bcd1c1; }
.section-kicker { color: #bd861c; font: 600 13px "Kanit"; letter-spacing: .08em; text-transform: uppercase; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--green-700); font-weight: 700; text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

.board { display: grid; gap: 22px; }
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.schedule-panel { overflow: hidden; border-radius: 24px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.schedule-panel--wide { grid-column: 1 / -1; }
.schedule-panel__head { padding: 20px 24px; background: linear-gradient(100deg, #efd873, #ba873a, #f2dd75); display: flex; align-items: center; gap: 12px; }
.schedule-panel__head--red { color: #fff; background: linear-gradient(100deg, #bf0005, #f3292e, #bc0005); }
.schedule-panel__head h3 { margin: 0; font: 700 25px "Kanit"; }
.schedule-panel__body { padding: 16px; display: grid; gap: 11px; }
.schedule-panel--wide .schedule-panel__body { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.round-card { min-height: 74px; padding: 12px 16px; border: 2px solid #e5e7e4; border-radius: 13px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 10px; background: #fff; transition: border-color .2s ease, transform .2s ease; }
.round-card:hover { transform: translateY(-2px); border-color: var(--gold-500); }
.round-card__flag { font-size: 25px; }
.round-card strong { display: block; color: #3f4541; font: 600 18px "Kanit"; }
.round-card__time { justify-self: stretch; min-width: 94px; padding: 11px 12px; border-radius: 10px; background: #edf7e8; color: #0b4a1c; text-align: center; font: 600 17px "Kanit"; }
.round-card--center { grid-template-columns: 1fr; place-items: center; min-height: 62px; }
.round-card--center .round-card__time { width: 100%; background: #f1f3f1; color: #353a36; }
.schedule-details summary { list-style: none; display: flex; align-items: center; justify-content: center; margin: 10px 16px 18px; padding: 12px; border: 1px dashed #b5bdb7; border-radius: 12px; color: var(--green-700); font-weight: 700; cursor: pointer; }
.schedule-details summary::-webkit-details-marker { display: none; }
.schedule-details[open] summary { margin-top: 16px; }
.schedule-grid--dense { padding: 0 16px 18px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }

.hubs-section { background: linear-gradient(155deg, #084c25, #022f14); }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.hub-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 260px; padding: 26px; border: 1px solid rgba(237,216,117,.35); border-radius: 20px; color: #fff; text-decoration: none; background: rgba(255,255,255,.055); transition: transform .2s ease, background .2s ease; }
.hub-card:hover { transform: translateY(-5px); background: rgba(255,255,255,.10); }
.hub-card__icon { display: grid; place-items: center; width: 49px; height: 49px; border-radius: 14px; color: #16270d; background: linear-gradient(135deg, #f2df7f, #b98533); font: 800 19px "Kanit"; }
.hub-card h3 { margin: 20px 0 6px; font: 700 25px "Kanit"; }
.hub-card p { margin: 0; color: #c7d9cb; line-height: 1.65; }
.hub-card__meta { margin-top: auto; padding-top: 20px; color: #f0d874; font-weight: 700; }

.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.article-card { overflow: hidden; border: 1px solid #e4e9e2; border-radius: 20px; background: #fff; box-shadow: 0 12px 35px rgba(9,42,17,.08); }
.article-card__image { display: block; aspect-ratio: 1/1; overflow: hidden; background: #fff; }
.article-card__image img { width: 100%; height: 100%; object-fit: contain; }
.article-card__body { padding: 20px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; color: #0c5c2a; background: #e6f5e5; font-size: 12px; font-weight: 700; }
.article-card h3 { margin: 13px 0 8px; font: 700 20px/1.35 "Kanit"; color: #1d2820; }
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { color: var(--green-700); }
.article-card p { margin: 0; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card__footer { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; color: #7b837d; font-size: 12px; }

.reviews-section { background: #fff9e7; color: var(--ink); }
.reviews-note { display: inline-flex; margin-bottom: 18px; padding: 8px 12px; border-radius: 10px; color: #735716; background: #f5e7af; font-size: 12px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.review-card { padding: 18px 20px; border: 1px solid #eadb9d; border-radius: 16px; background: #fff; }
.review-card p { margin: 0; line-height: 1.7; }
.review-card small { display: block; margin-top: 10px; color: #8a7330; }

.page-hero { padding: 72px 0 54px; background: radial-gradient(circle at 85% 0, #147342, transparent 35%), linear-gradient(135deg, #074d28, #012c13); }
.breadcrumbs { display: flex; gap: 8px; margin-bottom: 18px; color: #bfccbf; font-size: 13px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: #fff; }
.page-hero h1 { max-width: 900px; margin: 0; font: 700 clamp(36px,5vw,64px)/1.12 "Kanit"; }
.page-hero p { max-width: 760px; margin: 16px 0 0; color: #cfdfd2; line-height: 1.75; }

.how-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.how-card { position: relative; min-height: 170px; padding: 18px; border: 4px solid #cfb653; border-radius: 10px; color: #251f13; background: #fff8d9; box-shadow: 0 6px 13px rgba(0,0,0,.24); cursor: pointer; text-align: left; transition: transform .18s ease; }
.how-card:hover { transform: translateY(-4px); }
.how-card__flag { font-size: 25px; }
.how-card__help { position: absolute; right: 14px; top: 12px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: #9e9880; font-weight: 800; }
.how-card strong { position: absolute; inset: 50% 16px auto; transform: translateY(-45%); color: #d2090d; text-align: center; font: 700 21px "Kanit"; }
.how-note { margin-top: 25px; padding: 20px 24px; border-radius: 14px; color: #8a2429; background: #fff4cd; border: 1px solid #e5c45b; line-height: 1.7; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(0,20,8,.78); backdrop-filter: blur(5px); }
.modal { width: min(780px,100%); max-height: min(90vh,920px); overflow: auto; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 0 26px 100px rgba(0,0,0,.45); }
.modal__head { position: sticky; top: 0; z-index: 3; display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 20px 24px; color: #fff; background: linear-gradient(95deg, #9f0005, #ee2228); }
.modal__head h2 { margin: 0; font: 700 25px "Kanit"; }
.modal__close { border: 0; border-radius: 50%; width: 36px; height: 36px; color: #fff; background: rgba(0,0,0,.25); cursor: pointer; font-size: 22px; }
.modal__body { padding: 24px; }
.modal__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.modal__fact { padding: 14px 16px; border-radius: 12px; background: #f2f6f1; }
.modal__fact small { display: block; color: #6b766e; }
.modal__fact strong { color: var(--green-800); }
.modal__body p { line-height: 1.75; }
.modal__body img { display: block; margin: 18px auto; max-height: 480px; object-fit: contain; border-radius: 12px; }
.source-link { color: var(--green-700); overflow-wrap: anywhere; }

.hub-keywords { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; }
.keyword-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid #d9e0d8; border-radius: 999px; color: #28332b; background: #fff; text-decoration: none; }
.keyword-chip b { color: var(--green-700); }

.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 38px; align-items: start; }
.article-main { min-width: 0; }
.article-cover-link, .article-inline-banner { display: block; width: min(100%, 760px); margin-inline: auto; border-radius: 22px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.article-cover, .article-inline-banner img { display: block; width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.article-inline-banner { margin-block: 30px; }
.article-cta { display: flex; justify-content: center; margin: 34px 0; }
.article-cta a { min-width: min(320px, 90%); padding: 15px 28px; border: 4px solid #ff7276; border-radius: 999px; color: #fff; background: linear-gradient(90deg, #a90005, #f1282e, #ad0005); box-shadow: 0 0 0 0 rgba(230,20,27,.65); text-align: center; text-decoration: none; font: 700 22px "Kanit"; animation: register-pulse 1.15s ease-in-out infinite; }
@keyframes register-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(230,20,27,.65); } 50% { opacity: .78; box-shadow: 0 0 0 12px rgba(230,20,27,0); } }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 20px 0; color: #68726a; font-size: 13px; }
.article-content h2 { margin-top: 34px; font: 700 29px "Kanit"; color: #173d22; }
.article-content p { color: #39443c; font-size: 17px; line-height: 1.9; }
.article-tips { padding: 24px 28px; border-radius: 18px; color: #17371d; background: #eaf5e6; }
.article-tips li { margin: 8px 0; }
.article-sidebar { position: sticky; top: 24px; display: grid; gap: 18px; }
.sidebar-card { padding: 20px; border: 1px solid #e2e7e0; border-radius: 18px; background: #fff; }
.sidebar-card h3 { margin: 0 0 12px; font: 700 20px "Kanit"; }
.sidebar-card a { display: block; padding: 8px 0; color: var(--green-700); text-decoration: none; border-bottom: 1px solid #edf0ed; }
.sidebar-card a:last-child { border: 0; }
.article-reviews { margin-top: 42px; }
.article-faq { margin-top: 42px; }
.article-faq h2 { margin: 0 0 18px; font: 700 29px "Kanit"; color: #173d22; }
.faq-list { display: grid; gap: 12px; }
.faq-list details { border: 1px solid #dfe7df; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(10,58,29,.06); overflow: hidden; }
.faq-list summary { padding: 17px 20px; color: #173d22; cursor: pointer; font: 600 17px "Kanit"; }
.faq-list details[open] summary { border-bottom: 1px solid #edf1ed; background: #f4faf2; }
.faq-list p { margin: 0; padding: 16px 20px 20px; color: #465149; line-height: 1.8; }

.empty-state { grid-column: 1/-1; padding: 42px; border: 1px dashed #bfc8bf; border-radius: 18px; text-align: center; color: #667168; }
.error-state { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 40px; }
.error-state h1 { font: 700 50px "Kanit"; margin: 0; }
.error-state p { color: #cad8cd; }

.site-footer { padding: 45px 0 22px; background: #001e0c; }
.footer-grid { display: grid; grid-template-columns: 1.1fr .9fr .9fr; gap: 40px; padding-bottom: 36px; }
.footer-brand { display: flex; align-items: center; gap: 15px; }
.footer-brand img { width: 70px; }
.footer-brand strong { display: block; font: 700 23px "Kanit"; }
.footer-brand span { color: #9db2a2; font-size: 13px; }
.footer-column h3 { margin: 0 0 12px; color: #efd873; font: 600 18px "Kanit"; }
.footer-column a { display: block; padding: 5px 0; color: #b7c8ba; text-decoration: none; }
.footer-column a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); color: #829887; font-size: 12px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 12px; background: #fff; color: #18231a; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast--error { color: #8a1114; border-left: 4px solid #d51921; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 1000px) {
  .brand img { width: 112px; }
  .login-ribbon__inner { padding-left: 130px; }
  .hero__content { grid-template-columns: 1fr 1fr; gap: 30px; }
  .board-grid { grid-template-columns: 1fr 1fr; }
  .schedule-panel--wide { grid-column: 1/-1; }
  .hub-grid, .article-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .how-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, 620px); }
  .section { padding: 52px 0; }
  .topbar, .topbar__inner { min-height: 68px; }
  .brand { top: 5px; }
  .brand img { width: 80px; }
  .brand__word { display: block; font-size: 18px; }
  .mobile-toggle { display: grid; place-items: center; align-self: center; margin-left: auto; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.45); border-radius: 10px; color: #fff; background: rgba(0,0,0,.12); font-size: 22px; cursor: pointer; }
  .nav { position: absolute; top: 68px; inset-inline: 0; display: none; padding: 8px 12px 14px; background: #071f0d; box-shadow: 0 15px 30px rgba(0,0,0,.35); }
  .nav.is-open { display: grid; }
  .nav a { justify-content: start; padding: 12px 15px; border-radius: 9px; }
  .login-ribbon { border-bottom-width: 5px; }
  .login-ribbon__inner { min-height: 74px; padding-left: 88px; }
  .login-title { display: none; }
  .login-ribbon .pill-button--red { display: inline-block; }
  .pill-button { padding: 10px 16px; }
  .hero { padding: 52px 0 58px; }
  .hero__content { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .hero__art img { max-height: 430px; object-fit: cover; object-position: top; }
  .hero h1 { font-size: clamp(39px,12vw,58px); }
  .benefits { grid-template-columns: 1fr 1fr; }
  .benefits li { font-size: 17px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid #e5e9e4; }
  .board-grid, .hub-grid, .article-grid, .review-grid { grid-template-columns: 1fr; }
  .schedule-panel--wide .schedule-panel__body, .schedule-grid--dense { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .how-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1/-1; }
  .section-heading { align-items: start; }
}

@media (max-width: 460px) {
  .brand__word { display: none; }
  .login-ribbon__inner { padding-left: 78px; gap: 8px; }
  .benefits { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 18px; }
  .stat strong { font-size: 25px; }
  .schedule-panel--wide .schedule-panel__body, .schedule-grid--dense { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .how-card { min-height: 142px; padding: 12px; }
  .how-card strong { font-size: 17px; }
  .modal__facts { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
