/*
Theme Name: 789BET Thai SEO V1.3.1
Theme URI: https://789bet.site/
Author: Shubuonlam
Description: ธีม WordPress น้ำหนักเบาสำหรับเว็บไซต์ข้อมูล 789BET ในประเทศไทย เน้น SEO, Core Web Vitals, เมนูหลักอัตโนมัติ และ Hero ที่แก้ไขได้จากหน้าแก้ไข
Version: 1.3.1
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: bet789-th
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, news, custom-logo, custom-menu, featured-images, wide-blocks, translation-ready
*/

:root {
  --b789-accent: #ff7900;
  --b789-accent-dark: #d95f00;
  --b789-black: #0a0b0d;
  --b789-charcoal: #111318;
  --b789-ink: #171a21;
  --b789-muted: #667085;
  --b789-line: #e7e9ee;
  --b789-soft: #f5f6f8;
  --b789-white: #ffffff;
  --b789-success: #16a66a;
  --b789-container: 1180px;
  --b789-reading: 820px;
  --b789-radius: 14px;
  --b789-shadow: 0 12px 34px rgba(14, 18, 28, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--b789-ink);
  background: #f3f4f6;
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: #bb5100; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--b789-accent-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(255,121,0,.42); outline-offset: 3px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  top: 8px; left: 8px; z-index: 99999;
  width: auto; height: auto; padding: 10px 14px;
  clip: auto; background: #fff; color: #111;
}

.b789-container { width: min(calc(100% - 32px), var(--b789-container)); margin-inline: auto; }
.b789-site { min-height: 100vh; display: flex; flex-direction: column; }
.b789-main { flex: 1; }

/* Header */
.b789-topbar {
  background: #08090b;
  color: #c7cbd2;
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-size: 13px;
}
.b789-topbar__inner {
  min-height: 34px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px;
}
.b789-topbar p { margin: 0; }
.b789-topbar__trust { display: flex; gap: 16px; align-items: center; }
.b789-topbar__trust span::before { content: "•"; color: var(--b789-accent); margin-right: 7px; }

.b789-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(14, 15, 18, .98);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.admin-bar .b789-header { top: 32px; }
.b789-header__inner {
  min-height: 72px; display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 26px;
}
.b789-brand { display: flex; align-items: center; min-width: 170px; }
.b789-brand-link { display: inline-flex; align-items: center; max-width: 100%; text-decoration: none; }
.b789-brand-link .custom-logo-link { display: inline-flex; align-items: center; text-decoration: none; }
.b789-brand-link .custom-logo {
  display: block; width: auto; max-width: 190px; max-height: 50px; object-fit: contain;
}
.b789-brand-link--footer .custom-logo { max-width: 220px; max-height: 64px; }
.b789-site-title {
  color: #fff; font-size: 23px; font-weight: 900; line-height: 1.15; letter-spacing: -.025em;
}
.b789-site-title:hover { color: var(--b789-accent); }
.b789-brand-link--footer.b789-site-title { margin-bottom: 14px; font-size: 22px; }

