/*
 * The header's contact item (AIEO_Location_Contact::header_contact(), 11.3.10; Rooster Zero's header builder, its
 * `contact` kind): the request card's call control on a header row. One line in the row's ink (currentColor: no colour
 * of its own): the phone, the theme's label, the number, and the location's hours after it in a quieter weight, their
 * words set by the hours logic before the first paint (assets/js/aieo-hours.js). Smaller on a compact row. Where the
 * header row is narrow the words give way first, then the label: the phone and the number stay. Closed (.is-closed),
 * as the card's call: quieter, no hover, and nothing to press (inline) or a press opens the hours dialog (dialog: a
 * button, the hours' words not beside the number). Loaded only where the item is printed.
 * Two classes, so a theme's link colour and underline (a, a:hover) do not reach it.
 */
.aieo-header-contact.aieo-header-contact {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	min-width: 0;
	max-width: 100%;
	padding-block: 0.25em;
	color: inherit;
	font: inherit;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
}

.aieo-header-contact__icon {
	flex: none;
	width: 1.125em;
	height: 1.125em;
}

.aieo-header-contact__label::after {
	content: ":";
}

.aieo-header-contact__number {
	font-weight: 600;
}

.aieo-header-contact__note {
	min-width: 0;
	overflow: hidden;
	color: color-mix(in srgb, currentColor 72%, transparent);
	font-weight: 400;
	text-overflow: ellipsis;
}

.aieo-header-contact__note::before {
	content: "·";
	margin-inline-end: 0.4em;
}

.aieo-header-contact.aieo-header-contact:hover .aieo-header-contact__number {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.aieo-header-contact.aieo-header-contact:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

.aieo-header-contact.is-compact {
	gap: 0.3em;
	padding-block: 0.125em;
	font-size: 0.875em;
}

.aieo-header-contact.aieo-header-contact.is-closed {
	color: color-mix(in srgb, currentColor 72%, transparent);
	cursor: default;
}

.aieo-header-contact.aieo-header-contact.is-closed[role="button"] {
	cursor: pointer;
}

.aieo-header-contact.aieo-header-contact.is-closed:hover .aieo-header-contact__number {
	text-decoration: none;
}

/* The words give way by the header row's own width (the theme's rows are query containers, `rooster-header`): first
   the hours, then the label; the phone and the number stay. Outside such a row the item keeps its words. */
@container rooster-header (width < 75rem) {
	.aieo-header-contact__note {
		display: none;
	}
}

@container rooster-header (width < 40rem) {
	.aieo-header-contact__label {
		display: none;
	}
}

/* Out of hours, set to the dialog, the item opens it (a button, aria-haspopup="dialog"): its focus ring kept. */
.aieo-header-contact.aieo-header-contact.is-closed:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
