/* RésaPlaneur – client booking page. Inherits the theme's fonts and colours where possible.
   Default values without specificity: a rule of the site's Additional CSS always overrides them. */

:where(.vd-booking, .vd-availability) {
	--vd-error: #b32d2e;
	--vd-success: #1a7f37;
}

.vd-booking {
	max-width: 640px;
	margin: 0 auto;
	line-height: 1.5;
}

.vd-booking *,
.vd-booking *::before,
.vd-booking *::after {
	box-sizing: border-box;
}

.vd-booking h2 {
	margin: 0 0 0.75em;
}

.vd-booking h3 {
	margin: 1em 0 0.5em;
}

.vd-booking :focus-visible {
	outline: 3px solid var(--vd-accent);
	outline-offset: 2px;
}

/* Headings receive focus after each step, for screen readers; no visible frame on them. */
.vd-booking [tabindex="-1"]:focus {
	outline: none;
}

.vd-nowrap {
	white-space: nowrap;
}

.vd-header {
	border-bottom: 1px solid var(--vd-border);
	margin-bottom: 1.25em;
	padding-bottom: 0.75em;
	font-size: 0.92em;
	color: var(--vd-muted);
}

.vd-header p {
	margin: 0 0 0.25em;
}

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

.vd-form input[type="text"],
.vd-form input[type="email"],
.vd-form input[type="tel"],
.vd-form input[type="number"],
.vd-form input[type="date"],
.vd-form textarea {
	width: 100%;
	max-width: 420px;
	padding: 0.6em 0.75em;
	border: 1px solid var(--vd-border);
	border-radius: var(--vd-radius);
	font: inherit;
}

#vd-number {
	font-size: 1.25em;
	letter-spacing: 0.08em;
	font-variant-numeric: tabular-nums;
}

.vd-field {
	margin: 0 0 1em;
}

.vd-check {
	display: flex;
	gap: 0.6em;
	align-items: flex-start;
}

.vd-check input {
	/* Sized on the text of the label, not on the small font of form controls. */
	font-size: inherit;
	width: 1.1em;
	height: 1.1em;
	margin: 0.25em 0 0;
	flex: none;
	accent-color: var(--vd-accent);
}

.vd-check label {
	font-weight: normal;
	margin: 0;
}

/* Choice between a few options on one line, such as the civility. */
.vd-choice {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1.5em;
	border: 0;
	padding: 0;
	min-width: 0;
}

.vd-choice legend {
	width: 100%;
	padding: 0;
	margin-bottom: 0.4em;
	font-weight: 600;
}

/* Wins over « .vd-form label », which stacks the labels of text fields. */
.vd-choice .vd-check {
	display: flex;
	margin: 0;
	font-weight: normal;
	gap: 0.4em;
}

/* Postcode and town side by side, stacked on narrow screens. */
.vd-field-row {
	display: grid;
	grid-template-columns: minmax(7em, 1fr) 3fr;
	gap: 0 1em;
}

@media (max-width: 30em) {
	.vd-field-row {
		grid-template-columns: 1fr;
	}
}

/* Buttons. With a block theme they also carry .wp-element-button and take the theme's button style
   (colours, font, padding, rounding); the plugin only keeps their size and the outlined variants. */
.vd-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.vd-button:not(.wp-element-button) {
	padding: 0.6em 1.2em;
	border: 1px solid var(--vd-accent);
	border-radius: var(--vd-radius);
	background: var(--vd-accent);
	color: var(--vd-accent-text);
	font: inherit;
	font-weight: 600;
}

.vd-button:disabled {
	opacity: 0.5;
	cursor: default;
}

.vd-button.vd-secondary {
	background: transparent;
	color: var(--vd-accent);
}

.vd-button.vd-danger {
	background: transparent;
	border-color: var(--vd-error);
	color: var(--vd-error);
}

/* Outlined variants of the theme's button: a drawn border, whatever the theme's border width. */
.vd-button.wp-element-button.vd-secondary,
.vd-button.wp-element-button.vd-danger {
	box-shadow: inset 0 0 0 2px currentColor;
}

.vd-button.wp-element-button.vd-secondary:hover:not(:disabled),
.vd-button.wp-element-button.vd-secondary:focus-visible {
	background: var(--vd-accent);
	color: var(--vd-accent-text);
	box-shadow: none;
}

.vd-link {
	background: none;
	border: 0;
	padding: 0;
	color: var(--vd-accent);
	text-decoration: underline;
	font: inherit;
	cursor: pointer;
}

.vd-header-actions {
	font-size: 0.9em;
}

.vd-resume {
	margin-top: 1em;
}

.vd-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	align-items: center;
}

.vd-message {
	padding: 0.6em 0.9em;
	border-radius: var(--vd-radius);
	border-left: 4px solid currentColor;
	background: #f6f7f9;
}

.vd-message-error {
	color: var(--vd-error);
}

.vd-message-success {
	color: var(--vd-success);
}

.vd-message-info {
	color: var(--vd-muted);
}

.vd-note,
.vd-empty {
	color: var(--vd-muted);
	font-size: 0.95em;
}

