/* PAGE-2: page title on an image. The Cover block is the section itself. */

/*
 * As in HERO-2: the Cover keeps the vertical padding of a title bar and takes
 * the side padding of the page, so its text lines up with every other section.
 * Text on a photograph uses the strongest text colour of the colour style.
 */
.wprk-page-2.wp-block-cover {
	color: var(--wprk-heading);
	/* About two fifths of the screen, within fixed limits, so it is neither a strip nor a hero. */
	min-height: clamp(16rem, 40vh, 26rem);
	padding-block: var(--wp--preset--spacing--60);
	padding-left: var(--wp--style--root--padding-left, clamp(1rem, 4vw, 2rem));
	padding-right: var(--wp--style--root--padding-right, clamp(1rem, 4vw, 2rem));
}

.wprk-page-2 > .wp-block-cover__inner-container {
	padding-inline: 0;
}

/*
 * The overlay takes the background of the colour style, so light and tinted
 * stay readable as well. An overlay colour chosen by hand is left alone.
 */
.wprk-page-2 > .wp-block-cover__background.has-dark-background-color {
	background-color: var(--wprk-bg) !important;
}

/*
 * A second, graded layer: the picture is covered more on the side where the
 * words are and less on the other, so the text stays readable and the
 * photograph can still be seen. The stops are lengths measured from where the
 * text starts, so on a phone the dense part covers the whole width.
 */
.wprk-page-2.wp-block-cover::before {
	--wprk-page-2-start: max(0px, (100% - var(--wp--style--global--wide-size)) / 2);
	background-image: linear-gradient(
		90deg,
		color-mix(in srgb, var(--wprk-bg) 50%, transparent) var(--wprk-page-2-start),
		color-mix(in srgb, var(--wprk-bg) 35%, transparent) calc(var(--wprk-page-2-start) + 30rem),
		color-mix(in srgb, var(--wprk-bg) 15%, transparent) calc(var(--wprk-page-2-start) + 48rem),
		transparent calc(var(--wprk-page-2-start) + 70rem)
	);
	content: "";
	inset: 0;
	opacity: 1;
	pointer-events: none;
	position: absolute;
	z-index: 1;
}

.rtl .wprk-page-2.wp-block-cover::before {
	transform: scaleX(-1);
}

/*
 * The order of the layers, bottom to top: picture, the two overlays, text.
 * WordPress leaves it to the order in the markup, which the graded layer is
 * not part of, so it is spelled out here and kept inside the section.
 */
.wprk-page-2.wp-block-cover {
	isolation: isolate;
}

.wprk-page-2 > .wp-block-cover__image-background,
.wprk-page-2 > .wp-block-cover__video-background {
	z-index: 0;
}

.wprk-page-2 > .wp-block-cover__background {
	z-index: 1;
}

.wprk-page-2 > .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
}

.wprk-page-2 .wprk-page-2__inner {
	margin-inline: auto;
	max-width: var(--wp--style--global--wide-size);
}

/* A short accent rule above the text, as in HERO-2. */
.wprk-page-2 .wprk-page-2__inner::before {
	background-color: var(--wprk-accent);
	content: "";
	display: block;
	height: 2px;
	margin-block-end: var(--wp--preset--spacing--30);
	width: 3rem;
}

.wprk-page-2 .wprk-page-2__inner > * {
	margin-block: 0;
}

.wprk-page-2 .wprk-page-2__inner > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

.wprk-page-2 .wp-block-breadcrumbs {
	color: inherit;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
}

/*
 * Every crumb is a tap target 2.75rem high. The negative margin gives the
 * extra height back, so the crumbs take the room of one line of small text.
 */
.wprk-page-2 .wprk-page-2__inner > .wp-block-breadcrumbs {
	margin-block: calc((1.6em - 2.75rem) / 2);
}

.wprk-page-2 .wp-block-breadcrumbs :where(li) {
	min-height: 2.75rem;
}

.wprk-page-2 .wp-block-breadcrumbs :where(a) {
	align-items: center;
	align-self: stretch;
	display: flex;
}

/* Crumb links take the text colour too; the underline marks them as links. */
.wprk-page-2 .wp-block-breadcrumbs a {
	color: inherit;
}

.wprk-page-2 :where(h1) {
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.15;
	max-width: 22em;
}

.wprk-page-2 .wprk-page-2__inner > .wprk-lead {
	color: inherit;
	margin-block-start: var(--wp--preset--spacing--30);
	max-width: 40rem;
}
