/*
 * Reveal on scroll: the parts of each page section (heading row, grid, footer
 * row) and the cells of core grids fade and rise into place as they enter the
 * screen. CSS scroll-driven animation, no script: browsers without it, and
 * visitors who prefer reduced motion, see the content at once.
 *
 * The first section (hero, catalog speed tiles) is never animated: its lower
 * parts sit at the screen edge on load and would stay half transparent.
 */
@keyframes gms-reveal {

	from {
		opacity: 0;
		translate: 0 var(--wp--custom--motion--distance);
	}
}

@media screen and (prefers-reduced-motion: no-preference) {

	@supports (animation-timeline: view()) {

		/*
		 * Parts of a section, and the cells of its grids. A "Bordered grid"
		 * enters as a whole: its dividers are the grid background showing
		 * through 1px gaps, so a cell moving on its own would bare it.
		 */
		.site-main section.alignfull:not(:first-of-type) > .alignwide:not(.wp-block-group-is-layout-grid),
		.site-main section.alignfull:not(:first-of-type) > .is-style-bordered-grid,
		.site-main section.alignfull:not(:first-of-type) > .wp-block-group-is-layout-grid:not(.is-style-bordered-grid) > * {
			animation: gms-reveal linear both;
			animation-timeline: view();
			animation-range: entry 5% cover 30%;
		}
	}
}

/*
 * Group style "Card": translucent card with a light-blue border, readable on
 * dark and light sections.
 */
.wp-block-group.is-style-card {
	box-sizing: border-box;
	padding: 1.375rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 22%, transparent);
	border-radius: 14px;
	background-color: color-mix(in srgb, currentcolor 4%, transparent);
}

/*
 * Group style "Bordered grid": cells inside one rounded frame with hairline
 * dividers. The 1px gap shows the frame color between white cells, so dividers
 * need no extra markup.
 */
.wp-block-group.is-style-bordered-grid {
	gap: 1px;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--line);
}

.is-style-bordered-grid > * {
	margin: 0;
	background: var(--wp--preset--color--base);
}

/*
 * Group style "Grid pattern": faint blueprint grid over the section background
 * color.
 */
.wp-block-group.is-style-grid-pattern {
	background-image:
		linear-gradient(color-mix(in srgb, var(--wp--preset--color--accent) 6%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in srgb, var(--wp--preset--color--accent) 6%, transparent) 1px, transparent 1px);
	background-size: 56px 56px;
}

/*
 * Group style "Steps": translucent step cards on a dark section with round
 * arrow connectors between them (hidden on phones). A card with a background
 * color is the highlighted step.
 */
.is-style-steps > .wp-block-group {
	position: relative;
	box-sizing: border-box;
	gap: var(--wp--preset--spacing--30);
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 18%, transparent);
	border-radius: var(--wp--preset--border-radius--lg);
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 3%, transparent);
}

.is-style-steps > .wp-block-group.has-background {
	border-color: transparent;
}

.is-style-steps > .wp-block-group > * {
	margin: 0;
}

.is-style-steps > .wp-block-group:not(:last-child)::before,
.is-style-steps > .wp-block-group:not(:last-child)::after {
	content: "";
	position: absolute;
	z-index: 1;
}

/* Connector circle, centered in the gap next to the icon row. */
.is-style-steps > .wp-block-group:not(:last-child)::before {
	top: calc(var(--wp--preset--spacing--40) + 12px);
	right: calc(var(--wp--preset--spacing--30) / -2 - 14px);
	box-sizing: border-box;
	width: 28px;
	height: 28px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 40%, transparent);
	border-radius: 50%;
	background-color: var(--wp--preset--color--navy-900);
}

.is-style-steps > .wp-block-group:not(:last-child)::after {
	top: calc(var(--wp--preset--spacing--40) + 20px);
	right: calc(var(--wp--preset--spacing--30) / -2 - 6px);
	width: 12px;
	height: 12px;
	background-color: var(--wp--preset--color--accent);
	mask: url(../../icons/arrow-right.svg) center / contain no-repeat;
}

@media (max-width: 699.98px) {

	.is-style-steps > .wp-block-group::before,
	.is-style-steps > .wp-block-group::after {
		display: none;
	}
}

/*
 * Group style "Figures row": key figures separated by thin lines (hero). The
 * child selectors are needed because the figures are core groups without
 * classes of their own.
 */
.wp-block-group.is-style-stats {
	gap: 0;
	border-top: 1px solid color-mix(in srgb, currentcolor 14%, transparent);
}

.is-style-stats > .wp-block-group {
	gap: 0.375rem;
	padding: 1.75rem var(--wp--preset--spacing--40) 0;
	border-left: 1px solid color-mix(in srgb, currentcolor 14%, transparent);
}

.is-style-stats > .wp-block-group:first-child {
	padding-left: 0;
	border-left: 0;
}

.is-style-stats > .wp-block-group > p {
	margin: 0;
}

@media (max-width: 699.98px) {

	.is-style-stats > .wp-block-group {
		padding: var(--wp--preset--spacing--40) 0;
		border-left: 0;
		border-top: 1px solid color-mix(in srgb, currentcolor 14%, transparent);
	}

	.is-style-stats > .wp-block-group:first-child {
		border-top: 0;
	}
}

/*
 * Group style "Dot pattern": faint dot grid with a soft glow on the right (dark
 * sections).
 */
.wp-block-group.is-style-dots {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.wp-block-group.is-style-dots::before,
.wp-block-group.is-style-dots::after {
	content: "";
	position: absolute;
	z-index: -1;
	pointer-events: none;
}

.wp-block-group.is-style-dots::before {
	inset: 0;
	background-image: radial-gradient(color-mix(in srgb, var(--wp--preset--color--accent) 16%, transparent) 1px, transparent 1.2px);
	background-size: 22px 22px;
}

.wp-block-group.is-style-dots::after {
	top: -40%;
	right: -10%;
	width: 60%;
	height: 160%;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--wp--preset--color--primary) 32%, transparent), transparent);
}

/*
 * Group style "Timeline": the child groups are milestones on a vertical line,
 * each with a ring; the last one (the current milestone) has a filled dot.
 * Year, title and text are the children of each milestone group.
 */
.wp-block-group.is-style-timeline {
	position: relative;
	padding-left: 44px;
}

.wp-block-group.is-style-timeline::before {
	content: "";
	position: absolute;
	top: 10px;
	bottom: 10px;
	left: 10px;
	width: 2px;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 25%, transparent);
}

.is-style-timeline > .wp-block-group {
	position: relative;
	margin: 0;
}

.is-style-timeline > .wp-block-group > * {
	margin: 0;
}

.is-style-timeline > .wp-block-group::before {
	content: "";
	position: absolute;
	top: 0;
	left: -44px;
	box-sizing: border-box;
	width: 22px;
	height: 22px;
	border: 2px solid var(--wp--preset--color--primary);
	border-radius: 50%;
	background: var(--wp--preset--color--base);
}

.is-style-timeline > .wp-block-group:last-child::before {
	background: var(--wp--preset--color--primary);
}
