/* ==========================================================================
   Travel China — editorial stylesheet
   Warm paper palette, Fraunces display type, full dark mode, mobile first.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  color-scheme: light;

  --paper: #fbf8f3;
  --paper-2: #f4efe5;
  --paper-3: #ece5d8;
  --surface: #ffffff;

  --ink: #16120e;
  --ink-2: #4b4138;
  --ink-3: #7d7063;
  --ink-inv: #fbf8f3;

  --line: #e3dacc;
  --line-soft: #efe9de;

  --accent: #b23a28;
  --accent-deep: #8d2c1d;
  --accent-wash: #f7e9e5;
  --jade: #2e6a5c;
  --gold: #a8811f;

  --shadow-sm: 0 1px 2px rgb(22 18 14 / 6%), 0 4px 12px rgb(22 18 14 / 5%);
  --shadow-md: 0 2px 6px rgb(22 18 14 / 7%), 0 18px 42px rgb(22 18 14 / 9%);
  --shadow-lg: 0 8px 20px rgb(22 18 14 / 10%), 0 40px 80px rgb(22 18 14 / 14%);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-cjk: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(1.15rem, 4vw, 3rem);
  --max: 1180px;
  --max-wide: 1500px;
  --measure: 67ch;
  --radius: 3px;
  --radius-lg: 6px;

  --step--1: clamp(0.8rem, 0.77rem + 0.14vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.18vw, 1.075rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.38vw, 1.44rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.72vw, 1.95rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.4vw, 2.7rem);
  --step-4: clamp(2.2rem, 1.6rem + 2.8vw, 4rem);
  --step-5: clamp(2.6rem, 1.5rem + 5vw, 5.6rem);
}

:root:not([data-theme='light']) {
  @media (prefers-color-scheme: dark) {
    color-scheme: dark;
    --paper: #14120f;
    --paper-2: #1b1814;
    --paper-3: #241f1a;
    --surface: #1e1a16;
    --ink: #f5f0e8;
    --ink-2: #cabfb1;
    --ink-3: #968878;
    --ink-inv: #14120f;
    --line: #342c24;
    --line-soft: #27211b;
    --accent: #e0715a;
    --accent-deep: #ef8d78;
    --accent-wash: #2c1e19;
    --jade: #74b9a4;
    --gold: #d3ad5b;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-md: 0 2px 6px rgb(0 0 0 / 45%), 0 18px 42px rgb(0 0 0 / 40%);
    --shadow-lg: 0 8px 20px rgb(0 0 0 / 50%), 0 40px 80px rgb(0 0 0 / 45%);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #14120f;
  --paper-2: #1b1814;
  --paper-3: #241f1a;
  --surface: #1e1a16;
  --ink: #f5f0e8;
  --ink-2: #cabfb1;
  --ink-3: #968878;
  --ink-inv: #14120f;
  --line: #342c24;
  --line-soft: #27211b;
  --accent: #e0715a;
  --accent-deep: #ef8d78;
  --accent-wash: #2c1e19;
  --jade: #74b9a4;
  --gold: #d3ad5b;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-md: 0 2px 6px rgb(0 0 0 / 45%), 0 18px 42px rgb(0 0 0 / 40%);
  --shadow-lg: 0 8px 20px rgb(0 0 0 / 50%), 0 40px 80px rgb(0 0 0 / 45%);
}

/* --- Reset -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: #fff; }

/* --- Utilities ---------------------------------------------------------- */

.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.wrap-wide { width: min(100% - var(--gutter) * 2, var(--max-wide)); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 50%; translate: -50% -120%; z-index: 200;
  background: var(--ink); color: var(--ink-inv);
  padding: 0.7rem 1.2rem; border-radius: 0 0 var(--radius) var(--radius);
  transition: translate 0.2s;
}
.skip-link:focus { translate: -50% 0; }

