/* ===== SKIP LINK (Accessibility) ===== */
.skip-link {
  position: absolute; top: -100px; left: 0; z-index: 9999;
  background: #f0c040; color: #000; font-weight: 700;
  padding: 10px 20px; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
  background: #0a0a0f;
  color: #e8e0d0;
  line-height: 1.7;
  min-height: 100vh;
}
/* Links: ใช้ underline ช่วย + contrast สูงพอ (4.5:1) */
a { color: #ffc800; text-decoration: underline; text-underline-offset: 2px; transition: color .2s; }
a:hover { color: #ffe066; }
a:focus-visible { outline: 3px solid #ffc800; outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }

/* ===== VARIABLES ===== */
:root {
  --gold:       #f0c040;
  --gold-light: #ffd700;
  --gold-dark:  #b8922a;
  --bg-dark:    #0a0a0f;
  --bg-card:    #13131f;
  --bg-card2:   #1a1a2e;
  --text:       #e8e0d0;
  --text-muted: #a8a8c0; /* เพิ่ม contrast จาก #9090a8 → #a8a8c0 (ผ่าน 4.5:1 บน bg-card) */
  --border:     #2a2a40;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(240,192,64,.12);
}

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-sm { padding: 36px 0; }

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(10,10,15,.96);
  border-bottom: 2px solid var(--gold-dark);
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(8px);
}
.navbar-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 20px; max-width: 1200px; margin: 0 auto;
}
/* ลบ underline จาก UI elements (ไม่ใช่ body text links) */
.navbar-brand, .navbar-nav a, .btn-login, .btn-register,
.btn-hero-primary, .btn-hero-secondary, .related-link,
.footer-col a, .breadcrumb a, .card a { text-decoration: none !important; }
/* ให้ navbar links มี underline เมื่อ hover แทน */
.navbar-nav a:hover { text-decoration: underline; }
.footer-col a:hover { text-decoration: underline; }

.navbar-brand {
  font-size: 1.5rem; font-weight: 800;
  color: var(--gold); letter-spacing: .5px;
  text-shadow: 0 0 12px rgba(240,192,64,.4);
}
.navbar-brand span { color: #fff; }
.navbar-nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.navbar-nav a { color: #e0ddd5; font-size: .95rem; font-weight: 500; } /* contrast > 4.5:1 */
.navbar-nav a:hover { color: var(--gold); text-decoration: none; }
.navbar-actions { display: flex; gap: 10px; }
.btn-login {
  padding: 8px 18px; border-radius: 6px;
  background: transparent; border: 1.5px solid var(--gold);
  color: var(--gold); font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.btn-login:hover { background: var(--gold); color: #000; text-decoration: none; }
.btn-register {
  padding: 8px 20px; border-radius: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 2px 12px rgba(240,192,64,.35);
}
.btn-register:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(240,192,64,.5); text-decoration: none; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1a 100%);
  padding: 80px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(240,192,64,.08) 0%, transparent 70%);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900; color: #fff;
  text-shadow: 0 0 30px rgba(240,192,64,.3);
  margin-bottom: 16px; line-height: 1.3;
}
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p.lead {
  font-size: 1.15rem; color: #d0ccc0; max-width: 640px; /* #d0ccc0 contrast > 4.5:1 บน #0a0a0f */
  margin: 0 auto 32px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
  padding: 14px 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; font-size: 1.1rem; font-weight: 800;
  box-shadow: 0 4px 24px rgba(240,192,64,.4);
  transition: all .25s;
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(240,192,64,.55); text-decoration: none; }
.btn-hero-secondary {
  padding: 14px 36px; border-radius: 8px;
  background: transparent; border: 2px solid var(--gold);
  color: var(--gold); font-size: 1.1rem; font-weight: 700;
  transition: all .25s;
}
.btn-hero-secondary:hover { background: rgba(240,192,64,.1); text-decoration: none; }

/* ===== CARDS ===== */
.card-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover {
  border-color: var(--gold-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card-icon { font-size: 2.2rem; margin-bottom: 14px; }
.card h3 { color: var(--gold); font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: #b8b8cc; font-size: .95rem; } /* contrast > 4.5:1 บน bg-card #13131f */

/* ===== SECTION HEADING ===== */
.section-heading { text-align: center; margin-bottom: 40px; }
.section-heading h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; color: #fff; margin-bottom: 10px; }
.section-heading h2 span { color: var(--gold); }
.section-heading p { color: #b8b8cc; font-size: 1rem; max-width: 560px; margin: 0 auto; }
.divider { width: 60px; height: 3px; background: linear-gradient(90deg, var(--gold), transparent); margin: 14px auto 0; border-radius: 2px; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: var(--bg-card2); border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 20px; max-width: 1200px; margin: 0 auto; }
.breadcrumb li { font-size: .88rem; color: var(--text-muted); }
.breadcrumb li + li::before { content: '›'; margin-right: 6px; color: var(--gold-dark); }
.breadcrumb a { color: var(--gold); }

/* ===== CONTENT ===== */
.content-wrap { max-width: 860px; margin: 0 auto; }
.content-wrap h2 { font-size: 1.5rem; color: var(--gold); margin: 36px 0 14px; }
.content-wrap h3 { font-size: 1.2rem; color: #fff; margin: 28px 0 10px; }
.content-wrap p { margin-bottom: 16px; color: var(--text); }
.content-wrap ul, .content-wrap ol { padding-left: 22px; margin-bottom: 16px; }
.content-wrap li { margin-bottom: 8px; color: var(--text); }
.content-wrap strong { color: var(--gold); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; margin: 24px 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { background: var(--bg-card2); color: var(--gold); padding: 12px 16px; text-align: left; border-bottom: 2px solid var(--gold-dark); }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:hover td { background: rgba(240,192,64,.04); }

/* ===== FAQ ===== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
.faq-q {
  padding: 18px 20px; font-weight: 700; color: #fff;
  cursor: pointer; background: var(--bg-card);
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.faq-q:hover { background: var(--bg-card2); }
.faq-q::after { content: '+'; font-size: 1.4rem; color: var(--gold); transition: transform .25s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 16px 20px; color: #b8b8cc; background: var(--bg-card2); display: none; }
.faq-item.open .faq-a { display: block; }

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, var(--bg-card2), #16162a);
  border: 1px solid var(--gold-dark); border-radius: 16px;
  padding: 48px 32px; text-align: center; margin: 48px 0;
}
.cta-section h2 { font-size: 1.8rem; color: #fff; margin-bottom: 10px; }
.cta-section h2 span { color: var(--gold); }
.cta-section p { color: #bbb; margin-bottom: 28px; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== RELATED LINKS ===== */
.related-section { margin: 48px 0; }
.related-section h3 { color: var(--gold); font-size: 1.1rem; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.related-link {
  display: block; padding: 14px 18px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .92rem;
  transition: border-color .2s, color .2s;
}
.related-link:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.related-link span { display: block; font-size: .8rem; color: #a8a8c0; margin-top: 4px; }

/* ===== IMAGE PLACEHOLDER ===== */
.img-placeholder {
  background: linear-gradient(135deg, var(--bg-card2), #1e1e35);
  border: 2px dashed var(--border); border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 240px; color: var(--text-muted);
  font-size: .9rem; text-align: center; padding: 24px;
}
.img-placeholder::before { content: '🖼️'; font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; }
.badge-gold { background: rgba(240,192,64,.15); color: var(--gold); border: 1px solid var(--gold-dark); }
.badge-green { background: rgba(50,200,100,.12); color: #4cd080; border: 1px solid #2a6040; }

/* ===== FOOTER ===== */
.footer {
  background: #06060c;
  border-top: 2px solid var(--gold-dark);
  padding: 48px 0 24px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; margin-bottom: 36px; }
.footer-col h4 { color: var(--gold); font-size: 1rem; margin-bottom: 14px; }
.footer-col a { display: block; color: #b0b0c8; font-size: .92rem; padding: 7px 0; margin-bottom: 2px; min-height: 24px; }
.footer-col a:hover { color: var(--gold); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; text-align: center; color: #b0b0c8; font-size: .85rem; }
.footer-bottom a { color: var(--gold-dark); }

/* ===== HAMBURGER (MOBILE) ===== */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 4px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--gold); border-radius: 2px; }

@media (max-width: 768px) {
  .navbar-nav { display: none; flex-direction: column; width: 100%; background: var(--bg-dark); padding: 12px 20px; border-top: 1px solid var(--border); }
  .navbar-nav.open { display: flex; }
  .navbar-inner { flex-wrap: wrap; }
  .menu-toggle { display: flex; }
  .navbar-actions { order: -1; margin-left: auto; margin-right: 12px; }
  .hero { padding: 50px 0 40px; }
  .section { padding: 40px 0; }
  .cta-section { padding: 32px 20px; }
}

/* ===== UTILITIES ===== */
.text-gold { color: var(--gold); }
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.highlight-box {
  background: rgba(240,192,64,.06);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px; margin: 20px 0;
}
.highlight-box p { margin-bottom: 0; color: var(--text); }

/* ===== RESPONSIBLE GAMBLING DISCLAIMER ===== */
.rg-disclaimer {
  background: rgba(255,180,0,.06);
  border: 1px solid rgba(255,180,0,.25);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
}
.rg-inner { display: flex; gap: 14px; align-items: flex-start; }
.rg-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.rg-text { font-size: .85rem; color: #c0b090; line-height: 1.6; }
.rg-text strong { color: #e8c060; }

/* ===== AUTHOR BOX ===== */
.author-box {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 22px; margin: 32px 0;
}
.author-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), #6a4010);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.author-info { flex: 1; }
.author-name { font-weight: 700; color: var(--gold); font-size: .95rem; }
.author-role { font-size: .82rem; color: #a8a8c0; margin-top: 2px; }
.author-meta { font-size: .8rem; color: #888; margin-top: 6px; }
.author-meta time { color: #a8a8c0; }

/* ===== ARTICLE IMAGE ===== */
.article-img {
  width: 100%; border-radius: 10px; margin: 24px 0;
  aspect-ratio: 16/9; object-fit: cover;
  background: var(--bg-card2); display: block;
}
.img-wrap { position: relative; margin: 24px 0; }
.img-wrap figcaption {
  font-size: .8rem; color: #888; text-align: center; margin-top: 6px;
}
/* onerror fallback */
img.article-img[src=""],
img.article-img:not([src]) {
  background: linear-gradient(135deg,var(--bg-card2),#1e1e35);
  border: 2px dashed var(--border);
  min-height: 220px;
}
