/* The GIF maker (views/gif.js): the scene's text, images and the GIF's settings | the preview | the assistant, which
   reuses the newsletter editor's chat pane (.nl-chat). The scene itself is styled inside its frame (gif-runtime.js). */

.gif__body {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr) clamp(18rem, 24rem, 34vw);
  gap: var(--space-4);
  align-items: start;
}

.gif__side,
.gif__fields {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.gif__settings {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--space-2);
  align-items: end;
}

.gif__colour {
  width: 2.75rem;
  height: 2.5rem;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.gif__progress {
  width: 100%;
}

.gif__result {
  display: grid;
  gap: var(--space-2);
}

.gif__image {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.gif__result-bar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.gif__result-bar .hint {
  flex: 1;
}

.gif__stage {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
  min-width: 0;
}

.gif__stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.gif__stage-bar h2 {
  margin: 0;
  font-size: var(--text-m);
}

/* The scene at its own size, scaled to the GIF's width. */
.gif__frame {
  overflow: hidden;
  border: 1px solid var(--line);
}

.gif__host {
  transform-origin: top left;
}

/* The scene's frame, at the scene's own size (gif-frame.js sets it), scaled by .gif__host. */
.gif__iframe {
  display: block;
  border: 0;
  pointer-events: none;
}

.gif__images-box {
  display: grid;
  gap: var(--space-2);
}

.gif__images-head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.gif__images-head h2 {
  flex: 1;
  margin: 0;
  font-size: var(--text-m);
}

.gif__images {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gif__image-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.gif__image-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .gif__body {
    grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
  }

  .gif__chat {
    grid-column: 1 / -1;
    position: static;
    height: 32rem;
  }
}

@media (max-width: 820px) {
  .gif__body {
    grid-template-columns: minmax(0, 1fr);
  }
}
