/*
 * Referenssit: single Referenssi hero (templates/single-referenssi.html) and
 * the Näytöt työmailta cards (patterns/naytot-tyomailta.php).
 */

/* Single Referenssi: photo with the brand's 8px red top bar. */
.kt-referenssi-hero__image {
	border-top: var(--wp--preset--spacing--20) solid var(--wp--preset--color--red);
}

.kt-referenssi-hero .wp-block-post-title {
	line-height: 1;
}

.kt-referenssi-hero__location:empty {
	display: none;
}

/* Näytöt työmailta: header row (heading left, lead right, bottoms aligned). */
.kt-naytot__header {
	row-gap: var(--wp--preset--spacing--40);
}

.kt-naytot__header .wp-block-heading {
	line-height: 1.1;
}

.kt-naytot__header > p {
	margin: 0;
}

/* When the lead wraps under the heading, align it with the heading. */
@media (max-width: 781px) {

	.kt-naytot__header > p.has-text-align-right {
		text-align: left;
	}
}

.kt-naytot .wp-block-query {
	margin-block-start: var(--wp--preset--spacing--60);
}

/* Card: the whole card is the title link (one real <a>, stretched). */
.kt-referenssi-card {
	position: relative;
	height: 100%;
}

.kt-referenssi-card__title a {
	color: inherit;
	text-decoration: none;
}

.kt-referenssi-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.kt-referenssi-card:hover .kt-referenssi-card__title a {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15em;
}

.kt-referenssi-card:has(a:focus-visible) {
	outline: 3px solid var(--wp--preset--color--red);
	outline-offset: 6px;
}

.kt-referenssi-card__title a:focus-visible {
	outline: none;
}

/* Photo: 8px red top bar, 3:2, mild dark overlay, location centred on top. */
.kt-referenssi-card__media {
	position: relative;
	overflow: hidden;
	border-top: var(--wp--preset--spacing--20) solid var(--wp--preset--color--red);
	background-color: var(--wp--preset--color--near-black);
}

.kt-referenssi-card__media .wp-block-post-featured-image {
	margin: 0;
}

.kt-referenssi-card__media .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	transition: transform 0.4s ease;
}

.kt-referenssi-card:hover .kt-referenssi-card__media img {
	transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {

	.kt-referenssi-card__media .wp-block-post-featured-image img {
		transition: none;
	}

	.kt-referenssi-card:hover .kt-referenssi-card__media img {
		transform: none;
	}
}

.kt-referenssi-card__media::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgb(0 0 0 / 0.25);
	pointer-events: none;
}

.kt-referenssi-card__media > .wp-block-post-featured-image:empty,
.kt-referenssi-card__media:not(:has(img)) {
	aspect-ratio: 3 / 2;
}

.kt-referenssi-card__location.kt-referenssi-card__location {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	line-height: 1;
	text-transform: uppercase;
	text-shadow: 0 2px 12px rgb(0 0 0 / 0.6);
}

/* Below the photo: Palvelu label, title, bullet list. */
.kt-referenssi-card__palvelu {
	margin-block: var(--wp--preset--spacing--40) 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--mono-sm);
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.kt-referenssi-card__palvelu:empty {
	display: none;
}

.kt-referenssi-card__title.kt-referenssi-card__title {
	margin-block: var(--wp--preset--spacing--40) 0;
	line-height: 1.05;
}

.kt-referenssi-card__bullets.kt-referenssi-card__bullets {
	margin-block-start: var(--wp--preset--spacing--30);
	line-height: 1.4;
}

.kt-referenssi-card__bullets ul {
	margin: 0;
	padding-inline-start: 1.6em;
	list-style-type: disc;
}
