/**
 * Subpage section: Contact split (template-parts/sections/subpage/section-contact_split.php).
 *
 * Measured from design/subpages/contact-us.png at 1920 (TODO: verify in
 * Figma):
 * - In the ~1064px column: ~478px of cards, ~70px, a ~516px form.
 * - Cards ~14px apart, a 1px border, square corners. A ~40px heading band
 *   (17px Roboto 500, #1a1a1a, ~20px inline padding) over a white body
 *   (~12px block and ~20px inline padding, 17px/24px grey text, ~16px
 *   between paragraphs).
 * - Pink (urgent): band #fdeded, border #ffcac1, the numbers red #f44336
 *   (sampled; DECIDED: red as in the frame, bold and underlined here so the
 *   colour is not the only cue; about 3.7:1 on white, see the contrast
 *   report). Blue: band #e5f6fd, border #b3c9df, the numbers orange, the
 *   email orange and underlined.
 * Mobile and tablet (TODO, no frame): one column, the cards first (DECIDED),
 * then the form. Tokens are local to the section. Logical properties only.
 *
 * @package cartrack
 */

.contact-split {
	--contact-gap: var(--space-xl);
	--contact-cards: 478fr;
	--contact-form: 516fr;
	--contact-card-gap: 0.875rem;         /* ~14px. */
	--contact-pad-block: 0.75rem;         /* ~12px. */
	--contact-pad-inline: 1.25rem;        /* ~20px. */
	--contact-band-height: 2.5rem;        /* ~40px. */
	--contact-pink-band: #fdeded;
	--contact-pink-border: #ffcac1;
	--contact-blue-band: #e5f6fd;
	--contact-blue-border: #b3c9df;
	--contact-urgent: #f44336;            /* The frame's red; a darker red is recommended to the designer. */
	--contact-link: var(--color-text-accent);

	display: grid;
	gap: var(--contact-gap);
}

@media (min-width: 64em) { /* --bp-lg */
	.contact-split {
		--contact-gap: 4.375rem;          /* ~70px. */
		grid-template-columns: minmax(0, var(--contact-cards)) minmax(0, var(--contact-form));
		align-items: start;
	}

	.contact-split__heading {
		grid-column: 1 / -1;
	}
}

.contact-split__heading {
	overflow-wrap: anywhere;
}

/* ---------- Cards ---------- */

.contact-split__cards {
	display: flex;
	flex-direction: column;
	gap: var(--contact-card-gap);
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.contact-card {
	border: 1px solid var(--contact-blue-border);
	background: var(--color-bg);
}

.contact-card--pink {
	border-color: var(--contact-pink-border);
}

.contact-card__heading {
	display: flex;
	align-items: center;
	min-block-size: var(--contact-band-height);
	margin: 0;
	padding: var(--space-xs) var(--contact-pad-inline);
	background: var(--contact-blue-band);
	color: var(--color-text);
	font-family: var(--t-body-bold-family);
	font-size: var(--t-body-bold-size);
	font-weight: var(--t-body-bold-weight);
	line-height: var(--t-body-bold-line-height);
	letter-spacing: var(--t-body-bold-tracking);
	overflow-wrap: anywhere;
}

.contact-card--pink .contact-card__heading {
	background: var(--contact-pink-band);
}

.contact-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	padding: var(--contact-pad-block) var(--contact-pad-inline);
	color: var(--color-text-muted);
	font-family: var(--t-body-family);
	font-size: var(--t-body-size);
	line-height: var(--t-body-line-height);
	overflow-wrap: anywhere;            /* Long numbers and emails wrap. */
}

.contact-card__body p,
.contact-card__text {
	margin: 0;
}

.contact-card__text {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.contact-card__text p {
	margin: 0;
}

.contact-card__body a {
	color: var(--contact-link);
	text-decoration: none;
}

/* The email line and mailto: links in the text are underlined (frame); numbers are not. */
.contact-card__email a,
.contact-card__text a[href^="mailto:"] {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Urgent numbers: red, bold and underlined (colour is not the only cue). */
.contact-card--pink .contact-card__body a,
.contact-card--pink .contact-card__number {
	color: var(--contact-urgent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* A number moves to the next line as a whole; it breaks only when longer than the line. */
.contact-card__number,
.contact-card__text a[href^="tel:"] {
	display: inline-block;
	max-inline-size: 100%;
	unicode-bidi: isolate;              /* Numbers keep their order in right-to-left text. */
}

@media (hover: hover) {
	.contact-card__body a:hover {
		text-decoration: underline;
		text-decoration-thickness: 2px;
		text-underline-offset: 0.15em;
	}
}

.contact-card__body a:focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- Form ---------- */

.contact-split__form {
	min-inline-size: 0;
}