.zh { font-family: var(--font-cjk); font-weight: 400; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  /* Re-resolve the palette here so the over-hero override reaches descendants. */
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.3s, border-color 0.3s;
}
.site-header[data-over-hero='true']:not(.is-scrolled) {
  background: transparent;
  border-bottom-color: transparent;
  --ink: #fff; --ink-2: rgb(255 255 255 / 82%); --ink-3: rgb(255 255 255 / 70%);
  --line: rgb(255 255 255 / 28%); --line-soft: rgb(255 255 255 / 18%);
}
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 68px;
}
.brand {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.32rem; font-weight: 600; letter-spacing: -0.015em;
  display: flex; align-items: baseline; gap: 0.55rem; margin-right: auto;
}
.brand .brand-mark {
  font-family: var(--font-cjk); font-size: 0.78em; color: var(--accent);
  letter-spacing: 0.06em;
}
.nav { display: none; gap: 1.6rem; align-items: center; }
.nav a {
  font-size: 0.9rem; font-weight: 500; letter-spacing: 0.005em;
  color: var(--ink-2); position: relative; padding-block: 0.35rem;
  transition: color 0.18s;
}
.nav a::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 1.5px;
  background: var(--accent); scale: 0 1; transform-origin: left;
  transition: scale 0.25s ease;
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current='page']::after { scale: 1 1; }

.header-tools { display: flex; align-items: center; gap: 0.35rem; }
.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 50%;
  color: var(--ink-2); cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: none; }
:root[data-theme='dark'] .theme-toggle .moon { display: block; }
:root[data-theme='dark'] .theme-toggle .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .moon { display: block; }
  :root:not([data-theme='light']) .theme-toggle .sun { display: none; }
}

@media (min-width: 62rem) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 150;
  background: var(--paper); padding: var(--gutter);
  display: flex; flex-direction: column;
  translate: 0 -100%; opacity: 0; visibility: hidden;
  transition: translate 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s, visibility 0.32s;
}
.drawer[data-open='true'] { translate: 0 0; opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 68px; margin-bottom: 1.5rem; }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav a {
  font-family: var(--font-display); font-size: var(--step-2); font-weight: 500;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line-soft);
}
.drawer nav a .idx { font-family: var(--font-mono); font-size: 0.62em; color: var(--accent); margin-right: 0.8rem; }
@media (min-width: 62rem) { .drawer { display: none; } }

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(94svh, 820px);
  display: grid; align-items: end;
  margin-top: -68px; padding-top: 68px;
  color: #fff; isolation: isolate; overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.6s ease;
  animation: drift 26s ease-in-out infinite alternate;
}
.hero-media img.is-active { opacity: 1; }
@keyframes drift { from { scale: 1; } to { scale: 1.09; } }
@media (prefers-reduced-motion: reduce) { .hero-media img { animation: none; } }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgb(10 8 6 / 45%) 0%, rgb(10 8 6 / 8%) 32%, rgb(10 8 6 / 55%) 72%, rgb(10 8 6 / 84%) 100%);
}
.hero-body { position: relative; z-index: 2; padding-block: clamp(3rem, 9vh, 6rem); }
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-5); line-height: 0.98; letter-spacing: -0.028em;
  max-width: 15ch; text-wrap: balance;
  text-shadow: 0 2px 30px rgb(0 0 0 / 35%);
}
.hero .kicker {
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.3rem;
  color: rgb(255 255 255 / 88%);
}
.hero .kicker::before { content: ''; width: 34px; height: 1.5px; background: var(--accent); }
.hero .lede {
  margin-top: 1.4rem; max-width: 54ch;
  font-size: var(--step-1); line-height: 1.5; color: rgb(255 255 255 / 90%);
  text-shadow: 0 1px 18px rgb(0 0 0 / 40%);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }
.hero-caption {
  position: absolute; right: var(--gutter); bottom: 1rem; z-index: 2;
  font-size: 0.68rem; letter-spacing: 0.04em; color: rgb(255 255 255 / 55%);
}

