/*
 * Proef page: left column with title and points boxes, right column with the
 * numbered parts. Variants: dressuur, horsie, kur, springen.
 */

.proef-section {
	padding-block: 24px var(--rbnl-section-gap);
}

.proef__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 32px 48px;
	align-items: flex-start;
}

.proef__aside {
	display: flex;
	flex: 1 1 100%;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.proef__main {
	display: flex;
	flex: 1 1 100%;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.proef__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	min-height: 44px;
	color: var(--rbnl-ink);
	font-size: 17px;
	font-weight: 500;
	text-decoration: none;
}

.proef__back svg {
	transition: transform 0.35s var(--rbnl-ease);
}

.proef__back:hover {
	color: var(--rbnl-orange-dark);
}

.proef__back:hover svg {
	transform: translateX(-4px);
}

.proef__head {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.proef__crumb {
	margin: 0;
	color: var(--rbnl-mute);
	font-size: 17px;
	line-height: 1.3;
}

.proef--horsie .proef__crumb {
	color: var(--rbnl-orange-dark);
	font-family: var(--rbnl-font-heading);
	font-size: 16px;
	font-weight: 600;
}

.proef__title {
	margin: 0;
	font-size: clamp(44px, calc(44px + 20 * (100vw - 390px) / 1050), 64px);
	line-height: 0.95;
	letter-spacing: -0.035em;
}

.proef__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.proef__pill {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 0 14px;
	border-radius: var(--rbnl-radius-pill);
	background: var(--rbnl-peach);
	color: var(--rbnl-ink);
	font-size: 14px;
	font-weight: 500;
}

.proef--horsie .proef__pill {
	background: var(--rbnl-white);
}

/* ------------------------------------------------------------------ Boxes */

.proef-box {
	display: flex;
	flex-direction: column;
	padding: 24px;
	border-radius: 28px;
	background: var(--rbnl-lilac);
}

.proef-box--white {
	background: var(--rbnl-white);
	box-shadow: var(--rbnl-shadow-card);
}

.proef-box--sand {
	background: var(--rbnl-sand);
}

.proef-box--lilac {
	background: var(--rbnl-lilac);
}

.proef-box--map {
	gap: 14px;
	padding: 20px;
	background: var(--rbnl-white);
	box-shadow: var(--rbnl-shadow-card);
	align-items: flex-start;
}

.proef-box h2 {
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.proef-box__head {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.proef-box__cap {
	color: var(--rbnl-mute);
	font-size: 14px;
}

.proef-box__rows {
	margin: 0;
}

.proef-box__rows > div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid #dad7ec;
}

.proef-box__rows > div:last-child {
	border-bottom: 0;
}

.proef-box__rows dt {
	margin: 0;
	color: var(--rbnl-text);
	font-size: 17px;
}

.proef-box__rows dd {
	margin: 0;
	color: var(--rbnl-ink);
	font-family: var(--rbnl-font-heading);
	font-size: 19px;
	font-weight: 600;
}

.proef-box__note {
	margin: 0;
	color: var(--rbnl-mute);
	font-size: 13px;
	line-height: 1.5;
}

.proef-box__note--first {
	margin-bottom: 4px;
	font-size: 15px;
}

.proef-box__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.proef-box__list li {
	display: flex;
	align-items: baseline;
	gap: 14px;
	color: var(--rbnl-ink);
	font-size: 16px;
	line-height: 1.4;
}

.proef-box__n {
	flex: 0 0 auto;
	min-width: 1.4em;
	color: var(--rbnl-mute);
	font-family: var(--rbnl-font-heading);
	font-size: 16px;
	font-weight: 600;
}

/* Points text: every paragraph is a row, the bold part is the value on the right. */
.proef-box--points .rtext p {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	padding: 10px 0;
	border-bottom: 1px solid #dad7ec;
	color: var(--rbnl-text);
}

.proef-box--points .rtext p:last-child {
	border-bottom: 0;
}

.proef-box--points .rtext p:not(:has(strong)) {
	display: block;
	padding: 10px 0 0;
	border-bottom: 0;
	color: var(--rbnl-mute);
	font-size: 13px;
	line-height: 1.5;
}

.proef-box--points .rtext strong {
	color: var(--rbnl-ink);
	font-family: var(--rbnl-font-heading);
	font-size: 19px;
	font-weight: 600;
	text-align: right;
}

.proef-box--white .rtext p {
	border-bottom-color: var(--rbnl-line);
}

/* Rich text inside boxes (points, time). */
.rtext > :first-child {
	margin-top: 0;
}

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

.rtext p,
.rtext li {
	font-size: 17px;
}

.rtext ul {
	padding-left: 1.2em;
}

.proef__note {
	margin: 0;
	color: var(--rbnl-mute);
	font-size: 13px;
	line-height: 1.5;
}

/* ----------------------------------------------------------------- Horsie */

.proef__horsie {
	position: relative;
	height: 300px;
	overflow: clip;
	border-radius: 32px;
	background: var(--rbnl-peach-2);
}

.proef__bubble {
	position: absolute;
	top: 22px;
	left: 22px;
	z-index: 1;
	max-width: 190px;
	margin: 0;
	padding: 14px 18px;
	border-radius: 20px 20px 20px 6px;
	background: var(--rbnl-white);
	box-shadow: 0 10px 24px rgba(33, 30, 100, 0.1);
	color: var(--rbnl-ink);
	font-family: var(--rbnl-font-heading);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.25;
}

.proef__horsie-img {
	position: absolute;
	right: 10px;
	bottom: -40px;
	width: auto;
	max-width: none;
	height: 300px;
}

/* Horsie: peach number badges and warmer dividers. */
.proef--horsie .step-row {
	border-bottom-color: #f6dcc6;
}

.proef--horsie .step-row__n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: start;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--rbnl-peach-2);
	color: var(--rbnl-ink);
	font-family: var(--rbnl-font-heading);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

.proef--horsie .step-row__what {
	font-weight: 600;
}

/* --------------------------------------------------------- Course map (jump) */

.mapthumb {
	position: relative;
	display: block;
	width: min(300px, 100%);
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 18px;
	background: var(--rbnl-sand);
	cursor: zoom-in;
}

.mapthumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	transition: transform 0.6s var(--rbnl-ease);
}

.mapthumb:hover img {
	transform: scale(1.04);
}

.mapthumb__label {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 16px;
	border-radius: var(--rbnl-radius-pill);
	background: var(--rbnl-ink);
	color: var(--rbnl-white);
	font-size: 14px;
	font-weight: 500;
}

.textlink--sm {
	font-size: 15px;
}

/* ------------------------------------------------------------ Kür toggle */

.seg {
	display: inline-flex;
	align-self: flex-start;
	max-width: 100%;
	padding: 4px;
	border-radius: var(--rbnl-radius-pill);
	background: var(--rbnl-sand);
}

.seg__btn {
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--rbnl-radius-pill);
	background: transparent;
	color: var(--rbnl-ink);
	font-family: var(--rbnl-font-body);
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition:
		background-color 0.3s var(--rbnl-ease),
		color 0.3s var(--rbnl-ease);
}

