/**
 * Roskam — [branches] / [branche] shortcode
 * Tokens: assets/css/root.css (--rk-*)
 */

.rk-branches {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

@media (min-width: 768px) {
	.rk-branches {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.rk-branches {
		grid-template-columns: repeat(var(--rk-cols, 6), minmax(0, 1fr));
	}
}

.rk-branche {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 200px;
	height: 100%;
	padding: 16px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	text-decoration: none;
	color: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
	opacity: 0;
	transform: translateY(16px);
}

.rk-branche.is-visible {
	opacity: 1;
	transform: none;
	transition:
		opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.rk-branche.is-visible:hover {
	border-color: #0056b3;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
	transform: translateY(-2px);
}

.rk-branche__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.7s ease-out;
}

.rk-branche:hover .rk-branche__bg {
	transform: scale(1.1);
}

.rk-branche__tint {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(0, 86, 179, 0.45);
	mix-blend-mode: multiply;
	transition: background 0.3s ease;
}

.rk-branche:hover .rk-branche__tint {
	background: rgba(0, 86, 179, 0.25);
}

.rk-branche__grad {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(0, 56, 121, 0.7), rgba(0, 56, 121, 0.15) 55%, transparent);
	transition: background 0.3s ease;
}

.rk-branche:hover .rk-branche__grad {
	background: linear-gradient(to top, rgba(0, 56, 121, 0.8), rgba(0, 56, 121, 0.15) 55%, transparent);
}

.rk-branche__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-bottom: 12px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.15);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	color: #fff;
	transition: background 0.25s ease;
}

.rk-branche:hover .rk-branche__icon {
	background: #e2231a;
}

.rk-branche__icon-glyph {
	display: block;
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	background-color: currentColor;
	-webkit-mask: var(--rk-branche-icon) center / contain no-repeat;
	mask: var(--rk-branche-icon) center / contain no-repeat;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.rk-branche:hover .rk-branche__icon-glyph {
	transform: skewX(-10deg);
}

.rk-branche__title {
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.rk-branche__text {
	margin-top: 4px;
	font-size: 12px;
	line-height: 16px;
	min-height: 2rem;
	color: rgba(255, 255, 255, 0.85);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rk-branche__cta {
	margin-top: 12px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.rk-branche:hover .rk-branche__cta {
	opacity: 1;
}

/* Optionele banner onder de grid */
.rk-branches-wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.rk-branches-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	padding: 16px 24px;
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 12px;
}

.rk-branches-banner__text {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0 !important;
	padding: 0 !important;
	flex: 1 1 auto;
	min-width: 0;
	font-size: 14px;
	line-height: 1.4;
	color: #6b7280;
}

.rk-branches-banner__title {
	font-weight: 700;
	color: #0056b3;
	line-height: inherit;
}

.rk-branches-banner__lead {
	margin-left: 0.25em;
	line-height: inherit;
}

.rk-branches-banner__btn {
	display: inline-flex;
	align-items: center;
	align-self: center;
	gap: 8px;
	flex: 0 0 auto;
	margin: 0;
	padding: 10px 18px;
	border-radius: 9999px;
	background: #e2231a;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(226, 35, 26, 0.25);
	transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.rk-branches-banner__btn:hover,
.rk-branches-banner__btn:focus-visible {
	background: #c41c15;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(226, 35, 26, 0.3);
}

.rk-branches-banner__btn-icon {
	display: block;
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
	background-color: currentColor;
	-webkit-mask: var(--rk-branches-phone) center / contain no-repeat;
	mask: var(--rk-branches-phone) center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
	.rk-branche,
	.rk-branche__bg,
	.rk-branche__cta,
	.rk-branche__icon-glyph,
	.rk-branches-banner__btn {
		transition: none !important;
	}

	.rk-branche {
		opacity: 1;
		transform: none;
	}

	.rk-branche:hover .rk-branche__icon-glyph,
	.rk-branches-banner__btn:hover,
	.rk-branches-banner__btn:focus-visible {
		transform: none;
	}
}
