/**
 * Vibrant Contact - Frontend Styles
 *
 * Mobile first. Desktop two-column layout from 960px.
 *
 * @author  Accent - https://accentinteractive.nl
 * @package Vibrant
 * @since   1.0.0
 */

/* ==========================================================================
   Section
   ========================================================================== */

.wp-block-vibrant-contact-section {
	/* Colors - theme presets with the design system as fallback. */
	--vb-ct-bg: var(--wp--preset--color--background-card, #FFFFFF);
	--vb-ct-text: var(--wp--preset--color--text-primary, #1D261F);
	--vb-ct-text-muted: var(--wp--preset--color--text-secondary, #525F55);
	--vb-ct-accent: var(--wp--preset--color--action-primary, #A23E2B);
	--vb-ct-surface-subtle: var(--wp--preset--color--surface-subtle, #E5ECE6);
	--vb-ct-surface-accent: var(--wp--preset--color--surface-accent, #F2E5E6);
	--vb-ct-border-soft: var(--wp--custom--color--green--300, #C6D5CA);
	--vb-ct-border-default: var(--wp--preset--color--border-default, #DFE5E0);

	/* Typography */
	--vb-ct-font-display: var(--wp--preset--font-family--fraunces, "Fraunces", Georgia, serif);
	--vb-ct-font-body: var(--wp--preset--font-family--sora, "Sora", sans-serif);

	/* Layout */
	--vb-ct-max-width: 1280px;
	--vb-ct-section-gap: 24px;
	--vb-ct-grid-gap: 32px;
	--vb-ct-panel-padding: 24px;
	--vb-ct-panel-radius: 20px;
	--vb-ct-card-padding: 24px;
	--vb-ct-card-radius: 20px;

	box-sizing: border-box;
	padding: 32px 20px 48px;
	background: var(--vb-ct-bg);
	color: var(--vb-ct-text);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.wp-block-vibrant-contact-section *,
.wp-block-vibrant-contact-section *::before,
.wp-block-vibrant-contact-section *::after {
	box-sizing: border-box;
}

.vb-contact__inner {
	display: flex;
	flex-direction: column;
	gap: var(--vb-ct-section-gap);
	max-width: var(--vb-ct-max-width);
	margin-inline: auto;
}

/* ==========================================================================
   Breadcrumbs
   ==========================================================================
   The parent theme's vibrant/breadcrumbs block, rendered by this block
   itself (see render.php) so it lives inside .vb-contact__inner - the same
   centred 1280px box as the header and form/info grid - instead of sitting
   outside it and needing its own copy of that alignment maths. */

.wp-block-vibrant-breadcrumbs {
	display: block;
	margin-bottom: 0;
}

.vb-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-breadcrumbs__item {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--vb-ct-font-body);
	font-weight: 400;
	font-size: 0.75rem;
	line-height: 1.27;
	color: var(--vb-ct-text-muted);
}

.vb-breadcrumbs__item:not(:last-child)::after {
	margin: 0;
	color: var(--vb-ct-text-muted);
}

.vb-breadcrumbs__link {
	color: var(--vb-ct-text-muted);
	text-decoration: none;
	box-shadow: none;
}

.vb-breadcrumbs__link:hover,
.vb-breadcrumbs__link:focus-visible {
	color: var(--vb-ct-accent);
	text-decoration: underline;
}

.vb-breadcrumbs__current {
	font-weight: 700;
	color: var(--vb-ct-text);
}

/* ==========================================================================
   Header
   ========================================================================== */

.vb-contact__header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
}

.vb-contact__title {
	margin: 0;
	font-family: var(--vb-ct-font-display);
	font-weight: 900;
	font-size: 2.25rem;
	line-height: 1.22;
	color: var(--vb-ct-text);
}

.vb-contact__subtitle {
	margin: 0 !important;
	width: 100%;
	max-width: 800px;
	font-family: var(--vb-ct-font-body);
	font-weight: 400;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--vb-ct-text-muted);
}

/* Free intro content (paragraphs, headings, buttons, ...). Body copy keeps
   the old subtitle look; headings and buttons use the theme styles. */
.vb-contact__intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	width: 100%;
	max-width: 800px;
	font-family: var(--vb-ct-font-body);
	font-weight: 400;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--vb-ct-text-muted);
}

.vb-contact__intro > * {
	margin-block: 0 !important;
}

.vb-contact__intro > :is(h2, h3, h4, h5, h6) {
	color: var(--vb-ct-text);
}

/* ==========================================================================
   Grid
   ========================================================================== */

.vb-contact__grid {
	display: flex;
	flex-direction: column;
	gap: var(--vb-ct-grid-gap);
	width: 100%;
}

/* ==========================================================================
   Form panel
   ========================================================================== */

.vb-contact__form-panel {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	width: 100%;
	padding: var(--vb-ct-panel-padding);
	background: var(--vb-ct-bg);
	border: 1px solid var(--vb-ct-border-default);
	border-radius: var(--vb-ct-panel-radius);
}

.vb-contact__form-panel-title {
	margin: 0;
	font-family: var(--vb-ct-font-display);
	font-weight: 900;
	font-size: 1.375rem;
	line-height: 1.23;
	color: var(--vb-ct-text);
}

.vb-contact__form-placeholder {
	width: 100%;
	padding: 24px;
	background: var(--vb-ct-surface-subtle);
	border-radius: 12px;
	font-family: var(--vb-ct-font-body);
	font-size: 0.875rem;
	color: var(--vb-ct-text-muted);
	text-align: center;
}

.vb-contact__required-note {
	margin: 0 !important;
	width: 100%;
	font-family: var(--vb-ct-font-body);
	font-weight: 400;
	font-size: 12px !important;
	line-height: 1.25;
	text-align: center;
	color: var(--vb-ct-text-muted);
}

/* ==========================================================================
   Gravity Forms - submit button icon
   ========================================================================== */

/*
 * Base field/button styling is site-wide (see the child theme's
 * assets/css/blocks/gravityforms.css). Only the icon+label markup that this
 * module's gform_submit_button_{$form_id} filter adds stays here.
 */

.vb-contact__button-label {
	display: block;
}

.vb-contact__button-icon {
	display: block;
	flex: 0 0 auto;
	width: 11px;
	height: 11px;
}

/* ==========================================================================
   Info panel
   ========================================================================== */

.vb-contact__info-panel {
	display: flex;
	flex-direction: column;
	gap: var(--vb-ct-grid-gap);
	width: 100%;
}

/* ==========================================================================
   Info card
   ========================================================================== */

.vb-contact__card {
	--vb-ct-card-bg: var(--vb-ct-surface-subtle);

	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: var(--vb-ct-card-padding);
	background: var(--vb-ct-card-bg);
	border-radius: var(--vb-ct-card-radius);
}

.vb-contact__card.is-variant-green {
	--vb-ct-card-bg: var(--vb-ct-surface-subtle);
}

.vb-contact__card.is-variant-rose {
	--vb-ct-card-bg: var(--vb-ct-surface-accent);
}

.vb-contact__card.is-variant-white {
	--vb-ct-card-bg: var(--vb-ct-bg);
}

.vb-contact__card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	width: 100%;
}

.vb-contact__card-title {
	margin: 0;
	font-family: var(--vb-ct-font-display);
	font-weight: 900;
	font-size: 1.25rem;
	line-height: 1.25;
	color: var(--vb-ct-text);
}

.vb-contact__badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	background: var(--vb-ct-bg);
	border-radius: 100px;
	font-family: var(--vb-ct-font-body);
	font-weight: 700;
	font-size: 0.5rem;
	line-height: 1.25;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--vb-ct-accent);
	white-space: nowrap;
}

.vb-contact__card-rows {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
}

/* ==========================================================================
   Detail row
   ========================================================================== */

.vb-contact__row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
}

