/* ─────────────────────────────────────────────────────────────
   MMM-SFX  ·  assets/css/viewer.css
   Template 5 — Individual Universal Image Video Viewing Mode
───────────────────────────────────────────────────────────── */

/* ── Page reset for viewer ───────────────────────────────────── */
.viewer-body {
  background: #000;
  color: var(--c-white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Chrome bar (viewer variant) ─────────────────────────────── */
.viewer-chrome {
  background: #000;
  border-bottom: 1px solid #111;
}

/* ── Viewer header — footer info at top per design spec ──────── */
.viewer-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--sp-2) var(--sp-6);
  background: #000;
  border-bottom: 1px solid #111;
  font-family: var(--f-mono);
  font-size: var(--sz-xs);
  color: #444;
  letter-spacing: 0.06em;
}
.viewer-header .vh-left  { justify-self: start; }
.viewer-header .vh-mid   {
  justify-self: center;
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  color: #555;
}
.viewer-header .vh-right { justify-self: end; }
.viewer-header .sep { color: #333; font-size: 0.4rem; }

/* ── Viewer nav ──────────────────────────────────────────────── */
.viewer-nav {
  background: #000;
  border-bottom: 1px solid #111;
  padding: var(--sp-2) var(--sp-6);
  color: #444;
}
.viewer-nav a       { color: #444; }
.viewer-nav a:hover,
.viewer-nav a.active{ color: var(--c-teal); }
.viewer-nav .nav-sep{ color: #222; }

/* ── Stage — prev / media / next ────────────────────────────── */
.viewer-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  background: #000;
  min-height: 0;
  padding: var(--sp-6) 0;
}

/* ── Chevrons ────────────────────────────────────────────────── */
.viewer-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid #2a2a2a;
  border-radius: var(--r-sm);
  color: var(--c-teal);
  margin: 0 auto;
  transition: border-color var(--t-fast), color var(--t-fast);
  text-decoration: none;
  flex-shrink: 0;
}
.viewer-chevron svg { width: 22px; height: 22px; }
.viewer-chevron:hover {
  border-color: var(--c-teal);
  color: var(--c-white);
}
.viewer-chevron--inactive {
  color: #2a2a2a;
  border-color: #1a1a1a;
  cursor: default;
  pointer-events: none;
}

/* ── Media zone ──────────────────────────────────────────────── */
/* Container sizes to content — no forced aspect-ratio */
.viewer-media-zone {
  position: relative;
  display: block;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: var(--r-lg);
  overflow: visible;           /* allow controls to breathe */
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--t-fast);
}
.viewer-media-zone:hover { border-color: #2a2a2a; }

/* ── Image ───────────────────────────────────────────────────── */
.viewer-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  border-radius: var(--r-lg);
}

/* ── Video element in viewer ─────────────────────────────────── */
.viewer-video-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: var(--r-lg);
}

.viewer-video {
  width: 100%;
  height: auto;
  max-height: 70vh;
  display: block;
  border-radius: var(--r-lg);
}

/* Click-anywhere-to-return zone — covers the picture only, stops short
   of the native control bar at the bottom so transport controls stay usable */
.viewer-video-clickzone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 44px;
  cursor: pointer;
  text-decoration: none;
}

/* ── Vimeo embed (legacy, kept for compatibility) ──────────────── */
.viewer-vimeo {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.viewer-vimeo iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto;
}

/* ── Placeholder ─────────────────────────────────────────────── */
.viewer-placeholder {
  position: relative;
  aspect-ratio: 1080 / 720;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
}
.viewer-placeholder-label {
  font-family: var(--f-mono);
  font-size: var(--sz-sm);
  color: #333;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ── Play icon (large, viewer context) ──────────────────────── */
.play-icon--lg {
  width: 60px;
  height: 60px;
  border: 1px solid var(--c-teal-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-teal);
}
.play-icon--lg svg { width: 20px; height: 20px; margin-left: 3px; }

/* ── Counter ─────────────────────────────────────────────────── */
.viewer-counter {
  position: absolute;
  bottom: var(--sp-4);
  left: var(--sp-4);
  font-family: var(--f-mono);
  font-size: var(--sz-xs);
  color: #444;
  letter-spacing: 0.12em;
  pointer-events: none;
  z-index: 2;
}

/* ── Return hint ─────────────────────────────────────────────── */
.viewer-return-hint {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  font-family: var(--f-mono);
  font-size: var(--sz-xs);
  color: #555;
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--t-mid);
}

.viewer-media-zone:hover .viewer-return-hint {
  opacity: 1;
}

/* ── Caption bar ─────────────────────────────────────────────── */
.viewer-caption {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-3) var(--sp-6);
  background: #000;
  border-top: 1px solid #111;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast);
}
.viewer-caption:hover { background: #080808; }

.caption-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.caption-heading {
  font-family: var(--f-body);
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--c-white);
  white-space: nowrap;
}
.caption-sub {
  font-family: var(--f-mono);
  font-size: var(--sz-xs);
  color: var(--c-grey-dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.caption-links {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  justify-content: flex-end;
  flex-wrap: wrap;
}
.caption-link {
  font-family: var(--f-mono);
  font-size: var(--sz-xs);
  color: #444;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color var(--t-fast);
}
.caption-link:hover { color: var(--c-teal); }
.caption-links .sep { color: #222; font-size: 0.5rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .viewer-stage {
    grid-template-columns: 56px 1fr 56px;
  }
  .viewer-chevron {
    width: 38px;
    height: 38px;
  }
  .viewer-chevron svg { width: 18px; height: 18px; }
}

@media (max-width: 600px) {
  .viewer-stage {
    grid-template-columns: 44px 1fr 44px;
    padding: var(--sp-3) 0;
  }
  .viewer-header {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .viewer-header .vh-left,
  .viewer-header .vh-right { display: none; }
  .viewer-header .vh-mid   { justify-self: center; }
  .viewer-caption {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }
  .caption-links { justify-content: flex-start; }
}