/* A ticket design drawn as it will print, beside what its checks found (TicketingDesignPreviewComponent,
   packs/ticketing/app/components/ticketing_design_preview_component.rb), and the rest of a design's page (packs/ticketing/app/views/ticketing/office/designs/show.html.erb).
   The pictures take the wider column where there is room and the checks the narrower; on a phone the checks come after the pictures. A picture is the
   printer's own black on white (the draw step's picture is opaque), with a hairline in both modes. At printed size it is as long as the ticket, in a strip that
   scrolls sideways inside itself, so the page never does.

   Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the light shell
   and the console, in light and in dark, and mirrors in a right-to-left language. Nothing pinned to an edge, no height in vh, and everything that holds
   words may shrink and wrap, so a language 40% longer never widens the page (WCAG 1.4.10). */

.ticketing-design-preview {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}

.ticketing-design-preview__title {
  margin-block: 0;
}

.ticketing-design-preview__lede,
.ticketing-design-preview__caption,
.ticketing-design-preview__none {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.ticketing-design-preview__body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
  align-items: start;
  min-inline-size: 0;
}

@media (min-width: 64rem) {
  .ticketing-design-preview__body {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.ticketing-design-preview__pictures,
.ticketing-design-preview__checks {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  min-inline-size: 0;
}

.ticketing-design-preview__figure {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  min-inline-size: 0;
}

.ticketing-design-preview__image,
.ticketing-design-preview__actual {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

.ticketing-design-preview__image {
  inline-size: 100%;
  max-inline-size: 100%;
  block-size: auto;
}

/* At printed size: the inline style gives the stock's length and width; the strip scrolls, the picture never shrinks. */
.ticketing-design-preview__strip {
  overflow-x: auto;
  max-inline-size: 100%;
  padding-block-end: var(--space-2);
}

.ticketing-design-preview__strip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ticketing-design-preview__actual {
  max-inline-size: none;
}

.ticketing-design-preview__fallback {
  gap: var(--space-2);
}

.ticketing-design-preview__schematic {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-sm);
}

.ticketing-design-preview__paper {
  fill: var(--surface-raised);
  stroke: var(--rule-strong);
  stroke-width: 2;
}

.ticketing-design-preview__band {
  fill: var(--accent);
}

.ticketing-design-preview__line {
  fill: var(--rule);
}

.ticketing-design-preview__line--strong {
  fill: var(--fg3);
}

.ticketing-design-preview__tear {
  stroke: var(--rule-strong);
  stroke-width: 2;
}

.ticketing-design-preview__code-box {
  fill: var(--surface-sunken);
  stroke: var(--fg3);
  stroke-width: 2;
}

.ticketing-design-preview__svg-kicker {
  fill: var(--accent-text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
}

.ticketing-design-preview__svg-title {
  fill: var(--fg1);
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
}

.ticketing-design-preview__svg-meta,
.ticketing-design-preview__svg-note {
  fill: var(--fg2);
  font-family: var(--font-sans);
  font-size: 15px;
}

.ticketing-design-preview__checks-title {
  margin-block: 0;
  font-size: var(--text-lg);
}

.ticketing-design-preview__findings {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticketing-design-preview__finding {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* The design's page: its state on one line, what can be done with it as a list of buttons each with what it does, and its source in a monospace box. */
.ticketing-design-state {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
  margin: 0;
  overflow-wrap: anywhere;
}

.ticketing-design-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticketing-design-actions__item {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  min-inline-size: 0;
}

.ticketing-design-actions__item p {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.ticketing-design-source-field textarea,
.ticketing-design-source {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.ticketing-design-source {
  overflow: auto;
  max-block-size: 32rem;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticketing-design-source:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
