/*
 * Always full-bleed, like every other section block. The heading sits in
 * its own row above the grid; the intro text and button now live together
 * in a flex-end footer row below the grid instead of beside the heading.
 *
 * Defaults to white; editable via the block's own "Background color" panel
 * (supports.color.background in block.json) — picking any theme.json
 * palette color there (e.g. surface-strong, to match this section's own
 * original Figma instance) overrides this via WordPress's own inline
 * style, which always wins over this external stylesheet rule.
 *
 * Heading color (#002547) is the design's ink/navy "text-primary" — not yet
 * part of theme.json's palette (see square-card/style.css).
 */
.wp-block-andrei-saguna-linking-cards-section {
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--4);
	background-color: var(--wp--preset--color--base-white);
}

h2.wp-block-andrei-saguna-linking-cards-section__heading {
	width: 100%;
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto var(--wp--preset--spacing--12);
	font-family: var(--wp--preset--font-family--ivypresto-headline);
	font-size: var(--wp--preset--font-size--h-1);
	line-height: 1.1;
	color: #002547;
}

/*
 * Footer row holding the intro text and button together, below the grid.
 * flex-end on both axes: items bottom-align with each other, and the whole
 * row hugs the end (right) edge of the content column.
 */
.wp-block-andrei-saguna-linking-cards-section__footer {
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--4);
	width: 100%;
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
	margin-top: var(--wp--preset--spacing--8);
}

.wp-block-andrei-saguna-linking-cards-section__intro {
	flex: 0 0 424px;
	width: 424px;
}

.wp-block-andrei-saguna-linking-cards-section__text {
	margin: 0;
	font-family: var(--wp--preset--font-family--neue-haas-grotesk);
	font-size: var(--wp--preset--font-size--body-base);
	line-height: 1.5;
	color: #3f4a5a;
}

.wp-block-andrei-saguna-linking-cards-section__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--6);
	width: 100%;
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
}

/*
 * Reimplements theme.json's core/button style variations (styles.blocks
 * ["core/button"].variations) by hand, scoped to this block only. Necessary
 * because those variations DON'T actually apply via their plain
 * "is-style-X" class name at all — WordPress compiles each one to a
 * runtime-suffixed selector instead (e.g. ".is-style-big-primary--7", the
 * "--7" regenerated per page based on which blocks/styles actually appear
 * on it), and only that suffixed class carries the real background/color/
 * border/padding. The theme's own style.css candidly documents this split
 * ("Base color/spacing/border live in theme.json... this block only adds
 * what theme.json's variation schema can't express") - which is exactly
 * why a hand-rendered button using the plain, unsuffixed class name (this
 * block was never going to guess the runtime suffix) picked up NONE of a
 * variation's actual look, just style.css's flex-centering/hover extras.
 * Values below are copied 1:1 from theme.json so switching styles here
 * looks identical to picking the same style on a real core/button block.
 */
.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-big-primary .wp-block-button__link,
.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-small-primary .wp-block-button__link {
	background-color: var(--wp--preset--color--accent-500);
	color: var(--wp--preset--color--base-white);
	border-radius: var(--wp--custom--radius--md);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-big-primary .wp-block-button__link {
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--6);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-small-primary .wp-block-button__link {
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-big-secondary .wp-block-button__link,
.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-small-secondary .wp-block-button__link {
	background-color: var(--wp--preset--color--base-white);
	color: #002547;
	border: 1.5px solid #002547;
	border-radius: var(--wp--custom--radius--md);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-big-secondary .wp-block-button__link {
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--6);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-small-secondary .wp-block-button__link {
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-big-outline .wp-block-button__link,
.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-small-outline .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--base-white);
	border: 1.5px solid var(--wp--preset--color--border-on-image);
	border-radius: var(--wp--custom--radius--md);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-big-outline .wp-block-button__link {
	padding: var(--wp--preset--spacing--3) var(--wp--preset--spacing--6);
}

.wp-block-andrei-saguna-linking-cards-section__footer .wp-block-button.is-style-small-outline .wp-block-button__link {
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
}

@media (max-width: 767px) {
	.wp-block-andrei-saguna-linking-cards-section__footer {
		flex-direction: column;
		align-items: stretch;
		gap: var(--wp--preset--spacing--4);
		margin-top: var(--wp--preset--spacing--8);
	}

	.wp-block-andrei-saguna-linking-cards-section__intro {
		flex: 1 1 100%;
		width: 100%;
	}

	.wp-block-andrei-saguna-linking-cards-section__grid {
		grid-template-columns: 1fr;
	}
}
