.wp-block-button.grave-home-scroll .wp-block-button__link.wp-element-button {
	--grave-btn-icon-size: var(--wp--preset--spacing--40);
	--grave-btn-icon-only-padding: var(--wp--preset--spacing--25);

	background-color: transparent;
	color: var(--wp--preset--color--surface);
}

.wp-block-button.grave-home-scroll .wp-block-button__link:focus-visible {
	outline: calc(var(--wp--custom--border--width) * 2) solid var(--wp--preset--color--surface);
	outline-offset: 0.25rem;
}

.wp-block-button.grave-home-scroll .wp-block-button__link:active {
	color: var(--wp--preset--color--primary-soft);
}

@media (hover: hover) and (pointer: fine) {
	.wp-block-button.grave-home-scroll .wp-block-button__link:hover {
		color: var(--wp--preset--color--primary-soft);
	}

	.wp-block-button.grave-home-scroll .wp-block-button__link:hover::after {
		animation-play-state: paused;
	}
}

.wp-block-button.grave-home-scroll .wp-block-button__link:focus-visible::after {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-button.grave-home-scroll .wp-block-button__link::after {
		animation: grave-home-scroll-cue calc(var(--wp--custom--motion--duration--base) * 5) var(--wp--custom--motion--easing-in-out);
		animation-delay: var(--wp--custom--motion--delay--hero-cta);
		animation-iteration-count: infinite;
	}
}

@keyframes grave-home-scroll-cue {
	0%, 100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(0.25rem);
	}
}

.grave-besoin {
	scroll-margin-block-start: calc(var(--wp--custom--header--content-inset) + var(--wp-admin--admin-bar--height, 0px));
}

/* The wrapper is the query container rather than the grid it holds: `alignwide` carries its own
   `max-width` at a specificity this file cannot outrank, so the measure sits one level down. */
.grave-besoin__rows {
	container-type: inline-size;
}

.grave-besoin__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--30);
	max-width: var(--wp--custom--home--entry-rows-measure);
	margin-inline: auto;
}

.wp-block-group.grave-besoin__rows > *,
.wp-block-group.grave-besoin__grid > * {
	margin-block: 0;
}

@container (width > 44rem) {
	.grave-besoin__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* The section is the query container, so the cards follow the band they sit in rather than the
   viewport, and keep their count when the page is composed inside a narrower shell. */
.grave-home-services {
	container-type: inline-size;
}

/* Core gives the grid's children a block margin that would fight the grid tracks. Its
   `.wp-container-… > * + *` rule ties on specificity, so the reset needs the extra class to win.
   The section itself keeps its margins: they are its block gap. */
.wp-block-group.grave-home-services__grid > * {
	margin: 0;
}

.grave-home-services__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
}

.grave-home-services .grave-controle-media-card__text > .wp-block-heading {
	color: var(--wp--preset--color--fg-dark);
}

.grave-home-services .grave-controle-media-card__panel > .wp-block-buttons {
	flex: none;
	margin: 0;
}

.grave-home-services__button .wp-block-button__link {
	--grave-btn-icon-size: 1rem;
	--grave-btn-icon-only-padding: var(--wp--preset--spacing--30);

	border-radius: var(--wp--custom--radius--sm);
}

.grave-home-services .grave-controle-media-card:has(.grave-home-services__button .wp-block-button__link:focus-visible) {
	outline: auto;
}

.grave-home-services__button .wp-block-button__link:focus-visible {
	background-color: var(--wp--custom--button--secondary--background-hover);
	outline: none;
}

.grave-home-section-heading.is-motion-ready {
	opacity: 0;
	transform: translateY(var(--wp--preset--spacing--25));
	transition:
		opacity var(--wp--custom--motion--duration--base) var(--wp--custom--motion--easing--out),
		transform var(--wp--custom--motion--duration--base) var(--wp--custom--motion--easing--out);
}

.grave-home-section-heading.is-motion-ready.is-motion-visible {
	opacity: 1;
	transform: translateY(0);
}

.grave-besoin .grave-link-card:has(.grave-link-card__label a:active) .wp-block-grave-icon.is-style-chip {
	background-color: var(--wp--preset--color--primary-highlight);
}

@media (prefers-reduced-motion: no-preference) {
	.grave-besoin .grave-link-row.grave-link-card:has(.grave-link-card__label a:active) {
		transition-timing-function: var(--wp--custom--motion--easing--out);
	}

	.grave-besoin .grave-link-row.grave-link-card:has(.grave-link-card__label a:active) {
		transform: scale(0.98);
	}
}

@media (prefers-reduced-motion: reduce) {
	.grave-home-section-heading.is-motion-ready {
		transform: none;
		transition: opacity var(--wp--custom--motion--duration--fast) var(--wp--custom--motion--easing--out);
	}
}

/* Container conditions cannot resolve theme custom properties, so these structural thresholds
   stay font-relative while every visual value continues to come from theme.json. They break
   earlier than the contrôle grid's 48rem and 72rem: this grid ends on four columns, and at a
   tablet width the section is about 43rem, where a single column would draw a 700px square. */
@container (width <= 40rem) {
	.grave-home-services__grid .grave-controle-media-card__text > p {
		-webkit-line-clamp: unset;
	}
}

@container (width > 40rem) {
	.grave-home-services__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	@supports (grid-template-rows: subgrid) {
		.grave-home-services__grid {
			grid-auto-rows: auto max-content;
		}

		.grave-home-services__grid > .grave-controle-media-card {
			grid-row: span 2;
			grid-template-rows: subgrid;
			row-gap: 0;
		}

		.grave-home-services__grid > .grave-controle-media-card::before {
			content: "";
			grid-area: 1 / 1 / -1;
			aspect-ratio: 1;
			margin: calc(-1 * var(--wp--preset--spacing--25));
		}

		.grave-home-services__grid .grave-controle-media-card__panel {
			grid-area: 2 / 1;
		}
	}
}

@container (width > 64rem) {
	.grave-home-services__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
