/**
 * Booking scheduler.
 *
 * Consumes the branding custom properties Straelos_Storefront_Renderer defines,
 * with fallbacks, so a scheduler matches the storefront without this file
 * knowing anything about the creator's palette. --straelos-on-accent is derived
 * by WCAG luminance in branding_style() and is never hardcoded.
 */

.straelos-booking {
	margin: 2em auto;

	/*
	 * FOUND MISSING WHILE MEASURING scheme="dark" ON A DIFFERENT SURFACE
	 * (community.css) AND CHECKED HERE TOO: the base class never set its own
	 * `color`, so a plain, unclassed paragraph fell through to the THEME's
	 * default text colour rather than `--straelos-text`. Every specific
	 * element below already reads the right token; this is the one the outer
	 * wrapper itself was missing.
	 */
	color: var( --straelos-text, #111827 );

	/*
	 * `var(--straelos-measure,800px)`: an explicit `width=` attribute (which
	 * only ever sets --straelos-measure, never writes max-width directly - see
	 * Straelos_Storefront_Layout::width_class()) overrides this default; with
	 * no attribute the custom property is unset and the fallback applies,
	 * unchanged from before this existed.
	 */
	max-width: var( --straelos-measure, 800px );
}

.straelos-booking__daypicker {
	margin: 0 0 1em;
}

.straelos-booking__label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5em;
}

.straelos-booking__daychips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

/*
 * A REAL LINK, STYLED AS A CHIP - `<a>`, not `<button>`, because picking a
 * day is a navigation to `?straelos_date=` (see the PHP), not an in-page
 * state change. `min-height: 44px` matches every other primary control in
 * this file.
 */
.straelos-booking__daychip,
.straelos-booking__daypage {
	align-items: center;
	border: 1px solid var( --straelos-border, rgba( 0, 0, 0, 0.08 ) );
	border-radius: 10px;
	color: inherit;
	display: inline-flex;
	font: inherit;
	justify-content: center;
	min-height: 44px;
	padding: 0.5em 0.9em;
	text-decoration: none;
}

