/* Chapter section — /implementation/. Vertaald uit chapter-section/ en
 * main-content/ van de originele bron, met icon-title-text/ en usp-grid/ voor
 * de zijkolom. Breekpunten: 600, 1000, 1400, 1536.
 *
 * De column-width(n) van de bron is hier calc(--content-width * n/12 - --gutter
 * * (12-n)/12); --content-width moet de viewport-vorm blijven, want de
 * container heeft vanaf 1000px `width: fit-content` en een percentage van een
 * shrink-to-fit-ouder is circulair.
 */

/* Sectie en container */

.sq-block--chapter {
	/* Origineel .section: padding spacing(6) 0 spacing(4). */
	padding: 4.8rem 0 3.2rem;
}

/* Hoofdgebied */

.sq-chapter__grid {
	display: flex;
	flex-flow: row wrap;
	justify-content: space-between;
	width: 100%;
	padding: 0 0 2.4rem;
	overflow: hidden;
}

.sq-chapter__illustration-container {
	/* Origineel .illustrationContainer: spacing(28) vierkant. */
	width: 22.4rem;
	height: 22.4rem;
}

.sq-chapter__illustration {
	position: relative;
	height: 100%;
	margin: 0;
}

/* Twee selectorvormen omdat de WebP-plugin <img> naar <picture> herschrijft en
   de class daarbij naar het <picture>-element verhuist. Twee klassen zijn nodig
   om van .sq-theme-section img (object-fit: cover) in style.css te winnen. */
.sq-chapter__illustration .sq-chapter__image,
.sq-chapter__illustration .sq-chapter__image img,
.sq-chapter__illustration img.sq-chapter__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: left bottom;
	display: block;
}

.sq-chapter__number-container {
	align-self: flex-end;
	text-align: right;
}

.sq-chapter__number {
	stroke: var(--chapter-section-number-color);
	/* Origineel .number: spacing(13) mobiel. Breedte volgt uit de viewBox, dus
	   width blijft auto — een <svg> zonder width-attribuut zou anders op de
	   UA-standaard 100% uitkomen en het cijfer uitrekken. */
	height: 10.4rem;
	width: auto;
	max-width: none;
}

.sq-chapter__title-container {
	color: var(--chapter-section-title-color);
	width: 100%;
	padding-top: 2.4rem;
}

.sq-chapter__title {
	/* Bootstrap geeft h2 een margin-bottom; het origineel heeft er geen. */
	margin: 0;
	color: inherit;
}

.sq-chapter__text-container {
	width: 100%;
}

.sq-chapter__text {
	padding-top: 2.4rem;
}

/* Zet de globale h4/h5 uit wysiwyg.css blok-lokaal terug op de schaal van het
   origineel, dat geen ondermarge onder een kop heeft. De waarden volgen .sq-h4
   en .sq-h5 in _sqills_global.css; dát bestand is de bron van de schaal. */
.sq-chapter__text h4,
.sq-chapter__text h5,
.sq-chapter-modal__body h4,
.sq-chapter-modal__body h5 {
	font-family: var(--font-macan);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 125%;
	margin: 0;
}

/* Bewuste afwijking van het origineel, niet terugdraaien: dáár staat de
   kopkleur als inline span in de inhoud en is die per kop inconsistent. Die
   spans ontbreken na de import, dus geldt hier één regel in CSS: h4 accent,
   h5 lopende tekst. */
.sq-chapter__text h4,
.sq-chapter-modal__body h4 {
	font-size: 2rem;
	color: var(--text-color--accent);
}

.sq-chapter__text h5,
.sq-chapter-modal__body h5 {
	font-size: 1.6rem;
	color: inherit;
}

/* Origineel rich-text-renderer: 1,6rem direct na een kop in plaats van de
   3,2rem die .sq-body tussen blokken zet. Voor .sq-rich-text staat die regel al
   in _sqills_global.css; .sq-body heeft hem niet, dus hier voor het tekstblok. */
.sq-chapter__text > h1 + *,
.sq-chapter__text > h2 + *,
.sq-chapter__text > h3 + *,
.sq-chapter__text > h4 + *,
.sq-chapter__text > h5 + *,
.sq-chapter__text > h6 + * {
	margin-top: 1.6rem;
}