/* Page hero (interior pages) */
.page-hero {
  position: relative; color: #fff; isolation: isolate;
  margin-top: -68px; padding-top: 68px;
  min-height: min(74svh, 620px);
  display: grid; align-items: end; overflow: hidden;
}
.page-hero > img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgb(10 8 6 / 42%) 0%, rgb(10 8 6 / 5%) 28%, rgb(10 8 6 / 62%) 74%, rgb(10 8 6 / 88%) 100%);
}
.page-hero-body { position: relative; z-index: 2; padding-block: clamp(2.5rem, 7vh, 4.5rem); }
.page-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.025em;
  max-width: 18ch; text-wrap: balance;
}
.page-hero .zh-title { font-family: var(--font-cjk); font-size: var(--step-1); color: rgb(255 255 255 / 72%); margin-top: 0.5rem; letter-spacing: 0.08em; }
.page-hero .hook { margin-top: 1.1rem; max-width: 58ch; font-size: var(--step-1); line-height: 1.5; color: rgb(255 255 255 / 90%); }

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem;
  font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgb(255 255 255 / 72%); margin-bottom: 1.1rem;
}
.crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.crumbs .sep { opacity: 0.5; }

/* Slim hero for utility pages */
.slim-hero {
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
}
.slim-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-4); line-height: 1.03; letter-spacing: -0.025em;
  max-width: 20ch; text-wrap: balance;
}
.slim-hero .lede { margin-top: 1rem; max-width: 62ch; font-size: var(--step-1); color: var(--ink-2); line-height: 1.55; }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.78rem 1.5rem; border: 1px solid transparent; border-radius: 999px;
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, translate 0.2s;
}
.btn:hover { translate: 0 -1px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.btn-quiet { border-color: var(--line); color: var(--ink-2); background: var(--surface); }
.btn-quiet:hover { border-color: var(--ink-3); color: var(--ink); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- Section furniture -------------------------------------------------- */

.section { padding-block: clamp(3.2rem, 8vw, 6.5rem); }
.section-tint { background: var(--paper-2); }
.section-head { margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.eyebrow {
  display: flex; align-items: center; gap: 0.85rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 0.9rem;
}
.eyebrow .num { font-family: var(--font-mono); color: var(--accent); }
.eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.022em;
  max-width: 20ch; text-wrap: balance;
}
.section-head .sub { margin-top: 0.85rem; max-width: 60ch; color: var(--ink-2); font-size: var(--step-0); }
.section-head.row { display: flex; align-items: end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }

.more-link {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.more-link:hover { gap: 0.65rem; }
.more-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; transition: none; }

/* Shown in place of a photograph whose fetch failed, so layout never collapses. */
.img-fallback {
  width: 100%; height: 100%; min-height: 8rem;
  background:
    repeating-linear-gradient(135deg, var(--paper-3) 0 10px, var(--paper-2) 10px 20px);
}

/* --- Cards -------------------------------------------------------------- */

.grid { display: grid; gap: clamp(1.2rem, 2.6vw, 2rem); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }

.card { display: flex; flex-direction: column; height: 100%; }
.card-media {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--paper-3); aspect-ratio: 4 / 3;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.card:hover .card-media img { scale: 1.05; }
.card-media .badge { position: absolute; left: 0.7rem; top: 0.7rem; }
.card-body { padding-top: 1rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.card h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-1); line-height: 1.15; letter-spacing: -0.015em;
}
.card:hover h3 { color: var(--accent); }
.card .meta {
  font-size: 0.74rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}
.card .meta .dot { opacity: 0.45; }
.card p { color: var(--ink-2); font-size: 0.925rem; line-height: 1.55; }

/* Feature card — the big editorial one */
.card-feature { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 26rem; display: grid; align-items: end; color: #fff; isolation: isolate; }
.card-feature img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.card-feature::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgb(10 8 6 / 8%) 30%, rgb(10 8 6 / 72%) 100%); }
.card-feature:hover img { scale: 1.05; }
.card-feature .card-body { position: relative; z-index: 2; padding: clamp(1.3rem, 3vw, 2rem); }
.card-feature h3 { font-size: var(--step-2); }
.card-feature:hover h3 { color: #fff; }
.card-feature p { color: rgb(255 255 255 / 84%); }
.card-feature .meta { color: rgb(255 255 255 / 74%); }

/* Editorial asymmetric grid */
.editorial-grid { display: grid; gap: clamp(1.2rem, 2.6vw, 2rem); }
@media (min-width: 52rem) {
  .editorial-grid { grid-template-columns: 1.35fr 1fr; }
  .editorial-grid > .span-rows { grid-row: span 2; }
}

/* Tile (themes) */
.tile {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 3 / 4; display: grid; align-items: end; color: #fff; isolation: isolate;
}
.tile img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.tile::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgb(10 8 6 / 10%) 25%, rgb(10 8 6 / 78%) 100%); }
.tile:hover img { scale: 1.06; }
.tile-body { position: relative; z-index: 2; padding: 1.15rem; }
.tile h3 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: 1.15; }
.tile .zh { font-family: var(--font-cjk); font-size: 0.8rem; color: rgb(255 255 255 / 68%); letter-spacing: 0.1em; margin-top: 0.2rem; }
.tile p { font-size: 0.84rem; color: rgb(255 255 255 / 80%); margin-top: 0.5rem; line-height: 1.45; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  padding: 0.32rem 0.6rem; border-radius: 3px;
  background: var(--accent); color: #fff;
}
.badge-quiet { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); }
.badge-jade { background: var(--jade); color: #fff; }

/* --- Prose -------------------------------------------------------------- */

.prose { max-width: var(--measure); font-size: 1.075rem; line-height: 1.72; color: var(--ink-2); }
.prose > * + * { margin-top: 1.15em; }
.prose p { text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h2 {
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.02em;
  margin-top: 2.4em; margin-bottom: 0.1em; scroll-margin-top: 9rem;
}
.prose h3 {
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  font-size: var(--step-1); line-height: 1.25; margin-top: 1.9em; margin-bottom: 0.1em;
}
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-deep); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-top: 0.5em; }
.prose ul li { list-style: none; position: relative; }
.prose ul li::before {
  content: ''; position: absolute; left: -1.05em; top: 0.72em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.prose ol { list-style: decimal; }
.prose ol li::marker { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.prose .lead { font-size: 1.2rem; line-height: 1.6; color: var(--ink); }

.prose blockquote, .pullquote {
  border-left: 2px solid var(--accent); padding-left: 1.4rem; margin-left: 0;
  font-family: var(--font-display); font-size: var(--step-1); line-height: 1.45;
  color: var(--ink); font-style: italic;
}

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
thead th {
  text-align: left; padding: 0.85rem 1rem; background: var(--paper-2);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); line-height: 1.55; }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { color: var(--ink); font-weight: 500; }

/* Callouts */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--jade);
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem; font-size: 0.965rem;
}
.callout.is-warn { border-left-color: var(--accent); }
.callout h4 {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--jade); margin-bottom: 0.45rem;
  display: flex; align-items: center; gap: 0.45rem;
}
.callout.is-warn h4 { color: var(--accent); }
.callout p { color: var(--ink-2); line-height: 1.6; }

