/* Demo bar. The collapsed strip is 68px at 1440. The chevron opens the shell to 343px and pushes the page by the same amount.
 * The bar has its own fixed colors on purpose: it must not recolor itself when the demo changes the theme palette.
 * Layout uses the theme wrappers. outer is the full-bleed shell, inner uses the theme content max widths, content holds the side inset. */

:root {
	/* Starting sizes, until demo-bar.js measures the content and replaces these two. */
	--brro-demo-bar-collapsed: clamp(58px, 4.72vw, 76px) /*68px @ 1440*/;
	--brro-demo-bar-expanded: clamp(276px, 22.22vw, 356px) /*320px @ 1440*/;
	--brro-demo-slide: 380ms;
	--brro-demo-fade: 240ms;
	--brro-demo-bar-fill: #3c4759;
	--brro-demo-knop: #4363ff;
	--brro-demo-knop-ink: #ff31b0;
	/* Space taken above the bar: the WordPress admin bar overlays the viewport and does not push the theme. */
	--brro-demo-top: 0px;
	--brro-demo-ink: #ffffff;
	--brro-demo-accent: #ffd400;
}

body.admin-bar {
	--brro-demo-top: clamp(27px, 2.22vw, 36px) /*32px @ 1440*/;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--brro-demo-top: 46px;
	}
}

/* ----- Page offset -------------------------------------------------- */

/* Closed by default. :has follows the chevron button, which the script already toggles.
 * Occupied is the bar height. Reserved is the space the page and header keep, and drops to 0 while the bar is scrolled away. */
body {
	--brro-demo-occupied: var(--brro-demo-bar-collapsed);
	--brro-demo-reserved: var(--brro-demo-occupied);
	--brro-header-shift-offset: calc(var(--brro-demo-top) + var(--brro-demo-reserved));
	padding-top: calc(var(--brro-demo-top) + var(--brro-demo-reserved)) !important;
	transition: padding-top var(--brro-demo-slide) var(--cubix, ease);
}

body:has(.brro-demo-toggle[aria-expanded="true"]) {
	--brro-demo-occupied: var(--brro-demo-bar-expanded);
}

/* Brro FX adds brro-headerup while the page scrolls down, and removes it on the way back up. */
body:has(header.brro-headerup) {
	--brro-demo-reserved: 0px;
}

/* Menu links use a fixed top padding. Add the bar offset so they move with the header.
 * Below 1180px the theme sets this padding to 0 and centers the menu, so leave that alone. */
@media (min-width: 1180px) {
	#nav-popup .content-wrapper {
		padding-top: calc(clamp(124px, 10.49vw, 168px) + var(--brro-header-shift-offset));
		transition: padding-top var(--brro-demo-slide) var(--cubix, ease);
	}
}

/* ----- Reset inside the demo --------------------------------------- */

.brro-demo,
.brro-demo * {
	box-sizing: border-box;
}

.brro-demo {
	font-family: "Inter", sans-serif;
	font-size: clamp(14px, 0.97vw, 16px) /*14px @ 1440*/;
	line-height: 1.3;
	color: var(--brro-demo-ink);
}

