/* ═══════════════════════════════════════════════════════════
   MVS Event Detail
   ───────────────────────────────────────────────────────────
   A centred title band, then a 2/1 split: the record's copy on the left,
   a sticky registration panel on the right.

   THE PANEL IS THE ONLY FILLED SHAPE ON THE PAGE. Beyond an optional
   logo tile above the title the event carries no imagery, so the page has one block of colour and everything else is
   type on white — which is what makes the price and the CTA the thing
   the eye lands on. Same restraint as `event-listings`, where the date
   numeral does the job an image would.

   Shares that module's card language: the #f5f6f9 ground for the meta
   bar, --global-radius-md corners, uppercase --title-color eyebrows at
   0.95 line-height and hairline rules.

   Colours come from the three style choices (panel / button / accent),
   never from a hex in here — see the modifier blocks below.
   ═══════════════════════════════════════════════════════════ */


/* ── Scope tokens ─────────────────────────────────────────── */

.mvs-event-detail {
  --ed-ground: #f5f6f9;
  --ed-rule:   color-mix(in srgb, var(--hs-black) 12%, transparent);

  /* Panel: one surface colour, and the hairline + inset block are both
     mixed FROM it, so a panel swap carries its own furniture with it and
     nothing has to be restated per modifier. */
  --ed-panel:      var(--hs-black);
  --ed-panel-text: var(--hs-white);
  --ed-panel-rule: color-mix(in srgb, var(--ed-panel-text) 22%, transparent);
  --ed-panel-well: color-mix(in srgb, var(--ed-panel-text) 10%, transparent);
  --ed-panel-mute: color-mix(in srgb, var(--ed-panel-text) 70%, transparent);

  --ed-accent: var(--hs-primary);
  --ed-pad:    clamp(1.5rem, 3.5cqi, 2.25rem);

  display: flex;
  flex-direction: column;
  gap: var(--molecule-large);
  width: 100%;
}

/* Panel colour — set per instance from style.panel_colour. */
.mvs-event-detail--panel-dark      { --ed-panel: var(--hs-black);     --ed-panel-text: var(--hs-white); }
.mvs-event-detail--panel-primary   { --ed-panel: var(--hs-primary);   --ed-panel-text: var(--hs-primary--text-over); }
.mvs-event-detail--panel-secondary { --ed-panel: var(--hs-secondary); --ed-panel-text: var(--hs-secondary--text-over); }

/* Accent — the CPD chip and the date. */
.mvs-event-detail--accent-primary   { --ed-accent: var(--hs-primary); }
.mvs-event-detail--accent-secondary { --ed-accent: var(--hs-secondary); }
.mvs-event-detail--accent-dark      { --ed-accent: var(--hs-black); }


/* ═══ TITLE BAND ════════════════════════════════════════════ */

.mvs-event-detail__header {
  display: flex;
  flex-direction: column;
  gap: var(--atom-standard);
  padding-bottom: var(--molecule-standard);
  border-bottom: 1px solid var(--ed-rule);
}

.mvs-event-detail__header--center { text-align: center; align-items: center; }
.mvs-event-detail__header--left   { text-align: left;   align-items: flex-start; }

/* Event image / logo — same frame as the `event-listings` tile (white,
   hairline, md radius, contain-never-crop: it's a logo), scaled up for
   the masthead. Inherits the header's left/centre alignment. */
.mvs-event-detail__logo {
  display: block;
  width: clamp(6rem, 18cqi, 10rem);
  aspect-ratio: 1;
  padding: var(--atom-standard);
  box-sizing: border-box;
  background: var(--hs-white);
  border: 1px solid var(--ed-rule);
  border-radius: var(--global-radius-md);
  overflow: hidden;
}
.mvs-event-detail__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mvs-event-detail__title {
  margin: 0;
  /* Display scale — this is the one h1 on the page and it is the page's
     whole masthead, so it is allowed to be the largest thing on it. */
  font-size: clamp(2.25rem, 6cqi, 3.75rem);
  line-height: 0.95;
  color: var(--mvs-title-color-o, var(--heading-color));
}

.mvs-event-detail__place {
  margin: 0;
  font-size: var(--sub-title-size);
  font-weight: var(--sub-title-weight);
  color: var(--mvs-subtitle-color-o, var(--sub-title-color));
}


/* ═══ BODY SPLIT ════════════════════════════════════════════
   One column until there is room for two. The panel is ~320px at its
   narrowest, below which the split starves the copy before it starves
   the panel — so the breakpoint is on the CONTAINER, not the viewport,
   and the module behaves the same in a gutter placement as a full one.

   It queries `stage`, the container _mvsModule.css already names on
   .mvs-module__stage, rather than declaring one of its own: the stage IS
   the content column, so a second container here would measure the same
   width under a different name. (Same reason `cqi` below needs no local
   container — event-listings relies on the identical inheritance.) */

.mvs-event-detail__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--molecule-large);
  align-items: start;
}

