/**
 * Samenwerkingspartners: kaart, lijst en pop-up.
 *
 * Indeling en maatvoering zijn overgenomen van de LEEFH centra-plugin
 * (zijbalk 350px + kaart in één afgeronde kaart, rij van 600px, resultaten met
 * een ronde icoonpil ervoor). Alleen de kleuren zijn die van RS Thuiszorg.
 * Ze staan als custom property zodat het thema ze kan overschrijven.
 */

.rst-sp {
	--rst-sp-green: #006865;
	--rst-sp-green-hover: #00514f;
	--rst-sp-light: #edf9f7;
	--rst-sp-line: #e7e7e7;
	--rst-sp-ink: #1e1e1e;
	--rst-sp-radius: 30px;
	--rst-sp-row-height: 600px;
}

/* ------------------------------------------------------------- indeling --- */

.rst-sp-container {
	display: grid;
	grid-template-columns: 350px 1fr;
	grid-template-rows: var(--rst-sp-row-height);
	overflow: hidden;
}

@media (max-width: 991.98px) {
	/* Zoals bij LEEFH: kaart bovenaan, lijst eronder. De kaart krijgt zijn
	   hoogte uit aspect-ratio, want een auto-rij klapt een height:100%-kaart
	   dicht tot 0. De lijst krijgt een vaste rij en scrollt daarbinnen.
	   LEEFH klapt om op 800px, maar de container van dit thema is dan al 720px
	   breed: naast de vaste zijbalk van 350px houdt de kaart nog 346px over.
	   Vandaar de lg-grens van Bootstrap in plaats van 800px. */
	.rst-sp-container {
		grid-template-columns: 1fr;
		grid-template-rows: auto 500px;
	}
}

/* -------------------------------------------------------------- zijbalk --- */

.rst-sp-sidebar {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid var(--rst-sp-line);
	border-radius: var(--rst-sp-radius) 0 0 var(--rst-sp-radius);
	overflow: hidden;
}

@media (max-width: 991.98px) {
	.rst-sp-sidebar {
		border-top: 0;
		border-radius: 0 0 var(--rst-sp-radius) var(--rst-sp-radius);
	}
}

.rst-sp-search-form {
	padding: 20px;
}

.rst-sp-search-form h3 {
	margin: 0 0 10px;
	color: var(--rst-sp-green) !important;
	font-size: 18px !important;
}

.rst-sp-search-form label {
	display: block;
	margin-bottom: 5px;
	font-size: 0.9em;
	font-weight: 600;
	color: #555;
}

.rst-sp-search-wrapper {
	display: flex;
	align-items: center;
	height: 40px;
}

.rst-sp-search-wrapper input[type='text'] {
	flex: 1 1 auto;
	width: 100px;
	height: 100%;
	padding: 0 18px;
	border: 1px solid #ccc;
	border-right: none;
	border-radius: 100px 0 0 100px;
	font-size: 15px;
	outline: none;
	box-sizing: border-box;
}

.rst-sp-search-wrapper input[type='text']:focus {
	position: relative;
	z-index: 1;
	border-color: var(--rst-sp-green);
}

.rst-sp-search-wrapper button {
	flex-shrink: 0;
	width: 44px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--rst-sp-green);
	border-left: none;
	border-radius: 0 100px 100px 0;
	background: var(--rst-sp-green);
	color: #fff;
	cursor: pointer;
	box-sizing: border-box;
	transition: background-color 0.3s ease-in-out;
}

.rst-sp-search-wrapper button:hover {
	background: var(--rst-sp-green-hover);
}

.rst-sp-search-wrapper button svg {
	width: 20px;
	height: 20px;
}

/* ----------------------------------------------------------- resultaten --- */

.rst-sp-results-wrapper {
	flex-grow: 1;
	overflow-y: auto;
}

.rst-sp-results-list ul {
	margin: 0 !important;
	padding: 0;
	list-style: none;
}

.rst-sp-results-list li {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 15px 20px;
	margin-bottom: 0 !important;
	border-bottom: 1px solid var(--rst-sp-line);
	cursor: pointer;
	transition: background-color 0.2s;
}

.rst-sp-results-list li:last-of-type {
	border-bottom: 0;
}

.rst-sp-results-list li:hover,
.rst-sp-results-list li.rst-sp-active {
	background-color: var(--rst-sp-light);
}

.rst-sp-results-list li:focus-visible {
	outline: 2px solid var(--rst-sp-green);
	outline-offset: -2px;
}

/*
 * Het thema hangt aan elke li in de content een Font Awesome-pijl via ::before,
 * met de selector `body:not(.wp-admin) ul:not(..., #bootscore-navbar, ...) li`.
 * Door dat id telt die als id-selector: daar win je niet van op specificiteit.
 * Het thema gebruikt hiervoor zelf ook `unset !important`.
 */
.rst-sp li::before,
.rst-sp__dialog li::before {
	content: unset !important;
}

.rst-sp-result-arrow {
	flex-shrink: 0;
}

.rst-sp-arrow-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 9999px;
	background: var(--rst-sp-green);
	color: #fff;
}

.rst-sp-arrow-icon i {
	font-size: 13px;
	color: #fff;
}

.rst-sp-result-title {
	font-weight: 500;
	color: var(--rst-sp-ink);
}

.rst-sp-result-location {
	margin-top: 2px;
	font-size: 0.95em;
	opacity: 0.85;
}

.rst-sp-result-more {
	font-size: 0.95em;
	color: var(--rst-sp-green);
	text-decoration: underline;
}

