/*
 * Component styles, adapted from the brand kit's components/bundle.css.
 * Every colour is a token variable from /assets/tokens.css; no raw colour values.
 * Changes from the kit's file: preview scaffolding removed; the poster glow and
 * footer rule use color-mix() on token variables instead of rgba(); the list row
 * (.jm-row) is taken from the mockup's city page; cards are fluid, not 260px.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--surface-page);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--text-link);
}
.tnum {
  font-variant-numeric: tabular-nums;
}
.jm-display {
  font-family: var(--font-display);
}
.jm-ico {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.jm-ico-sm {
  width: 16px;
  height: 16px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* buttons */
.jm-btn {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
  min-height: var(--control-md);
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.jm-btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}
.jm-btn-primary:hover {
  background: var(--accent-hover);
}
.jm-btn-primary:active {
  background: var(--accent-pressed);
}
.jm-btn-external,
.jm-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.jm-btn-external:hover,
.jm-btn-secondary:hover {
  background: var(--surface-selected);
  color: var(--text-on-selected);
}
.jm-btn-external:active,
.jm-btn-secondary:active {
  background: var(--surface-selected);
  color: var(--text-on-selected);
  border-width: 3px;
}
.jm-btn-ghost {
  background: transparent;
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.jm-btn[disabled],
.jm-btn.is-disabled {
  background: var(--surface-section);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
  cursor: not-allowed;
}
.jm-btn-lg {
  min-height: var(--control-lg);
  font-size: 17px;
}

/* badges */
.jm-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.jm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border-subtle);
}
.jm-badge-error {
  background: var(--error-surface);
  color: var(--error);
  border-color: transparent;
}
.jm-badge-warning {
  background: var(--warning-surface);
  color: var(--warning);
  border-color: transparent;
}
.jm-badge-success {
  background: var(--success-surface);
  color: var(--success);
  border-color: transparent;
}
.jm-badge-info {
  background: var(--info-surface);
  color: var(--info);
  border-color: transparent;
}
.jm-badge-neutral {
  background: var(--surface-section);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* shared event text */
.jm-overline {
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.jm-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jm-card-title a {
  color: inherit;
  text-decoration: none;
}
.jm-card-title a:hover {
  text-decoration: underline;
}
.jm-card-meta {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.jm-card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.jm-card-seller {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.jm-sample {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary);
  font-style: italic;
}
.jm-strike {
  text-decoration: line-through;
}
.jm-seller {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
  margin: 0;
}

/* event card (kit) */
.jm-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
}
.jm-card-media {
  aspect-ratio: 4 / 5;
  position: relative;
  background: var(--surface-inverse);
  overflow: hidden;
}
.jm-card-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.jm-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jm-card-body .jm-btn {
  margin-top: 6px;
  align-self: flex-start;
}
.jm-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: 6px;
}

/* event list row (mockup, screen 1): the whole row is one link, no button */
.jm-row {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
}
.jm-row:hover {
  box-shadow: var(--shadow-2);
}
.jm-row-media {
  width: 88px;
  height: 110px;
  flex: none;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.jm-row-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.jm-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.jm-row-body .jm-badges {
  margin-bottom: 2px;
}

/* poster fallback */
.jm-poster {
  position: relative;
  width: 100%;
  height: 100%;
  color: var(--palladian);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  overflow: hidden;
}
.jm-poster-glow {
  background:
    radial-gradient(
      120% 80% at 80% 20%,
      color-mix(in srgb, var(--flame) 40%, transparent),
      color-mix(in srgb, var(--flame) 0%, transparent) 60%
    ),
    linear-gradient(160deg, var(--blue-fantastic) 0%, var(--abyssal) 70%);
}
.jm-poster-clay {
  background: linear-gradient(160deg, var(--truffle) 0%, var(--abyssal) 100%);
}
.jm-poster svg.dots {
  position: absolute;
  right: 0;
  top: 0;
  width: 70%;
  height: auto;
}
.jm-poster.is-compact {
  padding: 0;
}
.jm-poster.is-compact svg.dots {
  width: 100%;
}
.jm-poster .dot-flame {
  fill: var(--flame);
}
.jm-poster .dot-oatmeal {
  fill: var(--oatmeal);
}
.jm-poster .dot-truffle {
  fill: var(--truffle);
}
.jm-poster .t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 28px;
  position: relative;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jm-poster .s {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  position: relative;
  margin-top: 6px;
}

/* price */
.jm-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  line-height: 24px;
}
.jm-price-lg {
  font-size: 28px;
  line-height: 32px;
}
.jm-price-note {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary);
}

