/*
 * SagePath Article Shared Styles
 * Used by: article pages, blog listing, templates
 * All pages link this file instead of duplicating inline <style> blocks.
 */

/* ========================================
   1. DESIGN TOKENS
   ======================================== */
:root {
  --rice-paper: #F5F0E8; --rice-paper-light: #FAF7F2; --rice-paper-dark: #EDE5D8;
  --ink-black: #1A1A1A; --ink-deep: #2D2D2D; --ink-charcoal: #4A4A4A;
  --ink-stone: #8B8680; --ink-light: #B5B0A8; --ink-faint: #D5D0C8;
  --cinnabar: #C43B2F; --cinnabar-dark: #A83228; --cinnabar-faint: rgba(196, 59, 47, 0.1);
  --gold: #C9A961; --gold-light: #D4BC7E;
  --border: rgba(26, 26, 26, 0.08);
  --shadow-ink: 0 4px 20px rgba(26, 26, 26, 0.08);
  --shadow-ink-lg: 0 8px 40px rgba(26, 26, 26, 0.12);
  --shadow-cinnabar: 0 6px 20px rgba(196, 59, 47, 0.3);
  --font-calligraphy: 'Ma Shan Zheng', cursive;
  --font-chinese: 'Noto Serif SC', serif;
  --font-english-title: 'Cinzel', serif;
  --font-english-quote: 'Cormorant Garamond', serif;
  --font-english-body: 'Source Serif 4', serif;
  --radius-sm: 3px; --radius-md: 4px; --radius-lg: 6px;
  --radius-full: 9999px;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   2. BASE RESET
   ======================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: linear-gradient(180deg, var(--rice-paper-light) 0%, var(--rice-paper) 50%, var(--rice-paper-dark) 100%);
  color: var(--ink-black);
  font-family: var(--font-english-body), var(--font-chinese), Georgia, serif;
  font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. NAVIGATION
   ======================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(250, 247, 242, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink-black); }
.nav-seal {
  width: 32px; height: 32px; background: var(--cinnabar); border-radius: 8px 3px 8px 3px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, 'Times New Roman', serif; font-size: 1.2rem; font-weight: 700; line-height: 1; color: #fff;
  transform: rotate(-3deg);
  box-shadow: 0 2px 8px rgba(196, 59, 47, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.nav-seal::after { content: ''; position: absolute; right: 4px; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.nav-seal span { transform: rotate(3deg); }
.nav-brand {
  font-family: var(--font-english-title); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.1em; color: var(--ink-black);
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }

/* Explicit language picker in nav */
.nav-lang-select {
  min-width: 7rem;
  padding: 0.45rem 1.75rem 0.45rem 0.7rem; background: var(--rice-paper, #fffdf9);
  border: 1px solid var(--border, rgba(40, 35, 30, 0.18)); border-radius: 999px;
  font-family: var(--font-chinese); font-size: 0.75rem;
  color: var(--ink-stone); cursor: pointer;
  transition: all var(--transition-base);
}
.nav-lang-select:hover { color: var(--cinnabar); background: var(--cinnabar-faint); }
.nav-lang-select:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }

.nav-links a {
  font-family: var(--font-chinese);
  font-size: 0.8rem; font-weight: 500; color: var(--ink-stone);
  text-decoration: none;
  transition: color var(--transition-base);
}
.nav-links a:hover { color: var(--cinnabar); }
.nav-links a.active { color: var(--ink-black); font-weight: 600; }
.nav-cta {
  padding: 0.5rem 1.25rem; background: var(--ink-black); color: var(--rice-paper) !important;
  border-radius: var(--radius-md); font-size: 0.8rem !important; font-weight: 600 !important;
  font-family: var(--font-chinese);
  transition: all var(--transition-base);
}
.nav-cta:hover { background: var(--cinnabar); box-shadow: var(--shadow-cinnabar); }

/* ========================================
   4. ARTICLE HERO
   ======================================== */
.article-hero {
  position: relative; z-index: 1; max-width: 720px; margin: 0 auto;
  padding: 4rem 1.5rem 3rem; text-align: center;
}
.article-tag-row { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 2rem; }
.article-tag {
  font-family: var(--font-english-title); font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--cinnabar); background: var(--cinnabar-faint);
  padding: 0.35rem 0.85rem; border-radius: var(--radius-full);
}
.article-meta { font-family: var(--font-english-body), var(--font-chinese); font-size: 0.75rem; color: var(--ink-light); }
.article-hero h1 {
  font-family: var(--font-english-title); font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700; line-height: 1.15; letter-spacing: 0.05em;
  color: var(--ink-black); margin-bottom: 1.5rem;
}
.article-hero .lead {
  font-family: var(--font-english-quote); font-size: 1.2rem; font-weight: 300;
  font-style: italic; color: var(--ink-stone); line-height: 1.7;
  max-width: 560px; margin: 0 auto 2rem;
}
.article-author { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.author-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--cinnabar-faint);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-english-title); font-size: 0.7rem;
  font-weight: 600; color: var(--cinnabar);
}
.author-info .name { font-family: var(--font-english-body), var(--font-chinese); font-size: 0.8rem; font-weight: 500; color: var(--ink-charcoal); }
.author-info .date { font-size: 0.7rem; color: var(--ink-light); }
.article-hero::before {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-calligraphy); font-size: clamp(10rem, 25vw, 18rem);
  color: rgba(196, 59, 47, 0.03); pointer-events: none; line-height: 1; white-space: nowrap;
}

