/* =============================================================
   ArsomTrader — Landing (public) · Editorial  (v2: mobile + dark)
   ใช้ token จาก style.css (--text, --muted, --dim, --line, --card, --bg2)
   + token เฉพาะหน้านี้ (--ed-*) ที่มีค่าโหมดมืดครบ
   ============================================================= */
:root {
  --ed-display: "Taviraj", "Noto Serif Thai", Georgia, serif;
  --ed-body: "Anuphan", "Sarabun", "Noto Sans Thai", system-ui, sans-serif;
  --ed-accent: #005244;        /* หัวเรื่อง / ตัวเลข / ไอคอน */
  --ed-accent-soft: #00866E;
  --ed-ink-on-accent: #ffffff;
  --ed-band: #005244;          /* แถบเขียวเข้ม "อะไรจะกลับข้าง" */
  --ed-band-text: #CFE8DF;
  --ed-band-kicker: #7FC8B5;
  --ed-good: #15803d;
  --ed-bad: #DC2626;
  --ed-warn: #B45309;
  --ed-warn-bg: #FFF5E3;
  --ed-warn-line: #EAC98A;
  --ed-lean-bg: #EAF8F0;
  --ed-lean-line: #9AD7BE;
  --ed-alert-bg: #FFF0F0;
  --ed-alert-line: #F5B5B5;
  --ed-label: #5B6975;         /* ป้ายเล็ก — เข้มกว่า --dim เดิมให้อ่านออก */
  --ed-seg: #E3EAEC;
}
[data-theme="dark"] {
  --ed-accent: #7FE0B8;
  --ed-accent-soft: #38bdf8;
  --ed-ink-on-accent: #0b1220;
  --ed-band: #0f2a24;
  --ed-band-text: #cfe8df;
  --ed-band-kicker: #7fc8b5;
  --ed-good: #4ade80;
  --ed-bad: #f87171;
  --ed-warn: #fbbf24;
  --ed-warn-bg: #2a2110;
  --ed-warn-line: #6b5320;
  --ed-lean-bg: #0f2a24;
  --ed-lean-line: #2f6b57;
  --ed-alert-bg: #2e1616;
  --ed-alert-line: #7a2e2e;
  --ed-label: #a3b0bf;
  --ed-seg: #22304a;
}

body.ed-page { font-family: var(--ed-body); }
.ed-page .container { max-width: 1180px; }

/* ---------- small type: ใหญ่พอ อ่านออก ไม่ถ่างตัวอักษรไทย ---------- */
.ed-eyebrow { display: block; font-size: .86rem; font-weight: 600; color: var(--ed-label); letter-spacing: .3px; }
.ed-eyebrow.light { color: var(--ed-band-kicker); }
.ed-en { font-size: .88rem; color: var(--ed-label); }
.ed-num { font-family: var(--ed-display); font-weight: 600; color: var(--ed-accent); font-size: 1rem; }
.ed-rule { height: 1px; background: var(--line); margin: 20px 0 26px; }
.ed-link { font-weight: 700; color: var(--ed-accent); }
.good { color: var(--ed-good); } .bad { color: var(--ed-bad); }
.ed-page p { text-wrap: pretty; }

/* ---------- Topbar ---------- */
.ed-topbar .ed-tagline { font-size: .86rem; color: var(--ed-label); }
@media (max-width: 720px) {
  .ed-topbar .ed-tagline { display: none; }
  .ed-topbar .nav { flex-wrap: wrap; row-gap: 0; }
  .ed-topbar .nav a { font-size: .9rem; }
}

/* ---------- Hero ---------- */
.ed-hero { padding-top: 48px; }
.ed-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.ed-hero-text { display: flex; flex-direction: column; gap: 14px; }
.ed-kicker-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-dash { width: 32px; height: 1px; background: var(--ed-label); }
.ed-date { font-size: .86rem; color: var(--ed-label); }
.ed-title { font-family: var(--ed-display); font-size: clamp(2.9rem, 6.6vw, 5.4rem); line-height: 1.05; font-weight: 700; letter-spacing: -.5px; margin: 2px 0 0; color: var(--ed-accent); }
.ed-title.tone-caution { color: var(--ed-warn); } .ed-title.tone-alert { color: var(--ed-bad); } .ed-title.tone-neutral { color: var(--ed-accent-soft); }
.ed-tagline-big { font-family: var(--ed-display); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.4; font-weight: 500; margin: 0; color: var(--text); }

