/* Public viewer — dark archival reading room. Colors from tokens.css only. */

.browse-title {
  font-size: 2.6rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-5);
}

/* ---------- record cards ---------- */

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-4);
}

.record-card {
  display: block;
  color: var(--text);
  padding-bottom: var(--space-3);
  border-bottom: var(--hairline);
  transition: opacity var(--transition);
}

.record-card:hover { opacity: 0.6; }

.record-card-thumb {
  aspect-ratio: 16 / 10;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.record-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.record-card-ref { display: block; margin-bottom: var(--space-1); }

.record-card-title {
  font-size: 1.35rem;
  margin-bottom: var(--space-1);
}

.record-card-meta { font-size: 0.82rem; }

/* ---------- viewer ---------- */

.viewer { display: flex; flex-direction: column; gap: var(--space-3); }

.viewer-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.viewer-ref a { color: var(--text-muted); }
.viewer-ref a:hover { color: var(--gold); opacity: 1; }

.viewer-record-title { margin: var(--space-1) 0 0; font-size: 1.8rem; }

.viewer-counter {
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  white-space: nowrap;
}

.viewer-stage {
  --stage-bg: black; /* deliberate: media viewing surface, both themes */
  position: relative;
  background: var(--stage-bg);
  border-radius: var(--radius);
  /* fixed height: the stage (and its arrows/filmstrip below) must not
     resize as items of different aspect ratios flip through */
  height: 68vh;
  min-height: 16rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  outline: none;
}

.stage-media {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}

.stage-image { cursor: zoom-in; object-fit: contain; }
.stage-image.actual-size {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
.viewer-stage:has(.actual-size) {
  overflow: auto;
  justify-content: flex-start;
  align-items: flex-start;
}

.stage-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
}
.stage-audio audio { width: min(36rem, 90%); }

.stage-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  padding: var(--space-3);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
  z-index: 2;
}

.viewer-stage:hover .stage-arrow { opacity: 0.7; }
.stage-arrow:hover { color: var(--gold); opacity: 1; }
.stage-prev { left: 0; }
.stage-next { right: 0; }

.viewer-caption {
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 1.4em;
}

/* ---------- filmstrip ---------- */

.filmstrip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-2) 0 var(--space-3);
  border-top: var(--hairline);
  scrollbar-width: thin;
}

.strip-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 54px;
  padding: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--transition), border-color var(--transition);
}

.strip-thumb:hover { opacity: 0.85; }
.strip-thumb.active { opacity: 1; border-color: var(--gold); }
