/* Real Discipleship - Toelichting
   Een gemarkeerd woord in de lopende tekst met een venster met extra uitleg.
   Alle onderdelen zijn inline-elementen, zodat de markup geldig blijft binnen <p>. */

.rd-tl {
	display: inline;
}

/* --- Het gemarkeerde woord ------------------------------------------------ */

.rd-tl__trigger {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	cursor: pointer;
	text-align: inherit;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-decoration-thickness: 1px;
	text-decoration-color: currentColor;
	text-underline-offset: 0.22em;
	border-radius: 2px;
	transition: text-decoration-color 180ms var(--rd-ease, ease),
		background-color 180ms var(--rd-ease, ease);
}

@supports (color: color-mix(in oklab, currentColor 50%, transparent)) {
	.rd-tl__trigger {
		text-decoration-color: color-mix(in oklab, currentColor 55%, transparent);
	}
}

.rd-tl__trigger:hover,
.rd-tl__trigger[aria-expanded="true"] {
	text-decoration-color: currentColor;
	background-color: rgb(215 162 75 / 0.16);
}

.rd-tl__trigger:focus-visible {
	outline: 2px solid var(--rd-accent-ink, #8a6014);
	outline-offset: 3px;
}

/* Klein ringetje als teken dat er uitleg achter zit. */
.rd-tl__teken {
	display: inline-block;
	width: 0.42em;
	height: 0.42em;
	margin-left: 0.22em;
	vertical-align: 0.42em;
	border: 1px solid currentColor;
	border-radius: 50%;
	opacity: 0.6;
	transition: opacity 180ms var(--rd-ease, ease),
		background-color 180ms var(--rd-ease, ease);
}

.rd-tl__trigger:hover .rd-tl__teken,
.rd-tl__trigger[aria-expanded="true"] .rd-tl__teken {
	opacity: 1;
	background-color: var(--rd-accent, #d7a24b);
	border-color: var(--rd-accent, #d7a24b);
}

.rd-tl__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --- Het venster ---------------------------------------------------------- */

.rd-tl__paneel {
	display: none;
	position: fixed;
	inset: auto;
	z-index: 10000;
	box-sizing: border-box;
	width: max-content;
	max-width: min(38ch, calc(100vw - 32px));
	margin: 0;
	padding: 1.15em 1.3em 1.25em;
	background: var(--rd-surface, #fbf9f4);
	color: var(--rd-ink, #15181b);
	border: 1px solid var(--rd-line, #ddd8cf);
	border-radius: var(--rd-radius, 4px);
	box-shadow: 0 1px 2px rgb(21 24 27 / 0.06), 0 14px 34px -10px rgb(21 24 27 / 0.22);
	font-family: var(--rd-font-body, inherit);
	font-size: 0.92em;
	font-weight: 400;
	font-style: normal;
	line-height: 1.62;
	letter-spacing: 0;
	text-align: left;
	text-indent: 0;
	white-space: normal;
	overflow-wrap: break-word;
}

.rd-tl__paneel.is-open {
	display: block;
	animation: rd-tl-in 200ms var(--rd-ease, cubic-bezier(0.2, 0.7, 0.2, 1)) both;
}

@keyframes rd-tl-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.rd-tl__kop {
	display: block;
	margin: 0 0 0.35em;
	font-family: var(--rd-font-display, Georgia, "Times New Roman", serif);
	font-size: 1.1em;
	font-weight: 400;
	line-height: 1.24;
	letter-spacing: -0.012em;
	color: var(--rd-ink, #15181b);
}

.rd-tl__tekst {
	display: block;
	color: var(--rd-stone, #5e6469);
}

.rd-tl__p {
	display: block;
}

.rd-tl__p + .rd-tl__p {
	margin-top: 0.7em;
}

.rd-tl__tekst a {
	color: var(--rd-accent-ink, #8a6014);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.rd-tl__link {
	display: inline-block;
	margin-top: 0.85em;
	color: var(--rd-accent-ink, #8a6014);
	font-size: 0.94em;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

/* Puntje dat naar het woord wijst. */
.rd-tl__punt {
	position: absolute;
	top: -5px;
	left: var(--rd-tl-punt, 50%);
	width: 9px;
	height: 9px;
	margin-left: -5px;
	background: var(--rd-surface, #fbf9f4);
	border-left: 1px solid var(--rd-line, #ddd8cf);
	border-top: 1px solid var(--rd-line, #ddd8cf);
	transform: rotate(45deg);
}

.rd-tl__paneel--boven .rd-tl__punt {
	top: auto;
	bottom: -5px;
	border-left: 0;
	border-top: 0;
	border-right: 1px solid var(--rd-line, #ddd8cf);
	border-bottom: 1px solid var(--rd-line, #ddd8cf);
}

/* Sluitknop: alleen waar er geen Escape-toets is (aanraakschermen). */
.rd-tl__sluit {
	display: none;
	position: absolute;
	top: 6px;
	right: 6px;
	width: 32px;
	height: 32px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--rd-mist-dim, #79828a);
	font: inherit;
	font-size: 1.4em;
	line-height: 1;
	cursor: pointer;
}

.rd-tl__sluit:focus-visible {
	outline: 2px solid var(--rd-accent-ink, #8a6014);
	outline-offset: 2px;
}

/* --- Smal scherm: onderin als kaart --------------------------------------- */

@media (max-width: 520px) {
	.rd-tl__paneel.is-open {
		left: 16px;
		right: 16px;
		bottom: 16px;
		top: auto;
		width: auto;
		max-width: none;
		max-height: 62vh;
		overflow-y: auto;
		padding: 1.3em 1.3em 1.4em;
		font-size: 1em;
		animation-name: rd-tl-in-blad;
	}

	.rd-tl__paneel.is-open .rd-tl__punt {
		display: none;
	}

	.rd-tl__paneel.is-open .rd-tl__sluit {
		display: block;
	}

	@keyframes rd-tl-in-blad {
		from {
			opacity: 0;
			transform: translateY(12px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}

@media (pointer: coarse) {
	.rd-tl__paneel .rd-tl__sluit {
		display: block;
	}

	.rd-tl__paneel {
		padding-right: 2.6em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rd-tl__paneel.is-open {
		animation: none;
	}

	.rd-tl__trigger,
	.rd-tl__teken {
		transition: none;
	}
}

/* --- In de blokkeneditor --------------------------------------------------- */

.editor-styles-wrapper .rd-toelichting {
	text-decoration: underline;
	text-decoration-style: dotted;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	background-color: rgb(215 162 75 / 0.14);
	border-radius: 2px;
	padding: 0 0.08em;
}
