﻿/* MAXIMUM DARK FORCE · override parent theme / WP wrapper · belt-and-suspenders */
html, body, .page, .container, .main, main, article, section,
.wp-block-group, .entry-content, .site-content, #content, #main {
  background-color: #0a0a0c !important;
  color: #f4f0e6 !important;
}
[class*="bg-white"], .bg-light, [style*="background:#fff"], [style*="background: #fff"],
[style*="background:white"], [style*="background: white"] {
  background-color: transparent !important;
}
/* DARK THEME FORCED - iCafeFX brand identity */
:root {
  --bg: #0a0a0c !important;
  --bg-elev: #14141a !important;
  --bg-card: #1a1a22 !important;
  --bg-hover: #22222c !important;
  --fg: #f4f0e6 !important;
  --fg-dim: #a8a5a0 !important;
  --fg-mute: #6b6863 !important;
  --gold: #D4A853 !important;
  --gold-dim: #b8924a !important;
  --gold-soft: rgba(212, 168, 83, 0.12) !important;
  --gold-line: rgba(212, 168, 83, 0.3) !important;
  --line: rgba(244, 240, 230, 0.1) !important;
  --line-strong: rgba(244, 240, 230, 0.15) !important;
  color-scheme: dark !important;
}

html, body {
  background: #0a0a0c !important;
  color: #f4f0e6 !important;
  color-scheme: dark !important;
}

/* ============================================================
   iCafeFX Manual Â· Custom Stylesheet v1.0
   Design: Editorial trader aesthetic Â· Dark with gold accents
   Brand color: #D4A853 (iCafeFX gold)
   Fonts: Sarabun (Thai), Fraunces (display), JetBrains Mono (code/numbers)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Brand palette */
  --gold: #D4A853;
  --gold-dim: #b8924a;
  --gold-soft: rgba(212, 168, 83, 0.12);
  --gold-line: rgba(212, 168, 83, 0.3);
  
  /* Dark foundation */
  --bg: #0a0a0c;
  --bg-elev: #14141a;
  --bg-card: #1a1a22;
  --bg-hover: #22222c;
  
  /* Text */
  --fg: #f4f0e6;
  --fg-dim: #a8a5a0;
  --fg-mute: #6b6863;
  
  /* Accents */
  --line: rgba(244, 240, 230, 0.08);
  --line-strong: rgba(244, 240, 230, 0.15);
  --bull: #4ade80;
  --bear: #f87171;
  --news: #fbbf24;
  
  /* Type system */
  --font-display: 'Fraunces', 'Sarabun', Georgia, serif;
  --font-body: 'Sarabun', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Sarabun', monospace;
  
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
}

/* Light theme override removed Â· dark is brand default */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Texture / atmosphere ============ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 1200px 600px at 70% -10%, var(--gold-soft), transparent 60%),
    radial-gradient(ellipse 800px 400px at 10% 100%, rgba(212, 168, 83, 0.04), transparent 60%);
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, 0.005) 2px,
      rgba(255, 255, 255, 0.005) 4px
    );
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ============ Layout ============ */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

/* ============ Top nav ============ */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 64px;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 12, 0.85);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--gold);
}

.brand-sub {
  font-size: 11px;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.nav-actions {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--fg-dim);
}

.nav-actions a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-actions a:hover {
  color: var(--gold);
}

/* ============ Hero ============ */
.hero {
  padding: 80px 0 120px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 80px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  padding: 6px 12px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  margin-bottom: 32px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 24px;
}

.hero h1 .accent {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

.hero-lead {
  font-size: 22px;
  color: var(--fg-dim);
  max-width: 720px;
  margin-bottom: 48px;
  line-height: 1.5;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.hero-meta dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-mute);
  margin-bottom: 6px;
}

.hero-meta dd {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--fg);
}

.hero-meta dd.gold {
  color: var(--gold);
}

/* ============ Chapter cards (index page) ============ */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin: 64px 0;
}

.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.chapter-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, transparent 60%, var(--gold-soft));
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.chapter-card:hover {
  border-color: var(--gold-line);
  transform: translateY(-2px);
}

.chapter-card:hover::after {
  opacity: 1;
}

.chapter-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.chapter-desc {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.55;
}