/* .sq-rich-text zet p op --text-color--support; in het zijblad van het
   origineel staat de tekst gewoon op --color-purple--4, net als de koppen. */
.sq-chapter-modal__body p {
	color: inherit;
}

/* Zijkolom: één item */

.sq-chapter__aside-wrapper {
	position: relative;
}

/* Origineel .additionalContent_wrapper::before: de verticale scheidingslijn een
   gutter links van de zijkolom. Onder 1000px valt hij buiten beeld doordat de
   sectie daar horizontaal clipt — net als in het origineel. */
.sq-chapter__aside-wrapper::before {
	content: "";
	position: absolute;
	left: calc(-1 * var(--gutter));
	top: 0;
	height: 100%;
	max-height: 32rem;
	border-left: 0.1rem solid var(--border-color);
}

/* Zijkolom: meerdere kaarten */

.sq-chapter__usp-grid {
	overflow: hidden;
	/* Origineel .container onder md: de strook bleedt tot buiten de gutter en
	   is precies één venster breed, zodat je hem horizontaal kunt swipen. */
	margin-top: 1.6rem;
	position: relative;
	left: calc(var(--gutter) * -1);
	width: var(--window-width);
}

.sq-chapter__usp-list {
	list-style: none;
	margin: 0;
	display: flex;
	flex-flow: row nowrap;
	flex: 1;
	gap: var(--gutter);
	overflow-x: auto;
	overflow-y: hidden;
	padding: 0 var(--gutter);
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.sq-chapter__usp-list::-webkit-scrollbar {
	display: none;
}

.sq-chapter__usp-item {
	/* Origineel .listItem: spacing(35). */
	width: 28rem;
	flex-shrink: 0;
}

.sq-chapter__usp-item > * {
	height: 100%;
}

/* Kaart / icon-title-text */

/* Dubbel met usp_grid_section.css: stylesheets laden per blok en
   /implementation/ heeft geen usp_grid_section. De .sq-block--chapter-scoping
   houdt beide blokken op één pagina uit elkaar. */
.sq-block--chapter .sq-icon-title-text {
	padding-top: 2.4rem;
}

.sq-block--chapter .sq-icon-title-text__figure {
	width: 6.4rem;
	height: 6.4rem;
	margin: 0 0 1.6rem;
}

.sq-block--chapter .sq-icon-title-text__figure .sq-icon-title-text__icon,
.sq-block--chapter .sq-icon-title-text__figure .sq-icon-title-text__icon img,
.sq-block--chapter .sq-icon-title-text__figure img.sq-icon-title-text__icon {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sq-block--chapter .sq-icon-title-text__title {
	color: var(--text-color--accent);
	margin: 0 0 1.6rem;
}

.sq-block--chapter .sq-icon-title-text__text {
	color: var(--text-color);
}

.sq-block--chapter .sq-icon-title-text.has-border {
	border: 0.1rem solid var(--border-color);
	border-radius: 1.6rem;
	padding: 2.4rem;
}

.sq-block--chapter .sq-icon-title-text.has-border .sq-icon-title-text__figure {
	margin-bottom: 2.4rem;
}

.sq-block--chapter .sq-icon-title-text.has-border .sq-icon-title-text__title {
	margin-bottom: 0.4rem;
}

/* Volgorde uit de bron: .hasModal staat ná .hasBorder en wint bij gelijke
   specificiteit, vandaar 1,6rem in plaats van de 0,4rem hierboven. */
.sq-block--chapter .sq-icon-title-text.has-modal {
	background: var(--background-color);
	display: flex;
	flex-direction: column;
}

.sq-block--chapter .sq-icon-title-text.has-modal .sq-icon-title-text__figure {
	margin-bottom: 1.6rem;
}

.sq-block--chapter .sq-icon-title-text.has-modal .sq-icon-title-text__title {
	margin-bottom: 1.6rem;
}

.sq-block--chapter .sq-icon-title-text.has-modal .sq-icon-title-text__text {
	margin-bottom: 2.4rem;
}

/* Read more-knop */

.sq-chapter__read-more {
	display: inline-flex;
	align-items: center;
	/* Duwt de knop naar de onderkant van de kaart, ongeacht tekstlengte. */
	margin-top: auto;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--text-color--accent);
	font-family: var(--font-macan);
	font-size: 1.4rem;
	line-height: 1;
	font-weight: 600;
	letter-spacing: -0.02em;
	text-align: left;
}

.sq-chapter__read-more-label {
	margin-right: 0.8rem;
}

.sq-chapter__read-more-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.2rem;
	height: 3.2rem;
	flex-shrink: 0;
	border-radius: 50%;
	border: 0.1rem solid var(--link-border-color);
	transition: border-color 0.25s ease-in-out;
}

