/* หวยรู้ทัน — responsible_gambling */
:root {
  --primary: #2a7f7f;
  --primary-rgb: 42, 127, 127;
  --secondary: #1f5959;
  --accent: #e39280;
  --accent-soft: #6bb3b3;
  --bg: #faf6f2;
  --surface: #ffffff;
  --border: #e0d9d1;
  --text: #2a3d3d;
  --text-soft: #6b6560;
  --radius: 20px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(var(--primary-rgb), 0.06);
  --shadow-md: 0 6px 16px rgba(var(--primary-rgb), 0.12);
  --font-head: 'Sarabun', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Sarabun', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.72;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--primary); line-height: 1.28; font-weight: 700; }
h1 { font-size: 2.4rem; margin: 0 0 24px; letter-spacing: -0.01em; }
h2 { font-size: 1.75rem; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.3rem; margin: 32px 0 12px; color: var(--secondary); }
h4 { font-size: 1.1rem; margin: 24px 0 10px; }
p { margin: 0 0 18px; }
a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 32px 0; }
figcaption { font-size: 0.9rem; color: var(--text-soft); text-align: center; margin-top: 8px; font-style: italic; }
strong { color: var(--primary); font-weight: 700; }

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.container-fluid { max-width: 1400px; margin: 0 auto; padding: 0 32px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(140%) blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 32px; gap: 24px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 44px; width: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.main-nav a {
  color: var(--text); text-decoration: none; padding: 10px 14px; border-radius: var(--radius);
  font-weight: 500; font-size: 0.95rem; transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--bg); color: var(--primary); }
.main-nav a[aria-current="page"] { background: var(--primary); color: #fff; }

.nav-toggle-checkbox { display: none; }
.nav-toggle-label { display: none; cursor: pointer; padding: 8px; }
.nav-toggle-label span {
  display: block; width: 26px; height: 3px; background: var(--primary); margin: 5px 0;
  border-radius: 2px; transition: transform .3s, opacity .3s;
}

@media (max-width: 991px) {
  .header-inner { padding: 12px 20px; }
  .nav-toggle-label { display: block; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .main-nav ul { flex-direction: column; padding: 16px; gap: 4px; }
  .main-nav a { display: block; padding: 12px 16px; }
  .nav-toggle-checkbox:checked ~ .main-nav { max-height: 500px; }
  .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
  .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* Hero */
.hero {
  padding: 56px 0 40px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero-text .eyebrow {
  display: inline-block; padding: 4px 12px; font-size: 0.82rem; font-weight: 600;
  color: var(--accent); background: rgba(var(--primary-rgb), 0.06);
  border-radius: var(--radius); letter-spacing: 0.04em; margin-bottom: 16px;
}
.hero-text .lead { font-size: 1.15rem; color: var(--text-soft); margin-bottom: 24px; }
.hero-image { position: relative; }
.hero-image img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; }
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  h1 { font-size: 1.85rem; }
}

/* Byline */
.byline { display: flex; align-items: center; gap: 12px; padding: 16px 0; color: var(--text-soft); font-size: 0.92rem; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.byline-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.byline-name { font-weight: 600; color: var(--primary); }

/* Breadcrumbs */
.breadcrumbs { padding: 16px 0 8px; font-size: 0.88rem; color: var(--text-soft); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--text-soft); }
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

/* Table of Contents — two-column numbered */
.toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 28px; margin: 40px 0;
}
.toc-heading { margin: 0 0 18px; font-size: 1.15rem; color: var(--primary); border: none; padding: 0; }
.toc-list {
  list-style: none; counter-reset: toc-counter; column-count: 2; column-gap: 32px;
  column-rule: 1px solid var(--border); margin: 0; padding: 0;
}
.toc-list li {
  counter-increment: toc-counter;
  break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
  padding: 8px 0 8px 40px; position: relative;
}
.toc-list li::before {
  content: counter(toc-counter, decimal-leading-zero);
  position: absolute; left: 0; top: 8px; color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-weight: 600; font-size: 0.9rem;
}
.toc-list a { color: var(--text); text-decoration: none; font-weight: 500; }
.toc-list a:hover { color: var(--accent); }
@media (max-width: 700px) { .toc-list { column-count: 1; column-rule: none; } }

/* Steps — alternating zigzag timeline */
.steps { list-style: none; padding: 0; margin: 48px 0 52px; position: relative; }
.steps li:not(:last-child)::before {
  content: ""; position: absolute; left: 50%; top: 50%; bottom: -66px;
  width: 2px; transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, var(--border) 0 5px, transparent 5px 10px);
}
.steps li { position: relative; margin: 0 0 28px; min-height: 76px; display: flex; align-items: center; }
.step-num {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff;
  border: 4px solid var(--bg); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), .32); z-index: 2;
}
.step-body {
  padding: 18px 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); text-align: left;
}
@media (min-width: 992px) {
  .steps li { padding: 0 46px; }
  .steps li:nth-child(odd) .step-body { width: calc(50% - 46px); margin-right: auto; position: relative; }
  .steps li:nth-child(odd) .step-body::after {
    content: ""; position: absolute; right: -8px; top: 50%; width: 14px; height: 14px;
    background: var(--surface); border-right: 1px solid var(--border); border-top: 1px solid var(--border);
    transform: translateY(-50%) rotate(45deg);
  }
  .steps li:nth-child(even) .step-body { width: calc(50% - 46px); margin-left: auto; position: relative; }
  .steps li:nth-child(even) .step-body::after {
    content: ""; position: absolute; left: -8px; top: 50%; width: 14px; height: 14px;
    background: var(--surface); border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
    transform: translateY(-50%) rotate(45deg);
  }
}
@media (max-width: 991px) {
  .steps li:not(:last-child)::before { left: 24px; }
  .steps li { padding-left: 60px; }
  .step-num { left: 24px; }
  .step-body { width: 100%; }
}