.brro-demo button {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.brro-demo button {
	margin: 0;
	appearance: none;
	cursor: pointer;
}

.brro-demo p {
	margin: 0;
	padding: 0;
}

.brro-demo :focus-visible {
	outline: 2px solid var(--brro-demo-accent);
	outline-offset: 2px;
}

/* ----- Shell ------------------------------------------------------- */

/* outer-flex-wrapper is full-bleed. Fixed, because this strip sits over the theme. */
.brro-demo.outer-flex-wrapper {
	position: fixed;
	top: var(--brro-demo-top);
	left: 0;
	z-index: 1000;
	width: 100%;
	height: var(--brro-demo-occupied);
	transition: height var(--brro-demo-slide) var(--cubix, ease), transform var(--brro-demo-slide) var(--cubix, ease), visibility 0s linear 0s;
	/* Clip sideways only. A hidden overflow on both axes would cut off the shadow. */
	overflow-x: clip;
	overflow-y: visible;
	background-color: var(--brro-demo-bar-fill);
	color: var(--brro-demo-ink);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

/* Slide clear of the viewport, including the shadow, then leave pointer and keyboard. */
body:has(header.brro-headerup) .brro-demo.outer-flex-wrapper {
	transform: translateY(calc(-100% - var(--brro-demo-top) - 28px));
	pointer-events: none;
	visibility: hidden;
	transition: height var(--brro-demo-slide) var(--cubix, ease), transform var(--brro-demo-slide) var(--cubix, ease), visibility 0s linear var(--brro-demo-slide);
}

/* Header chrome follows the bar. Transform uses the bar duration so it stays in step.
 * Nav buttons keep the theme fill and ink transition; only the slide timing changes. */
header.brro-fx--header .header-logo-title-link,
header.brro-fx--header .menu-btn {
	transition: transform var(--brro-demo-slide) var(--cubix, ease);
}
header.brro-fx--header .header-nav > a.button {
	transition: background-color 400ms var(--cubix, ease), color 400ms var(--cubix, ease), transform var(--brro-demo-slide) var(--cubix, ease);
}

/* Inner width comes from .inner-flex-wrapper: --content-max-desk, --content-max-tab, --content-max-mob.
 * Both fill the shell so the columns stretch inside the fixed height. Overflow stays on the content box, not the shell, so the drop shadow still paints. */
.brro-demo .content-wrapper {
	height: 100%;
}

.brro-demo .content-wrapper {
	width: 100%;
	overflow: hidden;
	padding: clamp(13px, 1.04vw, 17px) /*15px @ 1440*/ clamp(46px, 3.82vw, 62px) /*55px @ 1440*/ clamp(13px, 1.04vw, 17px) /*15px @ 1440*/ clamp(61px, 5.14vw, 83px) /*74px @ 1440*/;
}

body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo .content-wrapper {
	padding-bottom: 26px;
}

/* The lead column keeps its frame width. The aside is only as wide as the buttons and the gap between them. */
.brro-demo-lead-col {
	width: clamp(390px, 32.99vw, 528px) /*475px @ 1440*/;
	max-width: clamp(390px, 32.99vw, 528px) /*475px @ 1440*/;
	min-width: 0;
	/* Same gap as the aside, so the two paragraphs start on one line. */
	gap: clamp(41px, 3.47vw, 56px) /*50px @ 1440*/;
}

.brro-demo-aside-col {
	width: max-content;
	flex-shrink: 0;
	gap: clamp(41px, 3.47vw, 56px) /*50px @ 1440*/;
}

/* ----- Top row (stays visible while closed) ------------------------ */

/* Acumin Pro Regular, 18px, white, 33px line. One line, so a long sentence still ellipsizes when the column shrinks. */
.brro-demo-intro {
	margin: 0;
	font-family: "acumin-pro", sans-serif;
	font-size: clamp(15px, 1.25vw, 20px) /*18px @ 1440*/;
	font-weight: 400;
	font-style: normal;
	line-height: 100%;
	color: var(--brro-demo-ink);
	transform: translateY(-2px);
}

.brro-demo-tools {
	min-width: 0;
	gap: clamp(15px, 1.25vw, 20px) /*18px @ 1440*/;
	overflow-x: auto;
	scrollbar-width: none;
}

.brro-demo-tools::-webkit-scrollbar {
	display: none;
}

/* knop-demo. Rest is the blue outline; the pressed chip and the contact button are the white fill.
 * 17px padding + 1px border puts the label 18px in, matching the frame. */
.brro-demo .brro-demo-chip,
.brro-demo .brro-demo-toggle,
.brro-demo a.brro-demo-back {
	flex-shrink: 0;
	gap: clamp(9px, 0.69vw, 12px) /*10px @ 1440*/;
	height: clamp(32px, 2.64vw, 43px) /*38px @ 1440*/;
	padding: 0 clamp(14px, 1.18vw, 19px) /*17px @ 1440*/;
	border: 1px solid var(--brro-demo-knop);
	border-radius: clamp(39px, 3.23vw, 52px) /*46.5px @ 1440*/;
	background-color: transparent;
	color: var(--brro-demo-knop-ink);
	font-family: "tenso", sans-serif;
	font-size: clamp(16px, 1.11vw, 18px) /*16px @ 1440*/;
	font-weight: 400;
	line-height: 206.25%; /* 33 / 16 */
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

/* Three overlapping circles in front of the example label. The ring matches the chip surface. */
.brro-demo-dot {
	width: clamp(10px, 0.83vw, 14px) /*12px @ 1440*/;
	height: clamp(10px, 0.83vw, 14px) /*12px @ 1440*/;
	border-radius: 50%;
	box-shadow: 0 0 0 1.5px var(--brro-demo-bar-fill);
}

.brro-demo-dot + .brro-demo-dot {
	margin-left: clamp(-4px, -0.28vw, -3px) /*-4px @ 1440*/;
}

.brro-demo-chip:hover .brro-demo-dot,
.brro-demo-chip[aria-pressed="true"] .brro-demo-dot {
	box-shadow: 0 0 0 1.5px var(--brro-demo-ink);
}

/* Square, so the shared height makes a circle. No side padding: the chevron is the only content. */
.brro-demo .brro-demo-toggle {
	width: clamp(32px, 2.64vw, 43px) /*38px @ 1440*/;
	padding: 0;
	border-radius: 50%;
}

.brro-demo-chevron {
	width: clamp(12px, 0.97vw, 16px) /*14px @ 1440*/;
	height: clamp(8px, 0.63vw, 10px) /*9px @ 1440*/;
	flex-shrink: 0;
	transition: transform 250ms ease;
}

.brro-demo-toggle[aria-expanded="true"] .brro-demo-chevron {
	transform: rotate(180deg);
}

.brro-demo .brro-demo-chip:hover,
.brro-demo .brro-demo-toggle:hover,
.brro-demo a.brro-demo-back:hover,
.brro-demo .brro-demo-chip[aria-pressed="true"] {
	border-color: var(--brro-demo-ink);
	background-color: var(--brro-demo-ink);
	color: var(--brro-demo-knop);
}

/* One slow pulse on a first visit, so the toggle gets noticed. */
.brro-demo-toggle.is-pulse {
	animation: brro-demo-pulse 1.6s ease-out 2;
}

@keyframes brro-demo-pulse {
	0% { box-shadow: 0 0 0 0 rgba(255, 212, 0, 0.7); }
	100% { box-shadow: 0 0 0 clamp(12px, 0.97vw, 16px) /*14px @ 1440*/ rgba(255, 212, 0, 0); }
}

/* ----- Extended column content ------------------------------------- */

/* .flex sets display:flex, which would otherwise beat the hidden attribute and show the block on load. */
.brro-demo [hidden] {
	display: none !important;
}

/* The bar height moves first. The lead block and the aside fade in after that, and fade out before the bar shrinks. */

@media (prefers-reduced-motion: reduce) {
	.brro-demo-toggle.is-pulse {
		animation: none;
	}

	.brro-demo-chevron {
		transition: none;
	}

	.brro-demo.outer-flex-wrapper,
	body:has(header.brro-headerup) .brro-demo.outer-flex-wrapper,
	header.brro-fx--header .header-logo-title-link,
	header.brro-fx--header .menu-btn,
	body {
		transition: none;
	}

	/* Drop the slide only. Fill and ink on the nav buttons stay. */
	header.brro-fx--header .header-nav > a.button {
		transition: background-color 400ms var(--cubix, ease), color 400ms var(--cubix, ease);
	}
}

/* The column gap sets the space under the welcome line. This gap sits between the lead and the buttons. */
.brro-demo-more {
	gap: clamp(28px, 2.36vw, 38px) /*34px @ 1440*/;
}

/* Appointment first, then the link back. 26px matches the open frame. */
.brro-demo-actions {
	gap: clamp(18px, 1.81vw, 29px) /*26px @ 1440*/;
}

.brro-demo-heading {
	max-width: 100%;
	gap: clamp(10px, 0.76vw, 13px) /*11px @ 1440*/;
}

.brro-demo-heading .brro-demo-intro {
	min-width: 0;
}

.brro-demo-lead,
.brro-demo-aside {
	font-family: "acumin-pro", sans-serif;
	font-weight: 300;
	color: var(--brro-demo-ink);
}

.brro-demo .brro-demo-lead {
	font-size: clamp(19px, 1.53vw, 25px) /*22px @ 1440*/;
	line-height: 136.36%; /* 30 / 22 */
}

.brro-demo .brro-demo-aside {
	/* Width 0 keeps this paragraph from widening the column. It wraps to the button row, but never past the max. */
	width: 0;
	min-width: min(100%, clamp(389px, 32.92vw, 527px));
	max-width: clamp(389px, 32.92vw, 527px) /*474px @ 1440*/;
	font-size: clamp(16px, 1.11vw, 18px) /*16px @ 1440*/;
	font-weight: 400;
	line-height: 150%; /* 24 / 16 */
}

/* Same knop size as the bar. This one is the filled white state from the frame. */
.brro-demo a.brro-demo-panel-contact {
	height: clamp(32px, 2.64vw, 43px) /*38px @ 1440*/;
	padding: 0 clamp(14px, 1.18vw, 19px) /*17px @ 1440*/;
	border: 1px solid var(--brro-demo-ink);
	border-radius: clamp(39px, 3.23vw, 52px) /*46.5px @ 1440*/;
	background-color: var(--brro-demo-ink);
	color: var(--brro-demo-knop);
	font-family: "tenso", sans-serif;
	font-size: clamp(16px, 1.11vw, 18px) /*16px @ 1440*/;
	font-weight: 400;
	line-height: 206.25%; /* 33 / 16 */
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.brro-demo a.brro-demo-panel-contact:hover {
	border-color: var(--brro-demo-knop);
	background-color: transparent;
	color: var(--brro-demo-knop-ink);
}

/* ----- Responsive --------------------------------------------------- */

/* Tablet keeps the desktop columns side by side. The open height, the inset, and the column caps change. */
@media (min-width: 768px) and (max-width: 1179px) {
	:root {
		--brro-demo-bar-expanded: clamp(276px, calc(-4.14vw + 324.77px), 293px) /*293px @ 768 : 276px @ 1179*/;
	}

	.brro-demo .content-wrapper {
		padding-right: clamp(20px, calc(6.33vw - 28.58px), 46px) /*20px @ 768 : 46px @ 1179*/;
		padding-left: clamp(20px, calc(9.98vw - 56.61px), 61px) /*20px @ 768 : 61px @ 1179*/;
	}

	.brro-demo-lead-col {
		width: clamp(310px, calc(19.46vw + 160.51px), 390px) /*310px @ 768 : 390px @ 1179*/;
		min-width: 0;
		flex-shrink: 1;
		gap: clamp(32px, calc(2.19vw + 15.18px), 41px) /*32px @ 768 : 41px @ 1179*/;
	}

	.brro-demo-aside-col {
		min-width: 0;
		flex-shrink: 1;
		gap: clamp(32px, calc(2.19vw + 15.18px), 41px) /*32px @ 768 : 41px @ 1179*/;
	}

	/* The 474px floor would push this column past the row. It follows the column instead. */
	.brro-demo .brro-demo-aside {
		width: auto;
		min-width: 0;
	}
}

/* Narrow tablet: the color dots come off the example buttons so the two columns fit. */
@media (min-width: 768px) and (max-width: 782px) {
	.brro-demo-dots {
		display: none;
	}
	.brro-demo-aside-col {
		width: 372px;
	}
}
@media (min-width: 783px) and (max-width: 807px) {
	.brro-demo-dots .brro-demo-dot:nth-child(2),
	.brro-demo-dots .brro-demo-dot:nth-child(3) {
		display: none;
	}
	.brro-demo-aside-col {
		width: 430px;
	}
}
@media (min-width: 808px) and (max-width: 839px) {
	.brro-demo-dots .brro-demo-dot:nth-child(3) {
		display: none;
	}
	.brro-demo-aside-col {
		width: 450px;
	}
}

@media (max-width: 767px) {
	.brro-demo .content-wrapper {
		padding-right: 12px;
		padding-left: 12px;
		max-width: clamp(347px, calc(34.4vw + 236.17px), 500px) /*360px @ 360 : 500px @ 767*/;
	}

	.brro-demo-lead-col,
	.brro-demo-aside-col {
		flex-grow: 0;
		width: 100%;
		max-width: none;
		margin-left: 0;
	}

	/* Closed: the title and the Info button share one row. The example chips stay out. */
	.brro-demo-chip {
		display: none;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-chip {
		display: inline-flex;
	}

	body:not(:has(.brro-demo-toggle[aria-expanded="true"])) .brro-demo .content-wrapper {
		align-items: center;
	}

	body:not(:has(.brro-demo-toggle[aria-expanded="true"])) .brro-demo-lead-col {
		width: auto;
		flex-grow: 1;
		min-width: 0;
	}

	/* Closed: the right column is empty (chips and short text are out), so it leaves the row. */
	body:not(:has(.brro-demo-toggle[aria-expanded="true"])) .brro-demo-aside-col {
		display: none;
	}

	/* Closed: the chevron sits at the end of the title row. */
	body:not(:has(.brro-demo-toggle[aria-expanded="true"])) .brro-demo-heading {
		width: 100%;
	}

	body:not(:has(.brro-demo-toggle[aria-expanded="true"])) .brro-demo-toggle {
		margin-left: auto;
	}

	/* Open phone. The column boxes drop out, and each piece is placed on the grid.
	 * Row 1: title and Info. Row 2: example buttons. Rows 3–4: the two paragraphs. Row 5: appointment, then the back link. */
	:root {
		--brro-demo-bar-expanded: clamp(415px, calc(-18.18vw + 554.45px), 497px) /*489px @ 360 : 415px @ 767*/;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-lead-col,
	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-aside-col,
	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-heading,
	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-more,
	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-actions,
	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-tools {
		display: contents;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo .content-wrapper {
		display: grid;
		grid-template-columns: repeat(6, minmax(0, 1fr));
		align-content: start;
		align-items: center;
		row-gap: 20px;
		column-gap: 8px;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-intro {
		grid-column: 1 / -1;
		grid-row: 1;
		height: auto;
		overflow: visible;
		/* The chevron sits on this same row, at the right. Keep the sentence clear of it. */
		padding-right: calc(clamp(32px, 2.64vw, 43px) + 8px);
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-toggle {
		grid-column: 5 / 7;
		grid-row: 1;
		justify-self: end;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-chip:nth-child(1) {
		grid-column: 1 / 3;
		grid-row: 2;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-chip:nth-child(2) {
		grid-column: 3 / 5;
		grid-row: 2;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-chip:nth-child(3) {
		grid-column: 5 / 7;
		grid-row: 2;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-chip {
		width: 100%;
		min-width: 0;
		justify-content: center;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-lead {
		grid-column: 1 / -1;
		grid-row: 3;
	}

	/* Drops the desktop 474px floor and cap, so the short text uses the full row. */
	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-aside {
		grid-column: 1 / -1;
		grid-row: 4;
		width: auto;
		min-width: 0;
		max-width: none;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) .brro-demo-back {
		grid-column: 4 / -1;
		grid-row: 5;
		justify-self: end;
	}

	body:has(.brro-demo-toggle[aria-expanded="true"]) a.brro-demo-panel-contact {
		grid-column: 1 / 4;
		grid-row: 5;
		justify-self: start;
	}

	/* One dot per example button. The later dots stay in the markup for desktop and tablet. */
	.brro-demo-dot + .brro-demo-dot {
		display: none;
	}

	/* The 16px floor is still large on a phone, especially next to "Voorbeeld". */
	.brro-demo .brro-demo-chip,
	.brro-demo .brro-demo-toggle,
	.brro-demo a.brro-demo-back,
	.brro-demo a.brro-demo-panel-contact {
		font-size: clamp(14px, calc(0.49vw + 12.23px), 16px) /*14px @ 360 : 16px @ 767*/;
	}
}

/* From 420px the example buttons show two dots. */
@media (min-width: 420px) and (max-width: 767px) {
	.brro-demo-dots .brro-demo-dot:nth-child(2) {
		display: block;
	}
}

/* From 470px all three dots are back. */
@media (min-width: 470px) and (max-width: 767px) {
	.brro-demo-dots .brro-demo-dot:nth-child(3) {
		display: block;
	}
}
