:root {
  color-scheme: light;
  --ink: #1f2a32;
  --muted: #67737d;
  --line: #dfe5e8;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --green: #39C5BB; /* Miku Teal */
  --green-deep: #2A9D95; /* Miku Deep Teal */
  --rust: #FF003F; /* Miku Pink/Red */
  --gold: #f39c12; /* Warmer Gold for Food */
  --sky: #E0F7F6;
  --shadow: 0 18px 50px rgba(57, 197, 187, 0.14);
  --food-accent: #e67e22;
  --food-bg: #fffcf9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  padding: 18px clamp(20px, 5vw, 64px);
  position: absolute;
  right: 0;
  top: 0;
  z-index: 10;
}

.site-header.solid {
  background: rgba(251, 250, 246, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: var(--green-deep);
  border-radius: 8px;
  color: #fff;
  display: grid;
  font-weight: 800;
  height: 40px;
  place-items: center;
  width: 40px;
  transition: transform 0.3s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.1);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: -2px;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 24px;
  font-size: 15px;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--green-deep);
}

.menu-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: none;
  flex-direction: column;
  gap: 5px;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.menu-toggle span {
  background: var(--ink);
  border-radius: 999px;
  display: block;
  height: 2px;
  transition: transform 180ms ease, opacity 180ms ease;
  width: 20px;
}

.site-header.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  display: grid;
  min-height: 86vh;
  overflow: hidden;
  place-items: center;
  position: relative;
  text-align: center;
}

.hero-media {
  background-position: center;
  background-size: cover;
  inset: 0;
  position: absolute;
  transform: scale(1.02);
}

.hero-content {
  width: 100%;
  max-width: 900px;
  padding: 150px 20px 84px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  color: var(--rust);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: clamp(40px, 7vw, 82px);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-bottom: 22px;
  width: 100%;
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  margin-bottom: 0;
}

h3 {
  font-size: 22px;
  line-height: 1.3;
  margin-bottom: 10px;
}

.hero-copy {
  color: #34434b;
  font-size: clamp(17px, 2vw, 21px);
  max-width: 620px;
}

.hero-search {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin: 30px auto 0;
  width: 100%;
  max-width: 720px;
  padding: 10px;
  border-radius: 12px;
}

.search-input-wrap {
  align-items: center;
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-width: 0;
}

.search-icon {
  border: 2px solid var(--muted);
  border-radius: 50%;
  height: 16px;
  margin-left: 8px;
  opacity: 0.75;
  position: relative;
  width: 16px;
}

.search-icon::after {
  background: var(--muted);
  border-radius: 999px;
  content: "";
  height: 7px;
  position: absolute;
  right: -5px;
  top: 10px;
  transform: rotate(45deg);
  width: 2px;
}

.hero-search input,
.filters input,
.filters select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-search input:focus,
.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(57, 197, 187, 0.15);
}

.hero-search input {
  border: 0;
  min-width: 0;
}

