/*
 * Reapit Base: shared treatments that theme.json cannot express (hero overlay, hero search card, eyebrows, wave
 * separator, paragraph measure, listing-card hierarchy, footer rhythm). Tokens only; brand deltas live in variation-*.css.
 */
@layer reapit.base, reapit.blocks, reapit.variation;

/* ---- hero cover: gradient overlay from the brand token instead of a flat dim ---- */
.wp-block-cover.reapit-hero > .wp-block-cover__background.has-background-dim {
	background-color: transparent !important; /* the preset class is !important */
	background-image: var(--wp--custom--hero--gradient);
	opacity: 1;
}
.wp-block-cover.reapit-hero {
	isolation: isolate;
}
.wp-block-cover.reapit-hero > .wp-block-cover__inner-container {
	width: 100%;
}
/* Full-width page banners with left-set copy: the heading sits on the wide content edge, never closer than a
   comfortable inset to the photo's edge (it landed 16-20 px from the viewport). Stone's hero positions its own copy. */
.wp-block-cover.alignfull.has-custom-content-position.is-position-center-left:not(.reapit-stone-hero) > .wp-block-cover__inner-container {
	box-sizing: border-box;
	padding-inline: max(var(--wp--preset--spacing--40), calc((100% - var(--wp--style--global--wide-size)) / 2));
}

/* ---- hero search card: white surface on the photo, brand radius, soft shadow ---- */
.reapit-hero-search {
	border-radius: var(--wp--custom--hero--search-radius);
	box-shadow: var(--wp--custom--hero--search-shadow);
}
.reapit-hero-search .wp-block-reapit-search-form {
	--reapit-radius-input: var(--wp--custom--hero--search-radius);
}

/* ---- eyebrow: the small lead-in above a section heading; per-brand tokens ---- */
p.reapit-eyebrow {
	margin: 0 0 var(--wp--preset--spacing--10);
	font-family: var(--wp--custom--eyebrow--font-family);
	font-style: var(--wp--custom--eyebrow--font-style);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: var(--wp--custom--eyebrow--letter-spacing);
	text-transform: var(--wp--custom--eyebrow--transform);
	color: var(--wp--custom--eyebrow--color);
}
p.reapit-eyebrow + h1,
p.reapit-eyebrow + h2,
p.reapit-eyebrow + h3 {
	margin-top: 0;
}
.has-primary-background-color p.reapit-eyebrow,
.has-footer-bg-background-color p.reapit-eyebrow {
	color: var(--wp--preset--color--accent);
}

/* ---- wave separator (Swell shoreline motif); colour is the text colour of the separator ---- */
.wp-block-separator.is-style-wave {
	width: auto; /* with alignfull's negative inline margins it bleeds to both viewport edges */
	max-width: none;
	height: 2rem;
	position: relative;
	z-index: 1;
	margin-top: 0;
	margin-bottom: 0;
	border: 0;
	transform: translateY(2px); /* overlaps the band below so no sub-pixel seam shows (the block prints inline margins) */
	background: currentColor;
	opacity: 1;
	mask: url("../images/motifs/wave.svg") center bottom / 100% 100% no-repeat;
	-webkit-mask: url("../images/motifs/wave.svg") center bottom / 100% 100% no-repeat;
}
/* The wave is the top edge of the band after it: no block gap between them. */
.wp-block-separator.is-style-wave + * {
	margin-block-start: 0 !important;
}

/* ---- section intros: in a band that holds wide content (a grid, slider, map, form), left-aligned intro copy starts
   at the wide edge instead of each element centring at its own measure (eyebrow, h2 and p landed at three x positions).
   Core centres constrained children with !important margins. Stone's copy bands and titles keep their own rules. ---- */
.is-layout-constrained:not(.is-content-justification-left, .is-content-justification-right, .reapit-stone-copy):has(> .alignwide) > :is(p, h1, h2, h3, .wp-block-buttons):not(.has-text-align-center, .has-text-align-right, .is-content-justification-center, .is-content-justification-right, .alignwide, .alignfull, .reapit-stone-title) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
	margin-right: auto !important;
}
/* Without wide content the shared edge is the content column's: a 72ch paragraph or a 36rem eyebrow starts where the
   heading starts instead of centring on its own narrower measure. */