.b789-nav { justify-self: end; min-width: 0; }
.b789-nav ul { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 4px; }
.b789-nav a {
  display: flex; align-items: center; min-height: 42px;
  padding: 8px 12px; color: #e9ebef; border-radius: 9px;
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.b789-nav a:hover, .b789-nav .current-menu-item > a, .b789-nav .current_page_item > a {
  color: #fff; background: rgba(255,121,0,.14);
}
.b789-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 9px 16px; border: 1px solid transparent;
  border-radius: 9px; font-weight: 800; line-height: 1.2;
  text-decoration: none; transition: .2s ease;
}
.b789-btn:hover { transform: translateY(-1px); text-decoration: none; }
.b789-btn--primary { color: #17100a; background: var(--b789-accent); box-shadow: 0 8px 18px rgba(255,121,0,.22); }
.b789-btn--primary:hover { color: #000; background: #ff942f; }
.b789-btn--outline { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.04); }
.b789-btn--outline:hover { color: #fff; border-color: var(--b789-accent); background: rgba(255,121,0,.1); }
.b789-menu-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px; background: transparent; color: #fff;
}
.b789-menu-toggle span, .b789-menu-toggle::before, .b789-menu-toggle::after {
  content: ""; display: block; width: 20px; height: 2px; margin: 4px auto; background: currentColor;
}

/* Hero */
.b789-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 82% 30%, rgba(255,121,0,.23), transparent 32%),
    linear-gradient(135deg, #090a0d 0%, #15171c 66%, #0a0b0d 100%);
  border-bottom: 1px solid rgba(255,121,0,.22);
}
.b789-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent);
}
.b789-hero__inner {
  position: relative; display: grid; grid-template-columns: minmax(0, .92fr) minmax(480px, 1.08fr);
  gap: 52px; align-items: center; min-height: 430px; padding-block: 58px;
}
.b789-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
  color: #ff9b43; font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
}
.b789-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--b789-accent); }
.b789-hero h1 { margin: 0 0 14px; max-width: 800px; color: #fff; font-size: clamp(32px, 4.5vw, 54px); line-height: 1.18; letter-spacing: -.035em; }
.b789-hero__excerpt { max-width: 760px; margin: 0; color: #c8ccd3; font-size: 17px; }
.b789-hero__excerpt p { margin: 0 0 10px; }
.b789-hero__excerpt p:last-child { margin-bottom: 0; }
.b789-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.b789-hero__actions .b789-btn { min-width: 160px; min-height: 48px; }
.b789-hero__note { margin: 15px 0 0; color: #9298a3; font-size: 13px; }
.b789-hero__media {
  width: 100%; padding: 8px; border: 1px solid rgba(255,121,0,.32); border-radius: 18px;
  background: rgba(255,255,255,.035); box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.b789-hero__media img {
  display: block; width: 100%; height: auto; max-height: none;
  border-radius: 11px; aspect-ratio: auto; object-fit: contain;
}
.b789-hero__placeholder {
  display: grid; place-items: center; aspect-ratio: 16/10; border-radius: 11px;
  color: #fff; background: radial-gradient(circle, #272a31, #101116); text-align: center;
}
.b789-hero__placeholder strong { display: block; color: var(--b789-accent); font-size: 52px; line-height: 1; }
.b789-hero__placeholder span { display: block; color: #d0d3d9; font-weight: 700; }

/* Quick navigation */
.b789-quicknav { background: #fff; border-bottom: 1px solid var(--b789-line); }
.b789-quicknav__inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.b789-quicknav a {
  display: flex; align-items: center; gap: 11px; min-height: 66px; padding: 12px 18px;
  color: #23262d; border-right: 1px solid var(--b789-line); text-decoration: none; font-weight: 800;
}
.b789-quicknav a:first-child { border-left: 1px solid var(--b789-line); }
.b789-quicknav a:hover { color: var(--b789-accent-dark); background: #fff8f2; }
.b789-quicknav__icon {
  display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px;
  color: #111; background: #fff1e5; border-radius: 9px; font-weight: 900;
}

/* Content */
.b789-content-wrap { padding-block: 34px 64px; }
.b789-content-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.b789-content-grid.b789-content-grid--single { grid-template-columns: minmax(0, var(--b789-reading)); justify-content: center; }
.b789-card { background: #fff; border: 1px solid var(--b789-line); border-radius: var(--b789-radius); box-shadow: var(--b789-shadow); }
.b789-entry { min-width: 0; padding: clamp(24px, 4vw, 46px); }
.b789-entry--plain { width: min(calc(100% - 32px), 920px); margin: 36px auto 64px; }
.b789-entry-header { margin-bottom: 22px; }
.b789-entry-title { margin: 0 0 8px; font-size: clamp(28px, 4vw, 44px); line-height: 1.25; letter-spacing: -.025em; }
.b789-entry-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--b789-muted); font-size: 13px; }
.b789-entry-thumbnail { margin: 0 0 28px; }
.b789-entry-thumbnail img { display: block; width: 100%; border-radius: 12px; }

.b789-entry-content { overflow-wrap: break-word; word-break: normal; }
.b789-entry-content > *:first-child { margin-top: 0; }
.b789-entry-content > *:last-child { margin-bottom: 0; }
.b789-entry-content h2, .b789-entry-content h3, .b789-entry-content h4 { color: #14171d; scroll-margin-top: 100px; }
.b789-entry-content h2 {
  margin: 42px 0 16px; padding-bottom: 10px;
  border-bottom: 2px solid #f1f2f4; font-size: clamp(24px, 3vw, 32px); line-height: 1.3;
}
.b789-entry-content h2::after { content: ""; display: block; width: 54px; height: 3px; margin-top: 10px; background: var(--b789-accent); border-radius: 3px; }
.b789-entry-content h3 { margin: 30px 0 12px; font-size: 22px; line-height: 1.35; }
.b789-entry-content p { margin: 0 0 18px; }
.b789-entry-content ul, .b789-entry-content ol { margin: 0 0 20px; padding-left: 24px; }
.b789-entry-content li { margin-bottom: 7px; }
.b789-entry-content blockquote {
  margin: 28px 0; padding: 20px 22px; border-left: 4px solid var(--b789-accent);
  background: #fff8f2; border-radius: 0 10px 10px 0;
}
.b789-entry-content figure { margin: 28px 0; }
.b789-entry-content figcaption { margin-top: 7px; color: var(--b789-muted); font-size: 13px; text-align: center; }
.b789-entry-content img { border-radius: 11px; }
.b789-entry-content .wp-block-image img { display: block; }
.b789-entry-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.b789-entry-content th, .b789-entry-content td { padding: 12px 14px; border: 1px solid #dde0e5; text-align: left; vertical-align: top; }
.b789-entry-content th { background: #17191e; color: #fff; }
.b789-entry-content tr:nth-child(even) td { background: #f8f9fa; }
.b789-entry-content details { margin: 12px 0; border: 1px solid var(--b789-line); border-radius: 10px; background: #fff; }
.b789-entry-content summary { cursor: pointer; padding: 14px 17px; font-weight: 800; }
.b789-entry-content details > *:not(summary) { margin-inline: 17px; }

.b789-entry-content .b789-notice,
.b789-entry-content .b789-note {
  margin: 24px 0; padding: 16px 18px; border: 1px solid #ffd6b3; border-left: 4px solid var(--b789-accent);
  border-radius: 10px; background: #fff8f2;
}
.b789-entry-content .b789-notice > *:last-child,
.b789-entry-content .b789-note > *:last-child { margin-bottom: 0; }
.b789-entry-content [class*="table-wrapper"] { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.b789-entry-content .home-policy-links,
.b789-entry-content .contact-policy-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 22px; }
.b789-entry-content .home-policy-links a,
.b789-entry-content .contact-policy-inline a,
.b789-entry-content .contact-policy-inline span { display: inline-flex; margin: 0; }
.b789-entry-content figure.aligncenter,
.b789-entry-content .aligncenter { margin-inline: auto; }
.b789-entry-content [id] { scroll-margin-top: 100px; }

.b789-toc { position: sticky; top: 100px; padding: 18px; }
.admin-bar .b789-toc { top: 132px; }
.b789-toc__title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; font-size: 15px; }
.b789-toc__title span { color: var(--b789-accent-dark); }
.b789-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.b789-toc li { counter-increment: toc; margin: 0; }
.b789-toc a { display: grid; grid-template-columns: 24px 1fr; gap: 7px; padding: 7px 0; color: #4c5360; font-size: 13px; line-height: 1.45; text-decoration: none; }
.b789-toc a::before { content: counter(toc, decimal-leading-zero); color: #a0a5ae; font-size: 11px; font-weight: 800; }
.b789-toc a:hover, .b789-toc a.is-active { color: var(--b789-accent-dark); }
.b789-toc:empty, .b789-toc.is-empty { display: none; }

.b789-breadcrumbs { margin-bottom: 14px; color: #7b818b; font-size: 13px; }
.b789-breadcrumbs a { color: #5f6570; text-decoration: none; }
.b789-breadcrumbs .sep { margin: 0 7px; color: #b1b5bc; }

/* Archive and blog */
.b789-listing { padding-block: 36px 64px; }
.b789-listing__header { margin-bottom: 24px; }
.b789-listing__header h1 { margin: 0 0 6px; font-size: clamp(30px, 4vw, 44px); }
.b789-post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.b789-post-card { overflow: hidden; }
.b789-post-card__thumb { display: block; aspect-ratio: 16/9; background: #17191e; }
.b789-post-card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.b789-post-card__body { padding: 20px; }
.b789-post-card__meta { margin-bottom: 7px; color: var(--b789-accent-dark); font-size: 12px; font-weight: 800; }
.b789-post-card h2 { margin: 0 0 9px; font-size: 20px; line-height: 1.35; }
.b789-post-card h2 a { color: #17191e; text-decoration: none; }
.b789-post-card h2 a:hover { color: var(--b789-accent-dark); }
.b789-post-card p { margin: 0; color: var(--b789-muted); font-size: 14px; }
.b789-pagination { margin-top: 30px; }
.b789-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.b789-pagination a, .b789-pagination span { display: grid; place-items: center; min-width: 40px; min-height: 40px; padding: 7px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--b789-line); text-decoration: none; }
.b789-pagination .current { color: #111; background: var(--b789-accent); border-color: var(--b789-accent); font-weight: 900; }

/* Footer */
.b789-footer { margin-top: auto; color: #c7cbd2; background: #0b0c0f; border-top: 3px solid var(--b789-accent); }
.b789-footer__main { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding-block: 34px 26px; }
.b789-footer p { margin: 0; color: #aeb3bd; font-size: 14px; }
.b789-footer a { color: #bdc2ca; text-decoration: none; }
.b789-footer a:hover { color: var(--b789-accent); }
.b789-footer__about { max-width: 470px; }
.b789-footer__about .b789-brand-link { margin-bottom: 10px; }
.b789-footer__policy { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; max-width: 560px; padding-top: 4px; }
.b789-footer__policy a { position: relative; color: #d6d9df; font-size: 12px; font-weight: 700; }
.b789-footer__policy a:not(:last-child)::after { content: "•"; position: absolute; right: -12px; color: var(--b789-accent); }
.b789-footer__legal { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.08); }
.b789-footer__legal-inner { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.b789-footer__legal-copy { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.b789-footer__legal p { margin: 0; font-size: 12px; }
.b789-footer__age { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 2px solid var(--b789-accent); border-radius: 50%; color: #fff; font-weight: 900; }

/* Forms and misc */
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="password"], textarea, select {
  width: 100%; padding: 12px 13px; border: 1px solid #d9dce2; border-radius: 8px; background: #fff; color: #17191e;
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(255,121,0,.25); border-color: var(--b789-accent); }
input[type="submit"], .wp-block-button__link { padding: 12px 18px; border: 0; border-radius: 8px; background: var(--b789-accent); color: #111; font-weight: 900; }

@media (max-width: 1080px) {
  .b789-header__inner { grid-template-columns: auto 1fr auto; gap: 14px; }
  .b789-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #111318; border-top: 1px solid rgba(255,255,255,.08); box-shadow: 0 18px 32px rgba(0,0,0,.25); }
  .b789-nav.is-open { display: block; }
  .b789-nav ul { display: block; padding: 10px 16px 18px; }
  .b789-nav a { min-height: 44px; }
  .b789-menu-toggle { display: block; justify-self: end; }
  .b789-hero__inner { grid-template-columns: minmax(0, .95fr) minmax(390px, 1.05fr); gap: 32px; }
  .b789-content-grid { grid-template-columns: 210px minmax(0, 1fr); }
  .b789-post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .admin-bar .b789-header { top: 46px; }
  .b789-topbar__trust { display: none; }
  .b789-topbar__inner { justify-content: center; text-align: center; }
  .b789-header__inner { min-height: 64px; }
  .b789-hero__inner { grid-template-columns: 1fr; min-height: 0; padding-block: 42px; }
  .b789-hero__media { display: block; margin-top: 4px; }
  .b789-quicknav__inner { grid-template-columns: repeat(2, 1fr); }
  .b789-quicknav a:nth-child(2) { border-right: 0; }
  .b789-content-grid { display: block; }
  .b789-toc { position: static; margin-bottom: 18px; }
  .b789-footer__main { gap: 28px; }
  .b789-footer__policy { max-width: 500px; }
}

@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .b789-container { width: min(calc(100% - 22px), var(--b789-container)); }
  .b789-topbar { display: none; }
  .b789-brand { min-width: 0; }
  .b789-brand-link .custom-logo { max-width: 158px; max-height: 44px; }
  .b789-site-title { font-size: 20px; }
  .b789-hero__inner { padding-block: 32px; }
  .b789-hero h1 { font-size: 31px; }
  .b789-hero__excerpt { font-size: 15.5px; }
  .b789-hero__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .b789-hero__actions .b789-btn { min-width: 0; padding-inline: 10px; }
  .b789-quicknav a { min-height: 58px; padding: 10px 12px; font-size: 13px; }
  .b789-quicknav__icon { width: 30px; height: 30px; flex-basis: 30px; }
  .b789-content-wrap { padding-block: 20px 38px; }
  .b789-entry { padding: 22px 18px; border-radius: 11px; }
  .b789-entry--plain { width: min(calc(100% - 22px), 920px); margin-block: 22px 38px; }
  .b789-entry-content h2 { margin-top: 34px; font-size: 25px; }
  .b789-entry-content h3 { font-size: 20px; }
  .b789-entry-content table { display: block; width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: normal; }
  .b789-entry-content .wp-block-table, .b789-entry-content figure.wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .b789-post-grid { grid-template-columns: 1fr; }
  .b789-footer__main { flex-direction: column; gap: 18px; padding-block: 28px 22px; }
  .b789-footer__policy { justify-content: flex-start; max-width: none; gap: 7px 14px; padding-top: 0; }
  .b789-footer__policy a:not(:last-child)::after { right: -9px; }
  .b789-footer__legal-inner { align-items: flex-start; }
  .b789-footer__legal-copy { display: block; }
  .b789-footer__legal-copy p + p { margin-top: 4px; }
}

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