/* Heritage Vault — Museum typography, atmosphere & immersive components */

/* ── Museum Typography ── */
.heritage-serif {
  font-family: "Georgia", "Times New Roman", "Noto Serif", serif;
}

.heritage-vault .heritage-title {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.heritage-vault .heritage-body {
  font-size: 1.125rem;
  line-height: 1.85;
  color: #374151;
}

/* ── Exhibition Hero / Parallax Cover ── */
.heritage-hero {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
}

.heritage-hero-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

@media (min-width: 768px) {
  .heritage-hero-image {
    height: 400px;
  }
}

.heritage-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.3) 40%,
    transparent 100%
  );
}

.heritage-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  color: white;
}

/* ── Artifact Cards (Gallery Grid) ── */
.heritage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

.heritage-card {
  border-radius: 1rem;
  border: 1px solid #f0f0f0;
  background: white;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.heritage-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(120, 100, 60, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.heritage-card-image {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
}

.heritage-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3/2;
  background: #fafaf9;
}

.heritage-card-body {
  padding: 1rem 1.125rem 1.125rem;
}

.heritage-card-title {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.heritage-card-era {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0.25rem 0 0;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.heritage-card-meta {
  font-size: 0.75rem;
  color: #b0b0b0;
  margin: 0.5rem 0 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Provenance Timeline ── */
.provenance-timeline {
  position: relative;
  padding-left: 2rem;
}

.provenance-timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.provenance-entry {
  position: relative;
  padding-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.provenance-entry.provenance-visible {
  opacity: 1;
  transform: translateY(0);
}

.provenance-dot {
  position: absolute;
  left: -1.625rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #e5e7eb;
}

.provenance-dot--creation { background: #22c55e; box-shadow: 0 0 0 2px #22c55e; }
.provenance-dot--colonial { background: #ef4444; box-shadow: 0 0 0 2px #ef4444; }
.provenance-dot--repatriation { background: #3b82f6; box-shadow: 0 0 0 2px #3b82f6; }
.provenance-dot--restoration { background: #14b8a6; box-shadow: 0 0 0 2px #14b8a6; }
.provenance-dot--default { background: #9ca3af; box-shadow: 0 0 0 2px #9ca3af; }

/* ── Audio Narration Bar ── */
.narration-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 9999px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.narration-play-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #1d9bf0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}

.narration-play-btn:hover {
  background: #1a8cd8;
}

.narration-progress-bar {
  flex: 1;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.narration-progress-fill {
  height: 100%;
  background: #1d9bf0;
  border-radius: 2px;
  width: 0%;
  transition: width 0.25s linear;
}

/* ── Comparison Slider (Before/After) ── */
.comparison-container {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.comparison-container img {
  display: block;
  width: 100%;
  height: auto;
}

.comparison-overlay {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
}

.comparison-overlay img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: white;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  z-index: 10;
}

.comparison-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Deep Zoom Overlay ── */
.deep-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.deep-zoom-container {
  width: 100%;
  height: 100%;
}

.deep-zoom-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 10;
}

.deep-zoom-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.deep-zoom-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.875rem;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 10;
}

/* ── TK Label Badges ── */
.tk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.tk-badge img {
  width: 0.875rem;
  height: 0.875rem;
}

/* ── Access Level Indicators ── */
.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.access-badge--public { background: #dcfce7; color: #166534; }
.access-badge--tribe { background: #dbeafe; color: #1e40af; }
.access-badge--elders { background: #fae8ff; color: #86198f; }
.access-badge--restricted { background: #fee2e2; color: #991b1b; }

/* ── Media Indicator Badges ── */
.media-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
}


/* ── Restricted Content Placeholder ── */
.heritage-restricted {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  border-radius: 0.75rem;
  background: repeating-linear-gradient(
    45deg,
    #f9fafb,
    #f9fafb 10px,
    #f3f4f6 10px,
    #f3f4f6 20px
  );
  border: 1px solid #e5e7eb;
}

/* ── Repatriation Badge ── */
.repatriation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

/* ══════════════════════════════════════════════ */
/* IMMERSIVE VIEW — Cinematic Museum Experience  */
/* ══════════════════════════════════════════════ */

.immersive-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #0a0a0f;
  overflow: hidden;
}

.immersive-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
}

.immersive-scene--hidden {
  opacity: 0;
  pointer-events: none;
}

.immersive-scene--visible {
  opacity: 1;
  pointer-events: auto;
}

.immersive-scene--fading {
  opacity: 0;
  pointer-events: none;
}

/* Spotlight vignette */
.immersive-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 70% at center,
    transparent 0%,
    rgba(10, 10, 15, 0.25) 55%,
    rgba(10, 10, 15, 0.75) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.immersive-artifact-image {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 0.25rem;
  filter: drop-shadow(0 0 80px rgba(201, 169, 110, 0.12));
  position: relative;
  z-index: 0;
}

.immersive-model-viewer {
  width: 90vw;
  height: 85vh;
  --poster-color: transparent;
}

/* Scene title overlay (bottom of scene) */
.immersive-scene-title {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.immersive-artifact-title {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7);
  margin: 0;
  line-height: 1.3;
}

.immersive-artifact-era {
  display: inline-block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #c9a96e;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* Image thumbnails */
.immersive-thumbs {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.375rem;
  padding: 0.375rem;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.immersive-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
  transition: border-color 0.2s;
}

.immersive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.immersive-thumb--active {
  border-color: #c9a96e;
}

/* ── HUD — Top Bar ── */

.immersive-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
  transition: opacity 0.4s ease;
}

.immersive-exit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.immersive-exit-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.immersive-exhibition-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.immersive-exhibition-title {
  font-family: "Georgia", serif;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.immersive-progress {
  font-size: 0.875rem;
  font-weight: 700;
  color: #c9a96e;
  font-variant-numeric: tabular-nums;
}

.immersive-top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.immersive-hud-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.immersive-hud-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.immersive-hud-btn--muted {
  color: rgba(255, 255, 255, 0.2);
}

/* ── Progress Dots ── */

.immersive-progress-dots {
  position: fixed;
  top: 3.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 0.375rem;
  align-items: center;
  transition: opacity 0.4s ease;
}

.immersive-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.immersive-dot--active {
  background: #c9a96e;
  width: 1.25rem;
  border-radius: 0.1875rem;
}

/* ── Navigation Arrows ── */

.immersive-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 5rem;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.2s, opacity 0.4s;
  background: transparent;
  padding: 0;
}

.immersive-nav-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}

.immersive-nav-btn--left { left: 0.5rem; }
.immersive-nav-btn--right { right: 0.5rem; }

/* ── Narration Bar ── */

.immersive-narration-bar {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 46;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 260px;
  max-width: 360px;
  transition: opacity 0.4s ease;
}

.immersive-narration-bar--hidden {
  display: none;
}

.immersive-narration-play-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #c9a96e;
  color: #0a0a0f;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.immersive-narration-play-btn:hover {
  background: #d4b87a;
}

.immersive-narration-progress {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.immersive-narration-progress-fill {
  height: 100%;
  width: 0%;
  background: #c9a96e;
  border-radius: 2px;
  transition: width 0.2s linear;
}

.immersive-narration-time {
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
}

/* ── Info Panel ── */

.immersive-info-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  max-height: 50vh;
  overflow-y: auto;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.88) 100%);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: 1.25rem 1.25rem 0 0;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 1.5rem 2rem;
}

.immersive-info-panel--hidden {
  transform: translateY(calc(100% + 1rem));
}

.immersive-info-handle {
  width: 2.5rem;
  height: 0.25rem;
  border-radius: 0.125rem;
  background: rgba(255, 255, 255, 0.25);
  margin: 0.75rem auto 1rem;
  cursor: pointer;
}

.immersive-info-content h2 {
  font-family: "Georgia", serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: white;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.immersive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.immersive-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(201, 169, 110, 0.15);
  color: #c9a96e;
  border: 1px solid rgba(201, 169, 110, 0.25);
}

.immersive-badge--tk {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

.immersive-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
}

.immersive-detail {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  font-size: 0.8125rem;
  color: rgba(224, 213, 193, 0.8);
}

.immersive-detail-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
}

.immersive-description {
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(224, 213, 193, 0.7);
  margin: 0 0 0.75rem;
}

.immersive-tk-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.immersive-view-details-link {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #c9a96e;
  text-decoration: none;
  transition: color 0.2s;
}

.immersive-view-details-link:hover {
  color: #d4b87a;
}

/* ── HUD Auto-hide ── */

.immersive-hud--hidden .immersive-top-bar,
.immersive-hud--hidden .immersive-nav-btn,
.immersive-hud--hidden .immersive-progress-dots,
.immersive-hud--hidden .immersive-narration-bar:not(.immersive-narration-bar--hidden) {
  opacity: 0;
  pointer-events: none;
}

/* ── Mobile ── */

@media (max-width: 640px) {
  .immersive-nav-btn { display: none; }
  .immersive-artifact-image { max-width: 100vw; max-height: 78vh; border-radius: 0; }
  .immersive-info-panel { max-height: 60vh; padding: 0 1rem 1.5rem; }
  .immersive-progress-dots { display: none; }
  .immersive-scene-title { bottom: 6rem; }
  .immersive-artifact-title { font-size: 1.25rem; }
  .immersive-narration-bar { min-width: 220px; max-width: 300px; bottom: 5rem; }
}