.seg__btn.is-active {
	background: var(--rbnl-ink);
	color: var(--rbnl-white);
}

/* The switch holds links (each side is its own page), not buttons. */
a.seg__btn {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

a.seg__btn:not(.is-active):hover {
	background: var(--rbnl-white);
}

/* Kür: one white box per group, with space between them. */
.proef__cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.kur-panel.is-hidden {
	display: none;
}

.kur-group__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 12px;
	padding: 20px 20px 8px;
}

.kur-group__title {
	margin: 0;
	font-size: 26px;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.kur-group__sub {
	color: var(--rbnl-mute);
	font-size: 14px;
}

.kur-panel > .kur-group__head ~ .kur-group__head {
	margin-top: 16px;
	border-top: 1px solid var(--rbnl-line);
	padding-top: 24px;
}

/* ---------------------------------------------------------- Numbered rows */

.proef__card {
	overflow: clip;
	border: 1.5px solid var(--rbnl-line);
	border-radius: 32px;
	background: var(--rbnl-white);
	box-shadow: var(--rbnl-shadow-card);
}

/* Room above the first and below the last row, so the rounded corners never cut into them. */
.proef__card .steps-list {
	padding-block: 12px;
}

.steps-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.step-row {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	gap: 2px 12px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--rbnl-line);
	transition: background-color 0.3s var(--rbnl-ease);
}