.sq-chapter__read-more-plus {
	width: 1.6rem;
	height: auto;
}

.sq-chapter__read-more:hover .sq-chapter__read-more-icon {
	border-color: var(--link-border-color--hover);
}

/* Read more-zijblad */

.sq-chapter-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
}

.sq-chapter-modal[hidden] {
	display: none;
}

.sq-chapter-modal__backdrop {
	position: fixed;
	inset: 0;
	background: var(--color-purple--4-75);
}

.sq-chapter-modal__panel {
	position: fixed;
	inset: 3.2rem 0 0 0;
	width: 100%;
	background: var(--color-white);
	color: var(--color-purple--4);
	/* Het zijblad is altijd wit, dus de accentkleur mag niet uit een donker
	   sectiethema komen — dat zou een witte kop op wit geven. */
	--text-color--accent: var(--color-purple--1);
	border-radius: 3.2rem 3.2rem 0 0;
	display: flex;
	flex-direction: column;
}

.sq-chapter-modal__header {
	flex: 0 0 auto;
	height: 7.2rem;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 var(--gutter);
}

/* Origineel .modalSheet_header.isScrolled: lijn zodra het blad gescrold is. */
.sq-chapter-modal__header.is-scrolled {
	border-bottom: 0.1rem solid var(--border-color);
}

.sq-chapter-modal__close {
	display: inline-flex;
	align-items: center;
	gap: 0.8rem;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--color-purple--4);
	font-family: var(--font-macan);
	font-size: 1.4rem;
	line-height: 1;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.sq-chapter-modal__close-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	flex-shrink: 0;
	border-radius: 50%;
	border: 0.1rem solid var(--border-color);
	transition: border-color 0.25s ease-in-out;
}

.sq-chapter-modal__close-svg {
	width: 1.6rem;
	height: auto;
}

.sq-chapter-modal__close:hover .sq-chapter-modal__close-icon {
	border-color: var(--link-border-color--hover);
}

.sq-chapter-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 1.6rem var(--gutter) 6.4rem;
}

html.sq-chapter-modal-open {
	overflow: hidden;
}

/* sm: 600px */

@media only screen and (min-width: 600px) {
	/* Origineel .listItem @sm: de kaarten in de swipe-strook worden een halve
	   vensterbreedte in plaats van de vaste 28rem. */
	.sq-chapter__usp-item {
		width: calc(var(--window-width) * 0.5);
	}

	/* Volgt .sq-h4 / .sq-h5 in _sqills_global.css. */
	.sq-chapter__text h4,
	.sq-chapter-modal__body h4 {
		font-size: 2.4rem;
	}

	.sq-chapter__text h5,
	.sq-chapter-modal__body h5 {
		font-size: 2rem;
	}
}

/* md: 1000px — de omslag naar het paneel */

