/* The Images step (components/images_step.cljs): the collections as the list
   of the step's two columns, the one collection shown at the right as a grid
   of 9:16 thumbnails, six a row (three on a phone), in a box as tall as the
   list that scrolls inside. Nothing scrolls sideways, on a phone too. The
   columns and lists are the step card's (step_card.css). */

.images-step__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.images-step__note {
  margin: 0;
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

/* The weak-fit note: in the card between the heading and the columns. */
.images-step__card-note {
  margin: 0 0 var(--space-4);
  font-size: var(--text-note);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.images-step__detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

/* The drop zone into My images: the grid's first tile, at a thumbnail's
   size, the icon and one word inside. */
.images-step__upload {
  min-width: 0;
}

.images-step__upload .file-drop-zone {
  height: 100%;
  aspect-ratio: 9 / 16;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-thumb);
}

.images-step__upload .file-drop-zone__title {
  font-size: var(--text-note);
}

.images-step__upload .file-drop-zone__hint:empty {
  display: none;
}

.images-step__figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
}

.images-step__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-content: start;
  gap: var(--space-2);
  box-sizing: border-box;
  height: var(--step-list-height);
  overflow-x: hidden;
  overflow-y: auto;
}

.images-step__grid--loading {
  overflow-y: hidden;
}

/* A note in the grid's place spans its columns. */
.images-step__grid-note {
  grid-column: 1 / -1;
}

.images-step__thumb,
.images-step__placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-thumb);
}

.images-step__thumb {
  object-fit: cover;
  background: var(--color-bg-page);
}

/* The loading rule (docs/design-system.md, Wizard): the grid's final layout
   as pulsing placeholders while a read runs, never a spinner. */
.images-step__placeholder {
  background: var(--color-bg-control);
  animation: wizard-pulse var(--duration-skeleton-pulse) var(--ease-default) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .images-step__placeholder {
    animation: none;
  }
}

.images-step__caption {
  font-size: var(--text-note);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

@media (max-width: 860px) {
  .images-step__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
