/*
 * APPtimal Klartext Barrierefreiheit – Sicher
 * Version 2.1.0
 *
 * These rules are intentionally narrow. They do not change Revolution Slider
 * geometry, iframe heights, calculator structure, menu fonts or admin styles.
 */

:root {
	--apptimal-safe-focus-dark: #111;
	--apptimal-safe-focus-light: #fff;
	--apptimal-safe-link: #00565d;
	--apptimal-safe-link-hover: #003b40;
	--apptimal-safe-hero-bg: #17383a;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Reliable keyboard focus on both light and dark backgrounds. */
:where(
	a,
	button,
	input,
	select,
	textarea,
	summary,
	[role="button"],
	[tabindex]:not([tabindex="-1"])
):focus-visible {
	outline: 0.1875rem solid var(--apptimal-safe-focus-dark) !important;
	outline-offset: 0.1875rem !important;
	box-shadow: 0 0 0 0.375rem var(--apptimal-safe-focus-light) !important;
}

/* The skip link must remain visible above the WordPress bar and slider. */
.skip-link:focus,
.apptimal-safe-skip-link:focus {
	position: fixed !important;
	inset-block-start: 0.5rem !important;
	inset-inline-start: 0.5rem !important;
	z-index: 1000000 !important;
	width: auto !important;
	height: auto !important;
	clip: auto !important;
	clip-path: none !important;
	overflow: visible !important;
	padding: 0.75rem 1rem !important;
	color: #fff !important;
	background: #111 !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	text-decoration: none !important;
}

#pe-maincontent {
	scroll-margin-block-start: 2rem;
}

.apptimal-safe-empty-heading {
	display: none !important;
}

/*
 * The solid background is attached only to the text wrapper, not to the
 * Revolution Slider layer. This guarantees AA contrast without recreating the
 * oversized title box that an earlier optimization caused.
 */
#slide-1-layer-1 > .apptimal-safe-hero-text,
#slide-1-layer-3 > .apptimal-safe-hero-text {
	display: inline;
	padding: 0.12em 0.28em;
	color: #fff;
	background: var(--apptimal-safe-hero-bg);
	border-radius: 0.08em;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

/* Text links stay recognisable without relying on colour alone. */
.pe-article-content a:not(.button):not([class*="btn"]),
#pe-footer a,
#pe-copyrights a {
	text-decoration-thickness: 0.1em;
	text-underline-offset: 0.15em;
}

.pe-article-content a:not(.button):not([class*="btn"]):hover,
.pe-article-content a:not(.button):not([class*="btn"]):focus-visible {
	text-decoration-thickness: 0.16em;
}

/* Explicit AA contrast values for the areas named in the offer. */
#pe-footer {
	color: #29333f;
	background-color: #fff;
}

#pe-footer a:not(.button):not([class*="btn"]) {
	color: var(--apptimal-safe-link);
}

#pe-footer a:not(.button):not([class*="btn"]):hover,
#pe-footer a:not(.button):not([class*="btn"]):focus-visible {
	color: var(--apptimal-safe-link-hover);
}

.blog .post-meta,
.archive .post-meta,
.blog .post-meta a,
.archive .post-meta a,
.blog .pe-article-content a:not(.readmore):not(.button),
.archive .pe-article-content a:not(.readmore):not(.button) {
	color: var(--apptimal-safe-link);
}

.blog .post-meta a:hover,
.blog .post-meta a:focus-visible,
.archive .post-meta a:hover,
.archive .post-meta a:focus-visible,
.blog .pe-article-content a:not(.readmore):not(.button):hover,
.blog .pe-article-content a:not(.readmore):not(.button):focus-visible,
.archive .pe-article-content a:not(.readmore):not(.button):hover,
.archive .pe-article-content a:not(.readmore):not(.button):focus-visible {
	color: var(--apptimal-safe-link-hover);
}

/* Content media can reflow, while slider and iframe heights remain untouched. */
.pe-article-content :where(img, video, svg),
.pe-widget-in :where(img, video, svg) {
	max-width: 100%;
}