/* Steps */
/* `.prose ol` is more specific than a bare `.steps`, hence the doubled selector. */
.steps, .prose ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
.prose ol.steps > li::marker { content: none; }
.steps li {
  counter-increment: step; position: relative;
  padding-left: 3.1rem; padding-bottom: 1.5rem;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0.05em;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  color: var(--accent);
  width: 2rem; height: 2rem; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
}
.steps li::after {
  content: ''; position: absolute; left: 1rem; top: 2.3rem; bottom: 0.3rem;
  width: 1px; background: var(--line);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps li b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 0.2rem; }
.steps li span { color: var(--ink-2); font-size: 0.965rem; line-height: 1.6; }

/* --- Article layout ----------------------------------------------------- */

.article-layout { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 62rem) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 20rem; }
  /* Clears both the site header (68px) and the sticky in-page subnav. */
  .article-aside { position: sticky; top: 9.5rem; }
}

.factbox { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.factbox h3 {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink-3); padding: 0.9rem 1.15rem; border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.factbox dl { padding: 0.35rem 1.15rem 1rem; }
.factbox div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line-soft); }
.factbox div:last-child { border-bottom: 0; }
.factbox dt { font-size: 0.76rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); flex-shrink: 0; }
.factbox dd { text-align: right; font-size: 0.9rem; color: var(--ink); font-weight: 500; }

