/* ============================================================
   China Trip Simplified — shared stylesheet
   Light theme, mobile-first, static-site friendly
   ============================================================ */

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #1f2430;
  --ink-soft: #3a4150;
  --muted: #6b7280;
  --brand: #c0392b;
  --brand-dark: #96281b;
  --brand-tint: #fbefed;
  --accent: #0f766e;
  --accent-tint: #e7f3f1;
  --gold: #b7791f;
  --line: #e6e2da;
  --line-soft: #efede7;
  --shadow-sm: 0 1px 2px rgba(31, 36, 48, 0.05);
  --shadow-md: 0 6px 24px rgba(31, 36, 48, 0.08);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand:hover { text-decoration: none; color: var(--ink); }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--brand); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}

.hero-kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-tint);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--ink);
}

.hero p.lede {
  font-size: 1.16rem;
  color: var(--ink-soft);
  max-width: 660px;
  margin: 0 0 28px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); text-decoration: none; }

/* ---------- Section ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-size: 1.55rem; letter-spacing: -0.01em; margin: 0; }
.section-head .more { font-size: 0.92rem; font-weight: 500; color: var(--muted); }
.section-head .more:hover { color: var(--brand); }

/* ---------- Category cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.cat-card .cat-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 14px; }
.cat-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink); }
.cat-card p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.55; }
.cat-card:hover h3 { color: var(--brand); }

/* ---------- Article list ---------- */
.article-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.article-card:hover { border-color: var(--brand); text-decoration: none; }
.article-card .tag {
  align-self: flex-start;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.article-card h3 { margin: 0 0 10px; font-size: 1.18rem; line-height: 1.35; color: var(--ink); }
.article-card:hover h3 { color: var(--brand); }
.article-card p { margin: 0 0 14px; font-size: 0.92rem; color: var(--muted); flex: 1; }
.article-card .meta { font-size: 0.82rem; color: var(--muted); }

/* ---------- Article page ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); padding: 20px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

.article-hero { padding: 32px 0 24px; }
.article-hero .tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.article-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.article-hero .byline { font-size: 0.9rem; color: var(--muted); }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  padding: 0 0 56px;
  align-items: start;
}

.prose { min-width: 0; }
.prose h2 { font-size: 1.4rem; margin: 2em 0 0.7em; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.15rem; margin: 1.7em 0 0.6em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: 0.35em 0; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--brand);
  background: var(--brand-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}
.prose blockquote p { margin: 0; }

.callout {
  margin: 1.4em 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  border: 1px solid #cfe6e2;
  font-size: 0.95rem;
}
.callout strong { color: var(--accent); }
.callout p { margin: 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.93rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg); font-weight: 600; }

/* FAQ */
.faq { margin: 2em 0; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.faq-q { padding: 15px 18px; font-weight: 600; color: var(--ink); }
.faq-a { padding: 0 18px 16px; color: var(--ink-soft); font-size: 0.95rem; }
.faq-a p { margin: 0 0 0.6em; }
.faq-a p:last-child { margin: 0; }

/* Sidebar */
.sidebar { position: sticky; top: 82px; }
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.toc h4 { margin: 0 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.1em; font-size: 0.9rem; line-height: 1.6; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--brand); }

.related { margin-top: 20px; }
.related h4 { margin: 0 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.related a {
  display: block;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.related a:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; margin-top: 32px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { margin: 0 0 12px; font-size: 0.9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--muted); font-size: 0.92rem; }
.site-footer a:hover { color: var(--brand); }
.site-footer .disclaimer { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-size: 0.82rem; color: var(--muted); line-height: 1.6; }

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

@media (max-width: 560px) {
  .cat-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .nav-links a.hide-sm { display: none; }
  body { font-size: 16px; }
}

/* ---------- Language switcher ---------- */
.lang-switch { display: inline-flex; align-items: center; }
.lang-switch select {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  max-width: 150px;
}
.lang-switch select:hover { border-color: var(--brand); color: var(--ink); }

/* ---------- Root language picker ---------- */
.lang-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.lang-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}
.lang-card:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] .article-hero,
[dir="rtl"] .prose,
[dir="rtl"] .breadcrumb,
[dir="rtl"] .hero .lede { text-align: right; }
[dir="rtl"] .prose ul,
[dir="rtl"] .prose ol { padding-right: 1.3em; padding-left: 0; }
[dir="rtl"] .toc ol { padding-right: 1.1em; padding-left: 0; }
[dir="rtl"] .prose blockquote {
  border-left: none;
  border-right: 4px solid var(--brand);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
[dir="rtl"] .prose th,
[dir="rtl"] .prose td { text-align: right; }
