/* ============================================
   TOUR LAYOUT — Container, transition, loading, header
   ============================================ */

:root {
  --c-surface-glass: var(--c-glass-heavy);
  --toolbar-h: 56px;
  --thumb-h: 90px;
  --header-h: 56px;
}

html, body {
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: fixed;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: none;
  touch-action: none;
}

/* ── VIEWER ── */
#tour-container {
  position: fixed;
  inset: 0;
  z-index: var(--z-canvas);
  cursor: grab;
}
#tour-container:active { cursor: grabbing; }

/* ── TRANSITION ── */
#tour-transition {
  position: fixed;
  inset: 0;
  z-index: var(--z-transition);
  background: var(--c-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* ── LOADING SCREEN ── */
.tour-loading {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
.tour-loading.hidden { opacity: 0; pointer-events: none; }
.tour-loading-inner { text-align: center; }
.tour-loading-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--c-text-strong);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
}
.tour-loading-logo span { color: var(--c-accent-light); }
.tour-loading-scene {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--c-text-dim);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.tour-loading-bar {
  width: 200px;
  height: 2px;
  background: rgba(200, 149, 108, 0.15);
  border-radius: 1px;
  overflow: hidden;
  margin: 0 auto 0.75rem;
}
.tour-loading-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--c-accent);
  border-radius: 1px;
  transition: width 0.3s ease;
}
.tour-loading-pct {
  font-size: 0.7rem;
  color: var(--c-text-dim);
  letter-spacing: 0.1em;
}

/* ── HEADER ── */
.tour-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--header-h);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: var(--c-surface-glass);
  border-bottom: 1px solid var(--c-line);
  transition: transform 0.3s ease;
}
.tour-header.hidden { transform: translateY(-100%); }

.tour-header-right { display: flex; align-items: center; gap: 0.75rem; }

.tour-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--c-text-strong);
  text-decoration: none;
  letter-spacing: 0.15em;
}
.tour-logo span { color: var(--c-accent-light); }

.tour-scene-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--c-accent);
  letter-spacing: 0.05em;
}

.tour-back {
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tour-back:hover { color: var(--c-accent); }
.tour-back svg { width: 16px; height: 16px; }

.tour-header-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--c-text-dim);
  transition: all 0.3s;
}
.tour-header-btn:hover { color: var(--c-accent); background: rgba(200, 149, 108, 0.1); }
.tour-header-btn.active { color: var(--c-accent); }
.tour-header-btn svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════
   TOUR LISTING PAGE
   ═══════════════════════════════════════ */

#tour-listing {
  min-height: 100vh;
  background: var(--c-bg);
}

/* ── Listing Header ── */
.listing-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: var(--c-glass-heavy);
  border-bottom: 1px solid var(--c-line);
}

.listing-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.listing-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--c-accent);
  letter-spacing: 0.05em;
}

/* ── Card Grid ── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.listing-card {
  display: block;
  text-decoration: none;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.listing-card:hover {
  transform: translateY(-4px);
  border-color: var(--c-accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.listing-card-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--c-input-bg);
}

.listing-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-card-placeholder svg {
  width: 48px;
  height: 48px;
  stroke: var(--c-text-dim);
  stroke-width: 1;
  fill: none;
  opacity: 0.3;
}

.listing-card-body {
  padding: 1.2rem 1.4rem;
}

.listing-card-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--c-text-strong);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.listing-card-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--c-text-dim);
  line-height: 1.5;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-card-meta {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--c-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.listing-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--c-text-dim);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 4rem 0;
}

/* ── Listing Responsive ── */
@media (max-width: 768px) {
  .listing-grid {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
    gap: 1.5rem;
  }
  .listing-header {
    padding: 0 1rem;
  }
  .listing-card-img {
    height: 180px;
  }
}
