/**
 * Kennisbank detailpagina: lagen onder de inhoud (ticket #19)
 *
 * @package   ThinkYellow\Kennisbank
 * @author    Think Yellow
 * @copyright 2026 Think Yellow
 */

/* Boven de titel: terugknop + categorie/datum */
.kb-back,
.kb-single-meta,
.kb-single {
	--kb-blue-600: #002d35;
	--kb-slate-400: #395b61;
	--kb-sky: #4db3eb;
}

.kb-single-page .kb-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 40px;
	font-family: "DM Sans", sans-serif;
	font-weight: 600;
	font-size: 17px;
	line-height: 30px;
	color: var(--kb-blue-600);
	text-decoration: none;

	&:hover,
	&:focus-visible {
		text-decoration: underline;
	}
}

.kb-single-page .kb-back__icon {
	display: block;
	flex: none;
	width: 24px;
	height: 24px;
	margin: 0 !important; /* Salient: img-marges */
}

.kb-single-page .kb-single-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 30px;
	line-height: normal;
}

.kb-single-page .kb-single-meta__date {
	font-family: "DM Sans", sans-serif;
	font-size: 15px;
	color: var(--kb-slate-400);
}

/* De (lege) Salient categorie-pills niet tonen */
.kb-single-page .meta-category {
	display: none;
}

.kb-single {
	--kb-blue-600: #002d35;
	--kb-blue-200: #8da3aa;
	--kb-blue-100: #ebf1f8;
	--kb-sky: #4db3eb;
	--kb-font-title: "DM Sans", sans-serif;
	--kb-font-body: "Inter", sans-serif;

	display: flex;
	flex-direction: column;
	gap: 40px; /* Figma: 40 tussen de lagen, 60 boven "Meer weten" (zie contacts) */
	margin-top: 60px;
	color: var(--kb-blue-600);
}

.kb-single .kb-single__title {
	margin: 0;
	padding: 0 0 16px;
	font-family: var(--kb-font-title);
	font-weight: 600;
	font-size: 27px;
	line-height: 34px;
	letter-spacing: 0;
	color: var(--kb-blue-600);
	border-bottom: 1px solid var(--kb-blue-200);
}

.kb-single .kb-single__title--plain,
.kb-single .kb-single__title--center {
	padding-bottom: 0;
	border-bottom: 0;
}

.kb-single .kb-single__title--center {
	text-align: center;
}

/* Categorie en Tags: lijn, daarna pills met pijl */
.kb-single__section {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Gedeelde lijst-reset tegen Salient (lage specificiteit) */
.kb-single :where(ul.kb-pills, ul.kb-related),
.kb-single :where(ul.kb-pills, ul.kb-related) > :where(li) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.kb-single .kb-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kb-single .kb-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 12px 5px 9px;
	font-family: var(--kb-font-body);
	font-size: 17px;
	line-height: 30px;
	color: var(--kb-blue-600);
	background: var(--kb-blue-100);
	border-radius: 6px;
	text-decoration: none;
	transition: background-color .15s;

	&:hover,
	&:focus-visible {
		background: #dbe5f0;
	}

	&:focus-visible {
		outline: 2px solid var(--kb-sky);
		outline-offset: 1px;
	}
}

.kb-single .kb-pill__icon {
	display: block;
	flex: none;
	width: 20.56px;
	height: 20.56px;
	margin: 0 !important; /* Salient: img in berichtinhoud krijgt margin-bottom 15px */
}

/* Misschien ook interessant: kaarten in 2 kolommen */
.kb-single__related {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.kb-single .kb-related {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.kb-single .kb-related > .kb-related__item {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 17px;
	background: var(--kb-blue-100);
	border-radius: 12px;
	transition: box-shadow .15s;

	&:hover,
	&:focus-within {
		box-shadow: 0 4px 16px rgba(0, 45, 53, .1);
	}
}

.kb-single .kb-related__cat {
	font-family: var(--kb-font-body);
	font-weight: 600;
	font-size: 15px;
	line-height: normal;
	color: var(--kb-sky);
}

.kb-single .kb-related__link {
	font-family: var(--kb-font-title);
	font-weight: 500;
	font-size: 18px;
	line-height: normal;
	color: var(--kb-blue-600);
	text-decoration: none;

	/* Hele kaart klikbaar */
	&::after {
		content: "";
		position: absolute;
		inset: 0;
		border-radius: 12px;
	}

	&:focus-visible {
		outline: none;

		&::after {
			outline: 2px solid var(--kb-sky);
			outline-offset: 2px;
		}
	}
}

@media (max-width: 690px) {
	.kb-single .kb-related {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Meer weten: titel gecentreerd, kaarten (Buro26 Contactpersoon) onder elkaar */
.kb-single__contacts {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-top: 20px;
}

/* Tekst verticaal gecentreerd naast de foto (Figma). Buro26 zet de foto over
   20 rijen en de tekst bovenaan; hier: lege 1fr-rij boven en onder de tekst. */
@media (min-width: 600px) {
	.kb-single__contacts .buro26-vc-contact .wpb_column .wpb_wrapper {
		grid-template-rows: 1fr repeat(10, auto) 1fr;
		align-items: start;

		&::before {
			content: "";
			grid-column: 2;
			grid-row: 1;
		}
	}

	.kb-single__contacts .buro26-vc-contact .team .team-member-image {
		grid-row: 1 / -1;
	}

	.kb-single__contacts .buro26-vc-contact .team .team-meta {
		grid-row: auto;
	}
}

/* Iconen zoals in Figma (Material outline) i.p.v. FontAwesome */
.kb-single__contacts .buro26-vc-contact .iwt-icon i:is(.fa-envelope, .fa-phone) {
	display: block;
	width: 24px !important;
	height: 24px;
	top: 0 !important; /* Salient: .iwithtext i { top: -2px } */
	background: center / 24px 24px no-repeat;

	&::before {
		content: none;
	}
}

.kb-single__contacts .buro26-vc-contact .iwt-icon i.fa-envelope {
	background-image: url("../img/kb-mail.svg");
}

.kb-single__contacts .buro26-vc-contact .iwt-icon i.fa-phone {
	background-image: url("../img/kb-call.svg");
}

/* Teamleden met een gecentreerde kolom in hun Global Section: toch links
   uitlijnen zoals de Buro26-kaart en Figma. */
.kb-single__contacts .buro26-vc-contact .wpb_wrapper,
.kb-single__contacts .buro26-vc-contact .wpb_wrapper :is(h3, h5, p, .team-meta, .iwithtext) {
	text-align: left !important;
}

.kb-single__contacts .buro26-vc-contact .nectar-responsive-text {
	grid-column: 2;

	& p {
		margin: 0;
		padding: 0;
	}

	& a {
		color: #002d35;
		font-weight: 700;
		font-size: 17px;
		line-height: 1.76;
		text-decoration: none;

		&:hover {
			text-decoration: underline;
		}
	}
}
