/* loovl-lasit-ennen-jalkeen (restyling.fi, 09.11.2026): before/after blocks of window tinting.
 * The «after» photo is the base, the «before» layer lies on it and is cut at the line (--le-jako, set by le.js).
 * Two blocks side by side from 700 px of room (container query), one under the other below.
 * Text colours - the theme variables (--rp-*), so light and dark themes both work.
 * Sibling of loovl-valot-ennen-jalkeen (ve.css), without the car switch; the frame here is 3:2. */

.loovl-le {
	container-type: inline-size;
}

/* Edges as the intro text of the page (Esiteksti): the page itself gives 30 px at the sides, the row is 1200 px. */
.loovl-le--palvelu .loovl-le__sisus {
	max-width: 1200px;
	margin: 0 auto;
	padding: 56px 0 64px;
}

/* In an article the section is the first thing under the title and the date, the contents list follows. */
.loovl-le--artikkeli {
	margin: 0 0 36px;
}

body .loovl-le .loovl-le__otsikko {
	margin: 0 0 24px;
	color: var(--rp-otsikko, #171a20);
	font-family: var(--rp-fontti, inherit);
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
}

.loovl-le__lohkot {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
}

@container (min-width: 700px) {
	.loovl-le__lohkot {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px;
	}
}

body .loovl-le p.loovl-le__nimi {
	margin: 0 0 12px;
	padding: 0;
	color: var(--rp-otsikko, #171a20);
	font-family: var(--rp-fontti, inherit);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

/* The frame: 3:2, the photos absolute inside (Safari does not apply percent heights in an aspect-ratio frame,
 * an absolute block works everywhere - frontend rule of 04.11.2026). */
.loovl-le__kuva {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	border-radius: 12px;
	background: #0c0c0e;
}

.loovl-le__kuva img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.loovl-le__ennen {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc(100% - var(--le-jako, 50%)) 0 0);
}

.loovl-le__ennen[hidden],
.loovl-le__merkki[hidden],
.loovl-le__liuku[hidden] {
	display: none;
}

.loovl-le__merkki {
	position: absolute;
	z-index: 2;
	top: 12px;
	padding: 4px 10px;
	border-radius: 20px;
	background: rgba(12, 12, 14, .62);
	color: #fff;
	font-family: var(--rp-fontti, inherit);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .06em;
	text-transform: uppercase;
	pointer-events: none;
}

.loovl-le__merkki--ennen {
	left: 12px;
}

.loovl-le__merkki--jalkeen {
	right: 12px;
}

/* The whole frame takes the drag; a finger moving up or down scrolls the page (touch-action: pan-y). */
.loovl-le__liuku {
	position: absolute;
	z-index: 3;
	inset: 0;
	outline: 0;
	cursor: ew-resize;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.loovl-le__viiva {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--le-jako, 50%);
	width: 2px;
	margin-left: -1px;
	background: #fff;
	box-shadow: 0 0 6px rgba(0, 0, 0, .55);
	pointer-events: none;
}

.loovl-le__kahva {
	position: absolute;
	top: 50%;
	left: var(--le-jako, 50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	border-radius: 50%;
	background: #fff;
	color: #171a20;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
	pointer-events: none;
}

.loovl-le__liuku:focus-visible .loovl-le__kahva {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

@media (max-width: 800px) {
	.loovl-le--palvelu .loovl-le__sisus {
		padding: 40px 0 48px;
	}

	body .loovl-le .loovl-le__otsikko {
		font-size: 26px;
	}
}

@media print {
	.loovl-le__liuku,
	.loovl-le__ennen,
	.loovl-le__merkki {
		display: none;
	}
}
