/*
 * Korrekturen am übernommenen Entwurf (assets/draft wird von tools/build-draft.ps1 neu erzeugt,
 * diese Datei nicht).
 *
 * Das Entwurfs-CSS liegt in der Layer "udc-draft". Daraus folgt:
 * - Normale Angaben hier ohne Layer schreiben. Sie schlagen jede normale Regel des Entwurfs,
 *   egal wie spezifisch sie ist.
 * - Gegen ein !important des Entwurfs nur in "@layer udc-fix" mit !important angehen.
 *   Diese Layer ist zuerst deklariert und gewinnt damit bei !important.
 *
 * Breakpoints: max-width 519/767/1023/1239, min-width 520/768/1024/1240.
 */
@layer udc-fix, udc-inline-important, udc-draft;

/* Der Entwurf kappt den horizontalen Überlauf global. Damit fielen abgeschnittene Inhalte nicht auf.
   Die Ursachen sind unten einzeln behoben, tools/qa-check.js meldet neue. */
@layer udc-fix {
	html,
	body {
		overflow-x: visible !important;
	}
}

/* 1024–1239: Das Desktop-Layout war für ab 1081 gebaut. Kopf und Zeitstrahl brauchen hier weniger Platz. */
@media (min-width: 1024px) and (max-width: 1239px) {
	.nav-links > a,
	.nav-links > span > a {
		padding-left: 9px;
		padding-right: 9px;
	}

	.nav-cta .btn {
		padding-left: 18px;
		padding-right: 18px;
	}

	.hx-timeline {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.hx-step {
		padding: 0 8px;
	}

	.hx-step h3 span {
		white-space: normal;
	}
}

/* Unternehmen, Zeitstrahl: Ein transparentes Deko-Rechteck steht 32px über den Rand. */
#unt-2 {
	overflow-x: clip;
}

/* Footer 768–1023: Der Entwurf setzt ab 761 alle Spalten in eine Reihe, die erst ab etwa 1000 passt. */
@layer udc-fix {
	@media (min-width: 768px) and (max-width: 1023px) {
		.footer .footer-nav > ul {
			grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
		}
	}
}

/* Karriere-CTA: Das Raster ist für zwei Buttons gebaut. Steht nur einer darin, bekommt er sonst
   nur 1.7fr und der englische Text wird abgeschnitten. */
@media (max-width: 1023px) {
	section[data-screen-label="Karriere CTA"] .cm-box > div:last-child > .btn:only-child {
		grid-column: 1 / -1;
	}
}

/* Unter 390: Texte, die in den Spalten des Entwurfs nicht mehr Platz finden.
   Der Entwurf setzt diese Werte mit !important, deshalb hier in udc-fix. */
@layer udc-fix {
	@media (max-width: 389px) {
		/* Englische Öffnungszeiten ("8:00 am – 5:00 pm") passen nicht in die halbe Footer-Spalte. */
		html[lang="en"] .footer-top > div:has(> p.footer-meta img) {
			grid-template-columns: minmax(0, 1fr) !important;
			grid-template-rows: none !important;
			grid-auto-flow: row !important;
		}

		#vorteile .kw-h {
			font-size: 34px !important;
		}

		#branchen-auswahl .bx-ctas .btn {
			padding-left: 4px !important;
			padding-right: 4px !important;
			column-gap: 3px !important;
			letter-spacing: 0 !important;
		}

		.bw-art-opt {
			padding-left: 6px !important;
			padding-right: 6px !important;
			font-size: 13px !important;
			hyphens: auto;
		}
	}

	/* Leistungen: Das Polster der drei Bereichs-Buttons wächst mit der Fensterbreite, der Text nicht. */
	@media (min-width: 1700px) {
		.l3-ctas .btn {
			padding-left: 22px !important;
			padding-right: 22px !important;
		}
	}
}

/* Topbar: Die Öffnungszeiten kommen aus den Theme-Einstellungen und sind frei änderbar. Die Leiste ist nur
   44px hoch und schneidet eine zweite Zeile ab, deshalb bleibt sie einzeilig. Die Vorgaben (DE und EN) passen
   ab 1536px; darunter sind die Öffnungszeiten ausgeblendet, längere eigene Texte werden mit „…“ gekürzt. */
@media (min-width: 768px) {
	.topbar-contacts {
		flex-wrap: nowrap;
	}

	.topbar-contacts a,
	.topbar-right a,
	.topbar-right .a11y-motion-btn {
		flex-shrink: 0;
		white-space: nowrap;
	}

	.tb-hours {
		display: block;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.tb-hours .tb-ic-img {
		display: inline-block;
		margin-right: 8px;
		vertical-align: middle;
	}
}

@media (min-width: 768px) and (max-width: 1599px) {
	.topbar-inner,
	.topbar-contacts,
	.topbar-right {
		gap: 18px;
	}
}

@media (min-width: 768px) and (max-width: 1239px) {
	.topbar-inner {
		font-size: 11px;
	}
}

@media (min-width: 768px) and (max-width: 1535px) {
	.tb-hours {
		display: none;
	}
}
