/*
 * Basis-Styles für das, was theme.json nicht abbildet: Abstände zwischen Bändern,
 * Fokus, Textauswahl, reduzierte Bewegung.
 */

/* ---------------------------------------------------------------------------
 * Bänder ohne Zwischenraum
 *
 * Sektionen bringen ihren Innenabstand selbst mit. Doppelte Klasse, weil die
 * Core-Regel gleich spezifisch ist und später steht.
 * ------------------------------------------------------------------------- */

.wp-site-blocks.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/*
 * Aufeinanderfolgende Bänder ohne Abstand, Fließtext behält ihn. Drei Selektoren
 * für Seiteninhalt, Editor und Sektionen direkt im Template.
 */

.wp-block-post-content > .alignfull + .alignfull,
.is-root-container > .alignfull + .alignfull,
main > .alignfull + .alignfull {
	margin-block-start: 0;
}

/*
 * Beginnt oder endet der Inhalt mit Fließtext statt mit einem Band (etwa bei
 * Rechtstexten), gibt der Inhaltsbereich den Abstand zu Seitenkopf und Footer.
 */

main > .wp-block-post-content:has(> :first-child:not(.alignfull)) {
	padding-block-start: var(--wp--preset--spacing--60);
}

main > .wp-block-post-content:has(> :last-child:not(.alignfull)) {
	padding-block-end: var(--wp--preset--spacing--60);
}

/* ---------------------------------------------------------------------------
 * Fokus
 * ------------------------------------------------------------------------- */

:focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--accent);
	outline-offset: var(--wp--custom--focus--offset);
}

/* ---------------------------------------------------------------------------
 * Textauswahl
 * ------------------------------------------------------------------------- */

::selection {
	background-color: var(--wp--custom--color--selection);
}

/* ---------------------------------------------------------------------------
 * Reduzierte Bewegung
 *
 * Setzt das Transitions-Token und alle übrigen Animationen zurück, mit !important,
 * weil der Reset jede spätere Deklaration schlagen muss. :root:root und html body
 * decken beide Orte ab, an denen WordPress die Custom Properties ausgibt.
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	:root:root,
	html body {
		--wp--custom--transition--base: 0.01ms linear;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
