/* Bricks Blocks – Vacancies ("Openstaande vacatures")
 *
 * A header row (heading left, count right) above one of two views. The cards: a grid of
 * soft cards with the tagline as the card title, the function below it, and a
 * "Bekijk op scouting.nl ↗" link pinned to the bottom so the links line up per row.
 * The compact list (.bb-vacancies--compact): one row per vacancy, see the end of the
 * grid section. Scoped under .bb-vacancies with
 * explicit values for headings, lists and links so the theme's element styles don't
 * leak in. Colours and spacing read the site's Bricks variables with the design value
 * as fallback. Colours and font sizes can be set per part: site-wide under
 * Bricks Blocks → Vacancies (printed as :where(.bb-vacancies){…}, zero specificity) and
 * per element in the builder; both set the optional --bb-vac-<part>-color / -size
 * variables read below, each falling back to the default.
 * Fonts (Geologica, Poppins) are expected to be loaded by the site.
 */

.bb-vacancies {
	--bb-vac-primary: var(--primary, #5f112b);
	--bb-vac-text: var(--text, #222222);
	--bb-vac-muted: var(--text-muted, #5a5a5a);
	--bb-vac-link: var(--bb-vac-text);
	--bb-vac-card-bg: var(--background-soft, #fbf1ef);
	--bb-vac-radius: 16px;
	--bb-vac-card-pad: 32px;
	--bb-vac-gap: var(--bb-vac-gap-site, 24px);
	--bb-vac-columns-auto: var(--bb-vac-cols-desktop, 3);
	--bb-vac-font-title: "Geologica", sans-serif;
	--bb-vac-font-body: "Poppins", sans-serif;

	box-sizing: border-box;
	display: block;
	width: 100%;
	font-family: var(--bb-vac-font-body);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--bb-vac-text);
	-webkit-font-smoothing: antialiased;
}

.bb-vacancies *,
.bb-vacancies *::before,
.bb-vacancies *::after {
	box-sizing: border-box;
}

.bb-vacancies svg {
	display: block;
	flex-shrink: 0;
}

/* ---------- Header ---------- */

.bb-vacancies__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin-bottom: 28px;
}

.bb-vacancies .bb-vacancies__heading {
	margin: 0;
	padding: 0;
	font-family: var(--bb-vac-font-title);
	font-weight: 900;
	font-size: var(--bb-vac-heading-size, clamp(1.75rem, 1.2rem + 2vw, 2.6rem));
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--bb-vac-heading-color, var(--bb-vac-primary));
}

.bb-vacancies .bb-vacancies__count {
	margin: 0 0 0.2em;
	font-size: 0.9rem;
	line-height: 1.4;
	color: var(--bb-vac-muted);
}

.bb-vacancies__count strong {
	font-weight: 700;
	color: var(--bb-vac-text);
}

/* ---------- Team filter (pills) ---------- */

.bb-vacancies [hidden] {
	display: none !important;
}

.bb-vacancies .bb-vacancies__filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: -6px 0 28px;
}

.bb-vacancies .bb-vacancies__pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 8px 8px 16px;
	border: 1.5px solid rgba(0, 0, 0, 0.14);
	border-radius: 999px;
	background: #fff;
	font-family: var(--bb-vac-font-body);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--bb-vac-text);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bb-vacancies .bb-vacancies__pill-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.07);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}

.bb-vacancies .bb-vacancies__pill:hover:not(:disabled):not(.is-active) {
	border-color: var(--bb-vac-team-bg-color, var(--bb-vac-primary));
}

