/* ============================================================
   Global Travel Guide — Design System v2.0 · COMPONENTS
   Shared, page-agnostic components: footer, nav, table-scroll,
   buttons, base typography. Route-plan keeps its own module CSS
   but references the same tokens above.
   ============================================================ */

/* ---- Top navigation (global shell) ---- */
.topnav {
  width: min(960px, 100%);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0 auto var(--space-4);
}
.topnav a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, .92);
  transition: border-color .18s ease, transform .18s ease;
}
.topnav a:hover { border-color: var(--brand); transform: translateY(-1px); }

/* ---- Footer (v2.0 international standard) ---- */
.site-footer {
  width: min(960px, 100%);
  margin: var(--space-8) auto 0;
  padding: var(--space-6) var(--space-4);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  align-items: start;
  gap: var(--space-6);
  border-top: 1px solid var(--line);
  color: var(--ink-light);
  font-size: 13px;
  line-height: 1.7;
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-logo { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--ink); }
.footer-tag { color: var(--ink-light); max-width: 240px; }
.footer-cols { display: contents; }
.footer-col h4 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
}
.footer-col a {
  display: block;
  color: var(--ink-light);
  text-decoration: none;
  padding: 2px 0;
  transition: color .15s ease;
}
.footer-col a:hover { color: var(--brand); }
.footer-copy {
  grid-column: 1 / -1;
  margin: var(--space-4) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-light);
}

/* ---- Table horizontal scroll (all tables) ---- */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Buttons (shared) ---- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }

/* ============================================================
   Home & City v2.0 components (shared, tokens-only)
   ============================================================ */

/* ---- Hero ---- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(520px, 64vh);
  padding: var(--space-12) var(--space-6);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(115deg, rgba(20, 40, 25, .72) 0%, rgba(20, 40, 25, .38) 55%, rgba(20, 40, 25, .28) 100%),
    var(--hero-image) center / cover;
  text-align: center;
  overflow: hidden;
}
.hero--city { min-height: min(340px, 46vh); }
.hero--story { min-height: min(320px, 44vh); }
.hero-inner { position: relative; z-index: 1; max-width: 680px; width: 100%; }
.hero-brand {
  margin: 0 0 var(--space-3);
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
}
.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .35);
}
.hero-sub {
  margin: var(--space-3) 0 0;
  font-size: clamp(17px, 2.6vw, 21px);
  font-weight: 600;
  color: rgba(255, 255, 255, .94);
}
.hero-sub-zh {
  margin: var(--space-2) 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .78);
}
.hero-meta {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .7);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  align-items: center;
  margin-top: var(--space-6);
}
.hero-search {
  display: flex;
  gap: var(--space-2);
  width: min(420px, 100%);
}
.hero-search input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .92);
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.hero-search input:focus { border-color: var(--accent); }
.btn-on-hero { color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-on-hero:hover { border-color: #fff; }

/* ---- Stats bar ---- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-8);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  color: #fff;
}
.stat-label {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .75);
}

/* ---- Section header ---- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-2);
}
.section-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.section-more {
  color: var(--brand);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.section-more:hover { text-decoration: underline; }

/* ---- Destination cards (country -> city two levels) ---- */
.dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.dest-grid--cities { margin-top: var(--space-4); }
.dest-card {
  display: block;
  min-height: 108px;
  padding: var(--space-4) var(--space-4);
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: transform .18s ease, box-shadow .18s ease;
}
.dest-card--country { background: var(--tint-brand); }
.dest-card--city { background: var(--tint-gold); min-height: 96px; }
.dest-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.dest-card strong { display: block; margin-bottom: 6px; font-size: 20px; color: var(--brand); }
.dest-card span { color: var(--ink-light); line-height: 1.7; font-size: 14px; }

