/*
 * The hours dialog (AIEO_Location_Contact::dialog_template(), 11.3.10; the owner, 10 Nov 2026: "When we are out of hours
 * instead of trying it call it ought to give a modal with the next opening hour!", then "on click it appear as a
 * tailwind modal"): a native <dialog> opened by a press out of hours on a call control set to open it, the header's or
 * the request card's. Tailwind UI's simple modal drawn on the theme's tokens and recipes (no Tailwind build on the
 * front, C7): a centred panel with the theme's corners and shadow over a dimmed page, a tinted circle with the clock,
 * the heading and the text, the week's lines, the actions at the foot (Close in the theme's button, the other ways in
 * as secondary buttons), the theme's x at the corner. No colour of its own: the theme's ground, text, line, accent and
 * shadow, the browser's pair where a theme has none; the page behind is dimmed by brightness, not by a colour. Loaded
 * with a control that opens it.
 */
.aieo-hours-dialog {
	box-sizing: border-box;
	position: fixed;
	width: min(32rem, calc(100% - 2 * var(--rooster-gutter, 16px)));
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	overflow: auto;
	border: 1px solid var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent));
	border-radius: var(--wp--custom--rooster--shape--card, var(--aieo-shape-card, 8px));
	background: var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas));
	color: var(--wp--preset--color--fg, CanvasText);
	box-shadow: var(--wp--preset--shadow--lg, none);
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	line-height: 1.5;
	text-align: start;
}

.aieo-hours-dialog::backdrop {
	background: transparent;
	-webkit-backdrop-filter: brightness(0.6);
	backdrop-filter: brightness(0.6);
}

/* The theme's x at the corner, in a 44 px box (FE-O1). */
.aieo-hours-dialog__x {
	position: absolute;
	top: 0.5rem;
	inset-inline-end: 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: var(--wp--custom--rooster--shape--control, 50%);
	background: transparent;
	color: var(--wp--preset--color--muted, color-mix(in srgb, currentColor 65%, transparent));
	cursor: pointer;
}

.aieo-hours-dialog__x > :is(svg, .rooster-icon) {
	flex: none;
	display: block;
}

.aieo-hours-dialog__x:is(:hover, :focus-visible) {
	background: color-mix(in srgb, currentColor 10%, transparent);
	color: inherit;
}

.aieo-hours-dialog__main {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1.5rem 1.5rem 1.25rem;
}

/* The tinted circle with the clock, in the theme's accent. */
.aieo-hours-dialog__badge {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--accent, currentColor) 14%, transparent);
	color: var(--wp--preset--color--accent-text, var(--wp--preset--color--accent, currentColor));
}

.aieo-hours-dialog__badge > :is(svg, .rooster-icon) {
	flex: none;
	display: block;
}

.aieo-hours-dialog__body {
	flex: 1;
	min-width: 0;
}

.aieo-hours-dialog__title {
	margin: 0;
	padding-block-start: 0.625rem;
	padding-inline-end: 2.5rem;
	font-size: var(--wp--preset--font-size--md, 1.0625rem);
	font-weight: 600;
	line-height: 1.4;
}

.aieo-hours-dialog__next {
	margin: 0.375rem 0 0;
	color: var(--wp--preset--color--muted, color-mix(in srgb, currentColor 65%, transparent));
}

.aieo-hours-dialog__label {
	margin: 1rem 0 0.25rem;
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	font-weight: 600;
	line-height: 1.4;
}

.aieo-hours-dialog__week {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aieo-hours-dialog__week li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0 1rem;
	padding-block: 0.375rem;
	border-block-end: 1px solid var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent));
}

.aieo-hours-dialog__week li:last-child {
	border-block-end: 0;
}

.aieo-hours-dialog__hours {
	font-variant-numeric: tabular-nums;
}

/* The actions at the foot, on the theme's quiet surface: Close at the end, the other ways in before it. */
.aieo-hours-dialog__actions {
	display: flex;
	flex-direction: row-reverse;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	background: var(--wp--preset--color--subtle, color-mix(in srgb, currentColor 4%, transparent));
}

.aieo-hours-dialog__ways {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.aieo-hours-dialog__close {
	min-height: 2.75rem;
}

/* A phone: the circle above, the words centred, the actions one under the other across the width. */
@media (max-width: 40rem) {
	.aieo-hours-dialog__main {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.aieo-hours-dialog__title {
		padding-inline: 2.5rem;
	}

	.aieo-hours-dialog__week li {
		text-align: start;
	}

	.aieo-hours-dialog__actions,
	.aieo-hours-dialog__ways {
		flex-direction: column;
		align-items: stretch;
	}

	.aieo-hours-dialog__ways {
		width: 100%;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.aieo-hours-dialog[open] {
		animation: aieo-hours-dialog-in 0.16s ease-out;
	}
}

@keyframes aieo-hours-dialog-in {
	from {
		opacity: 0;
		translate: 0 0.5rem;
	}
}