.hero-search > button {
  background: var(--green);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 48px;
  padding: 0 22px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.hero-search > button:hover {
  background: var(--green-deep);
}

.hero-search > button:active {
  transform: scale(0.98);
}

.search-clear {
  background: #eef4f4;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  margin-right: 4px;
  min-height: 32px;
  padding: 0 10px;
}

.search-clear[hidden] {
  display: none;
}

.search-clear:hover {
  background: #dfeaea;
  color: var(--ink);
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.search-suggestions a {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(223, 229, 232, 0.9);
  border-radius: 999px;
  color: #43515a;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
}

.search-suggestions a:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.metrics {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(20px, 5vw, 64px);
  transform: translateY(-28px);
}

.metrics article {
  background: var(--green-deep);
  color: #fff;
  padding: 24px;
}

.metrics strong {
  display: block;
  font-size: 28px;
  line-height: 1.2;
}

.metrics span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.toolbar-section,
.tour-results-section,
.region-band,
.detail-layout {
  margin: 0 auto;
  max-width: 1280px;
  padding: 58px clamp(20px, 5vw, 64px);
}

.section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.filters {
  align-items: end;
  background: var(--sky);
  display: grid;
  gap: 14px;
  grid-template-columns: 1.4fr 1fr auto;
  margin-bottom: 28px;
  padding: 18px;
}

.filters label span {
  color: #43515a;
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.reset-link {
  align-items: center;
  border: 1px solid rgba(31, 42, 50, 0.2);
  border-radius: 6px;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.reset-link:hover {
  background: rgba(31, 42, 50, 0.05);
  border-color: rgba(31, 42, 50, 0.4);
}

.results {
  min-height: 320px;
  transition: opacity 160ms ease;
}

.results.is-loading {
  opacity: 0.52;
}

.tour-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tour-card {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tour-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.tour-image-link {
  aspect-ratio: 16 / 10;
  background-color: #f0f3f4;
  overflow: hidden;
  position: relative;
}

.tour-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.tour-card:hover .tour-image-link img {
  transform: scale(1.1);
}

.duration-badge {
  background: var(--gold);
  border-radius: 6px;
  bottom: 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  left: 14px;
  padding: 5px 10px;
  position: absolute;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tour-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.tour-meta,
.spot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tour-meta {
  color: var(--rust);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.tour-body p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1;
}

.spot-row span {
  background: #f4f7f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4a5a64;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
}

.empty-state {
  background: rgba(31, 42, 50, 0.02);
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.site-footer {
  align-items: center;
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 40px clamp(20px, 5vw, 64px);
}

.site-footer a {
  color: var(--green-deep);
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}

.food-hero-media {
  background-position: center;
  background-size: cover;
}

/* Detail Pages */
.detail-hero {
  background-position: center;
  background-size: cover;
  color: #fff;
  min-height: 62vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 0 80px;
  position: relative;
}

.detail-hero::before {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
  content: "";
  inset: 0;
  position: absolute;
}

.detail-hero > div {
  width: 100%;
  max-width: 1280px;
  padding: 0 clamp(20px, 5vw, 64px);
  position: relative;
  z-index: 1;
}

.detail-hero h1 {
  font-size: clamp(42px, 6vw, 72px);
  margin-bottom: 18px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.detail-hero p {
  margin: 0 auto;
}

.detail-layout {
  margin: 0 auto;
  max-width: 1280px;
  padding: 80px clamp(20px, 5vw, 64px) 100px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
}

.facts {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  position: sticky;
  top: 100px;
  height: fit-content;
}

.facts div {
  padding: 16px 0;
}

.facts div:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.facts span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.facts strong {
  color: var(--ink);
  display: block;
  font-size: 18px;
}

.itinerary h2,
.food-article h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 32px;
  position: relative;
}

.itinerary h2::after,
.food-article h2::after {
  background: var(--green);
  bottom: -10px;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  width: 48px;
}

.itinerary ol {
  counter-reset: tour-counter;
  list-style: none;
  padding: 0;
}

.itinerary li {
  counter-increment: tour-counter;
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
  position: relative;
}

.itinerary li::before {
  align-items: center;
  background: var(--sky);
  border-radius: 50%;
  color: var(--green-deep);
  content: counter(tour-counter);
  display: flex;
  flex-shrink: 0;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.itinerary li:not(:last-child)::after {
  background: var(--line);
  content: "";
  height: calc(100% - 40px);
  left: 20px;
  position: absolute;
  top: 40px;
  width: 2px;
}

.back-link {
  color: rgba(255, 255, 255, 0.8);
  display: inline-block;
  font-weight: 700;
  margin-bottom: 24px;
}

.back-link:hover {
  color: #fff;
}

.food-article p {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 32px;
}

.food-article h2:not(:first-child) {
  margin-top: 60px;
}

.food-article ol,
.food-article ul {
  margin-bottom: 32px;
}

.food-article li {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}

.food-article .spot-row {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

/* Admin Styles */
.admin-table-wrap {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 1024px) {
  .tour-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .facts {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .facts div {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 768px) {
  .site-header {
    align-items: center;
    background: rgba(251, 250, 246, 0.96);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    padding: 16px 20px;
    position: sticky;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(31, 42, 50, 0.1);
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 12px;
    overflow: hidden;
    width: 100%;
  }

  .site-header.menu-open .nav-links {
    display: flex;
  }

  .nav-links a {
    border-bottom: 1px solid var(--line);
    padding: 13px 14px;
    width: 100%;
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .detail-hero {
    min-height: auto;
    padding: 100px 0 60px;
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .hero-search > button {
    width: 100%;
  }

  .search-input-wrap {
    min-height: 48px;
  }

  .search-suggestions {
    justify-content: flex-start;
    width: 100%;
  }

  .tour-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 40px;
  }

  .hero-content {
    padding-top: 100px;
  }
}
