/* ========================================
   Hollyday2026 - Design System CSS
   Following visual-direction.md & layout-system.md
   ======================================== */

:root {
  /* Base Palette */
  --bg: #f8f5f0;
  --paper: rgba(255, 255, 252, 0.95);
  --ink: #1a1a19;
  --muted: #7a726c;
  --line: rgba(26, 26, 25, 0.06);

  /* Destination Palette */
  --warm: #db7f61;
  --sea: #76b9bf;
  --dusk: #8f82b1;
  --sand: #caa174;

  /* Surface System */
  --surface-1: rgba(0,0,0,0.02);
  --surface-2: rgba(0,0,0,0.04);
  --surface-3: rgba(0,0,0,0.06);

  /* Focus Colors */
  --focus-warm: rgba(219, 127, 97, 0.12);
  --focus-sea: rgba(118, 185, 191, 0.12);
  --focus-dusk: rgba(143, 130, 177, 0.12);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.10);
  --shadow-warm: 0 8px 24px rgba(219,127,97,0.08);
  --shadow-sea: 0 8px 24px rgba(118,185,191,0.08);

  /* Radius */
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: Inter, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, .headline {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3.4rem, 14vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.86;
}

h2 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

p {
  margin-bottom: 1em;
}

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

/* Section Labels (Eyebrow) */
.section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: var(--space-xs);
}

.section-label.warm { color: var(--warm); }
.section-label.sea { color: var(--sea); }
.section-label.dusk { color: var(--dusk); }
.section-label.sand { color: var(--sand); }

/* Chapter Subhead */
.chapter-subhead {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.chapter-subhead.warm { color: var(--warm); }
.chapter-subhead.sea { color: var(--sea); }
.chapter-subhead.dusk { color: var(--dusk); }

/* Meta Text */
.meta {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Content Container */
.container {
  width: 100%;
  max-width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* Card Base */
.card {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card.featured {
  box-shadow: var(--shadow-warm);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 640px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--warm);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* Image handling */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.figure {
  position: relative;
}

.figure figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: var(--space-xs);
  font-style: italic;
}

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

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ========================================
   Navigation
   ======================================== */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--paper);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--ink);
  background: var(--surface-1);
}

.nav-link.active {
  background: linear-gradient(90deg, var(--surface-3), transparent);
  color: var(--ink);
  font-weight: 500;
  border-bottom: 2px solid var(--warm);
}

.nav-link.active[href="#phuket"] { border-bottom-color: var(--sea); }
.nav-link.active[href="#shanghai"] { border-bottom-color: var(--dusk); }

/* Language Switcher */
.lang-switch {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 1001;
  display: flex;
  gap: 4px;
  background: var(--paper);
  padding: 4px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.lang-switch a {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.lang-switch a:hover {
  color: var(--ink);
}

.lang-switch a.active {
  background: var(--surface-2);
  color: var(--ink);
}

/* ========================================
   Sections
   ======================================== */
section {
  margin-block: var(--space-2xl);
}

section + section {
  margin-block: var(--space-xl);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: var(--space-2xl) var(--space-md);
  background: var(--ink);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.7));
  pointer-events: none;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.6;
}

.hero-content {
  position: relative;
  width: 100%;
  max-width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  color: white;
}

.hero-content .eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: var(--space-sm);
  opacity: 0.9;
}

.hero-content h1 {
  color: white;
  margin-bottom: var(--space-md);
}

.hero-route {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
}

/* Overview Section */
#overview {
  padding: var(--space-xl) 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.destination-card {
  background: var(--surface-1);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
}

.destination-card h3 {
  margin-bottom: var(--space-sm);
}

.destination-card .dates {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

/* Journey/Timeline Section */
#journey {
  padding: var(--space-xl) 0;
}

.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 2px);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--warm);
  border: 2px solid var(--bg);
}

.timeline-item.phuket::before { background: var(--sea); }
.timeline-item.shanghai::before { background: var(--dusk); }

.timeline-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.timeline-location {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-activities {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Budget Section */
#budget {
  padding: var(--space-xl) 0;
}

.budget-total {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-family: Georgia, serif;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.budget-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.budget-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  padding-left: 16px;
  border-left: 2px solid transparent;
  background: var(--surface-1);
  border-radius: var(--radius-md);
}

.budget-line.confirmed {
  border-left-color: var(--warm);
}

.budget-line.estimated {
  border-left: 2px dashed var(--muted);
  opacity: 0.8;
}

.budget-label {
  display: flex;
  flex-direction: column;
}

.budget-label .item {
  font-weight: 500;
}

.budget-label .note {
  font-size: 0.75rem;
  color: var(--muted);
}

.budget-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Hotel Cards Section */
#stays {
  padding: var(--space-xl) 0;
}

.hotel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.hotel-card {
  background: var(--surface-2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hotel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hotel-card.featured {
  box-shadow: var(--shadow-warm);
}

.hotel-images {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2px;
  background: var(--line);
}

.hotel-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.hotel-info {
  padding: var(--space-md);
}

.hotel-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.hotel-location {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.hotel-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hotel-price .amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--warm);
}

.hotel-price .per-person {
  font-size: 0.75rem;
  color: var(--muted);
}

.hotel-features {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.hotel-feature {
  font-size: 0.75rem;
  padding: 4px 8px;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  color: var(--muted);
}

.hotel-map {
  margin-top: var(--space-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hotel-map img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.hotel-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--warm);
  color: white;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: filter 0.2s ease;
}

.hotel-cta:hover {
  filter: brightness(1.1);
}

.hotel-cta svg {
  width: 16px;
  height: 16px;
}

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

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

.chapter-hero {
  position: relative;
  height: 300px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.chapter-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.3));
}

.chapter-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-days {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.day-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-md);
}

.day-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  padding-top: 2px;
}

.day-content h4 {
  font-family: Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.day-content p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0;
}

/* Beijing Chapter */
#beijing {
  background: linear-gradient(to bottom, var(--surface-1), transparent);
  padding: var(--space-2xl) var(--space-md);
  border-radius: var(--radius-xl);
}

/* Phuket Chapter */
#phuket {
  padding: var(--space-2xl) var(--space-md);
}

/* Shanghai Chapter */
#shanghai {
  background: var(--ink);
  color: white;
  padding: var(--space-2xl) var(--space-md);
  border-radius: var(--radius-xl);
}

#shanghai h2 {
  color: white;
}

#shanghai .section-label {
  color: var(--dusk);
}

#shanghai .chapter-subhead {
  color: var(--dusk);
}

/* Notes Section */
#notes {
  padding: var(--space-xl) 0;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.note-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface-1);
  border-radius: var(--radius-lg);
}

.note-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}

.note-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.note-content p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* Footer/Credits Link */
.credits-link {
  display: block;
  text-align: center;
  padding: var(--space-lg);
  color: var(--muted);
  font-size: 0.875rem;
}

.credits-link:hover {
  color: var(--ink);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  :root {
    --space-2xl: 32px;
    --space-xl: 24px;
  }

  .hero {
    padding: var(--space-xl) var(--space-md);
  }

  .nav-link {
    padding: 8px 12px;
    font-size: 0.8125rem;
  }

  .day-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .hotel-images {
    grid-template-columns: 1fr;
  }

  .hotel-images img:first-child {
    height: 180px;
  }
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}