.bb-vacancies .bb-vacancies__pill.is-active {
	border-color: var(--bb-vac-team-bg-color, var(--bb-vac-primary));
	background: var(--bb-vac-team-bg-color, var(--bb-vac-primary));
	color: var(--bb-vac-team-color, #fff);
}

.bb-vacancies .bb-vacancies__pill.is-active .bb-vacancies__pill-count {
	background: rgba(255, 255, 255, 0.22);
}

.bb-vacancies .bb-vacancies__pill:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.bb-vacancies .bb-vacancies__pill:focus-visible {
	outline: 2px solid var(--bb-vac-team-bg-color, var(--bb-vac-primary));
	outline-offset: 2px;
}

/* ---------- Grid + cards ---------- */

.bb-vacancies .bb-vacancies__grid {
	display: grid;
	grid-template-columns: repeat(var(--bb-vac-columns, var(--bb-vac-columns-auto)), minmax(0, 1fr));
	gap: var(--bb-vac-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.bb-vacancies .bb-vacancies__card {
	display: flex;
	flex-direction: column;
	min-height: 180px;
	margin: 0;
	padding: var(--bb-vac-card-pad);
	overflow: hidden;
	border-radius: var(--bb-vac-radius);
	background: var(--bb-vac-card-bg-color, var(--bb-vac-card-bg));
	list-style: none;
}

.bb-vacancies__card::before,
.bb-vacancies__card::marker {
	content: none;
}

.bb-vacancies .bb-vacancies__tagline {
	margin: 0 0 6px;
	padding: 0;
	font-family: var(--bb-vac-font-title);
	font-weight: 800;
	font-size: var(--bb-vac-tagline-size, 1.1rem);
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	color: var(--bb-vac-tagline-color, var(--bb-vac-primary));
}

.bb-vacancies .bb-vacancies__title {
	margin: 0;
	font-size: var(--bb-vac-title-size, 0.9rem);
	line-height: 1.5;
	color: var(--bb-vac-title-color, var(--bb-vac-muted));
}

/* The main team as a thin strip across the top edge of the card (bleeds over the padding). */
.bb-vacancies .bb-vacancies__team {
	margin: calc(var(--bb-vac-card-pad) * -1) calc(var(--bb-vac-card-pad) * -1) 20px;
	padding: 7px var(--bb-vac-card-pad);
	background: var(--bb-vac-team-bg-color, var(--bb-vac-primary));
	font-size: var(--bb-vac-team-size, 0.72rem);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bb-vac-team-color, #fff);
}

/* margin-top: auto pins the footer to the card bottom, so links line up per row. */
.bb-vacancies .bb-vacancies__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 16px;
	margin-top: auto;
	padding-top: 24px;
}

.bb-vacancies .bb-vacancies__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--bb-vac-font-body);
	font-weight: 600;
	font-size: var(--bb-vac-link-size, 0.88rem);
	line-height: 1.4;
	color: var(--bb-vac-link-color, var(--bb-vac-link));
	text-decoration: none;
}

.bb-vacancies .bb-vacancies__date {
	font-size: var(--bb-vac-date-size, 0.78rem);
	line-height: 1.4;
	color: var(--bb-vac-date-color, var(--bb-vac-muted));
}

.bb-vacancies__link svg {
	width: 12px;
	height: 12px;
	transition: transform 0.15s ease;
}

.bb-vacancies .bb-vacancies__link:hover {
	color: var(--bb-vac-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bb-vacancies__link:hover svg {
	transform: translate(2px, -2px);
}

.bb-vacancies__link:focus-visible {
	outline: 2px solid var(--bb-vac-primary);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Whole card clickable: the link's hit area stretches over the card. */
.bb-vacancies__card {
	position: relative;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.bb-vacancies__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--bb-vac-radius);
}

.bb-vacancies__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(95, 17, 43, 0.10);
}

.bb-vacancies .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Compact list ---------- */

/* A container, so the rows adapt to the width they get (a column, a sidebar), not the screen's. */
.bb-vacancies--compact {
	container-type: inline-size;
}

.bb-vacancies .bb-vacancies__list {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--bb-vac-line-color, rgba(0, 0, 0, 0.12));
	list-style: none;
}

.bb-vacancies .bb-vacancies__row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 4px 24px;
	margin: 0;
	padding: 14px 12px;
	border-bottom: 1px solid var(--bb-vac-line-color, rgba(0, 0, 0, 0.12));
	list-style: none;
	transition: background-color 0.15s ease;
}

.bb-vacancies__row::before,
.bb-vacancies__row::marker {
	content: none;
}

.bb-vacancies .bb-vacancies__row:hover {
	background: var(--bb-vac-row-hover-color, var(--bb-vac-card-bg));
}

.bb-vacancies .bb-vacancies__row-main {
	flex: 1 1 auto;
	min-width: 0;
}

