/*
 * The plain default.
 *
 * Every value reads a theme.json token first and falls back to a literal, so a theme that ships
 * reefthemes core dresses this block with no work at all, a theme with its own tokens dresses it
 * for free, and a stock theme still gets something legible rather than unstyled form controls.
 */
.reef-booking {
	/* The board draws this card at 796px beside the room's photograph. */
	max-inline-size: 50rem;
}

.reef-booking__row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--40, 1rem);
}

.reef-booking__field {
	display: flex;
	flex: 1 1 12rem;
	flex-direction: column;
	gap: var(--wp--preset--spacing--10, 0.25rem);
	margin-block-end: var(--wp--preset--spacing--40, 1rem);
	min-inline-size: 0;
}

.reef-booking__field input,
.reef-booking__field select,
.reef-booking__field textarea {
	background-color: var(--wp--custom--color--field, #fff);
	border: 1px solid var(--wp--custom--color--field-border, #767676);
	border-radius: var(--wp--preset--border-radius--field, 0.25rem);
	color: inherit;
	font: inherit;
	min-block-size: var(--wp--custom--control--height, 2.75rem);
	padding: 0 var(--wp--preset--spacing--30, 0.75rem);
	inline-size: 100%;
}

.reef-booking__field textarea {
	padding-block: var(--wp--preset--spacing--20, 0.5rem);
}

.reef-booking__grid {
	display: grid;
	gap: var(--wp--preset--spacing--20, 0.5rem);
	/* Four across, as the board sets it: an evening of eight seatings reads as two rows. */
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-block: var(--wp--preset--spacing--30, 0.75rem) 0;
}

.reef-booking__slot {
	background-color: var(--wp--preset--color--muted, #f2f2f2);
	border: 1px solid var(--wp--preset--color--border, #ddd);
	border-radius: var(--wp--preset--border-radius--md, 0.25rem);
	color: inherit;
	cursor: pointer;
	/*
	 * A time is a figure, and every figure in a theme that ships a monospace face belongs in it: a
	 * grid of times that do not line up column to column is the one thing a guest scans, and the
	 * one thing this control is for. Stated as longhands — the `font` shorthand a button usually
	 * gets would reset the family again two lines later, which is exactly what it was doing.
	 */
	font-family: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	font-variant-numeric: tabular-nums;
	min-block-size: var(--wp--custom--control--height, 2.75rem);
	transition:
		background-color var(--wp--custom--motion--duration-micro, 150ms) var(--wp--custom--motion--ease-house, ease),
		border-color var(--wp--custom--motion--duration-micro, 150ms) var(--wp--custom--motion--ease-house, ease);
}

.reef-booking__slot:hover {
	border-color: var(--wp--preset--color--primary, #333);
}

.reef-booking__slot.is-chosen {
	background-color: var(--wp--preset--color--primary, #222);
	border-color: var(--wp--preset--color--primary, #222);
	color: var(--wp--preset--color--primary-foreground, #fff);
}

/*
 * A full hour, struck rather than missing. It stays in the grid and stays readable — a guest
 * counting four struck times and four free ones knows the evening is going, which is the whole
 * reason the grid is longer than the offers.
 */
.reef-booking__slot.is-full {
	border-color: transparent;
	color: var(--wp--preset--color--muted-foreground, #666);
	cursor: not-allowed;
	text-decoration: line-through;
}

.reef-booking__slot.is-full:hover {
	border-color: transparent;
}

.reef-booking__slot:focus-visible,
.reef-booking__send:focus-visible {
	outline: 2px solid var(--wp--preset--color--ring, currentColor);
	outline-offset: 3px;
}

.reef-booking__error {
	color: var(--wp--custom--color--critical-fill, #8a1f1f);
}

.reef-booking__small,
.reef-booking__note {
	color: var(--wp--preset--color--muted-foreground, #555);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}

.reef-booking__chosen {
	font-family: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	font-weight: 600;
}

/*
 * The honeypot. Off-screen rather than `display: none`: a script that checks for a hidden field
 * skips it, and a screen reader is kept out by `aria-hidden` on the wrapper instead.
 */
.reef-booking__pot {
	block-size: 1px;
	inline-size: 1px;
	inset-inline-start: -9999px;
	overflow: hidden;
	position: absolute;
}

.reef-booking__days {
	list-style: none;
	margin: 0;
	padding: 0;
}

.reef-booking__days li {
	border-block-end: 1px solid var(--wp--preset--color--border, #ddd);
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30, 0.75rem);
	justify-content: space-between;
	padding-block: var(--wp--preset--spacing--30, 0.75rem);
}

.reef-booking__live.is-busy {
	opacity: 0.6;
}

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

/* The guest's own view of their booking. */
.reef-booking__state {
	font-size: var(--wp--preset--font-size--large, 1.125rem);
	margin-block: var(--wp--preset--spacing--30, 0.75rem);
}

.reef-booking__yours {
	color: var(--wp--preset--color--muted-foreground, #555);
}

.reef-booking__cancel {
	margin-block-start: var(--wp--preset--spacing--20, 0.5rem);
}


/* ------------------------------------------------------ the board's own controls */

/*
 * What the canvas draws above the grid: a service chooser, a strip of days, a stepper for the
 * party. Each is a control a finger can hit and an eye can read at a glance — the board's point
 * is that a guest can see the whole evening without opening a single menu.
 */

.reef-booking__head {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30, 0.75rem);
	justify-content: space-between;
	margin-block-end: var(--wp--preset--spacing--30, 0.75rem);
}

/* The segmented control: one ground, the chosen half lifted out of it. */
.reef-booking__services {
	background-color: var(--wp--preset--color--muted, #f2f2f2);
	border-radius: 999px;
	display: flex;
	gap: 0.375rem;
	padding: 0.3125rem;
}

.reef-booking__service {
	background-color: transparent;
	border: 0;
	border-radius: 999px;
	color: var(--wp--preset--color--muted-foreground, #666);
	cursor: pointer;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	font-weight: 600;
	padding: 0.5rem 1rem;
	transition: background-color var(--wp--custom--motion--duration-micro, 150ms) var(--wp--custom--motion--ease-house, ease);
}

.reef-booking__service.is-chosen {
	background-color: var(--wp--preset--color--card, #fff);
	color: var(--wp--preset--color--card-foreground, #111);
}

.reef-booking__service:focus-visible,
.reef-booking__day:focus-visible,
.reef-booking__step:focus-visible {
	outline: 2px solid var(--wp--preset--color--ring, currentColor);
	outline-offset: 3px;
}

.reef-booking__walk-in {
	color: var(--wp--preset--color--muted-foreground, #666);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	margin: 0;
	max-inline-size: 18rem;
}

.reef-booking__part {
	margin-block-end: var(--wp--preset--spacing--50, 1.25rem);
}

.reef-booking__month {
	color: var(--wp--preset--color--muted-foreground, #666);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}

/*
 * Seven tiles, and every one of them a day this service runs.
 *
 * On a phone the strip scrolls instead of shrinking: four tiles a finger can hit beats seven it
 * cannot, which is what the 390 board draws. From the tablet step it stops scrolling and the seven
 * share the row — a strip that still scrolled at 1024, where the card sits in a column beside the
 * room's photograph, was hiding half the week behind a gesture nobody makes with a mouse.
 */
.reef-booking__strip {
	display: grid;
	gap: var(--wp--preset--spacing--20, 0.5rem);
	grid-auto-columns: minmax(4.5rem, 1fr);
	grid-auto-flow: column;
	overflow-x: auto;
	scrollbar-width: thin;
}

@media (min-width: 40rem) {
	.reef-booking__strip {
		grid-auto-columns: minmax(0, 1fr);
		overflow-x: visible;
	}
}

.reef-booking__day {
	align-items: center;
	background-color: transparent;
	border: 1px solid var(--wp--preset--color--border, #ddd);
	border-radius: var(--wp--preset--border-radius--md, 0.5rem);
	color: inherit;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding-block: var(--wp--preset--spacing--30, 0.75rem);
	position: relative;
	transition:
		background-color var(--wp--custom--motion--duration-micro, 150ms) var(--wp--custom--motion--ease-house, ease),
		border-color var(--wp--custom--motion--duration-micro, 150ms) var(--wp--custom--motion--ease-house, ease);
}

.reef-booking__day:hover {
	border-color: var(--wp--preset--color--primary, #333);
}

.reef-booking__day.is-chosen {
	background-color: var(--wp--preset--color--foreground, #111);
	border-color: var(--wp--preset--color--foreground, #111);
	color: var(--wp--preset--color--background, #fff);
}

.reef-booking__dow {
	font-size: var(--wp--preset--font-size--x-small, 0.75rem);
	letter-spacing: 0.08em;
	opacity: 0.66;
	text-transform: uppercase;
}

.reef-booking__num {
	font-family: var(--wp--preset--font-family--display, inherit);
	font-size: var(--wp--preset--font-size--x-large, 1.375rem);
	line-height: 1;
}

/*
 * Today, marked once. Not availability: that is a question per time, and the times answer it.
 *
 * The mark is a class on the tile rather than a `hidden` binding on the dot, because the dot is
 * the thing that is absent on six tiles out of seven and an attribute that has to be removed is a
 * worse default than one that has to be added.
 */
.reef-booking__dot {
	background-color: var(--wp--custom--color--positive-fill, #2f7d4f);
	block-size: 0.3125rem;
	border-radius: 999px;
	display: none;
	inline-size: 0.3125rem;
}

.reef-booking__day.is-today .reef-booking__dot {
	display: block;
}

.reef-booking__two {
	display: grid;
	gap: var(--wp--preset--spacing--55, 1.5rem);
	grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
	.reef-booking__two {
		grid-template-columns: 14rem 1fr;
	}
}

.reef-booking__stepper {
	align-items: center;
	block-size: 3.875rem;
	border: 1px solid var(--wp--preset--color--border, #ddd);
	border-radius: var(--wp--preset--border-radius--field, 0.5rem);
	display: flex;
	justify-content: space-between;
	margin-block-start: var(--wp--preset--spacing--30, 0.75rem);
	padding-inline: 0.625rem;
}

.reef-booking__step {
	background-color: var(--wp--preset--color--muted, #f2f2f2);
	block-size: 2.75rem;
	border: 0;
	border-radius: var(--wp--preset--border-radius--md, 0.5rem);
	color: inherit;
	cursor: pointer;
	font-size: 1.3125rem;
	inline-size: 2.75rem;
	line-height: 1;
}

.reef-booking__step:disabled {
	cursor: not-allowed;
	opacity: 0.4;
}

.reef-booking__party {
	font-family: var(--wp--preset--font-family--display, inherit);
	font-size: var(--wp--preset--font-size--xx-large, 1.625rem);
	font-variant-numeric: tabular-nums;
}

/* The foot: what was chosen, said in words, and the one action that follows from it. */
.reef-booking__foot {
	border-block-start: 1px solid var(--wp--preset--color--border, #ddd);
	margin-block-start: var(--wp--preset--spacing--50, 1.25rem);
	padding-block-start: var(--wp--preset--spacing--50, 1.25rem);
}

.reef-booking__summary {
	margin-block: 0 var(--wp--preset--spacing--40, 1rem);
}

.reef-booking__send-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--55, 1.5rem);
}

.reef-booking__assurances {
	color: var(--wp--preset--color--muted-foreground, #666);
	display: flex;
	flex-wrap: wrap;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	gap: var(--wp--preset--spacing--50, 1.25rem);
	list-style: none;
	margin: 0;
	padding: 0;
}

/*
 * Not yet, rather than faded.
 *
 * `opacity` over a filled clay button took its white label to **2.34:1** — a sentence a reader
 * cannot make out, telling them what the button is for. Disabled, it takes the muted surface and
 * the muted ink instead: the same pair used everywhere else on the page for something that is
 * present but not currently doing anything, and legible at every step.
 */
.reef-booking__send:disabled {
	background-color: var(--wp--preset--color--muted, #f2f2f2);
	color: var(--wp--preset--color--muted-foreground, #666);
	cursor: not-allowed;
}

/* Step two: the request, read back. */
.reef-booking__done-title {
	margin-block: var(--wp--preset--spacing--20, 0.5rem) var(--wp--preset--spacing--30, 0.75rem);
}

.reef-booking__docket {
	margin-block: var(--wp--preset--spacing--50, 1.25rem);
}
