:root {
  --paper: #f3eee2;
  --paper-raised: #ece5d4;
  --ink: #26281f;
  --ink-soft: #52543f;
  --matcha: #52693f;
  --matcha-deep: #38492c;
  --gold: #a9792f;
  --clay: #9a4428;
  --rule: rgba(38, 40, 31, 0.14);
  --shadow: rgba(38, 40, 31, 0.16);

  --font-display: "Fraunces", "Noto Serif", serif;
  --font-body: "Be Vietnam Pro", "PingFang SC", "Noto Sans SC", -apple-system,
    BlinkMacSystemFont, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1d16;
    --paper-raised: #25281e;
    --ink: #ece6d6;
    --ink-soft: #bcb9a3;
    --matcha: #9bbb85;
    --matcha-deep: #c9dcb8;
    --gold: #d9ac5c;
    --clay: #d6886b;
    --rule: rgba(236, 230, 214, 0.16);
    --shadow: rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  .place {
    scroll-margin-top: 1.25rem;
  }
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Masthead ---------- */

.masthead {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 1.75rem;
  text-align: left;
}

.eyebrow-free {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.masthead h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--matcha-deep);
}

.masthead-sub {
  margin: 0;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.quicknav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-bottom: 0.35rem;
}

.quicknav a {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-raised);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  white-space: nowrap;
}

.quicknav a span {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.page-link {
  margin: 1.25rem 0 0;
}

.page-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-raised);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--matcha-deep);
  box-sizing: border-box;
}

/* ---------- Main / places ---------- */

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.place {
  padding: 2.25rem 0;
  border-top: 1px solid var(--rule);
}

.place:first-child {
  border-top: 1px solid var(--rule);
  margin-top: 0.5rem;
}

.place-photos {
  position: relative;
  margin-bottom: 2.25rem;
}

.photo-main {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 10px 24px -14px var(--shadow);
}

.photo-accent {
  position: absolute;
  right: -0.5rem;
  bottom: -1.25rem;
  width: 38%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 6px solid var(--paper);
  border-radius: 2px;
  box-shadow: 0 8px 20px -10px var(--shadow);
  transform: rotate(2.5deg);
}

.place-tag {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 500;
}

.place-body h2 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  color: var(--ink);
  line-height: 1.2;
}

.pinyin {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

.place-alt {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.place-desc {
  margin: 0 0 1.4rem;
  max-width: 38rem;
}

.place-facts {
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.9rem;
}

.place-facts > div {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.place-facts > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.place-facts dt {
  font-size: 0.86rem;
  color: var(--matcha);
  font-weight: 500;
  padding-top: 0.1rem;
}

.place-facts dd {
  margin: 0;
}

.place-facts dd.conflict {
  color: var(--clay);
}

.place-facts dd.unclear {
  color: var(--ink-soft);
  font-style: italic;
}

.place-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.amap-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-raised);
  text-decoration: none;
  box-sizing: border-box;
}

.amap-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--matcha);
}

.amap-url {
  font-size: 0.85rem;
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.amap-link:hover .amap-url,
.amap-link:focus-visible .amap-url {
  color: var(--clay);
}

/* ---------- Section divider (carousel section intro) ---------- */

.section-divider {
  padding-top: 2.5rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--rule);
}

.section-heading {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 5.5vw, 2.1rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--matcha-deep);
}

.section-note {
  margin: 0 0 1.5rem;
  max-width: 38rem;
  color: var(--ink-soft);
}

.section-note em {
  font-style: italic;
  color: var(--ink);
}

.section-divider .quicknav {
  margin-top: 0;
}

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

.site-footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .place {
    display: grid;
    grid-template-columns: 15.5rem 1fr;
    gap: 2.25rem;
    align-items: start;
  }

  .place-photos {
    margin-bottom: 0;
  }
}