/* states */
.jm-state {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.jm-state h2 {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  margin: 0;
}
.jm-state p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* page frame */
.jm-page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}
.jm-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.jm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

/* muted states last, so they win over the base media rules */
.is-muted .jm-poster,
.is-muted .jm-card-media > img,
.is-muted .jm-row-media > img {
  filter: grayscale(1) contrast(0.85);
}

/* header and footer (kit SiteHeader / SiteFooter, mockup screen 1) */
.jm-skip {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  background: var(--surface-card);
  color: var(--text-link);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.jm-skip:focus {
  top: var(--space-2);
}
.jm-header {
  background: var(--surface-inverse);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2) 0 var(--space-4);
  min-height: 64px;
  position: relative;
}
.jm-header-logo {
  display: block;
  line-height: 0;
  padding: var(--space-1) 0;
}
.jm-header-logo img {
  display: block;
  width: 96px;
  height: 44px;
}
.jm-header .grow {
  flex: 1;
}
.jm-header-nav {
  display: none;
  gap: var(--space-5);
  font-size: 15px;
  font-weight: 600;
}
.jm-header-nav a {
  color: var(--text-inverse);
  text-decoration: none;
  padding: 20px 0;
  border-bottom: 3px solid transparent;
}
.jm-header-nav a.is-current {
  border-bottom-color: var(--accent);
}
.jm-header-menu summary {
  list-style: none;
  min-width: var(--control-md);
  min-height: var(--control-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-inverse);
}
.jm-header-menu summary::-webkit-details-marker {
  display: none;
}
.jm-header-menu nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--surface-inverse);
  border-top: 1px solid color-mix(in srgb, var(--text-inverse) 25%, transparent);
  padding: var(--space-2) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.jm-header-menu nav a {
  color: var(--text-inverse);
  padding: 10px 0;
  font-weight: 600;
}
@media (min-width: 768px) {
  .jm-header {
    padding: 0 var(--space-5);
    gap: var(--space-5);
  }
  .jm-header-nav {
    display: flex;
  }
  .jm-header-menu {
    display: none;
  }
}
.jm-footer {
  background: var(--surface-inverse);
  color: var(--text-inverse);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  font-size: 14px;
  line-height: 20px;
}
.jm-footer p {
  margin: 0;
}
.jm-footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px var(--space-4);
}
.jm-footer a {
  color: var(--text-inverse);
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.jm-footer .legal {
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--text-inverse) 25%, transparent);
  font-size: 12px;
  line-height: 16px;
}
@media (min-width: 768px) {
  .jm-footer {
    padding: var(--space-6) var(--space-5);
  }
  .jm-footer-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.jm-links {
  margin: 0;
  padding-left: var(--space-5);
}
.jm-links li {
  padding: 4px 0;
}

/* chips (kit FilterBar): links styled as chips; selected = tick + aria-current, never colour alone */
.jm-chip {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--control-md);
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-control);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.jm-chip:hover {
  background: var(--surface-section);
}
.jm-chip.is-selected {
  background: var(--surface-selected);
  border-color: var(--focus-ring);
  color: var(--text-on-selected);
}
.jm-chip.is-dark {
  background: transparent;
  border-color: var(--text-inverse);
  color: var(--text-inverse);
}
.jm-chip.is-dark.is-selected {
  background: var(--surface-selected);
  border-color: var(--surface-selected);
  color: var(--text-on-selected);
}
.jm-chip-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 4px;
}

