/*
 * TomTuT Bausteine: gemeinsame Variablen und das Inline-Format „Markierung“.
 *
 * Gestaltung nur mit den Farben und Abständen des Themes (--wp--preset--*).
 * Die Rückfallwerte nach dem Komma gelten nur, solange das Theme fehlt.
 * Eigene Variablen tragen das Präfix --ttb-, weil das Theme --ttb-* belegt.
 */
:root {
	/*
	 * Der Dunkelmodus des Themes tauscht die Presets sekundaer, text, schwarz,
	 * hellgrau, dunkelgrau und warnung; weiss, primary (Hausblau), akzent und
	 * heimwerker (Hausorange #f75133) bleiben gleich. Alle Farben hier hängen nur an diesen Presets:
	 * - Links, Symbole, Fokus: primary (Hausblau #34a2e6, in beiden Modi gleich).
	 * - Gefüllte Knöpfe: Hausblau bzw. Hausorange mit weißem Text, in beiden Modi gleich
	 *   (Kontrast unter AA, Vorgabe des Kunden); Hover per color-mix dunkler.
	 * - „schwarz“ ist der modusabhängige Gegenpol: In Mischungen wird aus Grün und Orange
	 *   hell ein dunkler Ton und dunkel ein heller Ton.
	 */
	--ttb-akzent: var(--wp--preset--color--primary, #34a2e6);
	--ttb-fuellung: var(--wp--preset--color--primary, #34a2e6);
	--ttb-auf-fuellung: var(--wp--preset--color--weiss, #fff);
	--ttb-fuellung-heimwerker: var(--wp--preset--color--heimwerker, #f75133);
	--ttb-heimwerker-text: var(--wp--preset--color--heimwerker, #f75133);
	--ttb-hinweis-info: var(--wp--preset--color--primary, #34a2e6);
	--ttb-hinweis-tipp: color-mix(in srgb, var(--wp--preset--color--akzent, #61ce70) 55%, var(--wp--preset--color--schwarz, #000));
	--ttb-hinweis-warnung: var(--wp--preset--color--warnung, #d8281e);

	--ttb-rahmen: color-mix(in srgb, currentcolor 42%, transparent);
	--ttb-rahmen-leise: color-mix(in srgb, currentcolor 22%, transparent);
	--ttb-flaeche: color-mix(in srgb, currentcolor 6%, transparent);
	--ttb-radius: 12px;
	--ttb-schatten: 0 2px 10px rgba(0, 0, 0, 0.22);
	--ttb-weiss: var(--wp--preset--color--weiss, #fff);
	--ttb-abstand-klein: var(--wp--preset--spacing--klein, 0.5rem);
	--ttb-abstand: var(--wp--preset--spacing--klein, 1rem);
	--ttb-abstand-gross: var(--wp--preset--spacing--mittel, 2rem);
	--ttb-tipp: 44px;
}

/* Inline-Format „Markierung“ (Rich-Text-Format tomtut/markierung). */
mark.tt-markiert {
	position: relative;
	padding: 0 0.15em;
	background: transparent;
	color: inherit;
}

mark.tt-markiert--kreis {
	border: 2px solid var(--ttb-akzent);
	border-radius: 50% / 45%;
	padding: 0.02em 0.4em;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

mark.tt-markiert--unterstrichen {
	text-decoration: underline;
	text-decoration-color: var(--ttb-akzent);
	text-decoration-thickness: 0.14em;
	text-underline-offset: 0.2em;
}

/* Hinweis, der nur im Editor erscheint. */
.tt-editor-hinweis {
	margin: 0;
	padding: 0.75rem 1rem;
	border: 1px dashed currentcolor;
	border-radius: 6px;
	font-size: 0.875rem;
}

/* Nur für Vorlesesoftware sichtbar. */
html body .tt-nur-lesegeraet {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Bausteine: gemeinsame Grundlagen. */
.tt-baustein {
	box-sizing: border-box;
	margin-block: var(--ttb-abstand-gross);
}

.tt-baustein *,
.tt-baustein *::before,
.tt-baustein *::after {
	box-sizing: border-box;
}

html body .tt-baustein a:focus-visible,
html body .tt-baustein button:focus-visible,
html body .tt-baustein input:focus-visible,
html body .tt-baustein summary:focus-visible,
html body .tt-baustein pre:focus-visible {
	outline: 3px solid var(--ttb-akzent);
	outline-offset: 2px;
}

/* Symbole */
.ttb-symbol {
	display: inline-block;
	width: 1em;
	height: 1em;
	flex: none;
	vertical-align: -0.125em;
}

.tt-symbol-vorschau svg {
	width: 1.2em;
	height: 1.2em;
	display: block;
}

/* Grundknopf (gefüllt) für Zwei-Klick-Platzhalter und Werkzeuge. */
html body .tt-knopf-basis {
	box-shadow: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: var(--ttb-tipp);
	padding: 0.6em 1.4em;
	border: 2px solid var(--ttb-fuellung);
	border-radius: 999px;
	background: var(--ttb-fuellung);
	color: var(--ttb-auf-fuellung);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

html body .tt-knopf-basis:hover {
	background: color-mix(in srgb, var(--ttb-fuellung) 80%, #000);
	border-color: color-mix(in srgb, var(--ttb-fuellung) 80%, #000);
}

/* Fremdinhalt nach dem Klick. */
html body .tt-fremdrahmen {
	display: block;
	width: 100%;
	border: 0;
}

/* Aufklapper (details/summary): eigener Pfeil, weil das Theme die Standardmarke entfernt. */
html body .tt-vk__zusammenfassung,
body summary.tt-toc__titel {
	list-style: none;
	justify-content: space-between;
	gap: 0.75rem;
}

html body .tt-vk__zusammenfassung::-webkit-details-marker,
body summary.tt-toc__titel::-webkit-details-marker {
	display: none;
}

html body .tt-vk__zusammenfassung::after,
body summary.tt-toc__titel::after {
	content: "";
	flex: none;
	width: 0.6rem;
	height: 0.6rem;
	margin-right: 0.25rem;
	border-right: 3px solid currentcolor;
	border-bottom: 3px solid currentcolor;
	transform: translateY(-25%) rotate(45deg);
}

body details[open] > .tt-vk__zusammenfassung::after,
body details[open] > summary.tt-toc__titel::after {
	transform: translateY(25%) rotate(-135deg);
}

/* Sternebewertung (Absatz „★★★★☆ 4 von 5“, Ausgabe aus includes/bloecke/class-sterne.php). */
.tt-sterne__reihe {
	display: inline-flex;
	gap: 0.05em;
	vertical-align: -0.05em;
	white-space: nowrap;
}

.tt-sterne__stern {
	position: relative;
	display: inline-block;
	line-height: 1;
}

.tt-sterne__stern--leer,
.tt-sterne__stern--halb {
	color: color-mix(in srgb, currentcolor 28%, transparent);
}

.tt-sterne__stern--halb::before {
	content: "★";
	position: absolute;
	inset: 0 50% 0 0;
	overflow: hidden;
	color: var(--tt-sterne-farbe, currentcolor);
}

.tt-sterne__stern--voll {
	color: var(--tt-sterne-farbe, currentcolor);
}