/* ========================================
   5. ARTICLE BODY
   ======================================== */
.article-body { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.article-body h2 {
  font-family: var(--font-english-title); font-size: 1.65rem; font-weight: 700;
  letter-spacing: 0.05em; color: var(--ink-black); margin-top: 3.5rem; margin-bottom: 1.25rem; line-height: 1.3;
}
.article-body h3 {
  font-family: var(--font-english-title); font-size: 1.3rem; font-weight: 600;
  letter-spacing: 0.03em; color: var(--ink-charcoal); margin-top: 2.5rem; margin-bottom: 1rem;
}
.article-body p {
  font-family: var(--font-english-body), var(--font-chinese), serif;
  font-size: 1.0625rem; font-weight: 400; color: var(--ink-charcoal);
  line-height: 1.85; margin-bottom: 1.5rem;
}
.article-body p strong { font-weight: 600; color: var(--ink-black); }
.article-body a { color: var(--cinnabar); text-decoration: underline; text-underline-offset: 2px; transition: color var(--transition-base); }
.article-body a:hover { color: var(--cinnabar-dark); }
.article-body ul, .article-body ol {
  font-family: var(--font-english-body), var(--font-chinese), serif;
  font-size: 1.0625rem; font-weight: 400; color: var(--ink-charcoal);
  line-height: 1.85; margin-bottom: 1.5rem; padding-left: 1.5rem;
}
.article-body li { margin-bottom: 0.5rem; }
.inline-cn { font-family: var(--font-chinese); font-weight: 400; color: var(--ink-black); }

/* ========================================
   6. PASSAGE QUOTE
   ======================================== */
.passage-quote {
  margin: 2.5rem 0; padding: 2.5rem 2rem; background: var(--rice-paper-dark);
  border-left: 3px solid var(--cinnabar); border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  position: relative;
}
.passage-quote .cn { font-family: var(--font-calligraphy); font-size: 1.5rem; color: var(--ink-black); line-height: 2; margin-bottom: 1rem; }
.passage-quote .en {
  font-family: var(--font-english-quote); font-size: 1.1rem; font-style: italic;
  font-weight: 400; color: var(--ink-stone); line-height: 1.7; margin-bottom: 1rem;
}
.passage-quote .source {
  font-family: var(--font-english-title); font-size: 0.65rem; font-weight: 600;
  color: var(--cinnabar); text-transform: uppercase; letter-spacing: 0.1em;
}

/* ========================================
   7. INSIGHT CALLOUT
   ======================================== */
.insight {
  margin: 2.5rem 0; padding: 1.75rem 2rem; background: var(--ink-black);
  border-radius: var(--radius-lg); color: var(--rice-paper);
  position: relative; overflow: hidden;
}
.insight::before {
  content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--cinnabar) 0%, var(--gold) 100%);
}
.insight .label {
  font-family: var(--font-english-title); font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold); margin-bottom: 0.75rem; padding-left: 0.75rem;
}
.insight p {
  font-family: var(--font-english-body), var(--font-chinese), serif;
  font-size: 1.05rem; font-weight: 300;
  color: rgba(245, 240, 232, 0.85); line-height: 1.8; margin-bottom: 0; padding-left: 0.75rem;
}
.insight p strong { font-weight: 500; color: var(--rice-paper); }

