/* Ticket option: one ticket type in the tickets card — its name and price,
   what it includes, and the way to take it (a stepper, the seat map, or a
   note that it is gone).
   data-state      unavailable  sold out or not on sale
   data-highlight  the one ticket its organizer highlights, by how strongly
                   (Ticket::Highlightable), always in the accent:
                   label  the label above the title, nothing else
                   frame  a frame with the label on its top edge
                   band   a band across the top that carries the label
                   tint   the tile washed in the accent */
.ticket-option {
  background: var(--color-surface-2);
  border-radius: var(--radius-l);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-s);
}

.ticket-option[data-state="unavailable"] {
  filter: grayscale(1);
  opacity: 0.5;
}

.ticket-option__title {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: var(--weight-semibold);
  letter-spacing: normal;
  line-height: var(--leading-snug);
}

.ticket-option__price {
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.ticket-option__features {
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  font-size: var(--step--1);
  gap: var(--space-3xs);
  list-style: none;
  padding: 0;

  li {
    align-items: center;
    display: flex;
    gap: var(--space-2xs);
  }
}

/* A note in place of the action: sold out, seats in the box office only */
.ticket-option__note {
  background: var(--color-surface-3);
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  padding: var(--space-2xs) var(--space-s);
  text-align: center;
}

/* The organizer's label: "Recommended", "Most popular" or their own words.
   It follows the ticket's name for screen readers and shows above it. */
.ticket-option__label {
  align-self: flex-start;
  order: -1;
  background: var(--color-accent-fill);
  border-radius: var(--radius-pill);
  color: var(--color-on-accent);
  font-size: var(--step--2);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  overflow-wrap: anywhere;
  padding: var(--space-3xs) var(--space-2xs);
}

/* Spaced from the tile above, so the label on the edge has room */
.ticket-option[data-highlight="frame"] {
  border: calc(var(--border-width) * 2) solid var(--color-accent-text);
  margin-block-start: var(--space-2xs);
  padding-block-start: var(--space-m);
  position: relative;

  .ticket-option__label {
    inset-block-start: 0;
    inset-inline-start: var(--space-s);
    max-inline-size: calc(100% - var(--space-s) * 2);
    position: absolute;
    translate: 0 -50%;
  }
}

.ticket-option[data-highlight="band"] {
  border: calc(var(--border-width) * 2) solid var(--color-accent-fill);
  overflow: hidden;
  padding-block-start: 0;

  .ticket-option__label {
    align-self: stretch;
    border-radius: 0;
    margin-inline: calc(var(--space-s) * -1);
    padding: var(--space-3xs) var(--space-s);
    text-align: center;
  }
}

/* Mixed in oklab: oklch would turn a grey surface towards pink on the way.
   The wash moves the tile's lightness, so its quieter text takes the full
   text colour to stay readable on any accent. */
.ticket-option[data-highlight="tint"] {
  --color-muted: var(--color-text);
  --color-subtle: var(--color-text);

  background: color-mix(in oklab, var(--color-accent-fill) 14%, var(--color-surface-2));
  box-shadow:
    0 0 0 var(--border-width) oklch(from var(--color-accent-text) l c h / 0.35),
    var(--shadow-raised);
  outline: var(--border-width) solid transparent;
}

/* Contrast themes (forced colors) drop the fills: the label keeps an edge */
@media (forced-colors: active) {
  .ticket-option__label {
    border: var(--border-width) solid CanvasText;
  }
}
