/*
 * My Fleurieu Journey: component styles, matching the agreed website mockup.
 * Colours and fonts come from theme.json presets.
 */

html {
	scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--sea-glass);
	outline-offset: 3px;
}

/* Sections butt together with no block gap between them, as in the mockup. */
.wp-site-blocks > *,
.wp-block-post-content > .alignfull {
	margin-block: 0;
}

/* Header */

.mfj-header-wrap {
	position: sticky;
	top: 0;
	z-index: 50;
}

body.admin-bar .mfj-header-wrap {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	body.admin-bar .mfj-header-wrap {
		top: 0;
	}
}

.mfj-header {
	border-bottom: 1px solid var(--wp--preset--color--sage);
}

.mfj-brand .wp-block-site-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.mfj-nav a {
	color: var(--wp--preset--color--accent-4);
	text-decoration: none;
}

.mfj-nav a:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
	text-underline-offset: 0.35em;
}

.mfj-nav .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--accent-5);
}

.mfj-brand .wp-block-site-title {
	white-space: nowrap;
}

/* Phones: the hero's own button does this job. The doubled class outranks the flex layout rule. */
@media (max-width: 600px) {
	.wp-block-buttons.mfj-header__cta {
		display: none;
	}
}

/* Hero: deep teal with the four drawn waves along the bottom edge */

.mfj-hero {
	position: relative;
	overflow: hidden;
}

.mfj-hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: clamp(56px, 7vw, 96px);
	pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cg fill='none' stroke-width='1.6' vector-effect='non-scaling-stroke'%3E%3Cpath d='M0 46 C240 18 420 20 720 40 S1200 66 1440 30' stroke='%23A3B86C' stroke-opacity='.85'/%3E%3Cpath d='M0 58 C260 34 460 34 740 52 S1220 76 1440 44' stroke='%237FB8C0' stroke-opacity='.85'/%3E%3Cpath d='M0 70 C280 50 480 50 760 64 S1240 86 1440 58' stroke='%23CBD9D4' stroke-opacity='.4'/%3E%3Cpath d='M0 82 C300 64 500 64 780 76 S1260 96 1440 72' stroke='%23A33E64' stroke-opacity='.9'/%3E%3C/g%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}

/* The wrapper spans the content width so the text lines up with the header; only its children are narrowed. */
.mfj-hero__text > * {
	max-width: 40rem;
}

.mfj-hero h1 {
	color: var(--wp--preset--color--base);
	margin-top: 0;
	max-width: 12.5ch;
}

.mfj-lede {
	color: var(--wp--preset--color--sage);
	font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
	max-width: 34rem;
}

.mfj-hero .is-style-outline .wp-block-button__link {
	color: var(--wp--preset--color--base);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 70%, transparent);
	background: transparent;
}

.mfj-hero .is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.mfj-tagline {
	font-family: var(--wp--preset--font-family--source-serif);
	font-style: italic;
	color: var(--wp--preset--color--sage);
	margin-top: var(--wp--preset--spacing--40);
}

/* Section intros */

.mfj-section__intro {
	margin-bottom: var(--wp--preset--spacing--50);
}

.mfj-section__intro > * {
	max-width: 44rem;
}

.mfj-section__intro h2 {
	margin-bottom: 0.5rem;
}

.mfj-section__intro p {
	margin-top: 0;
}

/*
 * Grids. Column counts are set here so a row never ends with an orphan.
 * The doubled class outranks the block's generated layout rule, which prints later.
 */

.wp-block-group.mfj-grid {
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}

