/* 城市攻略页：首图在上，正文在实色底上。颜色、字体、缓动、层级用 site.css 的变量 */

html {
  scroll-padding-top: calc(var(--bar-bottom, 60px) + 72px); /* 锚点跳转时让出导航栏和吸顶的目录条 */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--light);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  width: min(1080px, 100% - 2 * clamp(16px, 4vw, 48px));
  margin: 0 auto;
}

a { color: inherit; }

/* ---------- 首图：3 张图可以翻，底部渐变到正文的底色 ---------- */

.hero {
  position: relative;
  isolation: isolate; /* 首图里的层级不和导航栏比 */
  display: flex;
  align-items: flex-end;
  height: min(78vh, 760px);
  height: min(78svh, 760px);
  min-height: 460px;
  padding-bottom: clamp(32px, 6vh, 64px);
  overflow: hidden;
  background: #1b0e09; /* 图片未加载时的暖棕底色，同首页 */
}

.hero-photos {
  position: absolute;
  inset: 0;
  z-index: var(--z-backdrop);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-img:not(:first-child) { opacity: 0; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-scrim);
  pointer-events: none;
  background:
    linear-gradient(0deg, var(--ink) 0%, rgba(16, 12, 10, .62) 34%, transparent 66%),
    linear-gradient(180deg, rgba(14, 10, 8, .55) 0%, transparent 24%);
}

.hero-text {
  position: relative;
  z-index: var(--z-intro);
  text-shadow: 0 1px 24px rgba(10, 7, 6, .35);
}

.hero-kicker {
  margin: 0 0 .8em;
  font: 500 12px/1.2 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--light-dim);
}

.hero-title {
  margin: 0;
  font: 400 clamp(3rem, 8vw, 5.5rem)/1 var(--serif);
  letter-spacing: -.015em;
}

html[lang="zh-CN"] .hero-title {
  font-weight: 500;
  letter-spacing: .04em;
}

.hero-desc {
  max-width: 32em;
  margin: .8em 0 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.6;
}

.hero-months {
  margin: .5em 0 0;
  font-size: 14px;
  color: var(--light-dim);
}

/* 在转盘里看：和首页“下一站”一样的浅色胶囊 */
.hero-wheel {
  display: inline-flex;
  align-items: center;
  min-height: 2.5em;
  margin-top: 1.4em;
  padding: 0 1.35em;
  border-radius: 999px;
  background: var(--light);
  color: var(--button-ink);
  font: 500 .95rem/1 var(--sans);
  text-decoration: none;
  text-shadow: none;
  transition: transform .2s var(--ease-out), background-color .2s;
}

.hero-wheel:hover { background: #fffaf4; }
.hero-wheel:active { transform: scale(.97); }

.hero-flip {
  position: absolute;
  z-index: var(--z-chrome);
  right: calc(20px + env(safe-area-inset-right));
  bottom: 44px;
  display: flex;
  gap: 8px;
}

.hero-flip button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: rgba(16, 12, 10, .3);
  color: var(--light-dim);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}

.hero-flip button:hover {
  background: rgba(16, 12, 10, .5);
  color: var(--light);
}

.hero-flip svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-credit {
  position: absolute;
  z-index: var(--z-chrome);
  right: calc(24px + env(safe-area-inset-right));
  bottom: 16px;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--light-mute);
}

.hero-credit a,
.sight-photo figcaption a {
  color: inherit;
  text-decoration: none;
}

.hero-credit a:hover,
.sight-photo figcaption a:hover { color: var(--light); }

/* ---------- 吸顶目录条：上方留出导航栏的高度，吸顶时导航栏浮在这块实色底上 ---------- */

.toc {
  position: sticky;
  top: 0;
  z-index: var(--z-intro);
  padding-top: calc(var(--bar-bottom, 60px) + 4px); /* --bar-bottom 由 site.js 量出 */
  border-bottom: 1px solid var(--hairline);
  background: var(--ink);
}

.toc-links {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none; /* 手机上放不下时左右滑 */
  white-space: nowrap;
}

.toc-links::-webkit-scrollbar { display: none; }

.toc-links a {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 44px;
  color: var(--light-dim);
  font: 500 14px/1 var(--sans);
  text-decoration: none;
  transition: color .2s;
}

.toc-links a:hover { color: var(--light); }

.toc-links a + a::before {
  content: "";
  width: 3px;
  height: 3px;
  margin: 0 14px;
  border-radius: 50%;
  background: var(--light-mute);
}

