/*
 * "Contact line (Campfire)" element: one row of a contact list. Colours, sizes and spacing come from
 * the site's Bricks variables. The element's Text styles controls override the three text rules.
 */
.cf-contact-line {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	column-gap: var(--space-m);
	width: 100%;
	padding-block: var(--space-xs);
	border-top: 1px solid var(--cf-line);
	list-style: none;
}

/* No rule above the first row of a list. */
.cf-contact-line:first-child {
	border-top-width: 0;
}

.cf-contact-line__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cf-contact-line__name {
	font-weight: 600;
	color: var(--cf-ink);
}

/* Hidden full stop after the name, for screen readers only (contact-line.php). */
.cf-contact-line__stop {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cf-contact-line__note {
	font-size: var(--text-s);
	color: var(--cf-muted);
}

/* 2.75rem: a 44px target at the default text size, growing with the visitor's text size. */
.cf-contact-line__link {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	font-size: var(--text-m);
	font-weight: 700;
	color: var(--cf-ink);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.cf-contact-line__link:hover {
	text-decoration: underline;
}

.cf-contact-line--phone .cf-contact-line__link {
	white-space: nowrap;
}

/*
 * Email addresses and links sit under the name, left-aligned and underlined like the site's text
 * links: they are words, not a number, so they need to read as a link and can be long.
 */
.cf-contact-line--email,
.cf-contact-line--link {
	grid-template-columns: minmax(0, 1fr);
	padding-bottom: 0;
}

.cf-contact-line--email .cf-contact-line__link,
.cf-contact-line--link .cf-contact-line__link {
	justify-self: start;
	font-size: inherit;
	text-decoration: underline;
	text-decoration-thickness: 0.0625em;
	text-underline-offset: 0.25em;
}

.cf-contact-line--email .cf-contact-line__link:hover,
.cf-contact-line--link .cf-contact-line__link:hover {
	text-decoration-thickness: 0.1875em;
}

/*
 * "Show as button" (off by default): the value is the site's Outline button at its default size (theme style:
 * --text-button, 3.125rem tall), on the right of the name and note; it drops under them when the row is too
 * narrow for both (text keeps 15em). Every type (phone, email, link) uses this layout when it is a button.
 * Rows get --space-m above and below (so two services are 2 x --space-m apart) and --space-s between the text
 * and its button when stacked, so each service reads as its own block.
 */
.cf-contact-line--button {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	column-gap: var(--space-m);
	row-gap: var(--space-s);
	padding-block: var(--space-m);
}

.cf-contact-line--button > .cf-contact-line__text {
	flex: 1 1 15em;
}

.cf-contact-line__button {
	flex: 0 0 auto;
	max-width: 100%;
	white-space: nowrap;
}

/*
 * Phones (the site's 767px layouts): name, note and extra link, then the button under them at the full width of
 * the row, on every row, so the list doesn't mix side-by-side and stacked rows. In em (47.9375em = 767px at the
 * default 16px), so a visitor with larger browser text or a zoomed phone gets the same stacked layout whenever
 * the window is narrow in text terms. At the default text size it is exactly the 767px breakpoint.
 */
@media (max-width: 47.9375em) {
	.cf-contact-line--button > .cf-contact-line__text {
		flex-basis: 100%;
	}

	.cf-contact-line--button > .cf-contact-line__button {
		flex: 1 1 100%;
	}
}

/*
 * Extra link under the note (optional, e.g. more information on another site): underlined like the site's
 * text links, at the note's size, 2.75rem tall so it is a 44px target. .cf-contact-line in front beats the
 * theme's link underline rule (body.bricks-is-frontend a).
 */
.cf-contact-line .cf-contact-line__more {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	font-size: var(--text-s);
	font-weight: 600;
	color: var(--cf-ink);
	text-decoration: underline;
	text-decoration-thickness: 0.0625em;
	text-underline-offset: 0.25em;
}

.cf-contact-line .cf-contact-line__more:hover {
	text-decoration-thickness: 0.1875em;
}

/*
 * Contact lines - List, "Ink panel" variant (data-brx-variant="contact-lines-ink"; the panel's fill,
 * --cf-hero-base, and edge, --cf-white-t-2, are set on the component's variant): rows are slot content, which a
 * variant can't style, so their colours are here.
 * Dividers white 9% (--cf-white-t-1), names white, notes white 73% (--cf-white-t-8), links white.
 * The button becomes the site's Light outline button (theme style: white border and text, hover white fill
 * with ink text), and the focus ring is peach, as in every dark area.
 */
[data-brx-variant="contact-lines-ink"] .cf-contact-line {
	border-top-color: var(--cf-white-t-1);
}

[data-brx-variant="contact-lines-ink"] .cf-contact-line__name {
	color: var(--cf-white);
}

[data-brx-variant="contact-lines-ink"] .cf-contact-line__note {
	color: var(--cf-white-t-8);
}

[data-brx-variant="contact-lines-ink"] .cf-contact-line .cf-contact-line__link,
[data-brx-variant="contact-lines-ink"] .cf-contact-line .cf-contact-line__more {
	color: var(--cf-white);
}

[data-brx-variant="contact-lines-ink"] .cf-contact-line__button {
	color: var(--cf-white);
	border-color: var(--cf-white);
}

[data-brx-variant="contact-lines-ink"] .cf-contact-line__button:hover {
	color: var(--cf-ink);
	background-color: var(--cf-white);
	border-color: var(--cf-white);
}

body.bricks-is-frontend [data-brx-variant="contact-lines-ink"] :focus-visible {
	outline-color: var(--cf-peach);
}
