/* ============================================================
   Xi'an City Travel — Shared Stylesheet (TripAdvisor-inspired)
   Mobile-first • No Tailwind • Custom CSS only
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --c-green:       #00875a;
  --c-green-dark:  #006644;
  --c-green-light: #e6f4ee;
  --c-gold:        #e8a817;
  --c-gold-light:  #fef7e6;
  --c-red:         #d93b30;
  --c-text:        #2c2c2c;
  --c-text-light:  #5e5e5e;
  --c-text-muted:  #8c8c8c;
  --c-bg:          #ffffff;
  --c-bg-alt:      #f7f7f7;
  --c-border:      #e0e0e0;
  --c-white:       #ffffff;

  /* Typography */
  --ff-sans:  'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-serif: 'Noto Serif', Georgia, 'Times New Roman', serif;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --max-width: 1200px;
  --header-h:  64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--ff-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Grid System --- */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 600px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--c-green);
  color: var(--c-white);
}
.btn-primary:hover {
  background: var(--c-green-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--c-white);
  color: var(--c-text);
  border: 2px solid var(--c-border);
}
.btn-outline:hover {
  border-color: var(--c-green);
  color: var(--c-green);
}

.btn-gold {
  background: var(--c-gold);
  color: var(--c-white);
}
.btn-gold:hover {
  filter: brightness(0.95);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  font-size: 0.85rem;
  padding: 8px 18px;
}

.btn-block {
  width: 100%;
}

/* --- Header / Navigation --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--c-text);
  flex-shrink: 0;
}

.header-logo img {
  height: 36px;
  width: auto;
}

.header-logo span {
  font-family: var(--ff-serif);
  display: none;
}
@media (min-width: 480px) {
  .header-logo span { display: inline; }
}

/* Desktop nav */
.nav-desktop {
  display: none;
  align-items: center;
  gap: var(--space-xs);
}

.nav-desktop a {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text-light);
  transition: all 0.15s ease;
}
.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--c-green);
  background: var(--c-green-light);
}

.nav-lang {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: var(--space-md);
  padding-left: var(--space-md);
  border-left: 1px solid var(--c-border);
}
.nav-lang a {
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  color: var(--c-text-muted);
}
.nav-lang a:hover,
.nav-lang a.active {
  color: var(--c-green);
  background: var(--c-green-light);
}

@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .nav-lang { display: flex; }
}

/* Hamburger */
.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  color: var(--c-text);
  border-radius: 50%;
  transition: background 0.15s;
}
.hamburger:hover {
  background: var(--c-bg-alt);
}

@media (min-width: 768px) {
  .hamburger { display: none; }
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--c-white);
  z-index: 99;
  padding: var(--space-lg);
  overflow-y: auto;
}
.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 14px 0;
  font-size: 1.05rem;
  font-weight: 500;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--c-green); }

.mobile-lang {
  display: flex;
  gap: 12px;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--c-border);
}
.mobile-lang a {
  border-bottom: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  background: var(--c-bg-alt);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-text);
  overflow: hidden;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--c-white);
  padding: var(--space-2xl) var(--space-md);
  max-width: 720px;
}