/* FAQ — animated toggle */
.faq-section { margin: 48px 0; }
.faq-section details {
  border: 1px solid var(--border); border-radius: var(--radius-lg); margin: 12px 0;
  background: var(--surface); overflow: hidden;
  interpolate-size: allow-keywords;
  transition: box-shadow .2s, border-color .2s;
}
.faq-section details[open] { box-shadow: var(--shadow-sm); border-color: var(--accent-soft); }
.faq-section summary {
  padding: 18px 56px 18px 22px; position: relative; list-style: none;
  cursor: pointer; font-weight: 600; color: var(--primary); font-size: 1.03rem;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::before, .faq-section summary::after {
  content: ""; position: absolute; right: 24px; top: 50%;
  width: 14px; height: 2px; background: var(--primary);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.faq-section summary::before { transform: translateY(-50%) rotate(0deg); }
.faq-section summary::after { transform: translateY(-50%) rotate(90deg); }
.faq-section details[open] summary::after { transform: translateY(-50%) rotate(0deg); }
.faq-section details::details-content {
  height: 0; opacity: 0; overflow: clip;
  transition: height .35s cubic-bezier(.4,0,.2,1), opacity .3s ease-out, content-visibility .35s allow-discrete;
}
.faq-section details[open]::details-content { height: auto; opacity: 1; }
.faq-section details > *:not(summary) { padding: 0 22px 20px; animation: faqSlideDown .32s cubic-bezier(.4,0,.2,1); }
@keyframes faqSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Author box */
.author-box {
  display: grid; grid-template-columns: 100px 1fr; gap: 24px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin: 48px 0; box-shadow: var(--shadow-sm);
}
.author-box img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }
.author-box h3 { margin: 0 0 6px; color: var(--primary); }
.author-box .author-role { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 12px; }
.author-box .author-creds { list-style: none; padding: 0; margin: 12px 0 0; font-size: 0.88rem; color: var(--text-soft); }
.author-box .author-creds li { padding: 4px 0; border-top: 1px solid var(--border); }
@media (max-width: 600px) { .author-box { grid-template-columns: 1fr; text-align: center; } .author-box img { margin: 0 auto; } }

/* Warning boxes (regulatory framing) */
.notice {
  padding: 16px 20px; border-radius: var(--radius-lg); border-left: 4px solid var(--accent);
  background: rgba(214, 69, 69, 0.05); margin: 24px 0; color: var(--text);
}
.notice strong { display: block; margin-bottom: 4px; color: var(--accent); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; }
.info {
  padding: 16px 20px; border-radius: var(--radius-lg); border-left: 4px solid var(--accent-soft);
  background: rgba(var(--primary-rgb), 0.04); margin: 24px 0;
}
.info strong { display: block; margin-bottom: 4px; color: var(--secondary); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 32px 0; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); font-size: 0.95rem; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary); color: #fff; font-weight: 600; font-size: 0.9rem; letter-spacing: 0.02em; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: var(--bg); }

/* Lists */
main ul, main ol { padding-left: 24px; margin: 18px 0; }
main li { margin: 8px 0; }
main ul li::marker { color: var(--accent); }

/* Article body */
.article-body { padding: 40px 0 64px; }
.article-body figure img { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

/* Footer */
.site-footer {
  background: var(--secondary); color: rgba(255,255,255,.82);
  padding: 56px 0 24px; margin-top: 80px;
}
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 16px; letter-spacing: 0.02em; text-transform: uppercase; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-brand .footer-logo { height: 40px; margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.65; margin: 0 0 12px; color: rgba(255,255,255,.72); }
.footer-brand address { font-style: normal; font-size: 0.85rem; color: rgba(255,255,255,.6); line-height: 1.6; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 8px 0; }
.footer-col a { color: rgba(255,255,255,.78); text-decoration: none; font-size: 0.93rem; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-size: 0.85rem; color: rgba(255,255,255,.6);
}
.footer-age { display: flex; align-items: center; gap: 12px; }
.age-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 2px solid var(--accent); color: var(--accent);
  border-radius: 50%; font-weight: 700; font-size: 0.88rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Utility */
.section { margin: 56px 0; }
.text-center { text-align: center; }