.step-row:last-child {
	border-bottom: 0;
}

.step-row__n {
	grid-row: span 2;
	color: var(--rbnl-mute);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.8;
}

.step-row__where {
	color: var(--rbnl-orange-dark);
	font-family: var(--rbnl-font-heading);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

.step-row__where:empty {
	display: none;
}

.step-row__what {
	grid-column: 2;
	color: var(--rbnl-ink);
	font-family: var(--rbnl-font-heading);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.3;
}

.step-row__where:empty + .step-row__what {
	grid-row: 1 / span 2;
}

.step-row__value {
	grid-column: 2;
	color: var(--rbnl-orange-dark);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.steps-list--kur .step-row__value:empty {
	display: none;
}

.proef__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
}

.proef__more {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.proef__more .chip--quick {
	box-shadow: inset 0 0 0 1.5px var(--rbnl-line);
}

.proef__more .chip--quick:hover,
.proef__more .chip--quick:focus-visible {
	box-shadow: 0 8px 18px rgba(33, 30, 100, 0.18);
}

.proef__more-label {
	margin: 0;
	color: var(--rbnl-mute);
	font-size: 15px;
	font-weight: 500;
}

/* --------------------------------------------------------------- Lightbox */

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(33, 30, 100, 0.86);
	animation: rbnl-fade 0.3s var(--rbnl-ease);
}

.lightbox[hidden] {
	display: none;
}

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 16px;
	background: var(--rbnl-white);
	object-fit: contain;
}

.lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: var(--rbnl-white);
	color: var(--rbnl-ink);
	cursor: pointer;
}

@keyframes rbnl-fade {
	from {
		opacity: 0;
	}
}

/* ------------------------------------------------------------- Desktop */

@media (min-width: 1024px) {
	.proef__aside {
		flex: 0 0 340px;
		max-width: 340px;
	}

	.proef__main {
		flex: 1 1 0;
	}

	.step-row {
		grid-template-columns: 36px 200px minmax(0, 1fr);
		gap: 0 12px;
		padding: 12px 20px;
	}

	.step-row__n {
		grid-row: auto;
		line-height: 1.7;
	}

	.step-row__what {
		grid-column: auto;
	}

	/* An empty location keeps its column, so the description never moves left. */
	.step-row__where:empty {
		display: block;
	}

	.step-row__where:empty + .step-row__what {
		grid-row: auto;
		grid-column: auto;
	}

	.steps-list--kur .step-row {
		grid-template-columns: 36px minmax(0, 1fr) auto;
	}

	.steps-list--kur .step-row__value {
		grid-column: auto;
	}
}

@media (hover: hover) {
	.proef__card .step-row:hover {
		background: var(--rbnl-cream);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mapthumb img,
	.proef__back svg,
	.step-row,
	.lightbox {
		animation: none;
		transition: none;
	}
}

/*
 * Phone: the proef itself comes first (it is read aloud), then the extra assessment
 * points, then "Punten en stempels". Both columns dissolve into one stack, so the
 * boxes of the left column can sit after the proef of the right column.
 */
@media (max-width: 1023.98px) {
	.proef__grid {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 20px;
	}

	.proef__aside,
	.proef__main {
		display: contents;
	}

	.proef__aside > * {
		order: 8; /* download, instruction button */
	}

	.proef__aside > .proef__back {
		order: 1;
	}

	.proef__aside > .proef__head {
		order: 2;
	}

	.proef__aside > .seg {
		order: 3;
	}

	.proef__aside > .proef__horsie {
		order: 6; /* the mascot comes after the proef, so the proef starts right below the title */
	}

	.proef__main > .proef__card,
	.proef__main > .proef__cards {
		order: 5;
	}

	.proef__aside > .proef-box--sand {
		order: 6; /* extra assessment points */
	}

	.proef__aside > .proef-box:not(.proef-box--sand) {
		order: 7; /* points and stamps (Kür: time and scoring) */
	}

	.proef__main > .proef__nav {
		order: 9;
	}

	.proef__main > .proef__more {
		order: 10;
	}

	.proef__aside > .proef__note {
		order: 11;
	}
}