/* ========================================
   8. TAKEAWAYS
   ======================================== */
.takeaways { margin: 2.5rem 0; counter-reset: takeaway; }
.takeaway-item {
  counter-increment: takeaway; padding: 1.5rem 0 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border); position: relative;
}
.takeaway-item:last-child { border-bottom: none; }
.takeaway-item::before {
  content: counter(takeaway, decimal-leading-zero);
  font-family: var(--font-english-title); font-size: 0.75rem; font-weight: 600;
  color: var(--cinnabar); letter-spacing: 0.05em;
  position: absolute; left: 0; top: 1.5rem;
}
.takeaway-item h4 {
  font-family: var(--font-english-title); font-size: 1.1rem; font-weight: 600;
  letter-spacing: 0.03em; color: var(--ink-black); margin-bottom: 0.5rem;
}
.takeaway-item p {
  font-family: var(--font-english-body), var(--font-chinese), serif;
  font-size: 0.95rem; font-weight: 400; color: var(--ink-stone);
  line-height: 1.75; margin-bottom: 0;
}

/* ========================================
   9. CTA SECTION
   ======================================== */
.article-cta { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 0 1.5rem 5rem; }
.cta-card {
  background: var(--ink-black); border-radius: var(--radius-lg);
  padding: 3rem 2.5rem; position: relative; overflow: hidden;
}
.cta-card::before {
  position: absolute; bottom: -1rem; right: -0.5rem;
  font-family: var(--font-calligraphy); font-size: 12rem;
  color: rgba(196, 59, 47, 0.04); pointer-events: none; line-height: 1;
}
.cta-card h3 {
  font-family: var(--font-english-title); font-size: 1.5rem; font-weight: 600;
  letter-spacing: 0.05em; color: var(--rice-paper); margin-bottom: 0.5rem; position: relative;
}
.cta-card > p {
  font-family: var(--font-english-body), var(--font-chinese);
  font-size: 0.85rem; font-weight: 300;
  color: rgba(245, 240, 232, 0.5); margin-bottom: 2rem; position: relative;
}
.cta-demo {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; position: relative;
}
.cta-demo .msg { margin-bottom: 1rem; }
.cta-demo .msg:last-child { margin-bottom: 0; }
.cta-demo .msg-label {
  font-family: var(--font-english-title); font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.4rem;
}
.cta-demo .msg-label.user-label { color: rgba(201, 169, 97, 0.8); }
.cta-demo .msg-label.ai-label { color: var(--cinnabar); }
.cta-demo .msg-text {
  font-family: var(--font-english-body), var(--font-chinese), serif;
  font-size: 0.95rem; line-height: 1.7;
  color: rgba(245, 240, 232, 0.65);
}
.cta-demo .msg-text strong { color: var(--rice-paper); font-weight: 500; }
.cta-demo .msg-text .cn-inline { font-family: var(--font-chinese); color: var(--gold); }
.cta-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.85rem 2rem; background: var(--rice-paper); color: var(--ink-black);
  border-radius: var(--radius-md);
  font-family: var(--font-english-title), var(--font-chinese);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.05em;
  text-decoration: none; transition: all var(--transition-base); position: relative;
}
.cta-btn:hover { background: var(--cinnabar); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-cinnabar); }
.cta-note {
  font-family: var(--font-english-body), var(--font-chinese);
  font-size: 0.7rem; color: rgba(245, 240, 232, 0.3); margin-top: 1rem; position: relative;
}

/* ========================================
   10. RELATED ARTICLES
   ======================================== */
.related {
  position: relative; z-index: 1; max-width: 640px; margin: 0 auto;
  padding: 0 1.5rem 4rem; border-top: 1px solid var(--border);
}
.related h4 {
  font-family: var(--font-english-title); font-size: 0.85rem; font-weight: 600;
  color: var(--ink-stone); text-transform: uppercase; letter-spacing: 0.1em; margin: 3rem 0 1.5rem;
}
.related a {
  display: block; padding: 1rem 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--ink-black); transition: opacity var(--transition-base);
}
.related a:hover { opacity: 0.7; }
.related a h5 {
  font-family: var(--font-english-title); font-size: 1rem; font-weight: 600;
  letter-spacing: 0.03em; margin-bottom: 0.25rem;
}
.related a .meta { font-family: var(--font-english-body), var(--font-chinese); font-size: 0.7rem; color: var(--ink-light); }

