/* Events Hub booking form. Styles the plugin's own markup only.
   Platform behaviour lives here; each event's look comes from the brand and the page:
   --heh-accent and --heh-dark are set inline from the brand, type is inherited from the site,
   and any token below can be overridden on the page (e.g. .heh-booking { --heh-radius-panel: 8px; }). */
.heh-booking {
	--heh-accent: #1f1d1a;
	--heh-dark: #1f2a2e;
	--heh-ink: #0f2329;
	--heh-ink-soft: #33484d;
	--heh-line: #d6dedc;
	--heh-control: #7d8f8c; /* control edges: 3.3:1 on white, so a time or day reads as a button */
	--heh-booked: #e9ecea;
	--heh-radius-control: 8px;
	--heh-radius-tile: 12px;
	--heh-radius-panel: 20px;
	/* Titles follow the site's heading face (Breakdance exposes it), body and controls inherit the text face */
	--heh-font-heading: var( --bde-heading-font-family, inherit );
	--heh-panel: #fff;
	--heh-snow: #f3f1ec;
	--heh-focus: var( --heh-dark );
	--heh-labelled: #f7efd9;      /* times with a label (e.g. a SEND-friendly session): soft gold fill */
	--heh-labelled-line: #9c7726; /* and their edge: 3.9:1 on white, so they still read as buttons */
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	color: var( --heh-ink );
	font: inherit;
	text-align: left;
}
.heh-booking--dark { --heh-panel: var( --heh-snow ); }
.heh-booking *, .heh-booking *::before, .heh-booking *::after { box-sizing: border-box; }
.heh-booking fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.heh-booking legend { padding: 0; }
.heh-booking [hidden] { display: none !important; }
.heh-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect( 0 0 0 0 ); white-space: nowrap; border: 0; }

