/* Why us (Usluge page): warm light section, large two-tone statement and a photo on the left,
   reasons on the right with a product list and a highlighted line. Mobile-first. */

.iw-why {
	background: var(--iw-color-surface);
}

.iw-why__inner {
	display: grid;
	gap: var(--iw-space-12);
	max-width: var(--iw-container);
	margin: 0 auto;
	padding: var(--iw-space-16) var(--iw-gutter);
}

/* Statement */
.iw-why__statement {
	display: grid;
	justify-items: start;
	gap: var(--iw-space-6);
}

.iw-why__kicker {
	display: flex;
	align-items: center;
	gap: var(--iw-space-4);
	margin: 0;
	color: var(--iw-color-brown);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.iw-why__kicker::before {
	content: "";
	flex: none;
	width: 40px;
	height: 2px;
	background: var(--iw-color-primary);
}

.iw-why__title {
	margin: 0;
	color: var(--iw-color-brown);
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
	line-height: var(--iw-leading-tight);
	letter-spacing: -0.02em;
}

.iw-why__title-accent {
	display: block;
	color: var(--iw-color-taupe);
}

.iw-why__intro {
	max-width: 30rem;
	margin: 0;
	color: var(--iw-color-ink-soft);
	font-size: var(--iw-text-lg);
}

.iw-why__media {
	width: 100%;
	margin-top: var(--iw-space-4);
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--iw-color-line);
}

.iw-why__media picture,
.iw-why__media img {
	display: block;
	width: 100%;
	height: 100%;
}

.iw-why__media img {
	object-fit: cover;
}

/* Reasons */
.iw-why__reasons {
	display: grid;
}

.iw-why__reason {
	position: relative;
	display: grid;
	gap: var(--iw-space-4);
	padding: var(--iw-space-10) 0;
}

.iw-why__reason:last-child {
	padding-bottom: 0;
}

/* Rule above each reason, drawn in from the left */
.iw-why__reason::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--iw-color-line);
	transform-origin: left center;
}

/* The green stub marks the start of each reason */
.iw-why__reason::after {
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	width: 40px;
	height: 3px;
	background: var(--iw-color-primary);
	transform-origin: left center;
}

.iw-why__reason-title {
	margin: 0;
	font-size: var(--iw-text-h3);
}

.iw-why__reason-text {
	max-width: 38rem;
	margin: 0;
	color: var(--iw-color-ink-soft);
	font-size: var(--iw-text-lg);
}

/* Product list: an editorial index in two columns */
.iw-why__items {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 var(--iw-space-6);
	max-width: 38rem;
	margin: var(--iw-space-2) 0 0;
	padding: 0;
	list-style: none;
}

.iw-why__items li {
	padding: var(--iw-space-3) 0;
	border-bottom: 1px solid var(--iw-color-line);
	color: var(--iw-color-ink);
	font-weight: 600;
}

/* Highlighted line from the current site */
.iw-why__quote {
	max-width: 34rem;
	margin: var(--iw-space-2) 0 0;
	padding: var(--iw-space-6);
	background: var(--iw-color-bg);
	box-shadow: var(--iw-shadow-md);
	color: var(--iw-color-brown);
	font-family: var(--iw-font-heading);
	font-size: var(--iw-text-h4);
	line-height: 1.4;
}

/* Reveal (script.js adds is-armed to the section and is-in to each reason) */
@media (prefers-reduced-motion: no-preference) {
	.iw-why.is-armed .iw-why__reason::before,
	.iw-why.is-armed .iw-why__reason::after {
		transform: scaleX(0);
		transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1);
	}

	.iw-why.is-armed .iw-why__reason > *,
	.iw-why.is-armed .iw-why__items li {
		opacity: 0;
		transform: translateY(12px);
		transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	/* Photo opens like a curtain from the left, as in the service rows. Here the curtain is a cover in the
	   section colour that slides away, not a clip-path: the photo frame is what the IntersectionObserver
	   watches (a clipped element never reports as visible), and a clip-path together with a transform on a
	   bare Media Library img stayed hidden in Chrome. */
	.iw-why.is-armed .iw-why__media {
		position: relative;
	}

	.iw-why.is-armed .iw-why__media::after {
		content: "";
		position: absolute;
		inset: 0;
		background: var(--iw-color-surface);
		transform-origin: right center;
		transition: transform 1.1s cubic-bezier(0.7, 0, 0.2, 1);
	}

	.iw-why.is-armed .iw-why__media img {
		transform: scale(1.12);
		transition: transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	.iw-why.is-armed .iw-why__media.is-in::after {
		transform: scaleX(0);
	}

	.iw-why.is-armed .iw-why__media.is-in img {
		transform: none;
	}

	.iw-why.is-armed .iw-why__reason > .iw-why__items {
		opacity: 1;
		transform: none;
	}

	/* Same specificity as the armed rule above plus is-in, otherwise the rules stay hidden */
	.iw-why.is-armed .iw-why__reason.is-in::before,
	.iw-why.is-armed .iw-why__reason.is-in::after {
		transform: none;
	}

	.iw-why.is-armed .iw-why__reason.is-in::after {
		transition-delay: 0.3s;
	}

	.iw-why.is-armed .iw-why__reason.is-in > *,
	.iw-why.is-armed .iw-why__reason.is-in .iw-why__items li {
		opacity: 1;
		transform: none;
	}

	.iw-why__reason.is-in > :nth-child(1) { transition-delay: 0.2s; }
	.iw-why__reason.is-in > :nth-child(2) { transition-delay: 0.32s; }
	.iw-why__reason.is-in > :nth-child(3) { transition-delay: 0.44s; }

	.iw-why__reason.is-in .iw-why__items li:nth-child(1) { transition-delay: 0.5s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(2) { transition-delay: 0.58s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(3) { transition-delay: 0.66s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(4) { transition-delay: 0.74s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(5) { transition-delay: 0.82s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(6) { transition-delay: 0.9s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(7) { transition-delay: 0.98s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(8) { transition-delay: 1.06s; }
	.iw-why__reason.is-in .iw-why__items li:nth-child(n+9) { transition-delay: 1.14s; }
}

@media (min-width: 1024px) {
	.iw-why__inner {
		grid-template-columns: repeat(12, minmax(0, 1fr));
		gap: var(--iw-space-8);
		padding: var(--iw-space-24) var(--iw-gutter);
	}

	/* The photo takes the rest of the column height, so both columns end on the same line */
	.iw-why__header {
		display: flex;
		grid-column: 1 / span 5;
	}

	.iw-why__statement {
		display: flex;
		flex: 1;
		flex-direction: column;
		align-items: flex-start;
	}

	.iw-why__media {
		flex: 1;
		min-height: 320px;
		aspect-ratio: auto;
	}

	.iw-why__reasons {
		grid-column: 7 / span 6;
	}

	.iw-why__reason:first-child {
		padding-top: var(--iw-space-8);
	}

	.iw-why__reason {
		padding: var(--iw-space-12) 0;
	}

	.iw-why__reason:last-child {
		padding-bottom: 0;
	}
}
