/* ============================================
   VIEWER
   Full-screen artwork detail + story journey
   ============================================ */

.viewer {
  min-height: 100vh;
  background-color: var(--color-void);
}

/* --- Close / Back button --- */
.viewer__close {
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: calc(var(--z-viewer) + 10);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  letter-spacing: var(--letter-spacing-normal);
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(5, 5, 6, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-frame);
  border-radius: 2px;
  padding: 8px 16px;
  font-family: var(--font-body);
  transition: color var(--duration-fast) var(--ease-gentle),
              border-color var(--duration-fast) var(--ease-gentle);
}

.viewer__close:hover {
  color: var(--color-text-accent);
  border-color: var(--color-text-muted);
}

.viewer__close::before {
  content: '\2190';
  font-size: 1.1em;
}

/* --- Hero Section (side-by-side: artwork left, info right) --- */
.viewer__hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 80px var(--space-2xl);
  gap: var(--space-2xl);
  position: relative;
  cursor: pointer; /* clicking the void background navigates back to room */
}

/* Dark area beside the painting (viewer__artwork background) is also clickable —
   keep cursor: pointer to hint that clicking anywhere in the void navigates back */
.viewer__artwork {
  cursor: pointer;
}

/* Non-navigating areas reset cursor */
.viewer__meta,
.viewer__scroll-hint {
  cursor: auto;
}

/* Artwork display area (left column ~62%) */
.viewer__artwork {
  position: relative;
  flex: 0 1 62%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer__artwork-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 1px solid var(--color-frame);
  cursor: zoom-in;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.viewer__artwork-img.is-zoomed {
  cursor: zoom-out;
  transform: scale(2);
  z-index: 10;
}

/* Artwork placeholder (colored block for pieces without real images) */
.viewer__artwork-placeholder {
  width: 100%;
  max-width: 700px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-frame);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer__artwork-placeholder span {
  font-family: var(--font-display);
  font-size: var(--font-size-section-title);
  color: var(--color-text-dim);
  letter-spacing: var(--letter-spacing-normal);
}

/* Video player in viewer */
.viewer__video {
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid var(--color-frame);
  background: #000;
}

/* Artwork metadata (right column ~32%) */
.viewer__meta {
  flex: 0 0 30%;
  min-width: 0;
  text-align: left;
  margin-top: 0;
}

.viewer__title {
  font-family: var(--font-display);
  font-size: var(--font-size-room-title);
  font-weight: 300;
  letter-spacing: var(--letter-spacing-normal);
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.viewer__details {
  font-size: var(--font-size-body);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.viewer__description {
  font-size: var(--font-size-body);
  color: var(--color-text-primary);
  margin-top: var(--space-sm);
  font-weight: 300;
  line-height: var(--line-height-body);
  opacity: 0.8;
}

/* Scroll indicator for story */
.viewer__scroll-hint {
  margin-top: var(--space-xl);
}

/* --- Story Journey (below hero) --- */
.viewer__story {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
}

/* Story intro text */
.viewer__story-intro {
  font-family: var(--font-display);
  font-size: var(--font-size-section-title);
  font-weight: 300;
  color: var(--color-text-accent);
  text-align: center;
  line-height: 1.5;
  margin-bottom: var(--space-xl);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

.viewer__story-intro.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Story section — generic container */
.story-section {
  margin-bottom: var(--space-xl);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

.story-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Text sections */
.story-section--text {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  font-weight: 300;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

/* Process images strip */
.story-section--images {
  width: 100%;
}

.story-section__caption {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-sm);
  letter-spacing: var(--letter-spacing-normal);
  text-transform: uppercase;
}

.story-images-strip {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
}

.story-images-strip::-webkit-scrollbar {
  height: 4px;
}

.story-images-strip::-webkit-scrollbar-track {
  background: var(--color-surface);
}

.story-images-strip::-webkit-scrollbar-thumb {
  background: var(--color-frame);
  border-radius: 2px;
}

.story-image-item {
  flex: 0 0 auto;
  width: 280px;
  scroll-snap-align: start;
}

.story-image-item__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--color-frame);
  filter: brightness(0.7);
  transition: filter var(--duration-normal) var(--ease-gentle);
}

.story-image-item__img:hover {
  filter: brightness(1.0);
}

/* Placeholder for story images */
.story-image-item__placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-frame);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-image-item__placeholder span {
  font-size: var(--font-size-small);
  color: var(--color-text-dim);
}

.story-image-item__caption {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  margin-top: 6px;
  text-align: center;
}

/* Video section in story */
.story-section--video {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.story-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--color-frame);
}

.story-video-caption {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-xs);
}

/* --- Story End --- */
.viewer__story-end {
  text-align: center;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-frame);
}

.viewer__story-end-ornament {
  color: var(--color-text-accent);
  font-size: 1.2rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

/* Navigation at bottom */
.viewer__nav {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-md) 0 var(--space-xl);
  max-width: 800px;
  margin: 0 auto;
}

.viewer__nav-btn {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  letter-spacing: var(--letter-spacing-normal);
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-gentle);
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: 8px 16px;
  border: 1px solid var(--color-frame);
  border-radius: 2px;
}

.viewer__nav-btn:hover {
  color: var(--color-text-accent);
  border-color: var(--color-text-muted);
}

.viewer__nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* --- Audio player bar --- */
.audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-audio-player);
  background: rgba(10, 10, 12, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-frame);
  padding: 10px var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transform: translateY(100%);
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.audio-player.is-visible {
  transform: translateY(0);
}

.audio-player__label {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  letter-spacing: var(--letter-spacing-normal);
  text-transform: uppercase;
  white-space: nowrap;
}

.audio-player__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-frame);
  border-radius: 50%;
  cursor: pointer;
  background: none;
  color: var(--color-text-primary);
  transition: border-color var(--duration-fast) var(--ease-gentle);
  flex-shrink: 0;
}

.audio-player__btn:hover {
  border-color: var(--color-text-accent);
}

.audio-player__progress {
  flex: 1;
  height: 3px;
  background: var(--color-surface);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.audio-player__progress-fill {
  height: 100%;
  background: var(--color-text-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.audio-player__time {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
