/**
 * Appointment picker states.
 *
 * Deliberately small and unopinionated: the field itself keeps whatever the theme and Gravity
 * Forms give it, and only the status line below it is styled here.
 */

.md-aph-message {
	margin: 0.5em 0 0;
	font-size: 0.9em;
	line-height: 1.4;
}

.md-aph-message[hidden] {
	display: none;
}

.md-aph-message--empty {
	color: #555;
}

.md-aph-message--error {
	color: #8a1f11;
}

/**
 * Offer-block availability pills.
 *
 * Colours come from Kadence's palette variables where they exist, so the pills follow the site
 * rather than pinning a second set of brand colours that would drift out of step with it.
 */

.md-aph-pills {
	--md-aph-pill-bg: var(--global-palette7, #f3f7ff);
	--md-aph-pill-fg: var(--global-palette3, #20212e);
	--md-aph-pill-accent: var(--global-palette1, #dd4b11);

	margin: 1.25em 0;
}

/* The container and its parts are flex, so display has to be beaten back explicitly: without
   this the hidden attribute loses and the error state renders an empty box above the price. */
.md-aph-pills[hidden],
.md-aph-pills [hidden] {
	display: none !important;
}

.md-aph-pills__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.md-aph-pills__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Row alignment. The align attribute on the shortcode picks one of these. */
.md-aph-pills--align-center .md-aph-pills__list {
	justify-content: center;
	padding-left: 0;
}

.md-aph-pills--align-right .md-aph-pills__list {
	justify-content: flex-end;
}

.md-aph-pills--align-center .md-aph-pills__empty {
	text-align: center;
}

.md-aph-pills--align-right .md-aph-pills__empty {
	text-align: right;
}

/* The skeleton and the real pill share this box exactly, so filling the pills in costs no
   height and nothing below them moves. */
.md-aph-pill {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	min-width: 8.5em;
	padding: 0.7em 1.1em;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 0.5em;
	background: var(--md-aph-pill-bg);
	color: var(--md-aph-pill-fg);
	font: inherit;
	line-height: 1.3;
	text-align: left;
}

button.md-aph-pill {
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		transform 0.15s ease;
}

button.md-aph-pill:hover,
button.md-aph-pill:focus-visible {
	border-color: var(--md-aph-pill-accent);
	transform: translateY(-1px);
}

button.md-aph-pill:focus-visible {
	outline: 2px solid var(--md-aph-pill-accent);
	outline-offset: 2px;
}

.md-aph-pill__date {
	font-size: 0.85em;
	opacity: 0.75;
}

.md-aph-pill__time {
	font-size: 1.05em;
	font-weight: 700;
}

/* The skeleton spans hold a non-breaking space, so their line boxes are generated by the same
   font sizes as the real text and are exactly as tall. Nothing here guesses a height, which is
   what keeps the swap from nudging the page. */
.md-aph-pill--skeleton .md-aph-pill__date,
.md-aph-pill--skeleton .md-aph-pill__time {
	align-self: flex-start;
	border-radius: 0.2em;
	background: currentColor;
	opacity: 0.09;
}

.md-aph-pill--skeleton .md-aph-pill__date {
	width: 6em;
}

.md-aph-pill--skeleton .md-aph-pill__time {
	width: 5.5em;
}

.md-aph-pills__empty {
	margin: 0;
	font-weight: 700;
}

/* The sticky site header would otherwise sit over whatever a pill scrolls to. Applied to a class
   the script adds, so no stylesheet has to know the id used in the page content. */
.md-aph-scroll-target {
	scroll-margin-top: var(--md-aph-scroll-offset, 100px);
}

@media (max-width: 600px) {
	.md-aph-pills__list {
		flex-direction: column;
	}

	.md-aph-pill {
		min-width: 0;
	}

	/* Stacked, the row's main axis is vertical, so justify-content would space the pills out
	   rather than align them. Alignment has to move to the cross axis. Left is left alone, so a
	   default block still stacks full width. */
	.md-aph-pills--align-center .md-aph-pills__list {
		justify-content: flex-start;
		align-items: center;
	}

	.md-aph-pills--align-right .md-aph-pills__list {
		justify-content: flex-start;
		align-items: flex-end;
	}
}

@media (prefers-reduced-motion: reduce) {
	button.md-aph-pill {
		transition: none;
	}

	button.md-aph-pill:hover,
	button.md-aph-pill:focus-visible {
		transform: none;
	}
}