.vd-slots {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 0.5em;
}

.vd-button.vd-slot {
	width: 100%;
	white-space: nowrap;
	padding-inline: 0.5em;
	background: transparent;
	color: var(--vd-accent);
}

/* The time being confirmed, below the list. */
.vd-button.vd-slot[aria-pressed="true"] {
	background: var(--vd-accent);
	color: var(--vd-accent-text);
}

.vd-confirm,
.vd-gift-box,
.vd-card {
	border: 1px solid var(--vd-border);
	border-radius: var(--vd-radius);
	padding: 1em;
	margin: 1em 0;
}

.vd-card-date {
	font-size: 1.25em;
	font-weight: 700;
	margin: 0;
}

.vd-card-time {
	font-size: 1.1em;
	margin: 0.25em 0;
}

@media (max-width: 480px) {
	.vd-actions .vd-button {
		flex: 1 1 100%;
	}
}

/* Dates start with a capital letter, the rest keeps the language's own case (French months are lowercase). */
.vd-booking h3::first-letter,
.vd-month-title::first-letter,
.vd-card-date::first-letter {
	text-transform: uppercase;
}

.vd-limits {
	background: #f6f7f9;
	border-radius: var(--vd-radius);
	padding: 0.6em 0.9em;
	margin: 0.75em 0;
}

.vd-limits p {
	margin: 0 0 0.4em;
}

.vd-limits p:last-child {
	margin-bottom: 0;
}

.vd-gift-box {
	margin-top: 0;
	margin-bottom: 1.5em;
	background: #f6f7f9;
}

.vd-gift-box h2 {
	margin-top: 0;
}

.vd-gift-box a.vd-button {
	text-decoration: none;
}

/* Off-season message, above the free slots and the booking page. */
.vd-off-season {
	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto 1.5em;
	padding: 0.9em 1.1em;
	border-left: 4px solid var(--vd-accent);
	border-radius: var(--vd-radius);
	background: var(--vd-open);
	line-height: 1.5;
}

.vd-off-season p {
	margin: 0 0 0.6em;
}

.vd-off-season p:last-child {
	margin-bottom: 0;
}

/* [vol_decouverte_creneaux] */
.vd-availability {
	max-width: 640px;
	margin: 0 auto;
	line-height: 1.5;
}

.vd-availability .vd-note {
	color: var(--vd-muted);
	font-size: 0.92em;
}

.vd-availability .vd-date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 2px;
}

.vd-date-count {
	min-width: 1.6em;
	padding: 0 0.35em;
	border-radius: 999px;
	background: var(--vd-accent);
	color: var(--vd-accent-text);
	font-size: 0.72em;
	line-height: 1.5;
}

.vd-availability .vd-date[aria-pressed="true"] .vd-date-count {
	background: var(--vd-accent-text);
	color: var(--vd-accent);
}

.vd-availability .vd-day h3 {
	margin: 1em 0 0.5em;
}

.vd-availability .vd-day h3:focus {
	outline: none;
}

@media (max-width: 480px) {
	.vd-availability .vd-date {
		aspect-ratio: auto;
		min-height: 52px;
	}
}

.vd-availability .vd-day h3::first-letter {
	text-transform: uppercase;
}

.vd-session {
	margin-bottom: 1em;
}

.vd-session-title {
	margin: 0 0 0.4em;
}

.vd-time {
	padding: 0.4em 0.5em;
	border: 1px solid var(--vd-border);
	border-radius: var(--vd-radius);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.vd-availability .vd-slots {
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}

/* A time that can be chosen before buying (RG-26). */
.vd-time:has(> .vd-time-choice) {
	padding: 0;
	border-color: var(--vd-accent);
}

.vd-time-choice {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0.4em 0.5em;
	border: 0;
	border-radius: var(--vd-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

.vd-time-choice:hover,
.vd-time-choice:focus-visible {
	background: var(--vd-open);
}

.vd-time-choice[aria-pressed="true"] {
	background: var(--vd-accent);
	color: var(--vd-accent-text);
}

.vd-wish:not(:empty) {
	margin-top: 0.75em;
	padding: 0.75em 1em;
	border: 1px solid var(--vd-border);
	border-radius: var(--vd-radius);
}

.vd-wish p {
	margin: 0.25em 0;
}

.vd-wish p::first-letter {
	text-transform: uppercase;
}

.vd-availability .vd-actions a.vd-button {
	text-decoration: none;
}

.vd-availability .vd-actions a.vd-button[hidden] {
	display: none;
}

.vd-availability-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin: 0 0 1em;
}

.vd-availability-filter label {
	font-weight: 600;
}

.vd-availability-filter select {
	min-height: 44px;
	padding: 0.4em 0.75em;
	border: 1px solid var(--vd-border);
	border-radius: var(--vd-radius);
	font: inherit;
}

/* Button placed right after a field (voucher number): some space above it. */
.vd-booking .vd-form > .vd-button {
	margin-top: 1em;
}

/* The calendar keeps its size when the theme widens the page content. */
.vd-booking .vd-month,
.vd-booking .vd-day {
	max-width: 640px;
}
