/* The view from a seat: in place beside or under a seat picker (ticketing/seat_views/_frame) and on its own page (ticketing/seat_views/show). Tokens and
   logical properties only. The frame, the caption and the figures are the page's and follow light and dark; the picture painted in the browser is a
   daylight or house-lights scene with its own colors in either mode (ticketing/seat_view_scene), and the sketch the server draws for a page with no
   script is painted from the theme. Nothing here moves. */

/* Where the frame sits. Under the map is its home. The picker's script moves it into the side slot when the picker's layout has a second column, and
   says so on the picker (data-view-at): the slot then takes the top of that column and the cart the rest of it, where the cart still follows the page. */
.tk-view-slot {
  min-inline-size: 0;
}

.tk-view-slot--side {
  display: none;
}

.tk-picker[data-view-at="side"] .tk-view-slot--side {
  display: block;
  grid-column: 2;
  grid-row: 1;
}

.tk-picker[data-view-at="side"] .tk-view-slot--home {
  display: none;
}

.tk-picker[data-view-at="side"] .tk-picker__layout {
  grid-template-rows: auto 1fr;
}

.tk-picker[data-view-at="side"] .tk-picker__main {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.tk-picker[data-view-at="side"] .tk-picker__cart {
  grid-column: 2;
  grid-row: 2;
}

.tk-view {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  min-inline-size: 0;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.tk-view__heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--fg1);
  overflow-wrap: anywhere;
}

.tk-view__heading:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.tk-view__picture {
  display: block;
  inline-size: 100%;
  max-inline-size: 40rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  /* Until the picture is painted: a ceiling indoors, the sky outdoors. */
  background: color-mix(in srgb, var(--fg1) 14%, var(--surface));
}

.tk-view__picture[hidden] {
  display: none;
}

.tk-view__picture--outdoor {
  background: var(--surface-tint);
}

/* A lamp adds its light to what is behind it. */
.tk-view__glow {
  mix-blend-mode: screen;
}

/* The server's sketch. Each kind of shape is the page's own surface mixed with a little of its text color, so the floor, the walls and the stands tell
   apart in light and in dark with no color of their own. */
.tk-view__picture--sketch path {
  stroke: var(--fg2);
  stroke-opacity: 0.55;
  stroke-width: 1px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.tk-view__picture--sketch .tk-view__ground { fill: color-mix(in srgb, var(--fg1) 5%, var(--surface)); stroke: none; }
.tk-view__picture--sketch .tk-view__wall { fill: color-mix(in srgb, var(--fg1) 10%, var(--surface)); }
/* What is looked at: the stage, the court, the ice or the field, the one colored shape in the sketch. */
.tk-view__picture--sketch .tk-view__surface { fill: color-mix(in srgb, var(--accent) 35%, var(--surface)); stroke: var(--accent); stroke-opacity: 1; }
.tk-view__picture--sketch .tk-view__side { fill: color-mix(in srgb, var(--accent) 60%, var(--surface)); stroke: var(--accent); stroke-opacity: 1; }
.tk-view__picture--sketch .tk-view__line { fill: var(--surface-raised); fill-opacity: 0.8; stroke: none; }
.tk-view__picture--sketch .tk-view__bank { fill: var(--surface-raised); }
/* The stand this seat is in, under the buyer's feet. */
.tk-view__picture--sketch .tk-view__own { fill: color-mix(in srgb, var(--fg1) 22%, var(--surface)); stroke-opacity: 1; }
.tk-view__picture--sketch .tk-view__thing { fill: var(--fg2); }

.tk-view__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-2) var(--space-4);
  inline-size: 100%;
  margin: 0;
}

.tk-view__fact dt {
  color: var(--fg2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.tk-view__fact dd {
  margin: 0;
  color: var(--fg1);
  overflow-wrap: anywhere;
}

.tk-view__blocked {
  margin: 0;
  color: var(--tone-warn-fg);
}

.tk-view__note,
.tk-view__hint {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* In place by a picker: one frame, the picture edge to edge at its top with the caption on it, the figures under it. */
.tk-view--live {
  gap: 0;
  justify-items: stretch;
  padding: 0;
  overflow: hidden;
  background: var(--surface-raised);
}

.tk-view--live .tk-view__frame {
  position: relative;
  padding: var(--space-3) var(--space-3) 0;
}

.tk-view--live .tk-view__hint {
  padding: var(--space-1) var(--space-3) var(--space-3);
}

.tk-view--live[data-state="shown"] .tk-view__frame {
  padding: 0;
}

.tk-view--live .tk-view__picture {
  max-inline-size: none;
  border: 0;
  border-block-end: 1px solid var(--rule);
  border-radius: 0;
}

/* The caption sits on the picture on a plate of the page's own surface, so it reads the same over a bright sky and a dark hall. The plate hugs each line
   of the words, so a long name on two lines covers no more of the picture than it needs. */
.tk-view--live[data-state="shown"] .tk-view__heading {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  max-inline-size: calc(100% - 2 * var(--space-2));
  font-size: var(--text-sm);
  line-height: 1.7;
}

.tk-view--live[data-state="shown"] .tk-view__caption {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.tk-view--live .tk-view__body {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  padding: var(--space-3);
}

.tk-view--live .tk-view__body[hidden] {
  display: none;
}

/* Three short sentences, one to a line. */
.tk-view--live .tk-view__facts {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1);
}

.tk-view--live .tk-view__close {
  justify-self: end;
}
