/*
 * ============================================================
 *  CONTENT CLINIC — Shared Design System
 *  main.css v1.0
 *
 *  ⚡ SINGLE SOURCE OF TRUTH for all colors, fonts, spacing.
 *     Edit here → updates every page that links this file.
 *
 *  Used by: blog/ pages, blog/index.html
 *  NOT yet used by: index-th-v2.html (homepage has its own <style>)
 * ============================================================
 */

/* ============================================================
   1. DESIGN TOKENS — change brand colors / spacing HERE only
   ============================================================ */
:root {
  /* Brand colors */
  --yellow:      #FFE600;
  --yellow-dark: #F0D800;
  --black:       #0D0D0D;
  --white:       #FFFFFF;
  --gray:        #F5F5F5;
  --gray-mid:    #E8E8E8;
  --orange:      #FF8C00;
  --green:       #22c55e;
  --text-muted:  #555;

  /* Borders */
  --border:      3px solid #0D0D0D;
  --border-thin: 2px solid #0D0D0D;

  /* Radius */
  --radius:    12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  /* Spacing */
  --section-pad: 80px;
  --container-max: 760px;
  --container-wide-max: 960px;

  /* Font stacks */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
  --font-thai:    'Sarabun', sans-serif;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-thai);
  background: var(--white);
  color: var(--black);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* Thai text always uses Sarabun + generous line-height */
.th {
  font-family: var(--font-thai);
  line-height: 1.85;
}

/* ============================================================
   3. LAYOUT
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: var(--container-wide-max);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--section-pad) 0;
}

/* ============================================================
   4. TYPOGRAPHY UTILITIES
   ============================================================ */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.headline {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

/* Highlight — yellow background on inline text */
.hl {
  background: var(--yellow);
  color: var(--black);
  padding: 0 6px;
}
.yl { background: var(--yellow); padding: 0 6px; } /* alias */

/* ============================================================
   5. SHARED COMPONENTS
   ============================================================ */

/* --- Tag / Badge --- */
.tag-badge {
  display: inline-block;
  background: var(--yellow);
  border: var(--border-thin);
  border-radius: var(--radius-xs);
  padding: 4px 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--black);
}

/* --- Pill label --- */
.pill {
  display: inline-block;
  background: var(--yellow);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-thai);
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  line-height: 1.2;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 5px 5px 0 var(--black);
}
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-secondary { background: var(--black); color: var(--white); }
.btn-outline { background: transparent; color: var(--black); }

/* --- Cards --- */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 6px 6px 0 var(--black);
}
.card-dark {
  background: var(--black);
  color: var(--white);
}
.card-yellow {
  background: var(--yellow);
  color: var(--black);
}

/* ============================================================
   6. NAVIGATION — Blog / Article pages
   (Slim, centered, max-width 960px)
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: var(--container-wide-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

/* Logo */
.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-mark {
  background: var(--yellow);
  border: var(--border-thin);
  border-radius: var(--radius-xs);
  padding: 3px 9px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--black);
  line-height: 1;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--black);
}

/* Back link */
.nav-back {
  font-family: var(--font-thai);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-back:hover { color: var(--black); }

/* CTA button in nav */
.nav-cta {
  background: var(--yellow);
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-family: var(--font-thai);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--black);
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--black);
}

/* Nav right group */
.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ============================================================
   7. ARTICLE HERO
   ============================================================ */
.article-hero {
  background: var(--black);
  padding: 64px 24px 56px;
  border-bottom: var(--border);
}

.article-tag {
  display: inline-block;
  background: var(--yellow);
  border: var(--border-thin);
  border-radius: var(--radius-xs);
  padding: 4px 14px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--black);
  margin-bottom: 20px;
}

.article-hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}
.article-meta span {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}
.article-meta strong { color: rgba(255,255,255,0.85); }

/* ============================================================
   8. ANSWER CAPSULE (for AI/AISO citation)
   ============================================================ */
.answer-capsule {
  background: var(--yellow);
  border: var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 40px 0;
}
.answer-capsule-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(0,0,0,0.4);
  margin-bottom: 10px;
}
.answer-capsule p {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.7;
}

/* ============================================================
   9. ARTICLE BODY
   ============================================================ */
