/* The buy pages' read side (packs/ticketing, Ticketing::TicketsController): the frame (layouts/ticketing_tickets: a slim top bar, the page, the foot), the event
   lists (TicketingTicketsComponent: a heading, then one row per event, each row one link) and the event page (its facts, the price list the picker stub draws,
   the office's contact and the venue's lines). Phone first: one column, the date block beside the words; wider, a row reads date, what, then how it is going
   and what it costs at the end.

   Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads 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). */

/* ── The frame ─────────────────────────────────────────────────────────── */
.ticketing-frame {
  display: flex;
  flex-direction: column;
  min-block-size: 100dvh;
  background: var(--surface);
  color: var(--fg1);
}

.ticketing-top__bar {
  border-block-end: 1px solid var(--rule);
  background: var(--surface-header);
}

.ticketing-top__nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  max-inline-size: var(--page-w);
  margin-inline: auto;
  padding-block: var(--space-1);
  padding-inline: var(--page-gutter);
}

.ticketing-top a,
.ticketing-top summary {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  color: var(--fg1);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ticketing-top a:hover,
.ticketing-top a:focus-visible,
.ticketing-top summary:hover {
  text-decoration: underline;
}

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

.ticketing-top__institution {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--accent-text);
}

.ticketing-top__product {
  font-weight: 600;
}

.ticketing-top__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  margin-inline-start: auto;
  font-size: var(--text-sm);
}

.ticketing-top__wallet {
  font-weight: 600;
}

.ticketing-top a.ticketing-top__sign-in {
  color: var(--fg2);
}

/* Who is signed in: their first name, which opens their Tessera home and the way out. A details element, so it works with no script. */
.ticketing-top__who summary {
  gap: var(--space-1);
  cursor: pointer;
  list-style: none;
}

.ticketing-top__who summary::-webkit-details-marker {
  display: none;
}

.ticketing-top__who summary::after {
  content: "";
  inline-size: 0.45em;
  block-size: 0.45em;
  border-inline-end: 1.5px solid currentcolor;
  border-block-end: 1.5px solid currentcolor;
  /* Turned, the mark is wider than its box: the margin keeps its corner inside the name's own box, so nothing runs past the bar's edge. */
  margin-inline-end: 0.2em;
  transform: translateY(-0.15em) rotate(45deg);
}

/* The menu hangs from the bar, not from the name: a long name wraps to the start of a row of its own, and a menu hung from it there would open past the
   screen's edge. */
.ticketing-top__menu {
  position: absolute;
  inset-inline-end: var(--page-gutter);
  inset-block-start: 100%;
  z-index: 20;
  display: grid;
  min-inline-size: 12rem;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lift);
}

.ticketing-top__menu a {
  display: flex;
  padding-inline: var(--space-3);
  border-radius: var(--radius-sm);
}

/* The office's band: its own mark (or its name set large) on its one accent, the same in both modes; the color and the words on it come from the office's
   data (Ticketing::OfficeMark), which keeps them at 4.5:1. */
.ticketing-band {
  background: var(--ticketing-office, var(--accent));
  color: var(--ticketing-office-ink, var(--accent-fg));
  border-block-end: 1px solid var(--rule);
}

.ticketing-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  max-inline-size: var(--page-w);
  margin-inline: auto;
  padding-block: var(--space-2);
  padding-inline: var(--page-gutter);
}

.ticketing-top .ticketing-band a {
  color: inherit;
}

.ticketing-top .ticketing-band a:focus-visible {
  outline: 2px solid currentcolor;
  outline-offset: 2px;
}

.ticketing-band__office {
  gap: var(--space-3);
  min-inline-size: 0;
}

.ticketing-band__emblem {
  inline-size: auto;
  block-size: 2.5rem;
}

.ticketing-band__wordmark {
  inline-size: auto;
  max-inline-size: 100%;
  block-size: 1.75rem;
}

/* A dark mark the office's data says is shown reversed on its color. */
.ticketing-band__mark--invert {
  filter: brightness(0) invert(1);
}

.ticketing-band__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.15;
}

.ticketing-band__name--large {
  font-size: var(--text-2xl);
}

.ticketing-band__back {
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* On a phone the menu is as wide as the bar, under whichever row the name wrapped to; the band keeps to one row, its words wrapping inside their own
   halves, so the event's way forward stays on the first screen. */
@media (max-width: 30rem) {
  .ticketing-top__menu {
    inline-size: calc(100% - 2 * var(--page-gutter));
  }

  .ticketing-band__inner {
    flex-wrap: nowrap;
    gap: var(--space-3);
  }

  .ticketing-band__office {
    flex: 1 1 0;
  }

  .ticketing-band__back {
    flex: 0 0 auto;
    max-inline-size: 45%;
    text-align: end;
  }

  .ticketing-band__emblem {
    block-size: 2rem;
  }

  .ticketing-band__wordmark {
    block-size: 1.5rem;
  }

  .ticketing-band__name:not(.ticketing-band__name--large) {
    font-size: var(--text-md);
  }

  .ticketing-band__name--large {
    font-size: var(--text-xl);
  }
}

.ticketing-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
}