.rst-sp-no-results {
	padding: 20px;
	color: #777;
	font-style: italic;
}

/* ---------------------------------------------------------------- kaart --- */

.rst-sp-map-area {
	height: 100%;
	border-radius: 0 var(--rst-sp-radius) var(--rst-sp-radius) 0;
	overflow: hidden;
}

@media (max-width: 991.98px) {
	/*
	 * Kaart bovenaan, lijst eronder. Expliciete hoogte in plaats van
	 * aspect-ratio: bij een aspect-ratio bepaalt de hoogtelimiet ook de breedte
	 * en blijft de kaart smaller dan de container. Deze regels staan bewust ná
	 * de basisregel hierboven: die heeft hetzelfde gewicht, dus alleen de
	 * laatste van de twee wint.
	 */
	.rst-sp-map-area {
		order: -1;
		width: 100%;
		height: clamp(280px, 60vw, 420px);
		border-radius: var(--rst-sp-radius) var(--rst-sp-radius) 0 0;
	}
}


#rstSpMap {
	width: 100%;
	height: 100%;
	z-index: 0; /* houdt de kaart onder de header en de pop-up */
}

.rst-sp-marker {
	color: var(--rst-sp-green, #006865);
	cursor: pointer;
	transition: transform 0.3s ease-in-out;
}

.rst-sp-marker:hover {
	transform: scale(1.05);
	z-index: 9999 !important;
}

/* Eigen kantoor: beeldmerk in een witte badge met groene ring en een puntje. */
.rst-sp-marker--office {
	background: none;
	border: 0;
}

.rst-sp-marker__badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--rst-sp-green, #006865);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.rst-sp-marker__badge img {
	width: 30px;
	height: 30px;
	object-fit: contain;
}

.rst-sp-marker__point {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 12px;
	height: 12px;
	background: var(--rst-sp-green, #006865);
	transform: translateX(-50%) rotate(45deg);
	border-radius: 2px;
}

.rst-sp-office-popup {
	font-size: 14px;
	line-height: 1.45;
}

.rst-sp-office-popup a {
	color: var(--rst-sp-green, #006865);
	font-weight: 600;
}

.leaflet-tooltip.rst-sp-tooltip {
	padding: 4px 8px;
	border: 0;
	border-radius: 4px;
	background: #333;
	color: #fff;
	font-size: 14px;
	white-space: nowrap;
	box-shadow: none;
}

.leaflet-tooltip.rst-sp-tooltip::before {
	border-top-color: #333;
}

/* --------------------------------------------------------------- pop-up --- */

body.rst-sp-dialog-open {
	overflow: hidden;
}

.rst-sp__dialog {
	position: fixed;
	inset: 0;
	z-index: 1090; /* boven de sticky header van het thema */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.rst-sp__dialog[hidden] {
	display: none;
}

.rst-sp__dialog-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 40, 39, 0.55);
}

.rst-sp__dialog-panel {
	position: relative;
	width: min(560px, 100%);
	/* De padding van de overlay meerekenen, anders valt een lange lijst
	   boven en onder buiten beeld. */
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 32px;
	border-radius: var(--rst-sp-radius, 30px);
	background: #fff;
}

.rst-sp__dialog-close {
	position: absolute;
	top: 16px;
	inset-inline-end: 16px;
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--rst-sp-light, #edf9f7);
	color: var(--rst-sp-green, #006865);
	cursor: pointer;
}

.rst-sp__dialog-logo {
	max-width: 160px;
	height: auto;
	margin-bottom: 16px;
}

.rst-sp__dialog-title {
	margin: 0 0 4px;
	color: var(--rst-sp-green, #006865);
}

.rst-sp__dialog-district {
	margin: 0 0 20px;
	font-size: 14px;
	opacity: 0.65;
}

.rst-sp__dialog-heading {
	margin: 20px 0 8px;
	font-size: 16px;
	font-weight: 600;
}

.rst-sp__dialog-providers,
.rst-sp__dialog-contact {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 15px;
}

.rst-sp__dialog-contact li {
	display: flex;
	align-items: center;
	gap: 10px;
}

.rst-sp__dialog-contact li > span {
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--rst-sp-light, #edf9f7);
	color: var(--rst-sp-green, #006865);
	font-size: 11px;
}

.rst-sp__dialog-contact li a {
	word-break: break-word;
}

.rst-sp__dialog-providers li {
	position: relative;
	padding-inline-start: 18px;
}

.rst-sp__dialog .rst-sp__dialog-providers li::before {
	/* Het thema zet op dezelfde ::before een breedte en een lettergrootte voor
	   zijn pijl-icoon. Die wint op specificiteit, dus de maten moeten hier mee. */
	content: '' !important;
	position: absolute;
	inset-inline-start: 0;
	top: 0.65em;
	width: 6px !important;
	height: 6px !important;
	min-width: 0 !important;
	margin: 0 !important;
	border-radius: 50%;
	background: var(--rst-sp-green, #006865);
}

.rst-sp__dialog-actions {
	margin: 24px 0 0;
}

@media (prefers-reduced-motion: reduce) {
	.rst-sp-results-list li,
	.rst-sp-marker {
		transition: none;
	}

	.rst-sp-marker:hover {
		transform: none;
	}
}

/*
 * Geen override op de eigen .container. Het sjabloon "Blank with container" zet
 * `max-width: none` op zijn eigen .container, dus die begrenst niets: elk blok
 * op deze pagina haalt zijn breedte uit zijn eigen .container, en dat doet dit
 * blok dus ook.
 */