.pe-article-content :where(img, video):not([class*="rev-slide"]),
.pe-widget-in :where(img, video):not([class*="rev-slide"]) {
	height: auto;
}

.pe-article-content iframe,
.pe-widget-in iframe,
.pdfemb-viewer {
	max-width: 100%;
}

.pe-article-content,
.pe-widget-in,
.page-header-main-title {
	overflow-wrap: anywhere;
}

.pe-article-content {
	font-size: 1rem;
	line-height: 1.6;
}

.pe-article-content :where(p, li, dd, dt, blockquote, figcaption) {
	max-width: 100%;
}

.pe-article-content :where(pre, code) {
	max-width: 100%;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.pe-article-content table:not(#table) {
	display: block;
	width: max-content;
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
}

/* Team markup already exists in the page; only its robust reflow is supplied. */
.team-section {
	width: 100%;
}

.team-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.team-card {
	min-width: 0;
	text-align: center;
}

.team-card img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin-inline: auto;
}

.team-card h2 {
	margin-block: 0.75rem 0.35rem;
	font-size: clamp(1.125rem, 1rem + 0.35vw, 1.35rem);
	line-height: 1.3;
}

/* Native details/summary remain native; CSS only improves affordance/focus. */
.apptimal-faq details,
details.faq-item {
	border: 0.0625rem solid #b9c6c7;
	border-radius: 0.25rem;
	background: #fff;
}

.apptimal-faq details + details,
details.faq-item + details.faq-item {
	margin-block-start: 0.75rem;
}

.apptimal-faq summary,
details.faq-item > summary {
	position: relative;
	cursor: pointer;
	padding: 0.9rem 3rem 0.9rem 1rem;
	color: #1f2b2c;
	font-weight: 700;
	line-height: 1.4;
}

.apptimal-faq summary::after,
details.faq-item > summary::after {
	content: "+";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: 1rem;
	transform: translateY(-50%);
	font-size: 1.5rem;
	line-height: 1;
}

.apptimal-faq details[open] > summary::after,
details.faq-item[open] > summary::after {
	content: "−";
}

.apptimal-faq .faq-content,
details.faq-item > .faq-content {
	padding: 0 1rem 1rem;
}

/* The budget calculator remains unchanged; its page may scroll horizontally
 * at extreme zoom instead of crushing or recreating table/input elements. */
body.page-id-137 .pe-article-content {
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
}

body.page-id-137 #table input {
	min-height: 2.75rem;
	padding: 0.4rem 0.55rem;
	border: 0.0625rem solid #687879 !important;
	background: #fff;
	color: #111;
}

body.page-id-137 #table input:focus-visible {
	position: relative;
	z-index: 1;
}

/* Keep form controls usable when text is enlarged. */
:where(.pe-article-content, .pe-widget-in) :where(input, select, textarea, button) {
	max-width: 100%;
	font: inherit;
}

:where(.pe-article-content, .pe-widget-in) :where(button, input[type="button"], input[type="submit"]) {
	min-height: 2.75rem;
	height: auto;
	white-space: normal;
}

/* Footer copy and controls retain sufficient separation at narrow widths. */
#pe-footer a,
#pe-copyrights a {
	color: inherit;
}

.apptimal-safe-newsletter-dialog {
	max-width: calc(100vw - 2rem);
	max-height: calc(100vh - 2rem);
	overflow: auto;
	overscroll-behavior: contain;
}

@media (max-width: 56.25rem) {
	.team-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 37.5rem) {
	.team-grid {
		grid-template-columns: 1fr;
	}

	#pe-logo-nav-in {
		max-width: 100%;
	}

	#pe-bar-left {
		min-width: 0;
	}

	#pe-logo img {
		max-width: 100%;
		height: auto;
	}

	.pe-article-content,
	.pe-widget-in {
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	html:focus-within {
		scroll-behavior: auto;
	}

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

@media print {
	.skip-link,
	.apptimal-safe-skip-link {
		display: none !important;
	}
}
