/**
 * Booking form styles.
 *
 * Scoped under .smc-booking and driven by custom properties, so a theme can
 * restyle the form by overriding the variables rather than fighting selectors.
 */

.smc-booking {
	--smc-accent: #1f6feb;
	--smc-accent-text: #ffffff;
	--smc-border: #d8dee9;
	--smc-muted: #6b7280;
	--smc-surface: #ffffff;
	--smc-surface-soft: #f1f3f7;
	--smc-bg: #f7f8fa;
	--smc-radius: 8px;
	--smc-gap: 16px;
	--smc-error: #b42318;
	--smc-success: #067647;

	box-sizing: border-box;
	max-width: 46rem;
	color: inherit;
}

.smc-booking *,
.smc-booking *::before,
.smc-booking *::after {
	box-sizing: inherit;
}

.smc-title {
	margin: 0 0 0.25em;
	font-size: 1.5rem;
	line-height: 1.25;
}

.smc-description {
	margin: 0 0 0.75em;
}

.smc-meta {
	margin: 0 0 1.5em;
	color: var(--smc-muted);
	font-size: 0.875rem;
}

/* The single mention of the office timezone, kept at the foot of the form. */
.smc-footnote {
	margin: 1.5em 0 0 !important;
	padding-top: 0.9em;
	border-top: 1px solid var(--smc-border);
	color: var(--smc-muted);
	font-size: 0.8125rem;
}

.smc-step {
	margin-bottom: 1.75em;
}

/* Row 1: Calendar + Times side by side */
.smc-steps__main {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}

@media ( min-width: 48rem ) {
	.smc-steps__main {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
}

.smc-step--calendar {
	min-width: 0;
}

.smc-step--times {
	min-width: 0;
}

.smc-step--times .smc-slots {
	min-height: 200px;
}

/* Row 2: Contact details full width below */
.smc-step--details {
	margin-top: var(--smc-gap);
}

/* Calendar full height in side-by-side */
@media ( min-width: 48rem ) {
	.smc-step--calendar {
		height: fit-content;
	}
	.smc-step--times {
		display: flex;
		flex-direction: column;
	}
	.smc-step--times .smc-slots {
		flex: 1;
	}
	.smc-step--details {
		grid-column: 2 / -1;
	}
}

.smc-step__head {
	display: flex;
	align-items: center;
	gap: 0.6em;
	margin-bottom: 0.75em !important;
	padding-bottom: 0.75em !important;
}

.smc-step__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75em;
	height: 1.75em;
	border-radius: 50%;
	background: var(--smc-accent);
	color: var(--smc-accent-text);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1;
}

.smc-step__label {
	font-weight: 600;
}

.smc-date {
	max-width: 16em;
	padding: 0.5em 0.75em;
	border: 1px solid var(--smc-border);
	border-radius: var(--smc-radius);
	background: var(--smc-surface);
	color: inherit;
	font: inherit;
}

.smc-slots {
	min-height: 3em;
}

.smc-slots__loading,
.smc-slots__empty {
	margin: 0;
	color: var(--smc-muted);
	font-size: 0.9375rem;
}

.smc-slots__note {.smc-gmt-footnote {
	margin: 0.5em 0 0;
	padding: 0.4em 0.9em;
	background: var(--smc-surface-soft);
	color: var(--smc-muted);
	font-size: 0.75rem;
	border-top: 1px solid var(--smc-border);
}
	margin: 1em 0 0;
	color: var(--smc-muted);
	font-size: 0.8125rem;
}

.smc-day + .smc-day {
	margin-top: 1.25em;
}

.smc-day__title {
	margin: 0 0 0.5em;
	font-size: 1.25rem !important;
	font-weight: 600;
}

.smc-day__slots {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 7em, 1fr ) );
	gap: 0.5em;
}

.smc-slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.1em;
	padding: 0.6em 0.5em;
	border: 1px solid var(--smc-border);
	border-radius: var(--smc-radius);
	background: var(--smc-surface);
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.smc-slot:hover,
.smc-slot:focus-visible {
	border-color: var(--smc-accent);
	background: var(--smc-bg);
}

.smc-slot.is-selected {
	border-color: var(--smc-accent);
	background: var(--smc-accent);
	color: var(--smc-accent-text);
}

.smc-slot.is-selected .smc-slot__site {
	color: inherit;
	opacity: 0.8;
}

.smc-slot__local {
	font-size: 1rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.smc-slot__site {
	color: var(--smc-muted);
	font-size: 0.6875rem;
}

.smc-fields {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 14em, 1fr ) );
	gap: var(--smc-gap);
}

.smc-field {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	margin: 0;
}

.smc-field--wide {
	grid-column: 1 / -1;
}

.smc-field label {
	font-size: 0.875rem;
	font-weight: 500;
}

.smc-field input,
.smc-field textarea {
	padding: 0.55em 0.7em;
	border: 1px solid var(--smc-border);
	border-radius: var(--smc-radius);
	background: var(--smc-surface);
	color: inherit;
	font: inherit;
}

.smc-field input:focus-visible,
.smc-field textarea:focus-visible {
	outline: 2px solid var(--smc-accent);
	outline-offset: 1px;
}

.smc-field input[aria-invalid="true"] {
	border-color: var(--smc-error);
}

/* Event picker. Reuses the field styling so it looks native to the form. */
.smc-event {
	width: 100%;
	padding: 0.55em 0.7em;
	border: 1px solid var(--smc-border);
	border-radius: var(--smc-radius);
	background: var(--smc-surface);
	color: inherit;
	font: inherit;
}

.smc-event__info:empty {
	display: none;
}

/* A lone event offers no choice, so the select is replaced by a hidden field.
   Only the control is hidden: the information card below it is untouched. */