.article-body {
  padding: 56px 0 80px;
}

.article-body h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 3.5vw, 38px);
  text-transform: uppercase;
  line-height: 1.05;
  margin: 48px 0 16px;
  color: var(--black);
}

.article-body h3 {
  font-family: var(--font-thai);
  font-size: 20px;
  font-weight: 800;
  margin: 32px 0 12px;
  color: var(--black);
}

.article-body p {
  font-size: 16px;
  color: #333;
  margin-bottom: 18px;
}

.article-body strong { color: var(--black); }

.article-body ul,
.article-body ol {
  padding-left: 0;
  margin-bottom: 20px;
  list-style: none;
}

.article-body li {
  font-size: 16px;
  color: #333;
  padding: 10px 0 10px 30px;
  border-bottom: 1px solid #eee;
  position: relative;
}
.article-body li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 900;
}

.article-body ol { counter-reset: ol-counter; }
.article-body ol li { counter-increment: ol-counter; }
.article-body ol li::before {
  content: counter(ol-counter) ".";
  color: var(--black);
  font-weight: 900;
}

/* ============================================================
   10. STAT BOX (highlight numbers)
   ============================================================ */
.stat-box {
  background: var(--black);
  border: var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: transform 0.2s;
}
.stat-box:hover { transform: translateY(-4px); }
.stat-box .stat-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  color: var(--yellow);
  line-height: 1;
}
.stat-box .stat-label {
  font-family: var(--font-thai);
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
  line-height: 1.6;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

/* ============================================================
   11. COMPARISON TABLE
   ============================================================ */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.comparison-table th {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  text-align: left;
}
.comparison-table th.featured { background: var(--yellow); color: var(--black); }
.comparison-table td {
  padding: 12px 18px;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  color: #333;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:nth-child(even) td { background: var(--gray); }
.comparison-table .check { color: var(--green); font-weight: 800; }
.comparison-table .cross { color: #ccc; }
.comparison-table .featured-col { background: rgba(255,230,0,0.08); }

/* ============================================================
   12. FAQ ACCORDION
   ============================================================ */
.faq-item {
  border: var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  background: var(--white);
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: 16px;
  transition: background 0.15s;
  gap: 12px;
}
.faq-question:hover { background: var(--gray); }
.faq-question.open { background: var(--yellow); }

.faq-icon {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--black);
  flex-shrink: 0;
  transition: transform 0.2s;
  width: 24px;
  text-align: center;
}
.faq-question.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 18px 22px;
  border-top: 2px solid var(--black);
  background: var(--white);
  font-family: var(--font-thai);
  font-size: 15px;
  line-height: 1.85;
  color: #333;
}
.faq-answer.open { display: block; }

/* ============================================================
   13. RELATED POSTS GRID
   ============================================================ */
.related-posts {
  background: var(--gray);
  border-top: var(--border);
  padding: 60px 24px;
}

.related-posts h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
  text-transform: uppercase;
  margin-bottom: 28px;
  color: var(--black);
}

.related-grid {
  max-width: var(--container-wide-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.related-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--black);
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 6px 6px 0 var(--black);
}

.related-card-cat {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}

.related-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.15;
  color: var(--black);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.related-card-desc {
  font-family: var(--font-thai);
  font-size: 13px;
  line-height: 1.75;
  color: #555;
}

/* ============================================================
   14. ARTICLE CTA BLOCK
   ============================================================ */
.article-cta {
  background: var(--yellow);
  border: var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin: 48px 0 32px;
  text-align: center;
}
.article-cta h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 10px;
}
.article-cta p {
  font-family: var(--font-thai);
  font-size: 15px;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.75;
}

/* ============================================================
   15. FOOTER (article pages)
   ============================================================ */
footer {
  background: var(--white);
  border-top: var(--border);
  padding: 28px 24px;
}
.footer-inner {
  max-width: var(--container-wide-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-copy {
  font-family: var(--font-thai);
  font-size: 13px;
  color: #999;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-family: var(--font-thai);
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

/* ============================================================
   16. RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav-logo-text { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .answer-capsule { padding: 20px; }
  .article-hero { padding: 48px 20px 40px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