/* Sticky in-page subnav */
.subnav {
  position: sticky; top: 68px; z-index: 60;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.subnav ul { display: flex; gap: 1.5rem; overflow-x: auto; scrollbar-width: none; padding: 0; list-style: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a {
  display: block; padding: 0.95rem 0; white-space: nowrap;
  font-size: 0.83rem; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent; transition: color 0.18s, border-color 0.18s;
}
.subnav a:hover { color: var(--ink); }
.subnav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* Highlights list */
.highlights { list-style: none; padding: 0; display: grid; gap: 0; }
.prose ul.highlights li::before { content: none; }
.highlights li { padding: 1.35rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.35rem; }
.highlights li:last-child { border-bottom: 1px solid var(--line); }
.highlights h4 {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 600;
  color: var(--ink); line-height: 1.2;
}
.highlights p { color: var(--ink-2); font-size: 0.975rem; line-height: 1.6; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 0.6rem; }
.gallery button {
  padding: 0; border: 0; background: var(--paper-3); cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.5s, opacity 0.3s; }
.gallery button:hover img { scale: 1.05; opacity: 0.92; }

.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgb(8 6 5 / 94%); padding: clamp(1rem, 4vw, 3rem);
  place-items: center; backdrop-filter: blur(4px);
}
.lightbox[data-open='true'] { display: grid; }
.lightbox figure { margin: 0; max-width: min(100%, 1400px); max-height: 100%; display: grid; gap: 0.9rem; }
.lightbox img { max-height: 82svh; width: auto; margin-inline: auto; object-fit: contain; border-radius: var(--radius); }
.lightbox figcaption { color: rgb(255 255 255 / 62%); font-size: 0.8rem; text-align: center; }
.lightbox figcaption a { text-decoration: underline; text-underline-offset: 3px; }
.lightbox .close { position: absolute; top: 1rem; right: 1rem; color: #fff; }
.lightbox .nav-prev, .lightbox .nav-next {
  position: absolute; top: 50%; translate: 0 -50%; color: #fff;
  background: rgb(255 255 255 / 10%); border: 0; border-radius: 50%;
  width: 46px; height: 46px; display: grid; place-items: center; cursor: pointer;
}
.lightbox .nav-prev { left: 1rem; } .lightbox .nav-next { right: 1rem; }
.lightbox .nav-prev:hover, .lightbox .nav-next:hover { background: rgb(255 255 255 / 22%); }
.lightbox svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* --- Filters & search --------------------------------------------------- */

.filter-bar {
  position: sticky; top: 68px; z-index: 60;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid var(--line);
  padding-block: 0.9rem; margin-bottom: clamp(1.8rem, 4vw, 3rem);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.search-field { position: relative; flex: 1 1 15rem; min-width: 0; }
.search-field svg {
  position: absolute; left: 0.85rem; top: 50%; translate: 0 -50%;
  width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; pointer-events: none;
}
.search-field input {
  width: 100%; padding: 0.62rem 0.9rem 0.62rem 2.4rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 0.9rem; color: var(--ink);
}
.search-field input::placeholder { color: var(--ink-3); }
.search-field input:focus { border-color: var(--accent); outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  padding: 0.42rem 0.85rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  font-size: 0.795rem; font-weight: 500; white-space: nowrap;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--ink-inv); }
.filter-count { font-size: 0.8rem; color: var(--ink-3); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-hidden { display: none !important; }
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--ink-3); }

/* Compact index list */
.index-group + .index-group { margin-top: 2.6rem; }
.index-group > h3 {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 600;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); margin-bottom: 0.3rem;
  display: flex; align-items: baseline; gap: 0.7rem;
}
.index-group > h3 .count { font-family: var(--font-mono); font-size: 0.66em; color: var(--ink-3); margin-left: auto; }
.index-list { list-style: none; padding: 0; }
.index-list li { padding: 0.95rem 0; border-bottom: 1px solid var(--line-soft); display: grid; gap: 0.25rem; }
.index-list .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.55rem; }
.index-list b { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.index-list .zh { color: var(--ink-3); font-size: 0.85rem; }
.index-list .prov { font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin-left: auto; }
.index-list p { color: var(--ink-2); font-size: 0.9rem; line-height: 1.55; }
.index-list a:hover b { color: var(--accent); }

/* --- Accordion ---------------------------------------------------------- */

.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary {
  display: flex; align-items: center; gap: 1rem; cursor: pointer; list-style: none;
  padding: 1.25rem 0; font-family: var(--font-display); font-size: var(--step-1);
  font-weight: 500; color: var(--ink); line-height: 1.3;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: ''; margin-left: auto; flex-shrink: 0;
  width: 11px; height: 11px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  rotate: 45deg; translate: 0 -3px; transition: rotate 0.25s;
}
.accordion details[open] summary::after { rotate: -135deg; translate: 0 2px; }
.accordion .answer { padding-bottom: 1.4rem; max-width: var(--measure); color: var(--ink-2); line-height: 1.68; }

/* --- Itinerary ---------------------------------------------------------- */

.legs { list-style: none; padding: 0; }
.legs li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.2rem; padding: 1.3rem 0; border-top: 1px solid var(--line); }
.legs li:last-child { border-bottom: 1px solid var(--line); }
.legs .day {
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.05em;
  color: var(--accent); padding-top: 0.28rem;
}
.legs h4 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: 1.2; }
.legs p { color: var(--ink-2); font-size: 0.965rem; line-height: 1.6; margin-top: 0.3rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat-row div { background: var(--surface); padding: 1.05rem 1.15rem; }
.stat-row dt { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3); }
.stat-row dd { margin-top: 0.3rem; font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; color: var(--ink); line-height: 1.15; }