.vb-contact__row-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 8px;
	background: var(--vb-ct-bg);
	border-radius: 8px;
	color: var(--vb-ct-accent);
}

/*
 * A fixed box rather than auto sizing. These icons carry a viewBox only, and
 * an svg without an intrinsic size collapses in mobile Safari when it is a
 * flex item. preserveAspectRatio keeps the drawing in shape inside the box.
 */
.vb-contact__row-icon svg {
	display: block;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
}

.vb-contact__row-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.vb-contact__row-label {
	display: block;
	font-family: var(--vb-ct-font-body);
	font-weight: 700;
	font-size: 12px;
	line-height: 1.25;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--vb-ct-accent);
}

.vb-contact__row-value {
	margin: 0 !important;
	font-family: var(--vb-ct-font-body);
	font-weight: 400;
	font-size: 14px !important;
	line-height: 1.5;
	color: var(--vb-ct-text);
	white-space: pre-line;
}

/*
 * Phone numbers and email addresses inside a row value. Underlined, so they
 * read as links without relying on colour alone (WCAG 1.4.1), and with a tap
 * area of at least 24px for WCAG 2.5.8.
 */
.wp-block-vibrant-contact-section .vb-contact__row-link {
	display: inline-block;
	min-height: 24px;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	box-shadow: none;
}

.wp-block-vibrant-contact-section .vb-contact__row-link:hover,
.wp-block-vibrant-contact-section .vb-contact__row-link:focus-visible {
	color: var(--vb-ct-accent);
}

.wp-block-vibrant-contact-section .vb-contact__row-link:focus-visible {
	outline: 2px solid var(--vb-ct-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ==========================================================================
   Desktop
   ========================================================================== */

@media (min-width: 960px) {

	.wp-block-vibrant-contact-section {
		--vb-ct-section-gap: 48px;
		--vb-ct-grid-gap: 32px;
		--vb-ct-panel-padding: 40px;
		--vb-ct-panel-radius: 28px;
		--vb-ct-card-padding: 32px;
		--vb-ct-card-radius: 24px;

		padding: 40px 80px 96px;
	}

	.wp-block-vibrant-breadcrumbs {
		margin-bottom: -16px;
	}

	.vb-breadcrumbs__item {
		gap: 8px;
		font-size: 0.875rem;
		line-height: 1.23;
	}

	.vb-breadcrumbs__list {
		gap: 8px;
	}

	.vb-contact__header {
		gap: 16px;
		max-width: 800px;
	}

	.vb-contact__title {
		font-size: 3rem;
		line-height: 1.23;
	}

	.vb-contact__subtitle,
	.vb-contact__intro {
		font-size: 1.125rem;
		line-height: 1.5;
	}

	.vb-contact__grid {
		flex-direction: row;
		align-items: flex-start;
	}

	.vb-contact__form-panel {
		flex: 1 1 712px;
		gap: 24px;
	}

	.vb-contact__form-panel-title {
		font-size: 1.75rem;
	}

	.vb-contact__required-note {
		width: auto;
		text-align: right;
	}

	.vb-contact__info-panel {
		flex: 0 0 520px;
		max-width: 520px;
	}

	.vb-contact__card-title {
		font-size: 1.5rem;
	}

	.vb-contact__badge {
		padding: 4px 10px;
		font-size: 0.625rem;
	}

	.vb-contact__row-label {
		font-size: 12px;
	}
}