.ed-direction { display: flex; align-items: flex-start; gap: 14px; margin-top: 8px; padding: 14px 18px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.ed-dir-changing { background: var(--ed-warn-bg); border-color: var(--ed-warn-line); color: var(--ed-warn); }
.ed-dir-leaning  { background: var(--ed-lean-bg); border-color: var(--ed-lean-line); color: var(--ed-accent); }
.ed-dir-panic    { background: var(--ed-alert-bg); border-color: var(--ed-alert-line); color: var(--ed-bad); }
.ed-direction svg { flex-shrink: 0; margin-top: 2px; }
.ed-dir-head { font-weight: 700; font-size: 1.05rem; color: var(--text); line-height: 1.4; }
.ed-dir-sub { font-size: .92rem; color: var(--muted); margin-top: 2px; }

.ed-stats { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 12px 32px; margin-top: 6px; justify-content: start; }
.ed-stats > div { display: flex; flex-direction: column; gap: 2px; }
.ed-stat { font-family: var(--ed-display); font-size: 1.75rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.ed-stat small { font-family: var(--ed-body); font-size: .95rem; font-weight: 500; color: var(--muted); }
.ed-stat.tone-caution { color: var(--ed-warn); }

/* wheel */
.ed-wheel { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ed-wheel svg { width: 100%; max-width: 560px; height: auto; font-family: var(--ed-body); }
.ed-wheel figcaption { font-size: .86rem; color: var(--ed-label); text-align: center; }
.ed-wheel a { text-decoration: none; }
.wheel-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.wheel-ring2 { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; opacity: .6; }
.wheel-cap { font-size: 15px; fill: var(--ed-label); font-weight: 600; }
.wheel-center { font-family: var(--ed-display); font-size: 28px; font-weight: 600; fill: var(--text); }
.wheel-arrow { fill: none; stroke: #D88600; stroke-width: 2.5; stroke-dasharray: 7 6; }
.wheel-node { fill: var(--card); }
.wheel-lbl { font-size: 22px; fill: var(--muted); font-weight: 500; }
.wheel-lbl-active { font-size: 24px; font-weight: 700; }
.wheel-lbl-target { font-size: 24px; font-weight: 700; fill: var(--text); }
.wheel-tag { font-size: 15px; font-weight: 600; }
.wheel-target-fill { fill: var(--ed-warn-bg); }

/* meters */
.ed-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 36px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.ed-meter { padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--line); }
.ed-meter:last-child { border-right: none; }
.ed-meter-bar { display: flex; gap: 6px; }
.ed-seg { flex: 1; height: 7px; border-radius: 4px; background: var(--ed-seg); }
.ed-meter-labels { display: flex; justify-content: space-between; font-size: .86rem; color: var(--ed-label); }
.ed-meter-note { font-size: .98rem; color: var(--text); }

/* what + groups */
.ed-two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 48px; }
.ed-what { display: flex; flex-direction: column; gap: 14px; padding-right: 32px; border-right: 1px solid var(--line); }
.ed-lede { font-family: var(--ed-display); font-size: 1.3rem; line-height: 1.6; margin: 0; color: var(--text); }
.ed-signs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 1rem; }
.ed-signs li { display: flex; gap: 12px; align-items: flex-start; }
.ed-signs .ed-num { min-width: 24px; font-size: .95rem; }
.ed-ends { font-size: .9rem; color: var(--ed-label); border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
.ed-groups { display: flex; flex-direction: column; gap: 14px; }
.ed-groups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ed-g-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .98rem; margin-bottom: 6px; }
.ed-groups ul { list-style: none; margin: 0; padding: 0; }
.ed-groups li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.ed-note { font-size: .86rem; color: var(--ed-label); }

/* shift band */
.ed-shift { margin-top: 48px; background: var(--ed-band); color: #fff; border-radius: 6px; padding: 40px 44px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: center; }
.ed-shift-title { font-family: var(--ed-display); font-size: clamp(1.45rem, 2.6vw, 2.05rem); font-weight: 600; line-height: 1.3; margin: 6px 0 10px; color: #fff; }
.ed-shift p { margin: 0; color: var(--ed-band-text); font-size: 1rem; line-height: 1.65; }
.ed-shift-rows { display: flex; flex-direction: column; }
.ed-shift-row { display: grid; grid-template-columns: 1fr 36px auto; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.16); font-size: 1rem; color: var(--ed-band-text); }
.ed-shift-row:last-child { border-bottom: none; }
.ed-shift-row svg { color: var(--ed-band-kicker); }
.ed-shift-row .good { color: #9FE3C4; font-weight: 600; } .ed-shift-row .bad { color: #FFB4B4; font-weight: 600; }

/* ---------- Sections ---------- */
.ed-section { padding-top: 64px; }
.ed-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ed-h2 { font-family: var(--ed-display); font-size: clamp(1.75rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin: 4px 0 0; color: var(--text); }
.ed-section-sub { max-width: 520px; color: var(--muted); margin: 0; font-size: 1rem; }

.ed-regime-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.ed-regime { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 3px solid var(--dim); scroll-margin-top: 80px; }
.ed-regime.tone-positive { border-top-color: var(--ed-good); } .ed-regime.tone-caution { border-top-color: #D88600; }
.ed-regime.tone-alert { border-top-color: var(--ed-bad); } .ed-regime.tone-neutral { border-top-color: var(--ed-accent-soft); }
.ed-regime.is-current { border-top-color: var(--ed-accent); }
.ed-regime h3 { font-family: var(--ed-display); font-size: 1.4rem; font-weight: 600; margin: 0; color: var(--text); }
.ed-regime p { margin: 0; font-size: .96rem; color: var(--muted); }
.ed-regime-groups { display: flex; flex-direction: column; gap: 3px; font-size: .9rem; }

.ed-how { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; align-items: start; }
.ed-how-side { position: sticky; top: 24px; }
.ed-how-list { display: flex; flex-direction: column; }
.ed-how-item { display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); color: var(--ed-accent); }
.ed-how-item:last-child { border-bottom: 1px solid var(--line); }
.ed-how-item h3 { font-family: var(--ed-display); font-size: 1.35rem; font-weight: 600; margin: 0 0 4px; color: var(--text); }
.ed-how-item h3 span { font-family: var(--ed-body); font-size: .88rem; color: var(--ed-label); font-weight: 500; margin-left: 6px; }
.ed-how-item p { margin: 0; color: var(--muted); }

.ed-articles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.ed-article { display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
.ed-article:hover { text-decoration: none; } .ed-article:hover h3 { color: var(--ed-accent); }
.ed-article h3 { font-family: var(--ed-display); font-size: 1.3rem; font-weight: 600; line-height: 1.35; margin: 0; }
.ed-article p { margin: 0; color: var(--muted); font-size: .96rem; }

.ed-page .faq-item summary { font-size: 1.02rem; }
.ed-footer { margin-top: 64px; }
.ed-footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.ed-footer strong { color: var(--text); }

/* =============================================================
   Mobile — จัดลำดับใหม่: หัวเรื่อง → ทิศทาง → ตัวเลข → วงล้อ → มิเตอร์
   ============================================================= */
@media (max-width: 960px) {
  .ed-hero { padding-top: 28px; }
  .ed-hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .ed-title { font-size: clamp(2.6rem, 13vw, 3.6rem); }
  .ed-tagline-big { font-size: 1.2rem; }
  .ed-wheel { margin-top: 8px; padding: 12px 0 0; border-top: 1px solid var(--line); }
  .ed-wheel svg { max-width: 420px; }
  .ed-meters { grid-template-columns: 1fr; margin-top: 24px; }
  .ed-meter { border-right: none; border-bottom: 1px solid var(--line); padding: 16px 18px; }
  .ed-meter:last-child { border-bottom: none; }
  .ed-two { grid-template-columns: 1fr; gap: 28px; margin-top: 36px; }
  .ed-what { padding-right: 0; border-right: none; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .ed-lede { font-size: 1.15rem; }
  .ed-shift { grid-template-columns: 1fr; gap: 20px; padding: 26px 20px; margin-top: 36px; }
  .ed-section { padding-top: 48px; }
  .ed-regime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .ed-how { grid-template-columns: 1fr; gap: 16px; }
  .ed-how-side { position: static; }
  .ed-how-item { grid-template-columns: 40px 1fr; gap: 14px; padding: 18px 0; }
  .ed-how-item svg { width: 36px; height: 36px; }
  .ed-articles { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 560px) {
  .ed-stats { grid-template-columns: 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
  .ed-stats > div { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .ed-stats > div:last-child { border-bottom: none; }
  .ed-stat { font-size: 1.3rem; text-align: right; }
  .ed-eyebrow { font-size: .82rem; }
  .ed-groups-grid { grid-template-columns: 1fr; gap: 16px; }
  .ed-regime-grid { grid-template-columns: 1fr; }
  .ed-shift-row { grid-template-columns: 1fr 28px auto; font-size: .95rem; }
  .ed-meter-labels { font-size: .8rem; }
}