.hero-content h1 {
  font-family: var(--ff-serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: var(--space-xl);
  opacity: 0.95;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* --- Page Hero (sub-pages) --- */
.page-hero {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  background: var(--c-text);
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.25) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 2;
  padding: var(--space-3xl) var(--space-md) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  color: var(--c-white);
}

.page-hero-content h1 {
  font-family: var(--ff-serif);
  margin-bottom: var(--space-sm);
}

.page-hero-content p {
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 600px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: var(--space-md);
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { opacity: 0.5; }

/* --- Sections --- */
.section {
  padding: var(--space-2xl) 0;
}

.section-alt {
  background: var(--c-bg-alt);
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-green);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-bottom: var(--space-sm);
  color: var(--c-text);
}

.section-subtitle {
  color: var(--c-text-light);
  font-size: 1rem;
  max-width: 640px;
}

.section-header-center {
  text-align: center;
}
.section-header-center .section-subtitle {
  margin: 0 auto;
}

/* Decorative line under title */
.section-line {
  width: 48px;
  height: 3px;
  background: var(--c-green);
  border-radius: 2px;
  margin-top: var(--space-sm);
}
.section-header-center .section-line {
  margin-left: auto;
  margin-right: auto;
}

/* --- Card Component --- */
.card {
  background: var(--c-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--c-border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-img img {
  transform: scale(1.06);
}

/* Rating badge (TripAdvisor style bubble) */
.card-rating {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-green);
  color: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 2;
}

.card-rating-sm {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

.card-body {
  padding: var(--space-md);
}

.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
}
.tag-unesco  { background: #fce4ec; color: #c62828; }
.tag-history { background: #e3f2fd; color: #1565c0; }
.tag-food    { background: #fff3e0; color: #e65100; }
.tag-culture { background: #f3e5f5; color: #6a1b9a; }
.tag-museum  { background: #e8eaf6; color: #283593; }
.tag-nature  { background: #e8f5e9; color: #2e7d32; }
.tag-top     { background: var(--c-gold-light); color: #b8860b; }

.card-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-bottom: var(--space-sm);
}

.card-meta .stars {
  color: var(--c-gold);
}

.card-meta .reviews {
  color: var(--c-text-muted);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--c-text-light);
  line-height: 1.5;
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--c-border);
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

.card-footer i {
  margin-right: 4px;
}

/* Horizontal card (for lists) */
.card-h {
  display: flex;
  gap: var(--space-md);
  background: var(--c-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  overflow: hidden;
}

.card-h .card-img {
  width: 120px;
  min-width: 120px;
  aspect-ratio: auto;
}
@media (min-width: 480px) {
  .card-h .card-img { width: 180px; min-width: 180px; }
}

.card-h .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --- Feature Block (image + text side by side) --- */
.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.feature-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.feature-text h2 {
  font-family: var(--ff-serif);
  margin-bottom: var(--space-md);
}
.feature-text p {
  color: var(--c-text-light);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

@media (min-width: 768px) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature.reverse .feature-img { order: 2; }
  .feature.reverse .feature-text { order: 1; }
}

/* --- Icon Cards (for tips/highlights) --- */
.icon-card {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--c-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.icon-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.icon-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-green-light);
  color: var(--c-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto var(--space-md);
}

.icon-card h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-sm);
}

.icon-card p {
  font-size: 0.88rem;
  color: var(--c-text-light);
}

/* --- Rating Stars --- */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--c-gold);
  font-size: 0.85rem;
}

/* --- Tags Row --- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--c-bg-alt);
  color: var(--c-text-light);
  border: 1px solid var(--c-border);
}
.tag.active {
  background: var(--c-green);
  color: var(--c-white);
  border-color: var(--c-green);
}

/* --- Footer --- */
.footer {
  background: #1a1a1a;
  color: #b0b0b0;
  padding: var(--space-2xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

@media (min-width: 480px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer-col h4 {
  color: var(--c-white);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  padding: 4px 0;
  color: #b0b0b0;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--c-white); }

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: var(--space-lg);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
}

.footer-bottom a { color: #b0b0b0; }
.footer-bottom a:hover { color: var(--c-white); }

.footer-lang {
  display: flex;
  gap: 12px;
}

/* --- Breadcrumb --- */
.breadcrumb-bar {
  padding: var(--space-md) 0;
  background: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-border);
  font-size: 0.85rem;
  color: var(--c-text-muted);
}
.breadcrumb-bar a { color: var(--c-green); }
.breadcrumb-bar a:hover { text-decoration: underline; }
.breadcrumb-bar .sep { margin: 0 6px; }

/* --- Ad Container --- */
.ad-container {
  text-align: center;
  padding: var(--space-lg) 0;
  background: var(--c-bg-alt);
}
.ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  margin-bottom: var(--space-sm);
}

/* --- Misc --- */
.text-green  { color: var(--c-green); }
.text-gold   { color: var(--c-gold); }
.text-muted  { color: var(--c-text-muted); }
.text-center { text-align: center; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Scrolling row (for horizontal card lists on mobile) */
.scroll-row {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-sm);
  margin: 0 calc(-1 * var(--space-md));
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}
.scroll-row > * {
  scroll-snap-align: start;
  flex: 0 0 280px;
}
@media (min-width: 768px) {
  .scroll-row {
    overflow-x: visible;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  .scroll-row > * { flex: none; }
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-green);
  color: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 50;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
