/*
 * patterns/contact.css — "Contact Cards & Form"
 * Markup: wp-content/themes/fcs/patterns/contact.php
 * Root:   .fcs-contact
 *
 * Figma 10514:9163 (desktop only). Appears once, on Contact Us.
 *
 * STRUCTURE
 * ---------
 *   .fcs-contact                alignfull section, white
 *     .fcs-contact__inner       alignwide (1240px)
 *       .fcs-contact__intro     centred, 600px measure
 *       .fcs-contact__cards     the office grid
 *         .fcs-contact__card    H5, subtitle, items
 *       .fcs-contact__rule      1px divider
 *       .fcs-contact__form      512px column: the form, then two notes
 *
 * The FORM itself is not styled here. It takes the reusable .fcs-form class
 * (components/forms.css), set in the form's own Gravity Forms settings.
 *
 * Every block is optional — an editor can delete a subtitle, an item or a whole
 * card — so spacing is margin on the element that follows, never a gap on the
 * parent, except for the grid, where gap is the right tool.
 *
 * SECTION PADDING is not declared here — Medium and Large belong to the
 * editor's Dimensions panel, Small is pinned in layout/spacing.css.
 */

/* Stack ---------------------------------------------------------------- */

/*
 * Doubled classes throughout this file: core's flow-layout block-gap rule is
 * (0,1,0) and prints after the theme's stylesheets, so a single class ties and
 * loses on order.
 */
.fcs-contact__inner.fcs-contact__inner > * {
	margin-block: 0;
}

/* Figma: 40px between intro, cards, divider and form. */
.fcs-contact__inner.fcs-contact__inner > * + * {
	margin-block-start: 40px;
}

.fcs-contact__intro {
	max-width: 600px;
	margin-inline: auto;
}

/* Cards ---------------------------------------------------------------- */

/*
 * DERIVED (no mobile design): 1 column on Small, 2 on Medium, 3 on Large as
 * drawn. Three ~240px columns at 768px would wrap the longer email addresses
 * mid-word; two keep them on one line. A sixth card on a 2-column grid lands
 * evenly (3 rows of 2), so no orphan handling is needed.
 *
 * Grid rows stretch by default, which gives Figma's equal-height cards in a row.
 */
.fcs-contact .fcs-contact__cards {
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 32px;
}

/* Grid gap does the spacing; core's flow margins on the cards would add to it. */
.fcs-contact__cards.fcs-contact__cards > * {
	margin-block: 0;
}

@media ( min-width: 768px ) {
	.fcs-contact .fcs-contact__cards {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( min-width: 1024px ) {
	.fcs-contact .fcs-contact__cards {
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	}
}

/*
 * #d1d6db in Figma; the stroke preset (#d3d7de) is the same rule colour used
 * across the site and indistinguishable at 1px.
 */
.fcs-contact__card {
	padding: 24px;
	border: 1px solid var( --wp--preset--color--stroke );
	border-radius: 10px;
	overflow-wrap: anywhere;
}

.fcs-contact__card.fcs-contact__card > * {
	margin-block: 0;
}

/* Figma: 18px between the heading block and each detail. */
.fcs-contact__card.fcs-contact__card > * + * {
	margin-block-start: 18px;
}

/* …but the subtitle hangs 4px under its name. Heading type is theme.json's h5. */
.fcs-contact__card.fcs-contact__card > .fcs-contact__subtitle {
	margin-block-start: 4px;
}

/* One detail: a small label, 2px, then the value. */
.fcs-contact__item.fcs-contact__item > * {
	margin-block: 0;
}

.fcs-contact__item.fcs-contact__item > * + * {
	margin-block-start: 2px;
}

.fcs-contact__label {
	font-size: var( --wp--preset--font-size--small );
	line-height: 1.4286; /* 20px */
}

/* Divider -------------------------------------------------------------- */

/*
 * Core's separator is 100px wide, 2px tall and half-opaque by default; the
 * design's is a full-width 1px rule. Painted with background, not border, so
 * there is exactly one pixel whatever core's border reset does.
 *
 * The width cap is core's
 *     .wp-block-separator:not(.is-style-wide):not(.is-style-dots) { width: 100px }
 * at (0,3,0). The pattern ships the separator with core's own Wide style
 * (is-style-wide), which escapes it, but this selector is (0,4,0) as well so a
 * section inserted before that change — or one whose style an editor resets —
 * still runs full width.
 */
.fcs-contact__inner.fcs-contact__inner > .wp-block-separator.fcs-contact__rule {
	width: 100%;
	max-width: none;
	height: 1px;
	border: 0;
	background-color: var( --wp--preset--color--stroke );
	opacity: 1;
}

/* Form column ---------------------------------------------------------- */

.fcs-contact .fcs-contact__form {
	max-width: 512px;
	margin-inline: auto;
}

.fcs-contact__form.fcs-contact__form > * {
	margin-block: 0;
}

/* Figma: 40px from the submit button to the notes, 12px between notes. */
.fcs-contact__form.fcs-contact__form > * + .fcs-contact__note {
	margin-block-start: 40px;
}

.fcs-contact__form.fcs-contact__form > .fcs-contact__note + .fcs-contact__note {
	margin-block-start: 12px;
}

.fcs-contact__note {
	font-size: var( --wp--preset--font-size--small );
	line-height: 1.4286; /* 20px */
}