/* --- Dishes ------------------------------------------------------------- */

.prose ul.dishes li::before, .prose ul.legs li::before { content: none; }
.dishes { list-style: none; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.dishes li { background: var(--surface); padding: 1.25rem 1.4rem; }
.dishes h4 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.dishes h4 .zh { font-size: 0.72em; color: var(--ink-3); font-weight: 400; }
.dishes p { color: var(--ink-2); font-size: 0.95rem; line-height: 1.6; margin-top: 0.35rem; }

/* --- Footer ------------------------------------------------------------- */

.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); padding-block: clamp(3rem, 7vw, 5rem) 2.5rem; margin-top: clamp(3rem, 8vw, 6rem); }
.footer-top { display: grid; gap: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
@media (min-width: 48rem) { .footer-top { grid-template-columns: 1.5fr repeat(3, 1fr); gap: 3rem; } }
.footer-brand .brand { font-size: 1.5rem; margin-bottom: 0.9rem; }
.footer-brand p { color: var(--ink-2); font-size: 0.925rem; max-width: 34ch; line-height: 1.6; }
.footer-col h4 { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; display: grid; gap: 0.55rem; }
.footer-col a { font-size: 0.915rem; color: var(--ink-2); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { padding-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; font-size: 0.8rem; color: var(--ink-3); }
.footer-bottom a { text-decoration: underline; text-underline-offset: 3px; }

/* --- Reveal on scroll --------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; translate: 0 18px; transition: opacity 0.7s ease, translate 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
  .reveal.is-in { opacity: 1; translate: 0 0; }
}

/* --- Print -------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .subnav, .filter-bar, .hero-cta, .lightbox { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-hero, .hero { min-height: 0; color: #000; margin-top: 0; padding-top: 0; }
  .page-hero > img, .hero-media { display: none; }
  .page-hero::after, .hero::after { display: none; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #555; }
}