.ticketing-main {
  flex: 1;
  inline-size: 100%;
  max-inline-size: var(--page-w);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  padding-block: var(--space-4) var(--space-7);
  display: grid;
  align-content: start;
  gap: var(--section-gap);
  min-inline-size: 0;
}

.ticketing-main > * {
  min-inline-size: 0;
}

/* The foot runs the full width; its words keep the page's measure. */
.ticketing-foot {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  padding-block: var(--space-5);
  padding-inline: max(var(--page-gutter), calc((100% - var(--page-w)) / 2 + var(--page-gutter)));
  border-block-start: 1px solid var(--rule);
  background: var(--surface-sunken);
  color: var(--fg2);
  font-size: var(--text-sm);
}

.ticketing-foot > * {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ── /tickets: the offices, one under the other ────────────────────────── */
.ticketing-jump ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticketing-jump a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  padding-inline: var(--space-4);
  border: 1px solid var(--control-line);
  border-radius: 999px;
  color: var(--fg1);
  text-decoration: none;
}

.ticketing-jump a:hover,
.ticketing-jump a:focus-visible {
  border-color: var(--accent);
  color: var(--accent-text);
}

.ticketing-offices {
  display: grid;
  gap: var(--section-gap);
  min-inline-size: 0;
}

/* ── An event list (TicketingTicketsComponent) ─────────────────────────── */
.ticketing-tickets {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
  scroll-margin-block-start: var(--space-4);
}

.ticketing-tickets__head {
  display: grid;
  gap: var(--space-1);
  padding-block-end: var(--space-2);
  border-block-end: 2px solid var(--fg1);
}