/* Step headings */
.heh-step { display: flex; flex-direction: column; gap: 14px; }
.heh-step__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.heh-step__title { margin: 0; font-family: var( --heh-font-heading ); font-size: 1.375rem; line-height: 1.25; font-weight: 700; color: inherit; outline: none; }
.heh-step--questions .heh-step__title { font-size: clamp( 1.75rem, 1.2rem + 2vw, 2.75rem ); font-weight: 700; line-height: 1.1; flex: 1 1 100%; order: 1; }
.heh-step__count { margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; opacity: .85; }
.heh-step--questions .heh-step__count { order: 0; }
.heh-step__intro { margin: 0; order: 2; font-size: 1.0625rem; line-height: 1.6; max-width: 36em; opacity: .9; }
.heh-back { order: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.heh-booking--dark .heh-step__head, .heh-booking--dark .heh-days { color: var( --heh-snow ); }

/* Days */
.heh-days { display: grid; grid-template-columns: repeat( auto-fit, minmax( 96px, 1fr ) ); gap: 10px; }
.heh-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 44px; padding: 14px 14px 12px; border-radius: var( --heh-radius-tile ); border: 1px solid var( --heh-control ); background: #fff; color: var( --heh-ink ); cursor: pointer; line-height: 1.2; }
.heh-day__dow, .heh-day__mon { font-size: .8125rem; font-weight: 600; }
.heh-day__num { font-family: var( --heh-font-heading ); font-size: 1.875rem; font-weight: 700; line-height: 1.1; font-variant-numeric: lining-nums; }
.heh-day__note { margin-top: 6px; font-size: .75rem; }
.heh-day:hover { border-color: var( --heh-dark ); }
.heh-day:has( input:checked ) { background: var( --heh-dark ); border-color: var( --heh-dark ); color: #fff; }
.heh-day:has( input:disabled ) { opacity: .6; border-style: dashed; cursor: not-allowed; }
.heh-day:has( input:focus-visible ) { outline: 3px solid var( --heh-focus ); outline-offset: 2px; }
.heh-booking--dark .heh-day { background: rgba( 7, 29, 37, .9 ); border-color: rgba( 243, 241, 236, .45 ); color: var( --heh-snow ); }
.heh-booking--dark .heh-day:hover { border-color: var( --heh-snow ); }
.heh-booking--dark .heh-day:has( input:checked ) { background: var( --heh-snow ); border-color: var( --heh-snow ); color: var( --heh-ink ); }
.heh-booking--dark { --heh-focus: var( --heh-snow ); }
.heh-booking--dark .heh-panel, .heh-booking--dark .heh-card { --heh-focus: var( --heh-dark ); }

/* Panel: times and who's coming */
.heh-panel { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var( --heh-radius-panel ); background: var( --heh-panel ); color: var( --heh-ink ); border: 1px solid var( --heh-line ); }
.heh-booking--dark .heh-panel { border-color: transparent; }
.heh-panel__title { margin: 0 0 12px; font-family: var( --heh-font-heading ); font-size: 1.375rem; line-height: 1.25; font-weight: 700; }
/* Fieldsets stay block: Safari treats a floated legend inside a flex fieldset as the border legend. */
.heh-times { display: block; }
.heh-times > * + * { margin-top: 8px; }
.heh-times__group { margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var( --heh-ink-soft ); }
/* Times: every button carries its full time; wide screens put one hour on each row */
.heh-times__grid { display: grid; grid-template-columns: repeat( var( --heh-per-hour, 6 ), minmax( 0, 1fr ) ); gap: 8px; }
.heh-time { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border-radius: var( --heh-radius-control ); border: 1px solid var( --heh-control ); background: #fff; color: var( --heh-ink ); font-weight: 600; font-size: .9375rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.heh-time--labelled { background: var( --heh-labelled ); border-color: var( --heh-labelled-line ); }
.heh-times__group--labelled { display: flex; align-items: center; gap: 8px; color: var( --heh-ink ); }
.heh-times__group--labelled::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var( --heh-labelled-line ); }
.heh-time:hover { border-color: var( --heh-dark ); box-shadow: inset 0 0 0 1px var( --heh-dark ); }
/* Selected: filled, with a tick, so it never relies on colour alone */
.heh-time:has( input:checked ) { background: var( --heh-dark ); border-color: var( --heh-dark ); color: #fff; box-shadow: none; }
.heh-time:has( input:checked )::before { content: "\2713"; font-weight: 800; }
/* Booked: flat, struck through and dashed, so it reads as not a button */
.heh-time:has( input:disabled ) { background: var( --heh-booked ); border: 1px dashed #b3bebc; color: #5d6c6f; text-decoration: line-through; cursor: not-allowed; box-shadow: none; }
.heh-time:has( input:focus-visible ) { outline: 3px solid var( --heh-focus ); outline-offset: 2px; }
.heh-times__key { margin: 0; font-size: .875rem; color: var( --heh-ink-soft ); }
.heh-qty__note { flex: 1 1 100%; margin: 0; font-size: .875rem; font-weight: 600; color: var( --heh-ink-soft ); }
/* A step that still needs something: a clear edge around it, plus the message in the bar */
.heh-times > legend { float: left; width: 100%; margin-bottom: 20px; text-wrap: balance; }
.heh-times > legend + * { clear: both; margin-top: 0; }
.heh-times > .heh-times__grid + .heh-times__group { margin-top: 16px; }
.heh-times.heh-needs { padding: 10px; margin: -10px; }
.heh-needs { scroll-margin-top: 24px; }
.heh-needs { border-radius: var( --heh-radius-tile ); box-shadow: 0 0 0 2px var( --heh-panel ), 0 0 0 4px var( --heh-accent ); }
.heh-who { display: block; margin-top: 10px !important; padding-top: 22px !important; border-top: 1px solid var( --heh-line ) !important; }
.heh-who .heh-panel__title { float: left; width: 100%; margin: 0 0 18px; }
.heh-who > * + * { margin-top: 14px; }
.heh-who > legend + * { clear: both; margin-top: 0; }
.heh-who .heh-panel__title + * { clear: both; }
.heh-qty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.heh-qty label { display: flex; flex-direction: column; gap: 2px; font-size: 1.0625rem; }
.heh-qty label span { font-size: .875rem; color: var( --heh-ink-soft ); }
.heh-qty__ctl { display: flex; align-items: center; gap: 12px; }
.heh-qty__btn { width: 48px; height: 48px; border-radius: 999px; border: 1px solid var( --heh-control ); background: #fff; color: var( --heh-ink ); font: inherit; font-size: 1.5rem; font-weight: 600; line-height: 1; cursor: pointer; }
.heh-qty__btn:disabled { opacity: .4; cursor: not-allowed; }
.heh-qty input { width: 5rem; min-height: 48px; padding: 0 10px; border: 1px solid var( --heh-control ); border-radius: 8px; font: inherit; font-size: 1.125rem; text-align: center; background: #fff; color: var( --heh-ink ); }
.heh-booking--js .heh-qty input { width: 2.5ch; padding: 0; border: 0; background: transparent; font-size: 1.5rem; font-weight: 800; -moz-appearance: textfield; appearance: textfield; }
.heh-booking--js .heh-qty input::-webkit-inner-spin-button, .heh-booking--js .heh-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Questions */
.heh-cards { display: grid; grid-template-columns: repeat( auto-fit, minmax( min( 340px, 100% ), 1fr ) ); gap: 20px; align-items: start; }
.heh-card { display: block; padding: 24px !important; border: 1px solid var( --heh-line ) !important; border-radius: 20px; background: #fff; color: var( --heh-ink ); }
.heh-card__title { float: left; width: 100%; margin: 0 0 16px; font-family: var( --heh-font-heading ); font-size: 1.375rem; font-weight: 700; }
.heh-card > * + * { margin-top: 16px; }
.heh-card__title + * { clear: both; margin-top: 0 !important; }
.heh-field { display: flex; flex-direction: column; gap: 6px; }
.heh-field__label { font-size: .9375rem; font-weight: 600; line-height: 1.4; }
.heh-field__opt { font-weight: 500; color: var( --heh-ink-soft ); }
.heh-field__hint { font-size: .8125rem; line-height: 1.4; color: var( --heh-ink-soft ); }
.heh-field input, .heh-field select, .heh-field textarea { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var( --heh-control ); border-radius: 8px; background: #fff; color: var( --heh-ink ); font: inherit; font-size: 1rem; }
.heh-field textarea { padding: 10px 12px; min-height: 88px; resize: vertical; }
.heh-field input[type="number"] { max-width: 7rem; }
.heh-field input:focus-visible, .heh-field select:focus-visible, .heh-field textarea:focus-visible { outline: 3px solid var( --heh-dark ); outline-offset: 1px; }
.heh-field :user-invalid, .heh-field [aria-invalid="true"] { border-color: var( --heh-accent ); border-width: 2px; }
.heh-field__error { font-size: .875rem; font-weight: 600; line-height: 1.4; color: var( --heh-accent ); }
.heh-terms { margin: 0; font-size: .9375rem; }
.heh-terms a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.heh-booking--dark .heh-terms { color: var( --heh-snow ); }
.heh-field--check { flex-direction: row; flex-wrap: wrap; align-items: center; }
.heh-field--check input { width: 22px; min-height: 22px; height: 22px; }

/* Summary and actions */
.heh-summary { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 20px; padding: 14px 20px; border-radius: 16px; background: var( --heh-dark ); color: #fff; box-shadow: 0 -8px 24px rgba( 0, 0, 0, .18 ); }
.heh-summary__text { margin: 0 auto 0 0; font-size: .9375rem; line-height: 1.4; }
.heh-summary__text strong { display: block; font-size: 1.0625rem; }
.heh-summary__total { margin: 0; font-size: 1.5rem; font-weight: 800; }
.heh-booking__hint { flex: 1 1 100%; order: -1; margin: 0; padding: 10px 14px; border-radius: 8px; background: #fdecea; color: #7a1d12; font-weight: 600; font-size: .9375rem; }
.heh-booking__next, .heh-booking__submit { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px; background: var( --heh-accent ); color: #fff; font: inherit; font-size: 1.0625rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.heh-booking__next:hover, .heh-booking__submit:hover { filter: brightness( .88 ); }
.heh-booking__next:focus-visible, .heh-booking__submit:focus-visible, .heh-qty__btn:focus-visible, .heh-back:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var( --heh-dark ); }
.heh-booking__submit[disabled] { opacity: .75; cursor: progress; }
.heh-booking__error { margin: 0; padding: 12px 16px; border-radius: 10px; background: #fdecea; color: #7a1d12; font-weight: 600; }
.heh-booking--closed { padding: 20px 24px; border-radius: 16px; background: var( --heh-panel ); }
.heh-booking--closed p { margin: 0; font-weight: 600; }

@media ( max-width: 700px ) {
	/* Phone: about three and a half days in view, so a cut card and the edge fade show there are more */
	.heh-days { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 6px; scroll-padding-left: 16px; -webkit-mask-image: linear-gradient( 90deg, #000 calc( 100% - 40px ), transparent ); mask-image: linear-gradient( 90deg, #000 calc( 100% - 40px ), transparent ); }
	.heh-days:has( .heh-day:nth-child( 4 ):last-child ), .heh-days:has( .heh-day:nth-child( 3 ):last-child ) { -webkit-mask-image: none; mask-image: none; }
	.heh-day { flex: 0 0 calc( ( 100% - 30px ) / 3.5 ); scroll-snap-align: start; padding: 12px; }
	.heh-day__num { font-size: 1.625rem; }
	.heh-panel { padding: 20px 16px; border-radius: 16px; }
	.heh-panel__title, .heh-step__title { font-size: 1.1875rem; }
	/* Phone: three full times across, so each hour of six fills two rows */
	.heh-times__grid { grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); gap: 8px; }
	.heh-time { min-height: 48px; font-size: 1rem; }
	.heh-card { padding: 18px !important; border-radius: 16px; }
	.heh-summary { margin: 0 -16px; border-radius: 0; padding: 12px 16px; flex-wrap: nowrap; gap: 12px; }
	.heh-summary__text { min-width: 0; font-size: .875rem; }
	.heh-summary__total { font-size: 1.125rem; }
	.heh-wide { display: none; }
	.heh-booking__hint { position: absolute; left: 16px; right: 16px; bottom: 100%; margin-bottom: 8px; }
	.heh-booking__next, .heh-booking__submit { min-height: 48px; padding: 0 22px; font-size: 1rem; }
}
.heh-events { display: grid; gap: 1.5rem; }
/* A one pixel press on tap or click, so every control answers the hand; instant, so nothing to reduce. */
.heh-booking__next:active, .heh-booking__submit:active, .heh-qty__btn:active:not(:disabled), .heh-back:active, .heh-time:active:not(:has(input:disabled)), .heh-day:active:not(:has(input:disabled)) { transform: translateY( 1px ); }

/* One date and one time: nothing to choose, so the day rail and time grid stay in the form (they still submit) but out of sight. */
.heh-booking--single .heh-days, .heh-booking--single .heh-times { display: none !important; }
.heh-booking--single .heh-when { margin: 0; }
.heh-booking--single .heh-who { margin-top: 4px !important; }

/* Single event page (templates/event.php). Layout only: type is the site's, colour the brand's.
   Phone first; the rail, gutters and column split can be overridden on the page. */
.heh-event {
	/* The site's own section rail when it has one (Breakdance exposes it), so the page lines up with the header. */
	--heh-rail: var( --bde-section-width, 1180px );
	--heh-gutter: var( --bde-section-horizontal-padding, 16px );
	--heh-accent: #1f1d1a;
	--heh-dark: #1f2a2e;
	--heh-ink-soft: #4a5a5e;
	--heh-line: #d6dedc;
	--heh-radius-image: 20px;
	padding: 28px 0 72px;
	color: inherit;
}
.heh-event *, .heh-event *::before, .heh-event *::after { box-sizing: border-box; }
.heh-event__rail { max-width: var( --heh-rail ); margin-inline: auto; padding-inline: var( --heh-gutter ); }

/* Intro: the poster, then what it is, when, where and how much */
.heh-event__intro { display: grid; gap: 24px; align-items: center; }
.heh-event__media { margin: 0; }
.heh-event__media img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: var( --heh-radius-image ); background: var( --heh-dark ); }
.heh-event__head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-width: 0; }
.heh-event__eyebrow { margin: 0; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var( --heh-accent ); }
.heh-event__title { margin: 0; font-family: var( --bde-heading-font-family, inherit ); font-size: clamp( 2rem, 1.4rem + 2.6vw, 3.25rem ); line-height: 1.08; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; color: inherit; }
.heh-event__summary { margin: 0; font-size: 1.125rem; line-height: 1.55; max-width: 34em; color: var( --heh-ink-soft ); }
.heh-event__facts { display: grid; grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); gap: 0 20px; width: 100%; margin: 4px 0 0; padding: 0; border-top: 1px solid var( --heh-line ); }
.heh-event__facts > div { padding: 12px 0; border-bottom: 1px solid var( --heh-line ); min-width: 0; }
.heh-event__facts dt { margin: 0 0 2px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var( --heh-ink-soft ); }
.heh-event__facts dd { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.heh-event__cta { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 4px; padding: 0 30px; border-radius: 999px; background: var( --heh-accent ); color: #fff !important; font-size: 1.0625rem; font-weight: 700; text-decoration: none !important; }
.heh-event__cta:hover { filter: brightness( .88 ); }
.heh-event__cta:focus-visible { outline: 3px solid var( --heh-dark ); outline-offset: 3px; }
.heh-event__cta:active { transform: translateY( 1px ); }

/* Body: the details at a reading measure, the form beside them on wide screens */
.heh-event__body { display: grid; gap: 40px; margin-top: 48px; padding-top: 40px; border-top: 1px solid var( --heh-line ); align-items: start; }
.heh-event__label { margin: 0 0 16px; font-family: var( --bde-heading-font-family, inherit ); font-size: 1.5rem; line-height: 1.25; font-weight: 700; color: inherit; }
.heh-event__content { max-width: 40em; font-size: 1.0625rem; line-height: 1.7; }
.heh-event__content > * { margin: 0 0 1em; }
.heh-event__content > :last-child { margin-bottom: 0; }
.heh-event__content h2:not( .heh-event__label ), .heh-event__content h3 { margin: 1.6em 0 .5em; font-family: var( --bde-heading-font-family, inherit ); font-size: 1.25rem; line-height: 1.3; }
.heh-event__content ul { padding-left: 1.25em; }
.heh-event__content li { margin-bottom: .4em; }
.heh-event__content li::marker { color: var( --heh-accent ); }
.heh-event__content a { color: var( --heh-accent ); text-underline-offset: 2px; }
.heh-event__book { scroll-margin-top: 24px; min-width: 0; }
.heh-event--brief .heh-event__book { max-width: 640px; }

@media ( min-width: 600px ) {
	.heh-event { padding: 40px 0 88px; }
}
/* The poster and its facts sit side by side once both have room: the poster at its natural shape, the facts beside it. */
@media ( min-width: 900px ) {
	.heh-event { padding: 56px 0 104px; }
	.heh-event__intro { grid-template-columns: minmax( 0, 7fr ) minmax( 0, 5fr ); gap: 48px; }
	.heh-event__intro--text { grid-template-columns: minmax( 0, 1fr ); max-width: 760px; }
	.heh-event__body { grid-template-columns: minmax( 0, 1fr ) minmax( 360px, 440px ); gap: 64px; margin-top: 64px; padding-top: 56px; }
	.heh-event--brief .heh-event__body { grid-template-columns: minmax( 0, 1fr ); }
}
@media ( max-width: 700px ) {
	/* The form's phone rules pull the summary bar to the screen edge; inside the page rail that edge is the gutter. */
	.heh-event .heh-summary { margin: 0 calc( -1 * var( --heh-gutter ) ); }
}