/* ---- Route cards ---- */
.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.route-card {
  display: block;
  padding: var(--space-4) var(--space-4);
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-lg);
  background: var(--tint-brand);
  transition: transform .18s ease, box-shadow .18s ease;
}
.route-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.route-card strong { display: block; margin-bottom: 6px; font-size: 18px; color: var(--brand); }
.route-card span { color: var(--ink-light); line-height: 1.7; font-size: 14px; }
.route-card--featured {
  position: relative;
  padding: var(--space-6) var(--space-6);
  background:
    linear-gradient(120deg, rgba(27, 94, 32, .94) 0%, rgba(46, 125, 50, .88) 100%);
  color: #fff;
  margin-bottom: var(--space-4);
}
.route-card--featured strong { color: #fff; font-size: 22px; }
.route-card--featured span { color: rgba(255, 255, 255, .85); }

/* ---- Badge ---- */
.badge {
  display: inline-block;
  margin-bottom: var(--space-2);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--gold-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}

/* ---- Guide / Season / City cards (reuse .card surface) ---- */
.guide-card, .season-card, .city-card, .budget-card {
  border-radius: var(--radius-lg);
  background: #fff;
}
.season-card strong { color: var(--brand); }
.budget-card { background: var(--tint-gold); }
.budget-card strong { color: var(--gold-ink); }

/* ---- Unified card hover (tint cards) ---- */
.budget-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ---- Empty state ---- */
.empty-state {
  padding: var(--space-8) var(--space-4);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--tint-gold-3);
  text-align: center;
}
.empty-state strong {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink);
}
.empty-state span { color: var(--ink-light); font-size: 14px; line-height: 1.7; }

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: 13px;
  color: var(--ink-light);
}
.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb a + a::before { content: '›'; margin-right: var(--space-2); color: var(--line); }

/* ---- About text ---- */
.about-text {
  margin: 0 0 var(--space-4);
  color: var(--ink-light);
  line-height: 1.8;
  max-width: 720px;
}
.stats-bar--facts {
  justify-content: flex-start;
  gap: var(--space-6);
  margin-top: var(--space-4);
}
.stats-bar--facts .stat-value { color: var(--brand); }
.stats-bar--facts .stat-label { color: var(--ink-light); }

/* ============================================================
   Phase B · travel visual asset components (tokens-only)
   ============================================================ */

/* ---- Card image (alt / lazy / 16:9 aspect) ---- */
.card-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  background: var(--line);
}

/* ---- Guide category badge ---- */
.badge--guide { background: var(--tint-brand); color: var(--brand); }

/* ---- City highlights chips ---- */
.highlight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}
.chip {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--tint-gold);
  color: var(--gold-ink);
  font-size: 13px;
  font-weight: 600;
}

/* ---- Section summary line ---- */
.section-summary {
  margin: 0 0 var(--space-3);
  color: var(--ink-light);
  font-size: 14px;
  line-height: 1.7;
}

/* ---- Story cards (future UGC traveler stories, architecture reserved) ---- */
.story-card { background: #fff; }
.story-card strong { color: var(--brand); }

/* ---- Story meta / author badge (story page) ---- */
.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}
.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.author-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- City Gallery (P9) ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}
.gallery-card {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.gallery-card .card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.gallery-caption {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.5;
}

/* ---- Content Page Gallery (P14.x) ---- */
.image-gallery {
  margin: 2rem 0;
  padding: 0 1rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
}
.gallery-item {
  margin: 0;
  padding: 0;
  break-inside: avoid;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.gallery-img {
  width: 100%;
  height: 225px;
  object-fit: cover;
  display: block;
  background: var(--color-bg-secondary);
}
.gallery-caption {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  color: var(--ink-light);
  text-align: center;
  line-height: 1.4;
}
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-img {
    height: 180px;
  }
}

/* ---- Related Links Section (P15) ---- */
.related-links {
  margin: 2rem 0;
  padding: 0 1rem;
}
.related-links .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.related-links .card {
  padding: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.related-links .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.related-links .card-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
@media (max-width: 640px) {
  .related-links .cards {
    grid-template-columns: 1fr;
  }
}