/* city page hero (mockup screen 1): Night gradient, palladian text */
.jm-hero {
  background: linear-gradient(165deg, var(--abyssal) 0%, var(--blue-fantastic) 100%);
  color: var(--palladian);
  padding: 28px var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.jm-hero p {
  margin: 0;
}
.jm-hero-overline {
  color: var(--oatmeal);
}
.jm-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--display-1-mobile-font-size);
  line-height: var(--display-1-mobile-line-height);
  font-weight: 700;
}
.jm-hero .jm-chip:focus-visible {
  outline-color: var(--flame);
}
@media (min-width: 768px) {
  .jm-hero {
    padding: var(--space-7) var(--space-5) var(--space-6);
  }
  .jm-hero > * {
    max-width: var(--content-max);
  }
}
@media (min-width: 1200px) {
  .jm-hero-title {
    font-size: var(--display-1-font-size);
    line-height: var(--display-1-line-height);
    letter-spacing: var(--display-1-letter-spacing);
  }
}
.jm-results {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text-secondary);
}
.jm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.jm-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  margin: 0;
}
.jm-pages {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.jm-pages a {
  min-width: var(--control-md);
  min-height: var(--control-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-control);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}
.jm-pages a.is-current {
  background: var(--surface-selected);
  color: var(--text-on-selected);
  border-color: var(--focus-ring);
}

/* event page (screens 2 and 5) */
.jm-event {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: var(--measure);
}
.jm-breadcrumb {
  display: flex;
  gap: var(--space-2);
  font-size: 14px;
  line-height: 20px;
}
.jm-event-poster {
  aspect-ratio: 4 / 5;
  max-width: 420px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.jm-event-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jm-event-title {
  font-family: var(--font-display);
  font-size: var(--heading-1-mobile-font-size);
  line-height: var(--heading-1-mobile-line-height);
  font-weight: 700;
  margin: 0;
}
@media (min-width: 768px) {
  .jm-event-title {
    font-size: var(--heading-1-font-size);
    line-height: var(--heading-1-line-height);
  }
}
.jm-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
}
.jm-panel p {
  margin: 0;
}
.jm-seller-strong {
  font-weight: 700;
}
.jm-hint {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary);
}
.jm-event h2.jm-overline {
  margin: 0;
}
.type-heading-3 {
  font-family: var(--font-display);
  font-size: var(--heading-3-font-size);
  line-height: var(--heading-3-line-height);
  font-weight: var(--heading-3-font-weight);
  margin: 0;
}

/* forms (kit FormField) */
.jm-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text-primary);
}
.jm-input {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  min-height: var(--control-md);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-control);
  background: var(--surface-card);
  color: var(--text-primary);
  width: 100%;
}
.jm-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.jm-fieldset legend {
  margin-bottom: var(--space-2);
}
.jm-radio {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-md);
}
.jm-radio input {
  width: 20px;
  height: 20px;
  accent-color: var(--focus-ring);
}
.jm-alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 20px;
  align-items: flex-start;
}
.jm-alert-error {
  background: var(--error-surface);
  color: var(--error);
}

/* native event: ticket types (screen 2) */
.jm-stack-tight {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.jm-ticket-types {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.jm-ticket-type {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.jm-ticket-type:last-child {
  border-bottom: 0;
}
.jm-ticket-type-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.jm-alert-info {
  background: var(--info-surface);
  color: var(--info);
}
.jm-alert-info b {
  color: inherit;
}
.jm-similar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.jm-similar a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  text-decoration: none;
}
.jm-similar a:hover {
  box-shadow: var(--shadow-2);
}
.jm-event-poster > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--surface-inverse);
}
/* A poster layered over its fallback (EventCard, event page): if the image
   fails to load, the empty <img alt=""> is transparent and the fallback shows. */
.jm-event-poster {
  position: relative;
}
.jm-card-media > img.jm-media-img,
.jm-row-media > img.jm-media-img,
.jm-event-poster > img.jm-media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.jm-event-poster > img.jm-media-contain {
  object-fit: contain;
  background: transparent;
}
.jm-month {
  font-family: var(--font-display);
  font-size: var(--heading-3-font-size);
  line-height: var(--heading-3-line-height);
  font-weight: var(--heading-3-font-weight);
  margin: var(--space-3) 0 0;
}

/* /_kit preview helpers (no inline styles: the CSP allows style-src 'self' only) */
.jm-plain {
  list-style: none;
}
.jm-poster-frame {
  aspect-ratio: 4 / 5;
}

/* legal pages (/privacy, /terms, /accessibility) */
.jm-prose {
  max-width: 72ch;
}
.jm-prose h2 {
  margin-top: var(--space-6);
}
.jm-prose p,
.jm-prose ul {
  margin: var(--space-3) 0;
}
.jm-prose li {
  margin: var(--space-2) 0;
}