.ticketing-tickets__title {
  margin-block: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ticketing-tickets__lede,
.ticketing-tickets__empty {
  margin-block: 0;
  color: var(--fg2);
  overflow-wrap: anywhere;
}

.ticketing-tickets__rows {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticketing-tickets__rows > li {
  border-block-end: 1px solid var(--rule);
}

.ticketing-tickets__row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  align-items: start;
  padding-block: var(--space-3);
  padding-inline: var(--space-2);
  color: var(--fg1);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.ticketing-tickets__row:hover {
  background: var(--surface-tint);
}

.ticketing-tickets__row:hover .ticketing-tickets__name,
.ticketing-tickets__row:focus-visible .ticketing-tickets__name {
  text-decoration: underline;
}

.ticketing-tickets__date {
  display: grid;
  justify-items: center;
  padding-block: var(--space-1);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  line-height: 1.1;
}

.ticketing-tickets__date b {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
}

.ticketing-tickets__date span {
  color: var(--fg2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ticketing-tickets__what {
  display: grid;
  gap: 0.15rem;
  min-inline-size: 0;
}

.ticketing-tickets__note {
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ticketing-tickets__name {
  font-size: var(--text-md);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticketing-tickets__subtitle,
.ticketing-tickets__where {
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.ticketing-tickets__when {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ticketing-tickets__status {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-inline-size: 0;
}

.ticketing-tickets__price {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticketing-tickets__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  margin-block: 0;
}

.ticketing-tickets__links a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  color: var(--accent-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (min-width: 48rem) {
  .ticketing-tickets__row {
    grid-template-columns: 3.75rem minmax(0, 1fr) minmax(10rem, 14rem);
    align-items: center;
  }

  .ticketing-tickets__status {
    grid-column: 3;
    flex-direction: column;
    align-items: flex-end;
    text-align: end;
  }
}

/* ── The event page ────────────────────────────────────────────────────── */
/* On a phone, when and where take the width and how it is going sits beside the price, so the way forward is on the first screen. */
.ticketing-event__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0;
}

.ticketing-event__wide {
  grid-column: 1 / -1;
}

.ticketing-event__facts > div {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  min-inline-size: 0;
}

.ticketing-event__facts dt {
  color: var(--fg2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ticketing-event__facts dd {
  display: grid;
  gap: 0.2rem;
  margin: 0;
}

.ticketing-event__fact {
  font-size: var(--text-lg);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticketing-event__aside {
  color: var(--fg2);
  overflow-wrap: anywhere;
}

.ticketing-event__aside a,
.ticketing-event__pair a,
.ticketing-picker__soon a,
#ticketing-state a,
#ticketing-sign-in a {
  color: var(--accent-text);
  font-weight: 600;
}

/* A link on a line of its own, with no sentence around it, is a target of its own (WCAG 2.5.8): a box 24 px tall at the least with its words in the middle,
   and the touch floor with a finger, as a case's are (62-case-work.css). The pack's lines of that kind are named here once; a link with no such line around
   it says `ticketing-standalone`. A link inside a sentence is not named: it stays as tall as its line. */
.ticketing-standalone,
:is(.ticketing-event__aside, .ticketing-visit__source, .ticketing-buy__back, .ticketing-order__back, .ticketing-register__back, .tk-pkg__back, .tk-pkg__game-title) > a {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.5rem;
}

@media (pointer: coarse) {
  .ticketing-standalone,
  :is(.ticketing-event__aside, .ticketing-visit__source, .ticketing-buy__back, .ticketing-order__back, .ticketing-register__back, .tk-pkg__back, .tk-pkg__game-title) > a {
    min-block-size: var(--target-min);
  }
}

.ticketing-event__pair,
.ticketing-event__about {
  margin-block: 0;
  max-inline-size: 65ch;
  overflow-wrap: anywhere;
}

.ticketing-event__pair a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}

@media (min-width: 48rem) {
  .ticketing-event__facts {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  }

  .ticketing-event__wide {
    grid-column: auto;
  }
}

/* The one thing to do next: a button, a student's free ticket, or the step a banner points to; then, quietly, what signing in would change. */
.ticketing-event__next {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  min-inline-size: 0;
}

.ticketing-event__next > .btn {
  justify-content: center;
  inline-size: 100%;
  max-inline-size: 24rem;
}

.ticketing-event__choice {
  margin-block: 0;
  max-inline-size: 65ch;
  color: var(--fg2);
  overflow-wrap: anywhere;
}

.ticketing-event__next > .callout,
.ticketing-event__next > .ticketing-claim {
  inline-size: 100%;
}

/* The price list the picker's stub draws (ticketing/tickets/_picker). */
.ticketing-picker {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
}

.ticketing-picker h2,
.ticketing-contact h2,
.ticketing-visit h2 {
  margin-block: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  overflow-wrap: anywhere;
}

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

.ticketing-picker__zone {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  min-inline-size: 0;
}

.ticketing-picker__zone-name {
  margin-block: 0;
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.ticketing-picker__prices {
  display: grid;
  gap: var(--space-1);
  margin: 0;
}

.ticketing-picker__price {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}

.ticketing-picker__price dt {
  color: var(--fg2);
  overflow-wrap: anywhere;
}

.ticketing-picker__price dd {
  margin: 0;
  font-weight: 600;
}

.ticketing-picker__price[data-mine] dt {
  color: var(--fg1);
  font-weight: 600;
}

.ticketing-picker__mine {
  margin-inline-start: var(--space-2);
  padding-inline: var(--space-2);
  border: 1px solid var(--tone-good-line);
  border-radius: 999px;
  background: var(--tone-good-bg);
  color: var(--tone-good-fg);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ticketing-picker__all-in,
.ticketing-picker__soon {
  margin-block: 0;
  max-inline-size: 65ch;
  overflow-wrap: anywhere;
}

.ticketing-picker__soon {
  padding: var(--space-3) var(--space-4);
  border-inline-start: 3px solid var(--accent);
  background: var(--surface-tint);
}

/* The office's contact and the venue's lines. */
.ticketing-contact,
.ticketing-visit {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
  scroll-margin-block-start: var(--space-4);
}

.ticketing-contact > p {
  margin-block: 0;
}

.ticketing-contact__lines,
.ticketing-visit__facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-3) var(--space-5);
  margin: 0;
}

.ticketing-contact__lines > div,
.ticketing-visit__facts > div {
  min-inline-size: 0;
}

.ticketing-contact__lines dt,
.ticketing-visit__facts dt {
  color: var(--fg2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ticketing-contact__lines dd,
.ticketing-visit__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ticketing-contact__lines a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  color: var(--accent-text);
}

.ticketing-visit__facts p {
  margin-block: 0 var(--space-1);
}

.ticketing-visit__source {
  font-size: var(--text-sm);
}

.ticketing-visit__source a {
  color: var(--fg2);
  font-weight: 400;
}

/* Active ?promo=CODE notice on a public event page: token-only and wrap-safe at 320px. */
.ticketing-promo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  max-inline-size: 38rem;
  margin-block: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--tone-good-line);
  border-radius: var(--radius-sm);
  background: var(--tone-good-bg);
  color: var(--tone-good-fg);
  font-size: var(--text-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticketing-promo-banner__remove {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