.straelos-booking__daychip:hover,
.straelos-booking__daychip:focus-visible,
.straelos-booking__daypage:hover,
.straelos-booking__daypage:focus-visible {
	border-color: var( --straelos-accent, #2271b1 );
}

/* Same "a ring as well as the fill" rule as the time buttons below - a
   border-colour change alone is not a strong enough keyboard-focus signal. */
.straelos-booking__daychip:focus-visible,
.straelos-booking__daypage:focus-visible {
	outline: 3px solid var( --straelos-text, #111827 );
	outline-offset: 2px;
}

/* The day being viewed, filled - the same accent-fill-for-"this one" language
   the time buttons below already use for their own selected state. */
.straelos-booking__daychip[aria-current="true"] {
	background: var( --straelos-accent, #2271b1 );
	border-color: var( --straelos-accent, #2271b1 );
	color: var( --straelos-on-accent, #fff );
	font-weight: 600;
}

/*
 * A DAY WITH NO TIMES: THE SAME DASHED, MUTED LANGUAGE AS A FULL TIME BELOW,
 * never opacity (removed from every front-end sheet as a state mechanism: a
 * fade composites against whatever is behind it and cannot be held to a
 * contrast ratio). It is a <span>, not a link, so the hover and focus rings
 * above are put back to rest rather than relied on never to fire.
 */
.straelos-booking__daychip--none {
	border-style: dashed;
	color: var( --straelos-muted, #6b7280 );
	cursor: default;
}

.straelos-booking__daychip--none:hover {
	border-color: var( --straelos-border, rgba( 0, 0, 0, 0.08 ) );
}

/* The day being viewed, when it has nothing: an accent edge, never the fill
   (a filled chip reads as "pick this"). Full-contrast text, weight as the
   selected chip's. */
.straelos-booking__daychip--none[aria-current="true"] {
	background: transparent;
	border-color: var( --straelos-accent, #2271b1 );
	color: var( --straelos-text, #111827 );
	font-weight: 600;
}

.straelos-booking__daypage {
	color: var( --straelos-muted, #6b7280 );
	font-weight: 600;
}

/*
 * A BORDERED CARD, NOT A BARE MUTED SENTENCE - full contrast on the headline
 * (the region and abbreviation a visitor needs to actually trust the times
 * below), muted only on the explanation beneath it. No "Change zone"
 * control: nothing in this plugin resolves what one would do, and a link
 * with nothing behind it is worse than not offering it.
 */
.straelos-booking__zone {
	background: var( --straelos-surface, #fff );
	border: 1px solid var( --straelos-border, rgba( 0, 0, 0, 0.08 ) );
	border-radius: 10px;
	margin: 0 0 1.25em;
	padding: 0.85em 1em;
}

.straelos-booking__zone-headline {
	color: var( --straelos-text, #111827 );
	font-weight: 700;
	margin: 0 0 0.2em;
}

.straelos-booking__zone-explain {
	color: var( --straelos-muted, #6b7280 );
	font-size: 0.875rem;
	margin: 0;
}

.straelos-booking__times {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 11em, 1fr ) );
	gap: 10px;
}

.straelos-booking__times li {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
}

/*
 * 44px DECLARED, NOT INHERITED FROM THE THEME. MEASURED on this install: the time
 * button rendered 48px and the day-picker button 43px, both with `min-height:
 * auto` - so every one of those numbers is the creator's own line-height plus
 * padding, and one was already under WCAG 2.5.5 before anybody changed anything.
 *
 * The finding is not "these are too small"; it is that whether they are 44px was
 * the theme's decision. These are the primary controls of a booking flow, tapped
 * on a phone, so the height is declared here and stops moving.
 */
/*
 * NEUTRAL AT REST, ACCENT ONLY ON HOVER/SELECTED. Every unselected time used to
 * carry an accent-coloured border, which on a grid of a dozen times reads as a
 * dozen calls to action rather than a dozen equally-weighted choices - the same
 * "the accent is the one thing that's a call to action" reasoning the storefront
 * price colour change makes.
 *
 * var( --straelos-border ), NOT A FRESH LITERAL - a literal alpha here would be
 * exactly the bug border_on() was derived to fix: invisible the moment a
 * creator sets a dark surface. The token already carries the right hairline
 * weight for whatever surface is in play.
 */
.straelos-booking__time {
	/*
	 * COLUMN, LEFT-ALIGNED - a slot on a fall-back day carries a second
	 * disambiguation line (.straelos-booking__time-dst, see the PHP), and a
	 * centered two-line label reads badly where a centered one-line label
	 * does not. Applied to every slot, not only the ambiguous ones, so a grid
	 * mixing both kinds stays visually consistent.
	 */
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	justify-content: center;
	min-height: 44px;
	padding: 0.7em 0.5em;
	text-align: start;
	width: 100%;
	border: 1px solid var( --straelos-border, rgba( 0, 0, 0, 0.08 ) );
	border-radius: 5px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.straelos-booking__time-label {
	display: block;
}

/*
 * WEIGHT AND SIZE CARRY THE DE-EMPHASIS, NOT `--straelos-muted` - this text
 * sits on the accent fill once a slot is hovered or selected, and there is
 * no "muted on accent" token (storefront.css's own note on
 * .straelos-block--button's price explains why one should not exist).
 */
.straelos-booking__time-dst {
	display: block;
	font-size: 0.75rem;
	font-weight: 400;
}

.straelos-booking__time:hover,
.straelos-booking__time:focus-visible {
	background: var( --straelos-accent, #2271b1 );
	color: var( --straelos-on-accent, #fff );
}

/*
 * A RING AS WELL AS THE FILL. Grouping `:focus-visible` with `:hover` gave a
 * keyboard user the same accent fill a mouse user gets on hover and no outline
 * at all - so on a grid of times, "which one am I on" and "which one is under
 * the pointer" looked identical. The ring is what distinguishes them.
 */
.straelos-booking__time:focus-visible,
.straelos-booking__confirm:focus-visible {
	outline: 3px solid var( --straelos-text, #111827 );
	outline-offset: 2px;
}

/*
 * The selected state is a border weight AND a background, never colour alone -
 * colour is not an accessible signal on its own, and aria-pressed carries the
 * state for anyone not looking at it.
 */
.straelos-booking__time[aria-pressed="true"] {
	background: var( --straelos-accent, #2271b1 );
	color: var( --straelos-on-accent, #fff );
	box-shadow: 0 0 0 2px var( --straelos-accent, #2271b1 );
}

/* A comfortable count stays de-emphasised; a low one (--low, <=2 places) is
   worth the visitor's attention, so it goes full-contrast rather than muted -
   two rules rather than one, so "plenty of room" and "act now" don't read the
   same weight. */
.straelos-booking__seats {
	color: var( --straelos-muted, #6b7280 );
	font-size: 0.8em;
	text-align: center;
}

.straelos-booking__seats--low {
	color: var( --straelos-text, #111827 );
	font-weight: 600;
}

.straelos-booking__seats--full {
	color: var( --straelos-muted, #6b7280 );
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/*
 * FULL: THE SAME DASHED/MUTED/TRANSPARENT LANGUAGE EVERY OTHER DISABLED
 * CONTROL IN THIS PLUGIN USES (.straelos-buy__button[disabled],
 * .straelos-video-widget__button[disabled], .straelos-quiz__submit[disabled]),
 * not a fourth invention. aria-disabled rather than the disabled attribute
 * keeps the button focusable - see the PHP for why - so :hover/:focus-visible
 * are suppressed here rather than relying on a real disabled state to do it.
 */
.straelos-booking__time--full {
	border-style: dashed;
	color: var( --straelos-muted, #6b7280 );
	cursor: default;
}

.straelos-booking__time--full:hover,
.straelos-booking__time--full:focus-visible {
	background: transparent;
	color: var( --straelos-muted, #6b7280 );
}

.straelos-booking__empty {
	border: 1px dashed var( --straelos-border, rgba( 0, 0, 0, 0.2 ) );
	border-radius: var( --straelos-radius, 5px );
	padding: 1em 1.2em;
	margin: 0;
}

/*
 * `--straelos-border` RATHER THAN A BLACK LITERAL, now that the token is derived
 * from the creator's surface. Black at 12% is invisible on a dark surface - the
 * exact defect the derivation was written to fix - so a rule that bypasses the
 * token puts the bug straight back on the one surface it was fixed for.
 */
.straelos-booking__details {
	border: 1px solid var( --straelos-border, rgba( 0, 0, 0, 0.12 ) );
	border-radius: var( --straelos-radius, 6px );
	margin-top: 1.5em;
	padding: 1.2em;
}

.straelos-booking__details label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25em;
}

/*
 * SCOPED BY TYPE, AND THAT IS A FIX RATHER THAN TIDINESS. The rule was a bare
 * descendant selector - `.straelos-booking__details input` - and the two
 * TCPA/CASL consent controls are `<input type="checkbox">` inside that same
 * container, so both were being given `width: 100%; max-width: 26em`. A 26em
 * checkbox is not a checkbox.
 *
 * CLAUDE.md records that those two boxes being "separate, unchecked and not
 * required" are §9.7 REQUIREMENTS rather than styling, which makes their
 * presentation compliance-adjacent: a consent control a person cannot recognise
 * as one is not obviously consent.
 *
 * BORDER, RADIUS, GROUND, HEIGHT AND box-sizing DECLARED, because they were all
 * coming from the creator's theme. This is where somebody types the email their
 * booking confirmation is sent to.
 */
.straelos-booking__details input[type="text"],
.straelos-booking__details input[type="email"],
.straelos-booking__details input[type="tel"] {
	background: var( --straelos-surface, #fff );
	border: 1px solid var( --straelos-border, rgba( 0, 0, 0, 0.08 ) );
	border-radius: var( --straelos-radius, 6px );
	box-sizing: border-box;
	font: inherit;
	max-width: 26em;
	min-height: 44px;
	padding: 0 0.75em;
	width: 100%;
}

/*
 * A FOCUS RING ON THE FIELDS, WHICH THIS FILE HAD ONLY ON THE TIME BUTTONS.
 * `booking.js` moves focus to the first invalid field on a failed submit - so a
 * person whose email is wrong was being sent somewhere that showed no sign of
 * having received focus, unless their theme happened to supply one.
 */
/*
 * THE TYPE'S OWN QUESTIONS (Straelos_Booking_Questions): the same field, with a
 * list's chevron left to the browser and a several-line answer allowed the
 * panel's width, since it is where somebody explains what they want to work on.
 */
.straelos-booking__details textarea,
.straelos-booking__details select {
	background: var( --straelos-surface, #fff );
	border: 1px solid var( --straelos-border, rgba( 0, 0, 0, 0.08 ) );
	border-radius: var( --straelos-radius, 6px );
	box-sizing: border-box;
	color: inherit;
	font: inherit;
	min-height: 44px;
	width: 100%;
}

.straelos-booking__details select {
	max-width: 26em;
	padding: 0 0.75em;
}

.straelos-booking__details textarea {
	display: block;
	line-height: 1.5;
	min-height: 7em;
	padding: 0.6em 0.75em;
	resize: vertical;
}

.straelos-booking__required {
	color: var( --straelos-muted, #6b7280 );
	font-weight: 400;
}

/*
 * A field a refusal named: its own border, thicker, beside the words below.
 * Element and attribute, so it equals `input[type="text"]` above and wins by
 * coming later - a bare `[aria-invalid]` lost to it on the text fields.
 */
.straelos-booking__details input[aria-invalid="true"],
.straelos-booking__details textarea[aria-invalid="true"],
.straelos-booking__details select[aria-invalid="true"] {
	border: 2px solid var( --straelos-danger, #a32a1a );
}

/*
 * WHY A BOOKING WAS REFUSED, IN WORDS ON THE PAGE. It used to reach only the
 * visually hidden status region, so a sighted visitor saw the button come back
 * and nothing else.
 */
.straelos-booking__error {
	color: var( --straelos-danger, #a32a1a );
	font-weight: 600;
	margin: 0 0 0.75em;
}

.straelos-booking__error[hidden] {
	display: none;
}

.straelos-booking__details input:focus-visible,
.straelos-booking__details textarea:focus-visible,
.straelos-booking__details select:focus-visible,
.straelos-booking__consent input:focus-visible {
	outline: 3px solid var( --straelos-accent, #2d6cdf );
	outline-offset: 2px;
}

/*
 * The consent rows are a label beside a box, never a stretched field. Gap and
 * alignment only - nothing here should make either box look required, because
 * neither is.
 */
.straelos-booking__consent {
	margin: 0 0 0.6em;
}

.straelos-booking__consent label {
	align-items: flex-start;
	display: flex;
	gap: 0.6em;
	line-height: 1.45;
}

.straelos-booking__consent input {
	flex: 0 0 auto;
	margin-top: 0.2em;
}

.straelos-booking__chosen {
	font-weight: 600;
	margin-top: 0;
}

.straelos-booking__confirm {
	align-items: center;
	display: inline-flex;
	justify-content: center;
	min-height: 44px;
	padding: 0.7em 1.4em;
	border: 0;
	border-radius: 5px;
	background: var( --straelos-accent, #2271b1 );
	color: var( --straelos-on-accent, #fff );
	font: inherit;
	cursor: pointer;
}

/*
 * DISABLED IS A DASHED OUTLINE AND MUTED TEXT, matching every other disabled
 * control in the plugin. `opacity` on a filled accent button drags the label
 * toward the ground it sits on, and the four surfaces doing it were using four
 * different values - so "disabled" looked like a different state on each.
 */
.straelos-booking__confirm[disabled] {
	background: transparent;
	border: 1px dashed var( --straelos-border, rgba( 0, 0, 0, 0.08 ) );
	color: var( --straelos-muted, #6b7280 );
	cursor: default;
}

.straelos-booking__done {
	padding: 1.2em;
	border: 1px solid var( --straelos-accent, #2271b1 );
	border-radius: 6px;
}

.straelos-booking__done-title {
	font-weight: 600;
	margin-top: 0;
}

/*
 * THE "CONTINUE TO PAYMENT" PROMPT booking.js draws for a buyer who backed out of
 * Stripe with their slot still held (audit f-268). Accent border like the booked
 * confirmation - it is the same kind of statement, "this is yours" - and a link
 * that clears the 44px target every other control here holds to. Body text keeps
 * the surface's own colour: nothing in it sits on the accent, so there is no
 * on-accent pairing to get wrong.
 */
.straelos-booking__resume {
	background: var( --straelos-surface, #fff );
	border: 1px solid var( --straelos-accent, #2271b1 );
	border-radius: 10px;
	color: var( --straelos-text, #111827 );
	margin: 0 0 1.25em;
	padding: 0.85em 1em;
}

.straelos-booking__resume a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
}

/*
 * SESSION PACKAGES (0.7.55): what the viewer can book with - sessions left, a
 * package to buy, or a sign-in - above the calendar, or in its place for a type
 * only packages sell. The resume prompt's card: the same kind of statement, "this
 * is yours", in the surface's own text colour with nothing on the accent. Its
 * links clear the 44px target every other control here holds to.
 */
.straelos-booking__package {
	background: var( --straelos-surface, #fff );
	border: 1px solid var( --straelos-accent, #2271b1 );
	border-radius: 10px;
	color: var( --straelos-text, #111827 );
	margin: 0 0 1.25em;
	padding: 0.85em 1em;
}

.straelos-booking__package p {
	margin: 0 0 0.4em;
}

.straelos-booking__package p:last-child {
	margin-bottom: 0;
}

.straelos-booking__package-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25em;
}

.straelos-booking__package-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
	color: var( --straelos-accent-text, var( --straelos-accent, #2271b1 ) );
}

.straelos-booking__credits-left {
	font-weight: 600;
}
