/*
 * Heroes (patterns/hero-etusivu.php, hero-inner.php, hero-yhteystiedot.php).
 *
 * The photo heroes are core Cover blocks with the class `kt-hero`; as the
 * first block of a page the header is laid over them (header.css), so they
 * reserve var(--kt-header-height) at the top. The dark treatment is CSS: a
 * solid-black-to-transparent gradient from the left plus an overall dim, so
 * any plain colour photo works.
 */

.kt-hero.wp-block-cover {
	align-items: flex-start;
	min-height: 0;
	padding-block: calc(var(--kt-header-height) + var(--wp--preset--spacing--60)) var(--wp--preset--spacing--80);
	padding-inline: var(--wp--style--root--padding-left, 16px) var(--wp--style--root--padding-right, 16px);
	background-color: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
}

.kt-hero.wp-block-cover::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;

	/* As in the mockups: dark behind the heading, the photo shows from
	   about a third of the width. */
	background: linear-gradient(90deg, rgb(0 0 0 / 95%) 0%, rgb(0 0 0 / 88%) 22%, rgb(0 0 0 / 50%) 36%, rgb(0 0 0 / 20%) 55%, rgb(0 0 0 / 10%) 100%);
}

.kt-hero .wp-block-cover__inner-container {
	z-index: 2;
}

.kt-hero .wp-block-cover__inner-container > * {
	margin-block: 0;
}

/* Etusivu: tall, roughly a viewport (1170px at 1440). */
.kt-hero--etusivu.wp-block-cover {
	min-height: min(100svh, 1170px);
}

.kt-hero--etusivu .wp-block-cover__inner-container > .kt-hero__heading {
	margin-block-start: var(--wp--preset--spacing--40);
	line-height: 0.9;
}

/* "HYVÄ TYÖ ALKAA": the heading's first line, Display 2XL in off-white.
   !important: the font-size preset class on the heading is !important and
   would otherwise win over the pseudo-element in Chromium. */
.kt-hero--etusivu .kt-hero__heading::first-line {
	color: var(--wp--preset--color--off-white);
	font-size: var(--wp--preset--font-size--display-2-xl) !important;
	line-height: 1.25;
}

.kt-hero .kt-hero__lead {
	max-width: 52rem;
	margin-block-start: var(--wp--preset--spacing--60);
	line-height: 1.45;
}

.kt-hero .kt-hero__actions {
	margin-block-start: var(--wp--preset--spacing--80);
}

/* Inner pages (Urakointi, Kaivuutuet, Yritys): about half a viewport. */
.kt-hero--inner.wp-block-cover {
	min-height: min(70svh, 740px);
	padding-block-end: var(--wp--preset--spacing--90);
}

.kt-hero--inner .wp-block-cover__inner-container > .kt-hero__heading {
	margin-block-start: var(--wp--preset--spacing--40);
	line-height: 0.9;
}

.kt-hero--inner .kt-hero__lead {
	margin-block-start: var(--wp--preset--spacing--60);
}

/* Narrow screens: the photo shows on the right, text keeps a dark ground. */
@media (max-width: 781px) {

	.kt-hero.wp-block-cover::before {
		background: linear-gradient(180deg, rgb(0 0 0 / 70%) 0%, rgb(0 0 0 / 82%) 100%);
	}
}

/* Yhteystiedot: short, solid near-black, no photo; the header stays a solid
   bar above it (no `kt-hero` class). */
.kt-hero-solid.wp-block-group > * {
	margin-block: 0;
}

.kt-hero-solid .kt-hero__heading {
	margin-block-start: var(--wp--preset--spacing--40);
	line-height: 1;
}

/* Primary button with the long arrow (hero "Ota yhteyttä"). */
.kt-arrow-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--40);
	box-sizing: border-box;
}

@media (min-width: 600px) {

	.kt-arrow-button .wp-block-button__link {
		min-width: 434px;
	}
}

.kt-arrow-button .wp-block-button__link::after {
	content: "";
	flex: none;
	width: 40px;
	height: 16px;
	background-color: currentcolor;
	mask: url(../images/arrow.svg) center / contain no-repeat;
}
