/**
 * Community Events & Bookings – individual event pages.
 *
 * Layout only; text, fonts and buttons follow the active theme.
 * Colours for errors and success use CSS variables, so a theme can
 * change them, e.g.  .ceb-booking { --ceb-error: #a00; }
 * The defaults meet WCAG AA contrast on light backgrounds, and messages
 * never rely on colour alone (they include words and borders).
 */

.ceb-event-details,
.ceb-booking {
	--ceb-error: #b3261e;
	--ceb-success: #1b5e20;
	--ceb-info: #0b4f8a;
	--ceb-border: rgba(127, 127, 127, 0.45);
	margin: 2em 0;
}

.ceb-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Event details */
.ceb-event-details__list {
	display: grid;
	grid-template-columns: minmax(8em, max-content) 1fr;
	gap: 0.5em 1.5em;
	margin: 0;
}

.ceb-event-details__list dt {
	font-weight: 700;
}

.ceb-event-details__list dd {
	margin: 0;
}

.ceb-event-details__sessions {
	margin: 0;
	padding-left: 1.4em;
}

.ceb-event-details__sessions .is-past {
	opacity: 0.7;
}

@media (max-width: 600px) {
	.ceb-event-details__list {
		grid-template-columns: 1fr;
		gap: 0.15em;
	}

	.ceb-event-details__list dd {
		margin-bottom: 0.75em;
	}
}

/* Booking section */
.ceb-booking__privacy {
	padding: 0.75em 1em;
	border-left: 4px solid var(--ceb-border);
}

.ceb-booking__required-note,
.ceb-field__hint,
.ceb-optional {
	font-size: 0.9em;
	font-weight: 400;
}

.ceb-required {
	font-weight: 700;
	color: var(--ceb-error);
}

.ceb-booking-form {
	max-width: 40em;
}

.ceb-booking .ceb-field {
	margin: 0 0 1.25em;
	border: 0;
	padding: 0;
	min-width: 0;
}

.ceb-booking .ceb-field > label,
.ceb-booking .ceb-field > legend {
	display: block;
	margin-bottom: 0.35em;
	font-weight: 700;
	padding: 0;
}

.ceb-booking input[type="text"],
.ceb-booking input[type="email"],
.ceb-booking input[type="tel"],
.ceb-booking select,
.ceb-booking textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	font: inherit;
}

.ceb-booking select {
	width: auto;
	min-width: 6em;
}

.ceb-booking .ceb-radio {
	display: flex;
	align-items: center;
	gap: 0.5em;
	min-height: 44px;
	font-weight: 400;
}

.ceb-booking__family-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1em 2em;
}

.ceb-booking__family-row .ceb-field {
	margin-bottom: 0.5em;
}

.ceb-booking__total {
	font-weight: 700;
	margin: 0.5em 0;
}

.ceb-booking__warning {
	margin: 0.5em 0;
	padding-left: 0.75em;
	border-left: 4px solid var(--ceb-error);
	font-weight: 600;
}

/* Empty until there is something to say (kept in the page for screen readers). */
.ceb-booking__warning:empty {
	margin: 0;
	padding: 0;
	border: 0;
}

.ceb-field__hint {
	margin: 0 0 0.35em;
}

.ceb-booking__intro {
	font-size: 1.05em;
}

.ceb-booking__submit {
	min-height: 44px;
	cursor: pointer;
}

.ceb-booking__submit[aria-disabled="true"] {
	opacity: 0.7;
	cursor: progress;
}

/* Errors: shown with a border, the word "Error" and text – not colour alone. */
.ceb-booking [aria-invalid="true"] {
	border: 2px solid var(--ceb-error);
}

.ceb-field__error {
	margin: 0.35em 0 0;
	color: var(--ceb-error);
	font-weight: 600;
}

.ceb-error-summary,
.ceb-notice {
	margin: 0 0 1.5em;
	padding: 1em 1.25em;
	border: 3px solid var(--ceb-border);
}

.ceb-error-summary {
	border-color: var(--ceb-error);
}

.ceb-error-summary h3 {
	margin-top: 0;
}

.ceb-error-summary a {
	color: var(--ceb-error);
	font-weight: 600;
}

.ceb-notice--success {
	border-color: var(--ceb-success);
}

.ceb-notice--error {
	border-color: var(--ceb-error);
}

.ceb-notice--info {
	border-color: var(--ceb-info);
}

.ceb-notice h2 {
	margin-top: 0;
}

.ceb-booking__status {
	padding: 0.75em 1em;
	border: 2px dashed var(--ceb-border);
	font-weight: 600;
}

.ceb-booking__status p {
	margin: 0;
}

.ceb-booking__pay {
	display: inline-block;
	padding: 0.65em 1.3em;
	border: 2px solid currentColor;
	font-weight: 700;
	text-decoration: none;
}

/* Focus outlines for keyboard users */
.ceb-booking a:focus-visible,
.ceb-booking button:focus-visible,
.ceb-booking input:focus-visible,
.ceb-booking select:focus-visible,
.ceb-booking textarea:focus-visible,
.ceb-booking [tabindex="-1"]:focus {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

/* Honeypot: hidden from people, visible to bots. */
.ceb-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