.is-layout-constrained:not(.is-content-justification-left, .is-content-justification-right, .reapit-stone-copy):not(:has(> .alignwide)) > :is(p, h1, h2, h3, .wp-block-buttons):not(.has-text-align-center, .has-text-align-right, .is-content-justification-center, .is-content-justification-right, .alignwide, .alignfull, .reapit-stone-title) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
	margin-right: auto !important;
}

/* ---- logos-only social icons take the surrounding text colour, not vendor blue/pink/red on brand bands (an explicit
   icon colour chosen in the editor still wins) ---- */
.wp-block-social-links.is-style-logos-only:not(.has-icon-color) .wp-social-link {
	color: inherit;
}
.wp-block-social-links.is-style-logos-only:not(.has-icon-color) .wp-social-link:hover {
	opacity: 0.75;
}

/* ---- a band whose case-studies block rendered empty hides (the platform prints a hidden .is-empty marker; its
   reapit-ui.css rule covers any direct parent group, this one the pattern's band wherever the block sits) ---- */
.reapit-case-study-band:has(.wp-block-reapit-case-studies.is-empty) {
	display: none;
}

/* ---- bound fields with no value (e.g. an office without a phone) leave no empty gap ---- */
p.wp-block-paragraph:empty {
	display: none;
}

/* ---- measure: body copy never runs past ~72 characters ---- */
.wp-site-blocks .wp-block-post-content p:not(.has-text-align-center):not(.has-text-align-right) {
	max-width: min(100%, 72ch);
}
.wp-site-blocks .wp-block-post-content p.has-text-align-center {
	max-width: min(100%, 64ch);
	margin-inline: auto;
}
.wp-block-columns p,
.wp-block-cover p {
	max-width: min(100%, 56ch);
}

/* ---- section rhythm: a heading directly followed by a collection gets breathing room ---- */
.wp-block-post-content > .wp-block-group > h2.wp-block-heading + :is(.wp-block-reapit-listing-collection, .wp-block-reapit-cta-grid, .wp-block-reapit-agent-cards, .wp-block-reapit-testimonials, .wp-block-query) {
	margin-top: var(--wp--preset--spacing--40);
}
.wp-block-post-content > .wp-block-group > h2.wp-block-heading + p + :is(.wp-block-reapit-listing-collection, .wp-block-reapit-cta-grid, .wp-block-reapit-agent-cards, .wp-block-reapit-testimonials, .wp-block-query) {
	margin-top: var(--wp--preset--spacing--40);
}

/* ---- listing cards: price leads, address second, suburb quiet ---- */
.reapit-card__price {
	font-size: var(--wp--preset--font-size--medium);
	letter-spacing: 0.01em;
}
.reapit-card__suburb {
	letter-spacing: 0.02em;
}
.reapit-card__body {
	gap: 0.25em;
}
.reapit-badge {
	font-weight: 500;
}

/* ---- team cards ---- */
.reapit-agent__name {
	font-family: var(--wp--preset--font-family--heading);
}
.reapit-agent__photo {
	overflow: hidden;
}

/* ---- footer ---- */
.wp-site-blocks > footer .wp-block-heading.has-medium-font-size {
	font-family: var(--wp--custom--eyebrow--font-family);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.85;
}
.wp-site-blocks > footer .reapit-nav-footer {
	gap: 0.4em;
}
.wp-site-blocks > footer .reapit-nav-footer a {
	opacity: 0.85;
}
.wp-site-blocks > footer .reapit-nav-footer a:hover {
	opacity: 1;
}

/* ---- narrow screens: hero search stacks, card corners soften, page anchors scroll in one row ---- */
@media (max-width: 40em) {
	.wp-block-buttons.reapit-page-anchors {
		flex-wrap: nowrap;
		max-width: 100%;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.wp-block-buttons.reapit-page-anchors .wp-block-button__link {
		padding: 0.45em 1em;
		font-size: var(--wp--preset--font-size--small);
		white-space: nowrap;
	}
	.reapit-hero-search {
		border-radius: var(--wp--custom--radius--card);
	}
	.reapit-hero-search .wp-block-reapit-search-form {
		--reapit-radius-input: var(--wp--custom--radius--card);
	}
}
