/* Preview card (docs/design-system.md, Preview cards): the 9:16 frame, radius
   8, and the caption under it on the page background. The selected
   preview carries the amber outline, the active indicator. */

/* A grid of preview cards (Posts, Studio candidates): rows 24px apart so
   the captions breathe, columns 16px. */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: var(--space-6) var(--space-4);
}

.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--radius-media);
  background: var(--color-text);
}

.preview--selected {
  outline: var(--accent-bar-height) solid var(--color-accent);
  outline-offset: 2px;
}

.preview__badges {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

/* A preview that opens on click: the frame plus its caption. */
.preview-card {
  cursor: pointer;
}

/* Approve and Reject on a candidate: two round controls over the image,
   above the dots, shown on hover and on focus; on touch, where there is
   no hover, always (docs/design-system.md, Preview cards). The slide
   arrows at mid-height show on the same hover. */
.preview__decide {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--space-8);
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.preview__decide .button {
  pointer-events: auto;
}

.preview-card:hover .preview__decide,
.preview-card:focus-within .preview__decide {
  opacity: 1;
}

@media (hover: none) {
  .preview__decide {
    opacity: 1;
  }
}

/* A card still being made: a white frame on the page with the loading
   note in the middle. */
.preview--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-surface);
}

.preview__note--reserved {
  min-height: calc(var(--leading-snug) * 1em);
}

.preview__caption {
  margin-top: var(--space-2);
}

.preview__title {
  margin: 0;
  min-height: calc(2 * var(--leading-snug) * 1em);
  font-size: var(--text-body);
  line-height: var(--leading-snug);
  color: var(--color-text);
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.preview__note {
  margin: 0;
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

/* The wizard's Result gives each candidate its own Publish under the
   caption, in the open (docs/design-system.md, Amber). */
.preview-card__publish {
  margin-top: var(--space-3);
}