.bb-vacancies .bb-vacancies__row-title {
	margin: 0;
	padding: 0;
	font-family: var(--bb-vac-font-title);
	font-weight: 700;
	font-size: var(--bb-vac-title-size, 1rem);
	line-height: 1.35;
	letter-spacing: normal;
	text-transform: none;
	color: var(--bb-vac-title-color, var(--bb-vac-primary));
}

.bb-vacancies .bb-vacancies__row-link {
	color: inherit;
	text-decoration: none;
}

/* The whole row is clickable: the link's hit area stretches over it. */
.bb-vacancies__row-link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.bb-vacancies .bb-vacancies__row:hover .bb-vacancies__row-link {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bb-vacancies__row-link:focus-visible {
	outline: none;
}

.bb-vacancies__row-link:focus-visible::after {
	outline: 2px solid var(--bb-vac-primary);
	outline-offset: -2px;
}

.bb-vacancies .bb-vacancies__row-tagline {
	margin: 2px 0 0;
	font-size: var(--bb-vac-tagline-size, 0.85rem);
	line-height: 1.45;
	color: var(--bb-vac-tagline-color, var(--bb-vac-muted));
}

/* Fixed widths line the columns up from row to row. */
.bb-vacancies .bb-vacancies__row-team {
	flex: 0 0 12rem;
	margin: 0;
	font-size: var(--bb-vac-team-size, 0.72rem);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bb-vac-rowteam-color, var(--bb-vac-primary));
}

.bb-vacancies .bb-vacancies__row-date {
	flex: 0 0 9.5rem;
	font-size: var(--bb-vac-date-size, 0.8rem);
	line-height: 1.4;
	text-align: right;
	color: var(--bb-vac-date-color, var(--bb-vac-muted));
}

.bb-vacancies .bb-vacancies__row-go {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: var(--bb-vac-link-size, 0.85rem);
	line-height: 1.4;
	color: var(--bb-vac-link-color, var(--bb-vac-link));
}

.bb-vacancies__row-go svg {
	width: 12px;
	height: 12px;
	transition: transform 0.15s ease;
}

.bb-vacancies__row:hover .bb-vacancies__row-go svg {
	transform: translate(2px, -2px);
}

/* Narrower than the columns need: the function on its own line, the rest on one below it. */
@container (max-width: 860px) {
	.bb-vacancies .bb-vacancies__row {
		flex-wrap: wrap;
		padding: 12px 4px;
	}

	.bb-vacancies .bb-vacancies__row-main {
		flex: 1 1 100%;
	}

	.bb-vacancies .bb-vacancies__row-team,
	.bb-vacancies .bb-vacancies__row-date {
		flex: 0 1 auto;
		text-align: left;
	}

	.bb-vacancies .bb-vacancies__row-go {
		margin-left: auto;
	}
}

/* ---------- Empty state ---------- */

.bb-vacancies .bb-vacancies__empty {
	margin: 0;
	padding: 32px;
	border-radius: var(--bb-vac-radius);
	background: var(--bb-vac-card-bg-color, var(--bb-vac-card-bg));
	color: var(--bb-vac-muted);
	text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.bb-vacancies {
		--bb-vac-columns-auto: var(--bb-vac-cols-tablet, 2);
	}
}

@media (max-width: 600px) {
	.bb-vacancies {
		--bb-vac-columns-auto: var(--bb-vac-cols-mobile, 1);
		--bb-vac-gap: var(--bb-vac-gap-site, 16px);
		--bb-vac-card-pad: 24px;
	}

	/* One swipeable row instead of a tall stack of pills. */
	.bb-vacancies .bb-vacancies__filter {
		flex-wrap: nowrap;
		padding-bottom: 6px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.bb-vacancies .bb-vacancies__filter::-webkit-scrollbar {
		display: none;
	}

	.bb-vacancies .bb-vacancies__pill {
		flex: 0 0 auto;
	}

	.bb-vacancies .bb-vacancies__card {
		min-height: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bb-vacancies *,
	.bb-vacancies *::before,
	.bb-vacancies *::after {
		transition: none !important;
	}

	.bb-vacancies__card:hover,
	.bb-vacancies__link:hover svg,
	.bb-vacancies__row:hover .bb-vacancies__row-go svg {
		transform: none;
	}
}
