/* Hairtec Waarom widget.
   Fonts and heading sizes come from the Elementor kit; this file only lays the
   section out. Breakpoints follow the site's Elementor settings: tablet up to
   1274px, phone up to 767px. The sizes attribute of the photos uses the same
   two numbers (get_sizes_attribute() in the widget class).
   Buttons are styled through ".htw .htw-…" on purpose: the kit styles every
   <button> on the site and would otherwise win. */

.htw {
	--htw-primary: var(--e-global-color-primary, #223558);
	--htw-text: var(--e-global-color-text, #5c5c5c);
	--htw-soft: var(--e-global-color-secondary, #eeeff2);
	--htw-line: rgba(188, 185, 184, 0.5);
	--htw-step: 62px;
	--htw-photo: 540px;
	--htw-gap: 100px;
	--htw-radius: 20px;
	--htw-edge: 20px;

	/* Keeps the section off the screen edge when its container has no side
	   padding. 100vw includes a classic scrollbar; the script measures it. */
	margin-right: max(0px, calc(var(--htw-edge) - (100vw - var(--htw-scrollbar, 0px) - 100%) / 2));
	margin-left: max(0px, calc(var(--htw-edge) - (100vw - var(--htw-scrollbar, 0px) - 100%) / 2));
	color: var(--htw-text);
}

/* Header */

.htw-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 40px;
	margin-bottom: 36px;
}

.htw-intro {
	flex: 1 1 420px;
	min-width: 0;
}

/* Only reaches a <div>: the kit's h2/h3/h4 rules are more specific. */
.htw-title {
	font-size: 32px;
	font-weight: 700;
}

.htw-heading {
	font-size: 25px;
	font-weight: 700;
}

.htw .htw-title,
.htw .htw-heading {
	color: var(--htw-primary);
	overflow-wrap: break-word;
	text-wrap: balance;
}

.htw .htw-title {
	margin: 0 0 14px;
	line-height: 1.15;
}

.htw .htw-lead {
	max-width: 650px;
	margin: 0;
}

.htw .htw-lead,
.htw-text {
	overflow-wrap: break-word;
}

.htw-cta {
	flex: none;
}

.htw-cta .elementor-button-content-wrapper {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: center;
	gap: 15px;
}

/* Stage: steps on top, text and Terug/Vooruit on the left, photo on the right.
   The text column keeps a readable width however wide the photo is set. */

.htw-stage {
	display: grid;
	grid-template-columns: minmax(min(320px, 55%), 1fr) minmax(0, var(--htw-photo));
	grid-template-rows: auto 1fr auto;
	grid-template-areas:
		"steps  steps"
		"panels media"
		"nav    media";
	column-gap: var(--htw-gap);
}

.htw--text-only .htw-stage {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"steps"
		"panels"
		"nav";
}

/* Without photos the text would otherwise run the full container width. */
.htw--text-only .htw-panels,
.htw--text-only .htw-nav {
	max-width: 720px;
}

/* Numbered steps */

.htw-steps {
	grid-area: steps;
	position: relative;
	display: flex;
	align-items: center;
	gap: 70px;
	width: max-content;
	max-width: 100%;
	margin-bottom: 15px;
}

.htw-steps::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	left: 0;
	border-top: 1px solid var(--htw-line);
}

.htw .htw-step {
	position: relative;
	flex: none;
	width: var(--htw-step);
	height: var(--htw-step);
	padding: 5px;
	border: 1px solid var(--htw-primary);
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	color: #000;
	font: inherit;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.3s;
}

.htw .htw-step:hover,
.htw .htw-step:focus {
	border-radius: 50%;
	background: #fff;
	color: #000;
}

.htw-num {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	transition: background-color 0.3s, color 0.3s;
}

.htw-step:hover .htw-num {
	background: var(--htw-soft);
}

.htw .htw-step[aria-selected="true"] {
	border-color: #000;
	cursor: default;
}

.htw-step[aria-selected="true"] .htw-num {
	background: var(--htw-primary);
	color: #fff;
}

.htw-label,
.htw-status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Text */

.htw-panels {
	grid-area: panels;
	min-width: 0;
	padding-top: 8px;
}

.htw .htw-heading {
	margin: 0 0 16px;
	line-height: 1.2;
}

.htw-text > :last-child {
	margin-bottom: 0;
}

/* Links in the step text are underlined, as they were on the old section. */
.htw .htw-text a {
	text-decoration: underline;
}

@supports (content-visibility: hidden) {
	/* Closed steps keep their box but skip their content, so the browser's
	   find-in-page can still land in them (hidden="until-found"). */
	.htw-slot[hidden="until-found"] {
		display: block;
		content-visibility: hidden;
	}
}

/* Terug / Vooruit */

.htw-nav {
	grid-area: nav;
	position: relative;
	display: flex;
	justify-content: space-between;
	gap: 15px;
	padding-top: 20px;
}

.htw .htw-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 100px;
	min-height: 49px;
	padding: 8px 18px;
	border: 1px solid var(--htw-primary);
	border-radius: 100px;
	background: transparent;
	box-shadow: none;
	color: var(--htw-primary);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: normal;
	text-align: left;
	text-transform: uppercase;
	white-space: normal;
	cursor: pointer;
	transition: color 0.3s, border-color 0.3s;
}