@container stage (min-width: 60rem) {
  .mvs-event-detail__body {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 22rem);
    gap: var(--organism-tiny);
  }
}

/* No panel (nothing priced, no CTA, no facts) — the copy takes the width
   back rather than sitting in a half-empty grid. A modifier set in HubL,
   not `:not(:has(…))`, because the template already knows the answer and a
   browser without :has() would otherwise squeeze the copy against nothing. */
.mvs-event-detail--no-panel .mvs-event-detail__body {
  grid-template-columns: minmax(0, 1fr);
}

.mvs-event-detail__main {
  display: flex;
  flex-direction: column;
  gap: var(--molecule-standard);
  min-width: 0;
}


/* ── Meta bar ──────────────────────────────────────────────
   Two columns: when/where left, chip and type right. A GRID rather than
   `justify-content: space-between` on a flex row, so the two sides hold
   their columns instead of the right-hand group drifting inwards whenever
   the left-hand text is short. Both tracks are `minmax(0, …)`: the left can
   shrink below its content and the right can wrap internally, which is what
   keeps a long venue and a two-part tag group from overflowing the bar. */

.mvs-event-detail__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--atom-standard) var(--molecule-small);
  padding: var(--molecule-tiny) var(--ed-pad);
  background: var(--ed-ground);
  border-radius: var(--global-radius-md);
}

/* Stacked until there is room for the split. 34rem is measured against the
   STAGE, which is wider than the column this bar actually sits in once the
   body splits — but the split only happens at 60rem, where the main column
   is still ~37rem, so the same threshold holds on both sides of it. */
@container stage (min-width: 34rem) {
  .mvs-event-detail__meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  }
  .mvs-event-detail__meta-tags {
    justify-content: flex-end;
    text-align: right;
	max-width: 150px;
  }
}

.mvs-event-detail__meta-when,
.mvs-event-detail__meta-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--atom-small) var(--molecule-tiny);
  min-width: 0;
}

.mvs-event-detail__meta-when { flex-direction: column; align-items: flex-start; gap: var(--atom-tiny); }

.mvs-event-detail__dates {
  margin: 0;
  font-size: clamp(1.125rem, 2cqi, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ed-accent);
}

.mvs-event-detail__venue {
  display: flex;
  align-items: center;
  gap: var(--atom-small);
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-color-secondary);
}

.mvs-event-detail__venue i { color: var(--ed-accent); }

.mvs-event-detail__chip {
  display: inline-flex;
  align-items: center;
  padding: var(--atom-tiny) var(--atom-standard);
  border-radius: var(--global-radius-sm);
  background: color-mix(in srgb, var(--ed-accent) 14%, transparent);
  color: var(--ed-accent);
  font-size: var(--font-size-xsm);
  font-weight: 600;
  white-space: nowrap;
}

.mvs-event-detail__type {
  font-size: var(--font-size-xsm);
  color: var(--text-color-secondary);
  white-space: nowrap;
}


/* ── Body copy ────────────────────────────────────────────── */

/* In the split the column IS the measure — around 50rem beside the panel —
   so the atom's own 68ch would clamp it a second time and leave a ragged gap
   on the right. */
.mvs-event-detail__copy { --mvs-richtext-measure: none; }

/* ...but with no panel beside it the copy has the whole content width, and
   dropping the measure there gives ~190 characters a line. The panel was
   doing the work; without it the atom's default has to come back. */
.mvs-event-detail--no-panel .mvs-event-detail__copy {
  --mvs-richtext-measure: 68ch;
}


/* ═══ REGISTRATION PANEL ════════════════════════════════════
   Sticky, offset by the header so it doesn't slide under it. Long copy
   scrolls past a panel that stays put — which is the point of putting
   the price and the CTA in it. */

.mvs-event-detail__panel {
  position: sticky;
  top: calc(var(--mvs-sticky-top, 0px) + var(--molecule-tiny));
  border-radius: var(--global-radius-md);
  background: var(--ed-panel);
  color: var(--ed-panel-text);
  overflow: clip;
}

/* Sticky positioning needs a flow root it can measure; the inner element
   also keeps the padding off the sticky box itself. */
.mvs-event-detail__panel-inner {
  display: flex;
  flex-direction: column;
  gap: var(--molecule-tiny);
  padding: var(--ed-pad);
}

.mvs-event-detail__panel-label {
  margin: 0;
  font-size: var(--pre-title-size);
  font-weight: var(--pre-title-weight);
  line-height: var(--pre-title-line-height);
  letter-spacing: var(--pre-title-tracking);
  text-transform: var(--pre-title-transform);
  color: var(--ed-panel-mute);
}


/* ── Prices ───────────────────────────────────────────────── */

.mvs-event-detail__prices {
  display: flex;
  flex-direction: column;
  gap: var(--atom-small);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mvs-event-detail__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--atom-small);
  margin: 0;
  color: var(--ed-panel-mute);
  font-size: var(--font-size-sm);
}

