/* en2x Custom – global styles. CSS classes use the .en2x- prefix. */

/*
 * en2x project-wide design tokens.
 *
 * These custom properties are the single source of truth for en2x brand
 * colours and are meant to be used by EVERY module (current and future) instead
 * of hard-coded hex values. Add new shared tokens here.
 *
 * Headline convention: all relevant headlines/titles across modules use
 * var(--en2x-color-headline) (#250F51) – this is the project's standard
 * headline colour. Keep it consistent in new modules.
 */
:root {
	--en2x-color-headline: #250F51; /* Headlines/titles in all modules. */
	--en2x-color-primary: #221182;  /* Accent / Thema colour. */
	/* Full-pill button radius. A large value always caps at half the element
	 * height, so buttons are fully round regardless of their height (a fixed
	 * px value like Salient's --nectar-border-radius is not enough on taller
	 * buttons). Lower this for less rounding. */
	--en2x-button-radius: 999px;

	/* Content container width – matches the Beitrag-Hero (__inner max-width). */
	--en2x-container: 1600px;

	/* Self-brought side gutter for the article modules. In WPBakery "Full Width
	 * Content" rows the container padding is gone, so the modules bring their
	 * own. The centering offset (100vw - container)/2 aligns content to the same
	 * edge as the hero box; clamped so it is at least 20px and never over-pads a
	 * narrow column (cap 20% of the column width = safe on ultrawide). One place
	 * to tweak for all modules. */
	--en2x-side-gutter: clamp( 20px, calc( ( 100vw - var( --en2x-container ) ) / 2 ), 20% );

	/* Left/right gutters used by the modules. They default to the symmetric side
	 * gutter above, but container-align.js overrides them PER element and PER side
	 * (measured independently against the real container edges, each clamped to
	 * >= 0). This is what makes a module align correctly even inside a column of a
	 * Full Width Content row: left snaps to the Satzspiegel, right stays inside the
	 * column (2/3 left column) or insets to the Satzspiegel-right (1/3 right column)
	 * instead of over-padding symmetrically. Without JS the static symmetric value
	 * applies. */
	--en2x-gutter-left: var( --en2x-side-gutter );
	--en2x-gutter-right: var( --en2x-side-gutter );

	/* Offset for the fixed Salient header. Anchor targets use this as
	 * scroll-margin-top so a jumped-to headline is not hidden under the header.
	 * Staggered desktop / tablet / mobile (same height thinking as the Beitrag-
	 * Hero spacing) – the header gets shorter on smaller screens. Tune here once. */
	--en2x-header-offset: 110px;

	/* Optional per-module font-size scale ("Schriftgröße" option). Modules offer
	 * Standard (= Salient body, inherit) / Kleinere Schrift / Größere Schrift; the
	 * smaller/larger steps use these em factors. Change the percentages HERE once
	 * to retune every module at the same time (em scales with the body size). */
	--en2x-schrift-klein: 0.8em;
	--en2x-schrift-gross: 1.2em;
}

/* Tablet: shorter Salient header. */
@media (max-width: 1000px) {
	:root {
		--en2x-header-offset: 94px;
	}
}

/* Mobile: compact header. */
@media (max-width: 690px) {
	:root {
		--en2x-header-offset: 78px;
	}
}

/* Smooth in-page jumps to anchors. Respect reduced-motion preferences and only
 * set it if nothing else already does (low-risk, global). */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ---------------------------------------------------------------------------
 * Umbruch-Sicherung fuer alle Modul-Headlines.
 *
 * Lange deutsche Komposita ("FORTSCHRITTSBERICHT") passen bei schmalen
 * Viewports in keine Kastenbreite mehr. Ohne Umbruchregel laufen sie aus dem
 * Modul heraus und werden dort, wo der Modul-Root overflow:hidden hat, sogar
 * abgeschnitten. Bisher gab es projektweit KEINE einzige Umbruchregel.
 *
 * hyphens:auto trennt an echten Silbengrenzen und setzt einen Trennstrich -
 * moeglich, weil <html lang="de"> gesetzt ist. overflow-wrap:break-word ist der
 * Rueckfall fuer Woerter, fuer die der Browser kein Trennmuster kennt (Marken-
 * namen, Abkuerzungen). Bewusst NUR auf Ueberschriften, nicht auf Fliesstext -
 * dort waere automatische Trennung im Satzbild unruhig.
 *
 * -webkit-hyphens fuer Safari vor Version 17.
 *
 * Zwei Selektoren, weil beide Faelle vorkommen: die Ueberschrift traegt die
 * Modulklasse selbst (h2.en2x-teaser__headline) oder sie liegt in einem
 * Modul-Element.
 *
 * WICHTIG: Das wirkt nur, wenn das Ueberschriften-Element nicht auf seine
 * Max-Content-Breite aufgeblaeht wird. Genau das tat align-items:flex-start in
 * teaser-text.css und hero-slider.css - dort steht jetzt stretch. Taucht der
 * Fehler in einem weiteren Modul auf, ist das die erste Stelle zum Nachsehen.
 * ------------------------------------------------------------------------- */
[class*="en2x-"]:is( h1, h2, h3, h4, h5, h6 ),
[class*="en2x-"] :is( h1, h2, h3, h4, h5, h6 ) {
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
}