.htw .htw-arrow:hover,
.htw .htw-arrow:focus {
	border-color: var(--htw-text);
	border-radius: 100px;
	background: transparent;
	color: var(--htw-text);
}

/* The fade sits on the border and the content, not on the button, so the
   focus ring of a disabled Terug/Vooruit stays at full strength. */
.htw .htw-arrow[aria-disabled="true"] {
	border-color: rgba(34, 53, 88, 0.3);
	color: var(--htw-primary);
	cursor: default;
}

@supports (color: color-mix(in srgb, red 30%, transparent)) {
	.htw .htw-arrow[aria-disabled="true"] {
		border-color: color-mix(in srgb, var(--htw-primary) 30%, transparent);
	}
}

.htw .htw-arrow[aria-disabled="true"] > * {
	opacity: 0.3;
}

.htw-arrow svg {
	flex: none;
}

/* Photo */

.htw-media {
	grid-area: media;
	position: relative;
	min-height: 440px;
	overflow: hidden;
	border-radius: var(--htw-radius);
	background: var(--htw-soft);
}

/* A step without a photo: no empty grey frame. */
.htw-media:not(:has(.htw-figure:not([hidden]) > img)) {
	background: none;
}

.htw-figure {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
}

.htw-figure[hidden] {
	display: none;
}

.htw .htw-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 0;
	object-fit: cover;
}

/* The same ring the site draws on its other buttons, repeated here so it does
   not depend on the theme. */
.htw .htw-step:focus-visible,
.htw .htw-arrow:focus-visible,
.htw .htw-panel:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

/* Tablet: steps span the full width, the photo keeps its own proportions */

@media (max-width: 1274px) {
	.htw {
		--htw-photo: 42%;
		--htw-gap: 48px;
	}

	.htw-steps {
		justify-content: space-between;
		gap: 0;
		width: 100%;
	}

	.htw-media {
		align-self: start;
		min-height: 0;
		aspect-ratio: 1080 / 877;
	}
}

/* Tablet only: the text keeps the height of the desktop stage (440px minus the
   69px button row), so the section does not change height with every step. */

@media (min-width: 768px) and (max-width: 1274px) {
	.htw:not(.htw--text-only) .htw-panels {
		min-height: 371px;
	}
}

/* Phone: steps, photo, text, Terug/Vooruit below each other */

@media (max-width: 767px) {
	.htw {
		--htw-step: 46px;
	}

	.htw-header {
		margin-bottom: 24px;
	}

	.htw-title {
		font-size: 24px;
	}

	.htw-heading {
		font-size: 20px;
	}

	.htw-cta {
		width: 100%;
	}

	.htw-stage {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto;
		grid-template-areas:
			"steps"
			"media"
			"panels"
			"nav";
	}

	.htw .htw-step {
		flex: 0 1 var(--htw-step);
		width: auto;
		height: auto;
		padding: 4px;
		font-size: 14px;
	}

	/* The square is set on the disc, not on the button: Safari does not resolve
	   a 100% height inside a padded aspect-ratio box and would draw an oval. */
	.htw-num {
		height: auto;
		aspect-ratio: 1;
	}

	.htw-media {
		aspect-ratio: 16 / 9;
	}

	.htw-panels {
		padding-top: 16px;
	}

	.htw .htw-heading {
		margin-bottom: 10px;
	}
}

/* Without JavaScript, and on paper, every step is simply shown. */

@media (scripting: none), print {
	.htw-slot,
	.htw-slot[hidden] {
		display: block;
		content-visibility: visible;
		margin-bottom: 24px;
	}

	.htw-slot:last-child {
		margin-bottom: 0;
	}

	.htw-steps,
	.htw-nav {
		display: none;
	}

	/* One photo next to five texts: keep its own height instead of stretching. */
	.htw-media {
		align-self: start;
	}
}

/* Windows contrast themes drop background colours: mark the open step and the
   switched-off button with system colours instead. */

@media (forced-colors: active) {
	.htw-step[aria-selected="true"] .htw-num {
		background: Highlight;
		color: HighlightText;
		forced-color-adjust: none;
	}

	.htw .htw-arrow[aria-disabled="true"] {
		border-color: GrayText;
		color: GrayText;
	}

	.htw .htw-arrow[aria-disabled="true"] > * {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.htw .htw-step,
	.htw-num,
	.htw .htw-arrow {
		transition: none;
	}
}
