@charset "UTF-8";

/*
 * Elena's Bistro — table reservations, front end.
 *
 * The theme already styles sections, containers, buttons, fields and notices.
 * What is added here is the reservation-specific furniture: the list of times,
 * the consent block and the cancellation panel. Colours come from the theme's
 * custom properties where they exist, with a fallback so the form still looks
 * deliberate on a site using a different theme.
 */

.ebk-booking .elena-notice,
.ebk-cancel .elena-notice {
	margin-bottom: 1.5rem;
}

.ebk-booking .elena-notice p,
.ebk-cancel .elena-notice p {
	margin: 0;
}

.ebk-booking .elena-notice ul {
	margin: 0.4rem 0 0;
	padding-left: 1.1rem;
}

.ebk-booking .elena-notice li + li {
	margin-top: 0.25rem;
}

.ebk-booking__title,
.ebk-cancel__title {
	font-family: var(--elena-font-display, Georgia, serif);
	margin: 0 0 0.6rem;
}

.ebk-booking__intro {
	color: var(--elena-muted, #b8b0a1);
	margin: 0 0 1.75rem;
	max-width: 62ch;
}

.ebk-booking__tel,
.ebk-cancel__tel {
	color: var(--elena-gold, #c9a24a);
	text-decoration: none;
}

.ebk-booking__tel:hover,
.ebk-cancel__tel:hover,
.ebk-booking__tel:focus,
.ebk-cancel__tel:focus {
	text-decoration: underline;
}

.ebk-form .elena-form__honeypot {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

/* -------------------------------------------------------------------------
 * Field colours
 * -------------------------------------------------------------------------
 *
 * Field appearance (background, border, colour, caret and placeholder) is
 * owned by the theme's design system — `.elena-field__input` in
 * assets/css/theme.css — which this form's markup already uses. Underscores'
 * normalise layer in style.css used to reach every field first with
 * `input[type="…"] { color: #666; border: 1px solid #ccc }` and paint typed
 * values grey on the dark surface; that conflict has been removed at its
 * source, since one attribute selector outranks a lone class.
 *
 * The rules below are therefore a restatement of the shared field tokens
 * rather than a workaround. They are kept under the booking namespace so the
 * form still renders correctly on its own — if the plugin is ever activated
 * with an unmodified starter theme, or with the theme's stylesheet missing,
 * these fields remain legible. Nothing else on the site is touched and no
 * `!important` is needed.
 */

.ebk-form .elena-field__input,
.ebk-cancel .elena-field__input {
	background-color: var(--elena-night-3, #191713);
	border: 1px solid var(--elena-line, rgba(217, 191, 130, 0.22));
	border-radius: var(--elena-radius, 3px);
	/* Champagne marks the insertion point. */
	caret-color: var(--elena-champagne, #d9bf82);
	color: var(--elena-ivory, #f5f0e6);
	/* Scoped to the form's own controls: this is what keeps the native date
	 * picker, the number spinners and an autofilled field in their dark
	 * presentation instead of the browser's light default. */
	color-scheme: dark;
	font-family: var(--elena-font-body, inherit);
	/* A step down from the body size and a shorter padding: the form was built
	 * from fields 58px tall, which made a date and a party size read as the
	 * heaviest thing on the page. */
	font-size: 0.95rem;
	padding: 0.7rem 0.9rem;
	/* Safari paints the value through this property, which a plain `color`
	 * declaration does not reach. */
	-webkit-text-fill-color: var(--elena-ivory, #f5f0e6);
	transition: border-color var(--elena-speed, 220ms) ease, box-shadow var(--elena-speed, 220ms) ease;
	width: 100%;
}

.ebk-form .elena-field__input:hover,
.ebk-cancel .elena-field__input:hover {
	border-color: var(--elena-gold-soft, #d9bf82);
}

/* The colour and caret are restated on focus: a state change must never leave
 * dark text or a dim caret on the darker surface. */
.ebk-form .elena-field__input:focus,
.ebk-cancel .elena-field__input:focus {
	border-color: var(--elena-gold, #c9a24a);
	box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.18);
	caret-color: var(--elena-champagne, #d9bf82);
	color: var(--elena-ivory, #f5f0e6);
	-webkit-text-fill-color: var(--elena-ivory, #f5f0e6);
}

/* A selection inside a field keeps the house colours rather than the browser's
 * blue highlight on near-black text. */
.ebk-form .elena-field__input::selection,
.ebk-cancel .elena-field__input::selection {
	background-color: var(--elena-gold, #c9a24a);
	color: var(--elena-night, #0b0b0a);
}

/* Visible, but deliberately quieter than a typed value. The same token the
 * design system uses for placeholders, so the booking form's hints read
 * identically to the ones on the contact and enquiry forms. */
.ebk-form .elena-field__input::placeholder,
.ebk-cancel .elena-field__input::placeholder {
	color: var(--elena-muted, #b8b0a1);
	opacity: 1;
	-webkit-text-fill-color: var(--elena-muted, #b8b0a1);
}

/* An autofilled field must not turn white with unreadable text. The inset
 * shadow repaints the browser's yellow/blue fill in the house dark. */
.ebk-form .elena-field__input:-webkit-autofill,
.ebk-cancel .elena-field__input:-webkit-autofill {
	-webkit-text-fill-color: var(--elena-ivory, #f5f0e6);
	caret-color: var(--elena-champagne, #d9bf82);
	box-shadow: 0 0 0 100px var(--elena-night-3, #191713) inset;
}

.ebk-form .elena-field__input:autofill,
.ebk-cancel .elena-field__input:autofill {
	-webkit-text-fill-color: var(--elena-ivory, #f5f0e6);
	caret-color: var(--elena-champagne, #d9bf82);
	box-shadow: 0 0 0 100px var(--elena-night-3, #191713) inset;
}

/* While an autofilled field is hovered or focused the gold ring is kept
 * alongside the inset fill, so focus stays visible. Placed after the focus and
 * autofill rules above, which it shares a specificity with. */
.ebk-form .elena-field__input:-webkit-autofill:hover,
.ebk-form .elena-field__input:-webkit-autofill:focus,
.ebk-cancel .elena-field__input:-webkit-autofill:hover,
.ebk-cancel .elena-field__input:-webkit-autofill:focus,
.ebk-form .elena-field__input:autofill:hover,
.ebk-form .elena-field__input:autofill:focus,
.ebk-cancel .elena-field__input:autofill:hover,
.ebk-cancel .elena-field__input:autofill:focus {
	border-color: var(--elena-gold, #c9a24a);
	-webkit-text-fill-color: var(--elena-ivory, #f5f0e6);
	caret-color: var(--elena-champagne, #d9bf82);
	box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.18), 0 0 0 100px var(--elena-night-3, #191713) inset;
}

/* A disabled field stays legible, just quieter. */
.ebk-form .elena-field__input:disabled,
.ebk-cancel .elena-field__input:disabled {
	background-color: var(--elena-night-2, #12110f);
	border-color: var(--elena-line-soft, rgba(245, 240, 230, 0.1));
	color: var(--elena-muted, #b8b0a1);
	cursor: not-allowed;
	-webkit-text-fill-color: var(--elena-muted, #b8b0a1);
}

/* Labels, required markers and helper text, in the form's own colours. */
.ebk-form .elena-field__label,
.ebk-cancel .elena-field__label {
	color: var(--elena-ivory, #f5f0e6);
}

.ebk-form .elena-field__required,
.ebk-cancel .elena-field__required {
	color: var(--elena-gold, #c9a24a);
}

.ebk-form .elena-field__help,
.ebk-cancel .elena-field__help {
	color: var(--elena-muted, #b8b0a1);
}

.ebk-form textarea.elena-field__input,
.ebk-cancel textarea.elena-field__input {
	min-height: 9rem;
	resize: vertical;
}

.ebk-form select.elena-field__input,
.ebk-cancel select.elena-field__input {
	background-color: var(--elena-night-3, #191713);
	color: var(--elena-ivory, #f5f0e6);
}

.ebk-form select.elena-field__input option,
.ebk-cancel select.elena-field__input option {
	background-color: var(--elena-night-2, #12110f);
	color: var(--elena-ivory, #f5f0e6);
}

/*
 * The calendar button on a date or time field.
 *
 * `color-scheme: dark` above already paints the picker, its popup and that
 * button in the dark presentation, so this is only the affordance: the button
 * is clickable, so the pointer says so, and it comes up to full strength under
 * the pointer or once the field has focus — in step with the gold border the
 * same field takes when it is focused. These selectors are Chromium's; other
 * engines drop the rules and leave their own control alone.
 */
.ebk-form .elena-field__input::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.65;
	transition: opacity var(--elena-speed, 220ms) ease;
}

.ebk-form .elena-field__input::-webkit-calendar-picker-indicator:hover,
.ebk-form .elena-field__input:focus::-webkit-calendar-picker-indicator {
	opacity: 1;
}

/* The consent checkboxes: gold rather than the browser's default blue, and in
 * the dark presentation so the box keeps a visible outline on this ground. */
.ebk-form .ebk-check__input,
.ebk-cancel .ebk-check__input {
	accent-color: var(--elena-gold, #c9a24a);
	color-scheme: dark;
}

/* -------------------------------------------------------------------------
 * Field errors
 * ---------------------------------------------------------------------- */

.ebk-field__error {
	color: var(--elena-error, #d98072);
	display: block;
	font-size: 0.875rem;
	margin-top: 0.3rem;
}

.ebk-field--invalid .elena-field__input {
	border-color: var(--elena-error, #d98072);
}

/* -------------------------------------------------------------------------
 * Times
 * ---------------------------------------------------------------------- */

.ebk-slots {
	border: 0;
	margin: 1.5rem 0 0;
	padding: 0;
}

.ebk-slots__legend {
	font-family: var(--elena-font-display, Georgia, serif);
	font-size: 1.05rem;
	margin-bottom: 0.6rem;
	padding: 0;
}

/*
 * The times are a grid, not a wrapped row.
 *
 * As a flex row of minimum-width pills the columns filled from the left and
 * left a ragged edge on the right at every width that did not divide evenly —
 * three times out of four on a phone. Equal columns fill the row exactly, so
 * the times read as one block and the last row lines up with the rows above.
 *
 * The minimum is also what decides how many columns a given form width gets.
 * 6.25rem keeps three across the form on a phone, where a dozen times close as
 * four whole rows, and six across it on a larger screen, where the same dozen
 * closes as two rows instead of a row of seven and a row of five.
 */
.ebk-slots__list {
	display: grid;
	gap: 0.5rem;
	grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
}

/*
 * When there are no times, what replaces them is written inside this same grid:
 * a sentence, and a row of the next days. Both are prose rather than a column
 * of times, so both are given the whole width. Without this the sentence was
 * one 6.25rem column wide, which broke "The restaurant is closed on that date"
 * into five lines with the dates beside it.
 */
.ebk-slots__empty,
.ebk-slots__next-label,
.ebk-slots__next {
	grid-column: 1 / -1;
}

.ebk-slot {
	align-items: center;
	background-color: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--elena-line, rgba(0, 0, 0, 0.18));
	border-radius: var(--elena-radius, 3px);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	justify-content: center;
	min-width: 0;
	padding: 0.5rem 0.75rem;
	/* The radio is hidden by clipping it, not by moving it away, so its own
	 * label is its containing block: focusing it by keyboard cannot send the
	 * page scrolling after an off-screen box. */
	position: relative;
	text-align: center;
	transition: border-color var(--elena-speed, 220ms) ease, background-color var(--elena-speed, 220ms) ease;
}

.ebk-slot:hover {
	background-color: rgba(217, 191, 130, 0.1);
	border-color: var(--elena-gold, #c9a24a);
}

.ebk-slot__input {
	clip: rect(0 0 0 0);
	height: 1px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.ebk-slot__time {
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ebk-slot__note {
	color: var(--elena-muted, #b8b0a1);
	font-size: 0.75rem;
	letter-spacing: 0.02em;
	line-height: 1.35;
	text-wrap: pretty;
}

/* The chosen time.
 *
 * A tint was not enough: the one thing a guest must never have to hunt for is
 * the time they picked, so the chosen slot now carries the same gold ground and
 * near-black label as the selected category on the menu. */
.ebk-slot:has(.ebk-slot__input:checked) {
	background-color: var(--elena-gold, #c9a24a);
	border-color: var(--elena-gold, #c9a24a);
	box-shadow: 0 0 0 1px var(--elena-gold, #c9a24a) inset;
	color: var(--elena-night, #0b0b0a);
}

.ebk-slot:has(.ebk-slot__input:checked) .ebk-slot__time {
	color: var(--elena-night, #0b0b0a);
}

.ebk-slot:has(.ebk-slot__input:checked) .ebk-slot__note {
	color: rgba(11, 11, 10, 0.72);
}

.ebk-slot__input:focus-visible + .ebk-slot__time {
	outline: 2px solid var(--elena-gold, #c9a24a);
	outline-offset: 3px;
}

/* On the gold ground the ring has to be the dark one to be seen at all. */
.ebk-slot:has(.ebk-slot__input:checked) .ebk-slot__input:focus-visible + .ebk-slot__time {
	outline-color: var(--elena-night, #0b0b0a);
}

/* A time that is not on offer must not look tappable, and must not light up
 * like the others when the pointer crosses it.
 *
 * The class is kept alongside the newer tiers so a page cached from before the
 * tiers existed, or markup from an older extension, still reads correctly. */
.ebk-slot--taken,
.ebk-slot--full {
	background-color: rgba(255, 255, 255, 0.02);
	border-color: var(--elena-line-soft, rgba(245, 240, 230, 0.1));
	color: var(--elena-muted-2, #8f8779);
	cursor: not-allowed;
	opacity: 0.6;
	text-decoration: line-through;
}

.ebk-slot--taken .ebk-slot__time,
.ebk-slot--taken .ebk-slot__note,
.ebk-slot--full .ebk-slot__time,
.ebk-slot--full .ebk-slot__note {
	color: inherit;
}

.ebk-slot--taken:hover,
.ebk-slot--full:hover {
	background-color: rgba(255, 255, 255, 0.02);
	border-color: var(--elena-line-soft, rgba(245, 240, 230, 0.1));
}

/*
 * A table with covers left, but not enough of them for this party.
 *
 * It must not be confused with a full slot: there is still a table here, just
 * not one that fits the number of guests on the form, so it is struck through
 * like a full slot but keeps its own note and a warmer border - the guest is
 * one change of the party size away from a table at that time.
 */
.ebk-slot--unfit {
	background-color: rgba(217, 191, 130, 0.04);
	border-color: rgba(217, 191, 130, 0.22);
	cursor: not-allowed;
	opacity: 0.75;
	text-decoration: line-through;
}

.ebk-slot--unfit .ebk-slot__note {
	color: var(--elena-gold-soft, #d9bf82);
	text-decoration: none;
}

.ebk-slot--unfit:hover {
	background-color: rgba(217, 191, 130, 0.04);
	border-color: rgba(217, 191, 130, 0.22);
}

/* Few covers left. A gentle accent rather than a warning: the time can still
 * be booked, and the note underneath says how many covers remain. */
.ebk-slot--limited {
	border-color: rgba(217, 191, 130, 0.45);
}

.ebk-slot--limited .ebk-slot__note {
	color: var(--elena-gold-soft, #d9bf82);
}

.ebk-slot--limited:hover {
	border-color: var(--elena-gold, #c9a24a);
}

.ebk-slots__status {
	color: var(--elena-muted, #b8b0a1);
	font-size: 0.9rem;
	margin: 1rem 0 0;
}

.ebk-slots__error,
.ebk-slots__empty {
	color: var(--elena-error, #d98072);
	margin: 0;
}

.ebk-slots__empty {
	color: inherit;
}

.ebk-slots__status--error {
	color: var(--elena-error, #d98072);
}

/* The no-script button, and only that: with the script the list of times is
 * already in step with the date and the number of guests. */
.ebk-slots__refresh {
	margin: 1rem 0 0;
}

/* While an answer is on its way the previous list is dimmed and cannot be
 * picked, so a time drawn for the date the guest has just left is never
 * presented as one that can still be chosen. */
.ebk-slots__list[aria-busy="true"] {
	cursor: progress;
	opacity: 0.55;
	pointer-events: none;
}

/* The same treatment for a list whose day could not be checked: asking for the
 * times of another day failed, so what is on screen belongs to the day the
 * guest has just left and must not be presented as one that can still be
 * picked. The line above it says what went wrong, and changing the date asks
 * again and clears this. */
.ebk-slots__list--stale {
	cursor: not-allowed;
	opacity: 0.55;
	pointer-events: none;
}

.ebk-slots__next-label {
	font-size: 0.9rem;
	margin: 1rem 0 0.4rem;
}

.ebk-slots__next {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ebk-slots__next a {
	color: var(--elena-gold, #c9a24a);
}

.ebk-slots__next a:focus-visible {
	outline: 2px solid var(--elena-gold, #c9a24a);
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Consent
 * ---------------------------------------------------------------------- */

.ebk-consent {
	margin-top: 1.75rem;
}

.ebk-consent__field {
	margin-bottom: 0.9rem;
}

.ebk-check {
	align-items: flex-start;
	display: flex;
	gap: 0.65rem;
	line-height: 1.5;
}

.ebk-check__input {
	flex: 0 0 auto;
	height: 1.1rem;
	margin-top: 0.2rem;
	width: 1.1rem;
}

.ebk-check__label {
	cursor: pointer;
	font-size: 0.9375rem;
}

.ebk-consent__privacy {
	color: var(--elena-muted, #b8b0a1);
	font-size: 0.8125rem;
	margin: 0 0 0.9rem;
}

.ebk-consent__privacy a {
	color: var(--elena-gold, #c9a24a);
}

.ebk-consent__contact {
	font-size: 0.9375rem;
	margin: 0.9rem 0 0;
}

/* -------------------------------------------------------------------------
 * Cancellation panel
 * ---------------------------------------------------------------------- */

.ebk-cancel__summary {
	display: grid;
	gap: 0.35rem 1.25rem;
	grid-template-columns: max-content 1fr;
	margin: 0 0 1.5rem;
}

.ebk-cancel__summary dt {
	color: var(--elena-muted, #b8b0a1);
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ebk-cancel__summary dd {
	margin: 0;
}

.ebk-cancel__note {
	margin: 0 0 1rem;
}

.ebk-cancel__contact {
	color: var(--elena-muted, #b8b0a1);
	margin: 1.5rem 0 0;
}

@media (prefers-reduced-motion: reduce) {

	.ebk-slot,
	.ebk-form .elena-field__input,
	.ebk-cancel .elena-field__input {
		transition: none;
	}
}