.chapter-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ============ Chapter content layout ============ */
.chapter-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 80px;
  padding: 40px 0 120px;
}

@media (min-width: 1024px) {
  .chapter-page {
    grid-template-columns: 200px 1fr;
    gap: 80px;
  }
}

.chapter-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  font-size: 13px;
}

.chapter-sidebar h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-mute);
  margin-bottom: 16px;
}

.toc {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--fg-dim);
  text-decoration: none;
  border-left: 2px solid var(--line);
  transition: all 0.2s;
}

.toc a:hover, .toc a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  padding-left: 20px;
}

.chapter-main {
  max-width: 760px;
}

/* Section headers */
.section {
  margin-bottom: 64px;
  scroll-margin-top: 100px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.section-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.section h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 32px 0 16px;
  letter-spacing: -0.01em;
}

.section p {
  margin-bottom: 16px;
  color: var(--fg-dim);
  font-size: 17px;
}

.section strong {
  color: var(--fg);
  font-weight: 600;
}

/* TL;DR list */
.tldr-list {
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 24px 0;
}

.tldr-list li {
  position: relative;
  padding: 8px 0 8px 24px;
  color: var(--fg);
  font-size: 16px;
}

.tldr-list li::before {
  content: 'â†’';
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--gold);
  font-weight: 600;
}

.tldr-list li + li {
  border-top: 1px solid var(--line);
}

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 24px 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 0 16px 56px;
  color: var(--fg-dim);
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: var(--gold-soft);
}

.steps li:last-child {
  border-bottom: none;
}

/* Pro Tip callout */
.pro-tip {
  position: relative;
  background: linear-gradient(135deg, var(--gold-soft), transparent);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  margin: 32px 0;
}

.pro-tip::before {
  content: 'ðŸ’¡ PRO TIP';
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 16px;
  font-weight: 600;
}

.pro-tip blockquote {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.5;
  color: var(--fg);
  font-style: italic;
  border-left: 3px solid var(--gold);
  padding-left: 20px;
  margin: 16px 0;
}

.pro-tip blockquote strong {
  font-style: normal;
  color: var(--gold);
}

.pro-tip-author {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 16px;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}

.faq-question {
  font-weight: 600;
  color: var(--fg);
  font-size: 17px;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.faq-question::before {
  content: 'Q';
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
}

.faq-answer {
  color: var(--fg-dim);
  font-size: 16px;
  padding-left: 22px;
  line-height: 1.6;
}

/* See also */
.see-also {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.see-also a {
  display: block;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.2s;
}

.see-also a:hover {
  border-color: var(--gold-line);
  background: var(--bg-hover);
}

.see-also a small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.see-also a span {
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
}

/* Disclaimer footer */
.disclaimer {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 48px 0;
  font-size: 14px;
  color: var(--fg-dim);
}

.disclaimer strong {
  color: var(--bear);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 600;
}

/* Site footer */
footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 48px;
  margin-top: 80px;
  color: var(--fg-mute);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer-col h5 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--fg-dim);
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}

.tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .page { padding: 0 16px; }
  .hero { padding: 48px 0 64px; }
  .hero h1 { font-size: 44px; }
  .hero-lead { font-size: 17px; }
  .chapter-page { padding: 24px 0 64px; }
  .pro-tip { padding: 24px; }
  .pro-tip blockquote { font-size: 17px; }
}

/* Animation on load */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero, .chapter-card, .section {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chapter-card:nth-child(2) { animation-delay: 0.05s; }
.chapter-card:nth-child(3) { animation-delay: 0.1s; }
.chapter-card:nth-child(4) { animation-delay: 0.15s; }
.chapter-card:nth-child(5) { animation-delay: 0.2s; }
.chapter-card:nth-child(6) { animation-delay: 0.25s; }
.chapter-card:nth-child(7) { animation-delay: 0.3s; }
.chapter-card:nth-child(8) { animation-delay: 0.35s; }
.chapter-card:nth-child(9) { animation-delay: 0.4s; }
.chapter-card:nth-child(10) { animation-delay: 0.45s; }
.chapter-card:nth-child(11) { animation-delay: 0.5s; }
.chapter-card:nth-child(12) { animation-delay: 0.55s; }