@media only screen and (min-width: 1000px) {
	/* Paneelopmaak hangt aan de scrollrichting en niet aan de schermbreedte, dus
	   alles hieronder is op body.scroll_horizontal gescoopt; op een verticale
	   pagina valt het blok terug op de stroomlayout hierboven. `:where()` houdt
	   de specificiteit op nul, zodat de bredere media-queries verderop blijven
	   winnen. */

	:where(body.scroll_horizontal) .sq-block--chapter {
		height: var(--window-height);
		padding: var(--header-height) 0;
	}

	/* Een paneel mag breder zijn dan het venster, en de `min-width:
	   var(--window-width)` die _sqills_global.css op elke .sq-block zet vervangt
	   de automatische minimumgrootte van het grid-item en kapt het af op één
	   venster. Die vloer verhuist daarom naar de container hieronder. */
	body.scroll_horizontal .container_scroll_horizontal > article > .sq-block--chapter {
		min-width: initial;
	}

	/* Twee klassen om van .sq-container in style.css te winnen: dat bestand
	   laadt ná de blokstylesheets, dus één klasse verliest bij gelijkspel. */
	:where(body.scroll_horizontal) .sq-block--chapter .sq-chapter__container {
		min-width: var(--window-width);
		width: fit-content;
		/* .sq-container kapt op 2560px af; de originele Container doet dat niet
		   en het Run-paneel is bij 1920px al 2848px breed. */
		max-width: none;
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		gap: 0 var(--gutter);
		height: 100%;
		align-items: flex-start;
	}

	:where(body.scroll_horizontal) .sq-chapter__main,
	:where(body.scroll_horizontal) .sq-chapter__aside {
		flex-shrink: 0;
		height: 100%;
	}

	:where(body.scroll_horizontal) .sq-chapter__main {
		width: calc(var(--content-width) * 0.75 - var(--gutter) * 0.25);
		padding-top: 4.8rem;
	}

	/* Bij meer dan één item is de zijkolom net zo breed als het hoofdgebied en
	   wordt het paneel breder dan het venster; de bezoeker scrollt er
	   horizontaal doorheen. */
	:where(body.scroll_horizontal) .sq-chapter__aside {
		width: calc(var(--content-width) * 0.75 - var(--gutter) * 0.25);
	}

	:where(body.scroll_horizontal) .sq-chapter__aside--single {
		width: calc(var(--content-width) * 0.25 - var(--gutter) * 0.75);
	}

	:where(body.scroll_horizontal) .sq-chapter__grid {
		padding: 0;
		height: 100%;
		display: grid;
		gap: 0 var(--gutter);
		/* Bewust 1fr en niet minmax(0, 1fr): net boven 1000px is het cijfer
		   breder dan een derde en moet de kolom meegeven, niet knijpen. */
		grid-template-columns: 1fr 1fr 1fr;
		grid-template-rows: 80fr 432fr 208fr;
		grid-template-areas:
			"titleContainer  titleContainer        titleContainer"
			"numberContainer illustrationContainer illustrationContainer"
			"numberContainer textContainer         textContainer";
		overflow: hidden;
	}

	:where(body.scroll_horizontal) .sq-chapter__illustration-container {
		grid-area: illustrationContainer;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: flex-end;
		justify-content: flex-start;
	}

	/* Geen aspect-ratio: de illustraties zijn net niet vierkant, dus de hoogte
	   moet uit het beeldbestand komen. */
	:where(body.scroll_horizontal) .sq-chapter__illustration {
		width: 100%;
		max-width: 50%;
		height: auto;
	}

	:where(body.scroll_horizontal) .sq-chapter__number-container {
		grid-area: numberContainer;
		text-align: left;
		height: 100%;
		display: flex;
		/* column-reverse hangt het cijfer aan de onderkant van het paneel. */
		flex-direction: column-reverse;
		align-items: flex-start;
	}

	:where(body.scroll_horizontal) .sq-chapter__number {
		height: 100%;
		max-height: 24rem;
	}

	:where(body.scroll_horizontal) .sq-chapter__title-container {
		grid-area: titleContainer;
		padding-top: 0;
	}

	:where(body.scroll_horizontal) .sq-chapter__text-container {
		grid-area: textContainer;
		display: flex;
		align-items: center;
	}

	:where(body.scroll_horizontal) .sq-chapter__text {
		padding-top: 4.8rem;
	}

	/* Origineel: chapter geeft UspGrid de klasse .grid mee, en die zet vanaf md
	   overflow: visible op de container. De strook-eigenschappen eronder
	   vervallen hier. */
	:where(body.scroll_horizontal) .sq-chapter__usp-grid {
		margin-top: 0;
		position: static;
		left: auto;
		width: auto;
		overflow: visible;
	}

	:where(body.scroll_horizontal) .sq-chapter__usp-list {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 2.4rem var(--gutter);
		padding: 0;
	}

	:where(body.scroll_horizontal) .sq-chapter__usp-item {
		width: 100%;
	}

	:where(body.scroll_horizontal) .sq-block--chapter .sq-icon-title-text.has-border {
		padding: 1.6rem;
	}

	:where(body.scroll_horizontal) .sq-block--chapter .sq-icon-title-text.has-border .sq-icon-title-text__figure {
		margin-bottom: 0.8rem;
	}

	/* .hasModal blijft ook hier na .hasBorder staan, zoals in de bron. */
	:where(body.scroll_horizontal) .sq-block--chapter .sq-icon-title-text.has-modal .sq-icon-title-text__figure {
		margin-bottom: 1.6rem;
	}

	:where(body.scroll_horizontal) .sq-chapter__read-more {
		font-size: 1.6rem;
	}

	:where(body.scroll_horizontal) .sq-chapter__read-more-icon {
		width: 4rem;
		height: 4rem;
	}

	:where(body.scroll_horizontal) .sq-chapter__read-more-plus {
		width: 2.4rem;
	}

	/* Origineel .modalSheet @md: max-width column-width(5), rechts vastgezet. */
	:where(body.scroll_horizontal) .sq-chapter-modal__panel {
		inset: 0 0 0 auto;
		width: calc(var(--content-width) * 0.41666667 - var(--gutter) * 0.58333333);
		max-width: none;
		border-radius: 4.8rem 0 0 0;
	}

	:where(body.scroll_horizontal) .sq-chapter-modal__header {
		justify-content: flex-start;
		height: 9.6rem;
		padding: 0 2.4rem;
	}

	/* Boven 1000px staat het ronde icoon links van het label. */
	:where(body.scroll_horizontal) .sq-chapter-modal__close {
		flex-direction: row-reverse;
		gap: 1.2rem;
	}

	:where(body.scroll_horizontal) .sq-chapter-modal__body {
		padding: 0 2.4rem 6.4rem;
	}
}

