/*
 Theme Name:   Kieswerk Ponickau
 Description:  Child-Theme von Hello Elementor für kieswerk-ponickau: Härtung, Kommentare aus, Bild- und SVG-Regeln, Barrierefreiheits-Grundlagen. Gestaltung kommt aus Elementor.
 Template:     hello-elementor
 Version:      2.0.0
 Requires PHP: 8.1
 Text Domain:  hello-elementor-child
*/

/* ---------- Barrierefreiheit: sichtbarer Tastatur-Fokus (hell und dunkel gut erkennbar) ---------- */
/* !important: Elementors Menü-CSS setzt bei .elementor-item den Fokusrahmen sonst zurück */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.elementor-button:focus-visible,
.elementor-menu-toggle:focus-visible,
.elementor-nav-menu a:focus-visible {
	outline: 3px solid #1D1D1B !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #FFFFFF !important;
}

/* ---------- Barrierefreiheit: Inhalte mit Einblend-Animation per Tastatur erreichbar ----------
 * Elementor versteckt sie bis zum Hinscrollen mit visibility:hidden → per Tab nicht erreichbar.
 * Stattdessen nur durchsichtig: fokussierbar; springt der Fokus hinein, scrollt der Browser dorthin und die
 * Animation läuft wie gewohnt (optisch keine Änderung). */
.elementor-invisible {
	visibility: visible !important;
	opacity: 0;
}

/* ---------- Lange Wörter in Überschriften („Generalunternehmern“) nie über den Rand ----------
 * Überall: Notumbruch nur, wenn ein Wort sonst überstehen würde (ändert sonst nichts).
 * Handy und Tablet: deutsche Silbentrennung für Überschriften (sonst „Rohstoffversorgu|ng“ ohne Trennstrich). */
.elementor-heading-title,
h1, h2, h3, h4, h5, h6 {
	overflow-wrap: break-word;
}
@media (max-width: 1024px) {
	.elementor-heading-title,
	h1, h2, h3, h4, h5, h6 {
		-webkit-hyphens: auto;
		hyphens: auto;
		/* nur lange Wörter, mind. 4 Buchstaben vor/nach dem Trennstrich (kein „Ge-neral…“) */
		hyphenate-limit-chars: 10 4 4;
	}
}

/* ---------- Formulare: Datei-Upload als Ablagefläche mit Knopf im Seitenstil ----------
 * (im Child-Theme statt im Elementor-Widget-CSS: Elementor ersetzt dort „selector“ auch in „::file-selector-button“) */
.elementor-field-type-upload input[type="file"] {
	width: 100%;
	padding: 18px;
	border: 2px dashed #B4B4B4;
	border-radius: 10px;
	background: #FFFFFF;
	color: var(--e-global-color-text);
	font-size: 16px;
	cursor: pointer;
}
.elementor-field-type-upload input[type="file"]:hover {
	border-color: var(--e-global-color-primary);
}
.elementor-field-type-upload input[type="file"]::file-selector-button {
	margin-right: 16px;
	padding: 10px 20px;
	border: 0;
	border-radius: 10px;
	background: var(--e-global-color-secondary);
	color: #FFFFFF;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.elementor-field-type-upload input[type="file"]::file-selector-button:hover {
	background: var(--e-global-color-primary);
}
/* Hinweistext (HTML-Feld) direkt unter dem Upload */
.elementor-field-type-html {
	margin-top: -12px;
	font-size: 14px;
	color: var(--e-global-color-text);
}

/* ---------- Ausklapp-Menü (Hamburger): Text exakt mittig, Pfeil am rechten Rand ----------
 * Elementor zentriert Text + Pfeil gemeinsam → Einträge mit Unterpunkten saßen links von der Mitte. */
.elementor-nav-menu--dropdown a.has-submenu {
	position: relative;
	padding-left: 52px !important;
	padding-right: 52px !important;
}
.elementor-nav-menu--dropdown a.has-submenu .sub-arrow {
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	margin: 0 !important;
	padding: 0 !important;
}
/* Unterpunkte: Elementor rückt mit 8 px Rand links ein – bei zentriertem Text nur ein Versatz */
.elementor-nav-menu--dropdown .sub-menu a {
	border-inline-start-width: 0 !important;
}
/* Pfeil dreht sich, wenn aufgeklappt */
.elementor-nav-menu--dropdown a.has-submenu .sub-arrow svg {
	transition: transform .2s ease;
}
.elementor-nav-menu--dropdown a.has-submenu.highlighted .sub-arrow svg {
	transform: rotate(180deg);
}

/* ---------- Barrierefreiheit: weniger Bewegung, wenn im System so eingestellt ----------
 * Entscheidung: bei „Bewegung reduzieren“ nicht ganz ohne Effekt, sondern nur weich einblenden (Deckkraft),
 * ohne Reinfliegen/Bewegung. Scroll-Effekte (Motion Effects) bleiben aus. */
@keyframes kp-einblenden {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	/* höhere Spezifität als Elementors eigene Regel „.animated { animation: none !important }“ */
	html body .elementor-element.animated {
		animation-name: kp-einblenden !important;
		animation-duration: .6s !important;
		animation-timing-function: ease-out !important;
		transform: none !important;
	}
	.elementor-motion-effects-element,
	.elementor-motion-effects-layer {
		animation: none !important;
		transition: none !important;
		transform: none !important;
	}
	html {
		scroll-behavior: auto !important;
	}
}