/* ---------- 正文各段 ---------- */

.section > .wrap { padding-top: clamp(48px, 7vw, 88px); }
.section + .section > .wrap { margin-top: clamp(48px, 7vw, 88px); border-top: 1px solid var(--hairline); }
.section:last-child { padding-bottom: clamp(64px, 10vw, 120px); }

.section-title {
  margin: 0 0 clamp(24px, 4vw, 40px);
  font: 400 clamp(2rem, 4vw, 2.75rem)/1.1 var(--serif);
  letter-spacing: -.01em;
}

html[lang="zh-CN"] .section-title,
html[lang="zh-CN"] .sight-name {
  font-weight: 500;
  letter-spacing: .02em;
}

/* 核对日期：每段末尾一行小字 */
.checked {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--light-mute);
}

/* 看点：图在左、文字在右，手机上上下排 */
.sight {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.sight + .sight { margin-top: clamp(48px, 7vw, 80px); }

.sight-photo { margin: 0; }

.sight-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #1b0e09;
}

.sight-photo figcaption {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--light-mute);
}

/* 心形放在名字左边：加入时滑出的行程栏在右侧，不会盖住它 */
.sight-head {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.sight-name {
  margin: 0;
  font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.2 var(--serif);
}

.sight-text {
  margin: .6em 0 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

/* 加入行程：和首页一样的心形圆按钮，已加入时心形填满 */
.like {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: none;
  color: var(--light-dim);
  cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s, color .2s;
}

.like:hover {
  background: var(--glass);
  color: var(--light);
}

.like:active { transform: scale(.94); }

.like svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: fill .2s;
}

.like[aria-pressed="true"] { color: var(--light); }
.like[aria-pressed="true"] svg { fill: currentColor; }

.facts { margin: 1.4em 0 0; }

.facts > div {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.facts dt {
  font: 500 12px/1.9 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--light-mute);
}

.facts dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
}

/* 样板行程：每天一张卡片 */
.days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day {
  padding: 20px 24px 8px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.day-title {
  margin: 0 0 8px;
  font: 500 12px/1.2 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--light-dim);
}

.day-stops {
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-stops li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.day-stops li + li { border-top: 1px solid var(--hairline); }

.day-stops a {
  font: 400 1.15rem/1.3 var(--serif);
  text-decoration: none;
}

.day-stops span {
  flex: none;
  font-size: 13px;
  color: var(--light-dim);
  font-variant-numeric: tabular-nums;
}

@media (hover: hover) and (pointer: fine) {
  .day-stops a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }
}

/* 交通、实用：一段文字，限制行宽 */
.prose { max-width: 44em; }

.prose > p:not(.checked) {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-wheel:focus-visible,
.hero-flip button:focus-visible,
.hero-credit a:focus-visible,
.toc-links a:focus-visible,
.sight-photo a:focus-visible,
.like:focus-visible,
.day-stops a:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
  border-radius: 2px;
}

.toc-links a:focus-visible { outline-offset: -2px; }

/* ---------- 手机：单列；‹ › 移到首图底部右侧，署名在左 ---------- */

@media (max-width: 719px) {
  .hero {
    height: 72vh;
    height: 72svh;
    min-height: 420px;
    padding-bottom: 76px;
  }

  .hero-flip { right: calc(16px + env(safe-area-inset-right)); bottom: 12px; }

  .hero-credit {
    left: calc(16px + env(safe-area-inset-left));
    right: calc(120px + env(safe-area-inset-right));
    bottom: 27px;
  }

  .sight {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .sight-photo img { aspect-ratio: 3 / 2; }

  .facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

@media (pointer: coarse) {
  .hero-wheel { min-height: 44px; }
  .hero-flip button,
  .like { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- 没有首图的页面（隐私政策）：正文从导航栏下方开始 ---------- */

.page > .section:first-child > .wrap { padding-top: calc(var(--bar-bottom, 60px) + clamp(32px, 5vw, 64px)); }

.prose h2 {
  margin: 2em 0 .6em;
  font: 500 1.15rem/1.4 var(--sans);
}

.prose > ul {
  margin: .8em 0 0;
  padding-left: 1.2em;
  font-size: 1.05rem;
  line-height: 1.75;
}

.prose > p + p:not(.checked) { margin-top: .8em; }

.prose a:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
  border-radius: 2px;
}