@media (min-width: 700px) {
	.wp-block-group.mfj-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wp-block-group.mfj-grid--why {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 960px) {
	.wp-block-group.mfj-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.mfj-grid h3 {
	font-size: 1.15rem;
	margin: 0 0 0.4rem;
}

.mfj-grid p {
	margin: 0;
}

/* Services: rows divided by thin rules */

.wp-block-group.mfj-grid--ruled {
	row-gap: 0;
	border-bottom: 1px solid var(--wp--preset--color--sage);
}

.mfj-item {
	border-top: 1px solid var(--wp--preset--color--sage);
	padding-block: 1.4rem 1.6rem;
}

.mfj-item h3 {
	color: var(--wp--preset--color--accent-2);
}

/* Who we work with: coloured rule on the left */

.mfj-who {
	border-left: 3px solid var(--wp--preset--color--accent-3);
	padding: 0.15rem 0 0.25rem 1rem;
}

.mfj-who--teal {
	border-left-color: var(--wp--preset--color--accent-2);
}

.mfj-who--wine {
	border-left-color: var(--wp--preset--color--accent-1);
}

/* How we work: a numbered list */

.mfj-steps {
	border-bottom: 1px solid var(--wp--preset--color--sage);
}

.mfj-steps .mfj-step {
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr);
	column-gap: 0.75rem;
	padding-block: 1.1rem;
	margin-block: 0;
}

.mfj-steps .mfj-step + .mfj-step {
	border-top: 1px solid var(--wp--preset--color--sage);
}

.mfj-steps .mfj-step > * {
	grid-column: 2;
	margin-block: 0;
}

.mfj-steps .mfj-step > .mfj-step__num {
	grid-column: 1;
	grid-row: 1 / span 2;
	color: var(--wp--preset--color--accent-1);
	font-family: var(--wp--preset--font-family--source-serif);
	font-size: 1.45rem;
	line-height: 1.1;
}

.mfj-steps .mfj-step h3 {
	font-size: 1.1rem;
	margin-bottom: 0.3rem;
}

/* Pricing */

.mfj-prices {
	border-bottom: 1px solid var(--wp--preset--color--sage);
}

.mfj-prices .mfj-price {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.6rem var(--wp--preset--spacing--50);
	padding-block: 1.25rem;
	border-top: 1px solid var(--wp--preset--color--sage);
	margin-block: 0;
}

.mfj-prices .mfj-price > * {
	margin-block: 0;
}

@media (min-width: 782px) {
	.mfj-prices .mfj-price {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}
}

.mfj-price h3,
.mfj-price p {
	margin: 0;
}

.mfj-price h3 {
	color: var(--wp--preset--color--accent-2);
	font-size: 1.1rem;
}

.mfj-price__what p,
.mfj-price__cost p + p {
	font-size: 0.95rem;
	margin-top: 0.2rem;
}

.mfj-price__main {
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--source-serif);
	font-size: 1.2rem;
	font-weight: 700;
}

/* Why choose a local */

.mfj-why h3 {
	font-size: 1.05rem;
}

/* Contact: deep teal, light text, dark fields */

.mfj-contact-section h2 {
	color: var(--wp--preset--color--base);
}

.mfj-contact-section p {
	color: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
}

.mfj-contact {
	list-style: none;
	padding: 0;
	margin: var(--wp--preset--spacing--40) 0 0;
	max-width: 22rem;
}

.mfj-contact li {
	padding-block: 0.15rem;
}

.mfj-contact a {
	color: var(--wp--preset--color--base);
	text-decoration: none;
	display: block;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 70%, transparent);
}

.mfj-contact li:last-child a {
	display: inline;
	border-bottom: 0;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.mfj-contact a:hover {
	color: var(--wp--preset--color--sea-glass);
}

.mfj-form {
	display: grid;
	gap: 0.9rem;
}

.mfj-form p {
	margin: 0;
}

.mfj-form__field {
	display: grid;
	gap: 0.35rem;
}

.mfj-form label {
	color: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
	font-size: 0.92rem;
}

.mfj-form input,
.mfj-form select,
.mfj-form textarea {
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--base);
	background: color-mix(in srgb, var(--wp--preset--color--base) 9%, transparent);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--sea-glass) 45%, transparent);
	border-radius: 8px;
	padding: 0.7rem 0.8rem;
	width: 100%;
	box-sizing: border-box;
	color-scheme: dark;
}

.mfj-form select option {
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base);
}

.mfj-form textarea {
	resize: vertical;
}

.mfj-form [aria-invalid="true"] {
	border-color: #F2A7B8;
	box-shadow: 0 0 0 1px #F2A7B8;
}

.mfj-form__error {
	color: #F2A7B8;
	font-weight: 600;
}

.mfj-form__actions {
	display: grid;
	justify-items: start;
	gap: 0.9rem;
	margin-top: 0.4rem;
}

.mfj-form__actions .wp-element-button {
	border: 0;
	cursor: pointer;
}

.mfj-form__actions .wp-element-button:hover {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Spam trap: off screen for people, still in the form for bots. */
.mfj-form__hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mfj-contact-section .mfj-form__success {
	font-family: var(--wp--preset--font-family--source-serif);
	font-size: 1.3rem;
	line-height: 1.4;
	color: var(--wp--preset--color--base);
	border-left: 3px solid var(--wp--preset--color--sea-glass);
	padding: 0.4rem 0 0.4rem 1.1rem;
	outline: none;
}

.mfj-form__note {
	color: color-mix(in srgb, var(--wp--preset--color--base) 75%, transparent);
	font-size: 0.85rem;
}

/* Footer */

.mfj-footer p {
	margin: 0;
}