/* ========================================
   11. FOOTER
   ======================================== */
.footer {
  position: relative; z-index: 1; border-top: 1px solid var(--border);
  padding: 2rem 1.5rem; text-align: center;
}
.footer a {
  color: var(--ink-light); text-decoration: none; font-size: 0.75rem; margin: 0 0.75rem;
  transition: color var(--transition-base);
  font-family: var(--font-english-body), var(--font-chinese), serif;
}
.footer a:hover { color: var(--ink-black); }
.footer p {
  font-family: var(--font-english-body), var(--font-chinese);
  font-size: 0.7rem; color: var(--ink-light); margin-top: 1rem;
}

/* ========================================
   12. RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
  .nav { padding: 0.85rem 1.25rem; }
  .nav-links .hide-mobile { display: none; }
  .article-hero { padding: 3rem 1.25rem 2.5rem; }
  .article-hero h1 { font-size: 1.75rem; }
  .article-hero .lead { font-size: 1.05rem; }
  .article-body { padding: 0 1.25rem 3rem; }
  .article-body h2 { font-size: 1.4rem; }
  .passage-quote { padding: 2rem 1.5rem; }
  .cta-card { padding: 2rem 1.5rem; }
  .cta-demo { padding: 1.25rem; }
}

/* ========================================
   13. CHINESE LANGUAGE OVERRIDES
   Applied when <html lang="zh">
   ======================================== */
html[lang="zh"] body {
  font-family: var(--font-chinese), var(--font-english-body), Georgia, serif;
  line-height: 1.9;
}
html[lang="zh"] .article-body p,
html[lang="zh"] .article-body ul,
html[lang="zh"] .article-body ol {
  font-family: var(--font-chinese), var(--font-english-body), serif;
  font-size: 1rem; line-height: 2;
}
html[lang="zh"] .article-body h2 {
  font-family: var(--font-chinese); font-size: 1.5rem;
}
html[lang="zh"] .article-body h3 {
  font-family: var(--font-chinese); font-size: 1.2rem;
}
html[lang="zh"] .article-hero h1 {
  font-family: var(--font-chinese); font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  line-height: 1.4; letter-spacing: 0.02em;
}
html[lang="zh"] .article-tag {
  font-family: var(--font-chinese); font-size: 0.7rem;
}
html[lang="zh"] .article-meta,
html[lang="zh"] .author-info .name {
  font-family: var(--font-chinese);
}
html[lang="zh"] .article-hero .lead {
  font-size: 1.15rem;
}
html[lang="zh"] .insight .label {
  font-family: var(--font-chinese); font-size: 0.7rem;
}
html[lang="zh"] .insight p {
  font-family: var(--font-chinese), var(--font-english-body), serif;
  font-size: 1rem; line-height: 1.9;
}
html[lang="zh"] .takeaway-item h4 {
  font-family: var(--font-chinese); font-size: 1.05rem; letter-spacing: 0.02em;
}
html[lang="zh"] .takeaway-item p {
  font-family: var(--font-chinese), var(--font-english-body), serif;
  line-height: 1.85;
}
html[lang="zh"] .cta-card h3 {
  font-family: var(--font-chinese); font-size: 1.4rem; letter-spacing: 0.02em;
}
html[lang="zh"] .cta-card > p,
html[lang="zh"] .cta-btn,
html[lang="zh"] .cta-note,
html[lang="zh"] .cta-demo .msg-label,
html[lang="zh"] .cta-demo .msg-text {
  font-family: var(--font-chinese), var(--font-english-body), serif;
}
html[lang="zh"] .cta-btn { font-size: 0.9rem; }
html[lang="zh"] .related h4 {
  font-family: var(--font-chinese); font-size: 0.9rem; letter-spacing: 0.05em;
}
html[lang="zh"] .related a h5 {
  font-family: var(--font-chinese); letter-spacing: 0.02em;
}
html[lang="zh"] .related a .meta { font-family: var(--font-chinese); font-size: 0.75rem; }
html[lang="zh"] .passage-quote .source {
  font-family: var(--font-chinese); font-size: 0.75rem; text-transform: none;
  letter-spacing: 0.05em;
}
html[lang="zh"] .inline-cn { font-family: var(--font-calligraphy); }