/* ── Selectable tickets ───────────────────────────────────
   A <button> has to be stripped back to the price row it looks like: the
   panel's type, full width, no chrome. Everything the button brings that we
   do want — focus ring, disabled semantics, the pointer — is kept. */

.mvs-event-detail__price--ticket {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--global-radius-sm);
  padding: var(--atom-small) var(--atom-standard);
  cursor: pointer;
  transition: background var(--global-trans), border-color var(--global-trans),
              opacity var(--global-trans);
}

.mvs-event-detail__price--ticket:hover:not(:disabled) {
  border-color: var(--ed-panel-rule);
}

/* Keyboard focus only — a mouse click already shows itself by selecting. */
.mvs-event-detail__price--ticket:focus-visible {
  outline: 2px solid var(--ed-panel-text);
  outline-offset: 2px;
}

/* Restricted to an audience this visitor isn't in. Faded AND `disabled`, so
   it reads as unavailable and genuinely cannot be focused or clicked —
   opacity alone would leave a working control that merely looks inert. */
.mvs-event-detail__price--ticket:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* The headline price — raised out of the panel on its own well so the
   hierarchy holds even when every line is the same length, which a column of
   currency amounts usually is. Worn by the SELECTED ticket, and in the editor
   fallback by the first row. Nothing wears it until something is picked,
   which is what makes the selection legible at a glance.
   `border-color` is restated so a selected row that is also hovered does not
   keep the hover outline. */
.mvs-event-detail__price--lead,
.mvs-event-detail__price--ticket.is-selected {
  padding: var(--molecule-tiny);
  border-radius: var(--global-radius-sm);
  border-color: transparent;
  background: var(--ed-panel-well);
  color: var(--ed-panel-text);
}

.mvs-event-detail__price-amount {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
}

.mvs-event-detail__price--lead .mvs-event-detail__price-amount,
.mvs-event-detail__price--ticket.is-selected .mvs-event-detail__price-amount {
  font-size: clamp(1.75rem, 4cqi, 2.5rem);
  font-weight: 700;
}

/* Takes the space the amount doesn't and aligns to the right edge, so a long
   ticket name shrinks toward the amount instead of wrapping onto its own
   line the moment it outgrows the gap. It still wraps under the SELECTED
   row, where the amount is display-sized and genuinely leaves no room. */
.mvs-event-detail__price-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-size: var(--font-size-sm);
  color: var(--ed-panel-mute);
}

.mvs-event-detail__price-note {
  margin: 0;
  font-size: var(--font-size-xsm);
  color: var(--ed-panel-mute);
}


/* ── CTA ──────────────────────────────────────────────────── */

/* Full width inside the panel: it is the only action here, so there is
   nothing for it to sit beside. `align-self` rather than `width: 100%` —
   the atom already sets border-box, but stretching the flex item does not
   depend on that staying true. Label left, chevron hard right. */
.mvs-event-detail__panel .mvsButton {
  display: flex;
  align-self: stretch;
  justify-content: space-between;
}

/* The CTA before a ticket is chosen. Muted rather than hidden: the visitor
   should see what the next step is while it is still out of reach. It really
   has no href, so this is appearance following state, not the reverse. */
.mvs-event-detail__panel .mvsButton[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* The logged-out state. Deliberately quiet — it is an explanation, not a
   second CTA competing with the one the visitor can't use yet. */
.mvs-event-detail__gate {
  margin: 0;
  padding: var(--molecule-tiny);
  border: 1px dashed var(--ed-panel-rule);
  border-radius: var(--global-radius-sm);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--ed-panel-mute);
}

.mvs-event-detail__gate a {
  color: var(--ed-panel-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.mvs-event-detail__gate a:hover { color: var(--ed-accent); }


/* ── Fact rows ────────────────────────────────────────────── */

.mvs-event-detail__facts {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding-top: var(--atom-small);
  border-top: 1px solid var(--ed-panel-rule);
}

.mvs-event-detail__fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--molecule-tiny);
  padding-block: var(--atom-small);
  font-size: var(--font-size-sm);
}

.mvs-event-detail__fact + .mvs-event-detail__fact {
  border-top: 1px solid var(--ed-panel-rule);
}

.mvs-event-detail__fact dt {
  margin: 0;
  font-weight: 400;
  color: var(--ed-panel-mute);
}

.mvs-event-detail__fact dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  color: var(--ed-panel-text);
}


/* ── Fallback for no container-query support ──────────────── */
/* Safari < 16 / Firefox < 110. The split simply never engages and the
   panel stacks under the copy, which is the mobile layout — degraded,
   not broken. `container-type` gates it so newer browsers ignore this. */
@supports not (container-type: inline-size) {
  @media (min-width: 60rem) {
    .mvs-event-detail__body {
      grid-template-columns: minmax(0, 1fr) minmax(20rem, 22rem);
    }
    .mvs-event-detail--no-panel .mvs-event-detail__body {
      grid-template-columns: minmax(0, 1fr);
    }
  }
}
