/* Design system page (#/design-system).
   Layout-only styles; the components themselves carry their own look. The
   token tiles show a token on a plain surface. */

.design-system__section {
  margin-bottom: var(--space-12);
}

.design-system__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) 0;
}

.design-system__row-label {
  flex-basis: 160px;
  font-size: var(--text-note);
  color: var(--color-text-muted);
}

.design-system__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  align-items: start;
  flex: 1;
  min-width: 0;
}

.design-system__stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.design-system__inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.design-system__numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.design-system__rows {
  width: 560px;
  max-width: 100%;
}

.design-system__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 300px;
  max-width: 100%;
}

.design-system__progress {
  min-width: 260px;
}

.design-system__drop {
  width: 400px;
  max-width: 100%;
}

.design-system__text {
  margin: 0;
}

.design-system__token-name {
  font-size: var(--text-note);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* Token tiles */

.design-system__swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
}

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

.design-system__swatch-color {
  height: 56px;
  margin-bottom: var(--space-1);
  border-radius: var(--border-radius);
  box-shadow: inset 0 0 0 var(--border-width) var(--color-border);
}

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

.design-system__space {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.design-system__space .design-system__token-name {
  flex: 0 0 100px;
}

.design-system__space-bar {
  height: 12px;
  background: var(--color-text);
}

.design-system__chamfer {
  display: flex;
  align-items: flex-end;
  width: 120px;
  height: 64px;
  padding: var(--space-2);
  background: var(--color-bg-surface-inverse);
  color: var(--color-text-on-dark);
  font-size: var(--text-note);
}

.design-system__surface {
  display: flex;
  align-items: center;
  width: 180px;
  height: 64px;
  padding: var(--space-2);
  background: var(--color-bg-surface);
}

/* A stand-in for a page area: headers, tabs, tables */
.design-system__frame {
  flex: 1;
  min-width: 0;
}

.design-system__frame > * + * {
  margin-top: var(--space-6);
}

/* Previews: a 9:16 card the size of a grid preview, with controls laid over it */

.design-system__media {
  width: 185px;
}

.design-system__preview {
  width: 185px;
}

.design-system__media-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.design-system__choice-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: var(--content-narrow);
}

/* The first slide in an option card's media slot */
.design-system__option-media {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius-thumb);
}

/* A slide at the step picture size */
.design-system__step-picture {
  display: block;
  width: var(--step-picture-width);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius-thumb);
}

.design-system__overlay-row,
.design-system__decide {
  position: absolute;
  left: 0;
  right: 0;
  /* Above the preview badges (4) and the slide navigation */
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

.design-system__overlay-row {
  top: 50%;
  transform: translateY(-50%);
}

/* Approve and Reject sit above the slide dots */
.design-system__decide {
  bottom: var(--space-6);
}

.design-system__overlay-corner {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
}

/* The Settings profile: label and note on the left, the value on the right */
.design-system__list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.design-system__icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-4);
}

.design-system__icon-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-bg-surface);
  border-radius: var(--border-radius);
}

.design-system__sidebar-demo {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 520px;
}

.design-system__sidebar-demo .sidebar {
  position: static;
  height: auto;
}

.design-system__sidebar-demo-content {
  flex: 1;
  padding: var(--space-8) var(--space-12);
  background: var(--color-bg-page);
}

/* Studio: the Generate tab's column of step cards at the narrow width,
   the candidates grid under it */

.design-system__studio {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  flex: 1;
  min-width: 0;
}

.design-system__form-panel {
  max-width: var(--content-narrow);
}

/* A template's thumbnail in a batch cell, an image in place of the canvas */
.design-system__cell-thumb {
  display: block;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius-thumb);
}

.design-system__form-panel,
.design-system__results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.design-system__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

@media (max-width: 860px) {
  .design-system__row-label {
    flex-basis: 100%;
  }

  .design-system__sidebar-demo {
    flex-direction: column;
  }
}
