/* 678.in.th – Crypto Editorial Theme */
:root {
  --c-bg: #0f1117;
  --c-surface: #1a1d27;
  --c-border: #2a2d3a;
  --c-accent: #f59e0b;
  --c-accent2: #3b82f6;
  --c-text: #e2e4ed;
  --c-muted: #8b8fa8;
  --c-heading: #ffffff;
  --c-card: #1e2130;
  --font-sans: 'IBM Plex Sans Thai', 'Noto Sans Thai', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-w: 780px;
  --max-w-wide: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1,h2,h3,h4 { color: var(--c-heading); font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); margin: 2.5rem 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--c-accent); display: inline-block; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
p  { margin-bottom: 1.2rem; }
a  { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--c-heading); }

/* ── Layout ── */
.container { width: 100%; max-width: var(--max-w-wide); margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: var(--max-w); }

/* ── Header / Nav ── */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-logo {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: 1.2rem; color: var(--c-heading);
  text-decoration: none;
}
.site-logo .badge {
  background: var(--c-accent);
  color: #000;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: .05em;
}
.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a { color: var(--c-muted); font-size: .9rem; transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--c-accent); text-decoration: none; }

/* ── Ticker ── */
.ticker-bar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: .4rem 0;
  overflow: hidden;
  font-size: .78rem;
  font-family: var(--font-mono);
}
.ticker-inner { display: flex; gap: 2rem; white-space: nowrap; }
.ticker-item { display: flex; gap: .4rem; align-items: center; }
.ticker-symbol { color: var(--c-muted); }
.ticker-price { color: var(--c-heading); font-weight: 600; }
.ticker-up { color: #22c55e; }
.ticker-down { color: #ef4444; }

/* ── Hero Article ── */
.hero-article {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--c-border);
}
.hero-article .category-tag {
  display: inline-block;
  background: var(--c-accent);
  color: #000;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
}
.hero-article h1 { margin-bottom: 1rem; }
.hero-article .excerpt { font-size: 1.1rem; color: var(--c-muted); line-height: 1.6; }
.hero-article .meta { margin-top: 1.5rem; font-size: .82rem; color: var(--c-muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-article .meta span { display: flex; align-items: center; gap: .3rem; }

/* ── Article Grid ── */
.section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-accent);
  margin: 2.5rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--c-border);
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.article-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.article-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
}
.article-card .card-body { padding: 1.2rem; }
.article-card .card-cat {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-accent); margin-bottom: .5rem;
}
.article-card h3 { font-size: .95rem; line-height: 1.4; margin-bottom: .5rem; }
.article-card h3 a { color: var(--c-heading); text-decoration: none; }
.article-card h3 a:hover { color: var(--c-accent); }
.article-card .card-meta { font-size: .75rem; color: var(--c-muted); margin-top: .8rem; }

/* ── Article Page ── */
.article-wrap { padding: 2.5rem 0 4rem; }
.article-header { margin-bottom: 2rem; }
.article-header .breadcrumb { font-size: .78rem; color: var(--c-muted); margin-bottom: 1rem; }
.article-header .breadcrumb a { color: var(--c-muted); }
.article-header .breadcrumb a:hover { color: var(--c-accent); }
.article-header .cat-tag {
  display: inline-block;
  background: var(--c-accent);
  color: #000; font-size: .7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 1rem;
}
.article-meta {
  display: flex; gap: 1.2rem; flex-wrap: wrap;
  margin-top: 1rem; font-size: .82rem; color: var(--c-muted);
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--c-border);
}

/* ── Article Body ── */
.article-body { max-width: var(--max-w); }
.article-body h2 {
  font-size: 1.35rem; margin: 2.5rem 0 .8rem;
  padding-bottom: .4rem; border-bottom: 2px solid var(--c-accent);
  display: block; width: 100%;
}
.article-body p { color: var(--c-text); line-height: 1.85; }

.article-body .callout {
  background: rgba(245,158,11,.08);
  border-left: 3px solid var(--c-accent);
  padding: 1rem 1.2rem; border-radius: 0 6px 6px 0;
  margin: 1.5rem 0;
}
.article-body .callout strong { color: var(--c-accent); }

/* ── Table of Contents ── */
.toc {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0 2rem;
}
.toc-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--c-accent); margin-bottom: .8rem; }
.toc ol { padding-left: 1.2rem; }
.toc li { margin-bottom: .4rem; }
.toc a { font-size: .88rem; color: var(--c-muted); }
.toc a:hover { color: var(--c-accent); }

/* ── Data Table ── */
.data-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .88rem; }
.data-table th { background: var(--c-surface); color: var(--c-accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: .7rem 1rem; text-align: left; border-bottom: 2px solid var(--c-border); }
.data-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--c-border); }
.data-table tr:hover td { background: rgba(255,255,255,.03); }
.data-table .up { color: #22c55e; font-weight: 600; }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--c-border); padding: 1.2rem 0; }
.faq-q { font-weight: 700; color: var(--c-heading); margin-bottom: .5rem; font-size: .95rem; }
.faq-a { color: var(--c-muted); font-size: .9rem; line-height: 1.7; }

/* ── CTA Box ── */
.cta-box {
  background: linear-gradient(135deg, rgba(245,158,11,.1), rgba(59,130,246,.1));
  border: 1px solid var(--c-accent);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  margin: 2.5rem 0;
}
.cta-box h3 { margin-bottom: .5rem; }
.cta-box p { color: var(--c-muted); margin-bottom: 1.2rem; }
.btn {
  display: inline-block;
  background: var(--c-accent);
  color: #000; font-weight: 700; font-size: .9rem;
  padding: .6rem 1.4rem; border-radius: 6px;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; text-decoration: none; }

/* ── Sidebar / Layout ── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.sidebar { position: sticky; top: 80px; }
.sidebar-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}
.sidebar-card .sidebar-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--c-accent); margin-bottom: 1rem; }
.related-list li { list-style: none; padding: .5rem 0; border-bottom: 1px solid var(--c-border); }
.related-list li:last-child { border-bottom: none; }
.related-list a { font-size: .85rem; color: var(--c-text); line-height: 1.4; }
.related-list a:hover { color: var(--c-accent); }

/* ── Footer ── */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 2.5rem 0;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-about p { font-size: .85rem; color: var(--c-muted); line-height: 1.7; margin-top: .5rem; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-accent); margin-bottom: .8rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul a { font-size: .85rem; color: var(--c-muted); }
.footer-col ul a:hover { color: var(--c-accent); }
.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding-top: 1.2rem;
  font-size: .78rem; color: var(--c-muted);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.footer-disclaimer { font-size: .72rem; color: var(--c-muted); margin-top: 1rem; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .site-nav { display: none; }
  .article-grid { grid-template-columns: 1fr; }
  .ticker-inner { animation: ticker-scroll 20s linear infinite; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .data-table { font-size: .78rem; }
  .data-table th, .data-table td { padding: .5rem .6rem; }
}

@media (max-width: 400px) {
  .container { padding: 0 1rem; }
  .article-meta { flex-direction: column; gap: .4rem; }
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Utility ── */
.text-muted { color: var(--c-muted); }
.text-accent { color: var(--c-accent); }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