/* lg: 1400px */

@media only screen and (min-width: 1400px) {
	:where(body.scroll_horizontal) .sq-chapter__illustration {
		max-width: 40%;
	}

	:where(body.scroll_horizontal) .sq-chapter__usp-grid {
		height: 100%;
	}

	/* Origineel .list @lg: pas hier mag de lijst overlopen — dat is precies waar
	   de versprongen tweede kolom hieronder om vraagt. */
	:where(body.scroll_horizontal) .sq-chapter__usp-list {
		overflow: visible;
	}

	/* Origineel .listItem @lg: elke tweede kaart zakt spacing(9). */
	:where(body.scroll_horizontal) .sq-chapter__usp-item:nth-child(2n) {
		transform: translateY(7.2rem);
	}

	:where(body.scroll_horizontal) .sq-block--chapter .sq-icon-title-text.has-border {
		padding: 2.4rem;
	}

	:where(body.scroll_horizontal) .sq-block--chapter .sq-icon-title-text.has-border .sq-icon-title-text__figure {
		margin-bottom: 2.4rem;
	}

	:where(body.scroll_horizontal) .sq-block--chapter .sq-icon-title-text.has-modal .sq-icon-title-text__figure {
		margin-bottom: 1.6rem;
	}
}

/* lg-2: 1536px */

@media only screen and (min-width: 1536px) {
	:where(body.scroll_horizontal) .sq-chapter__illustration {
		max-width: 33%;
	}
}

/* xl: 1792px */

@media only screen and (min-width: 1792px) {
	/* Origineel label3 gaat hier naar 2rem; de rest van dit blok verandert niet. */
	:where(body.scroll_horizontal) .sq-chapter__read-more {
		font-size: 2rem;
	}

	/* Volgt .sq-h4 / .sq-h5 in _sqills_global.css. */
	:where(body.scroll_horizontal) .sq-chapter__text h4,
	:where(body.scroll_horizontal) .sq-chapter-modal__body h4 {
		font-size: max(2.4rem, min(-2.2666666667rem + 2.6041666667vw, 4.4rem));
	}

	:where(body.scroll_horizontal) .sq-chapter__text h5,
	:where(body.scroll_horizontal) .sq-chapter-modal__body h5 {
		font-size: max(2rem, min(-1.7333333333rem + 2.0833333333vw, 3.6rem));
	}
}