.smc-event--fixed {
	display: none;
}

.smc-event__info {
	margin-top: 0.75em;
	padding: 0.75em 0.9em;
	border-left: 3px solid var(--smc-accent);
	border-radius: 0 var(--smc-radius) var(--smc-radius) 0;
	background: var(--smc-surface-soft);
}

.smc-event__meta {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 500;
}

.smc-event__where {
	font-weight: 400;
	word-break: break-word;
}

.smc-event__desc {
	margin: 0.4em 0 0;
	font-size: 0.9375rem;
}

/* Hidden from people, reachable by naive bots. */
.smc-honeypot {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.smc-actions {
	display: flex;
	align-items: center;
	gap: 1em;
	flex-wrap: wrap;
}

.smc-submit {
	padding: 0.7em 1.5em;
	border: 0;
	border-radius: var(--smc-radius);
	background: var(--smc-accent);
	color: var(--smc-accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.smc-submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.smc-selected {
	color: var(--smc-muted);
	font-size: 0.875rem;
}

.smc-feedback:not(:empty) {
	margin-top: 1em;
	padding: 0.75em 1em;
	border-radius: var(--smc-radius);
	font-size: 0.9375rem;
}

.smc-feedback--error {
	background: #fef3f2;
	color: var(--smc-error);
}

.smc-feedback--success {
	background: #ecfdf3;
	color: var(--smc-success);
}

.smc-notice {
	margin: 0 0 1em;
	padding: 0.75em 1em;
	border-radius: var(--smc-radius);
	background: #fef3f2;
	color: var(--smc-error);
}

@media ( prefers-reduced-motion: reduce ) {
	.smc-slot {
		transition: none;
	}
}

/* ------------------------------------------------------------------ *
 * Month calendar
 *
 * A real table, because that is what a month grid is: weekday headers keep
 * their column meaning and the layout needs no flex maths.
 * ------------------------------------------------------------------ */

.smc-cal {
	max-width: none;
	width: 100%;
}
.post-content .smc-cal > p {
	margin: 12px 0 0;
}

.smc-cal__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
	margin-bottom: 0.5em;
}

.smc-cal__month {
	font-weight: 600;
	text-align: center;
}

.smc-cal__nav {
	flex: 0 0 auto;
	width: 2.25em;
	height: 2.25em;
	padding: 0;
	border: 1px solid var(--smc-border);
	border-radius: var(--smc-radius);
	background: var(--smc-surface);
	color: inherit;
	font-size: 1.35em;
	line-height: 1;
	cursor: pointer;
}

.smc-cal__nav:hover {
	background: var(--smc-surface-soft);
}

.smc-cal__nav:focus-visible {
	outline: 2px solid var(--smc-accent);
	outline-offset: 1px;
}

.smc-cal__table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	margin-bottom: 1.5em;
}

.smc-cal__weekday {
	padding: 0.35em 0;
	color: var(--smc-muted);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.smc-cal__day {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	min-height: 2.25em;
	padding: 0;
	border: 0;
	border-radius: var(--smc-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
}

.smc-cal__day:hover:not(:disabled) {
	background: var(--smc-surface-soft);
}

.smc-cal__day:focus-visible {
	outline: 2px solid var(--smc-accent);
	outline-offset: -2px;
}

/* Fully booked, or a day the settings never offered. */
.smc-cal__day:disabled {
	color: var(--smc-muted);
	opacity: 0.4;
	cursor: default;
}

/* Days that have already gone by are history rather than unavailable, so they
   are dimmed further and lose the surface they would otherwise keep. */
.smc-cal__day.is-past:disabled {
	opacity: 0.22;
	background: transparent;
}

/* Days past the booking horizon are not full, they are simply not open yet. A
   different tone keeps the cut-off line readable at a glance. */
.smc-cal__day.is-beyond:disabled {
	opacity: 0.3;
	background: transparent;
	color: var(--smc-muted);
}

/* A dot marks the days that have something free, so the month is scannable
   without reading 30 numbers. */
.smc-cal__day.is-open::after {
	content: "";
	position: absolute;
	bottom: 0.28em;
	left: 50%;
	width: 0.3em;
	height: 0.3em;
	border-radius: 50%;
	background: var(--smc-accent);
	transform: translateX(-50%);
}

.smc-cal__day.is-today {
	box-shadow: inset 0 0 0 1px var(--smc-border);
	font-weight: 700;
}

.smc-cal__day.is-selected {
	background: var(--smc-accent);
	color: var(--smc-accent-text);
	font-weight: 600;
}

.smc-cal__day.is-selected::after {
	background: var(--smc-accent-text);
}

.smc-cal__hint {
	margin: 0.5em 0 0;
	color: var(--smc-muted);
	font-size: 0.875rem;
}

.smc-cal__hint:empty {
	display: none;
}

.smc-cal__legend {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin: 0.6em 0 0;
	color: var(--smc-muted);
	font-size: 0.8125rem;
}

.smc-cal__dot {
	flex: 0 0 auto;
	width: 0.4em;
	height: 0.4em;
	border-radius: 50%;
	background: var(--smc-accent);
}

.smc-cal__more {
	margin-left: 0.35em;
	padding: 0;
	border: 0;
	background: none;
	color: var(--smc-accent);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.smc-cal__more:hover {
	color: var(--smc-accent);
	filter: brightness( 0.85 );
}

.smc-cal__grid[aria-busy="true"] {
	opacity: 0.55;
}

@media (prefers-reduced-motion: no-preference) {
	.smc-cal__day,
	.smc-cal__nav {
		transition: background-color 120ms ease, color 120ms ease;
	}
}
.smc-event__title {
	margin: 0 0 0.5em;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--smc-accent);
}
