/**
 * Kontakt page (page-templates/kontakt.php, D-026). Loaded only there.
 * In the language of "Hilfe & Angebote": the shared .page-intro with a
 * frosted strip (like the offers quick overview), then a calm editorial
 * section with the form and a "Gut zu wissen" note boxed by fine rules
 * (like the offers' meta box).
 */

/* ---------- Direct ways: one full-width frosted strip ---------- */

.contact-ways {
	--ways-gap: clamp(32px, 4vw, 56px);
	--ways-pad: var(--space-4);
	background-color: var(--glass-surface);
	-webkit-backdrop-filter: var(--glass-blur);
	backdrop-filter: var(--glass-blur);
	border-block: 1px solid var(--glass-edge);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.contact-ways {
		background-color: var(--glass-surface-solid);
	}
}

.contact-ways__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: var(--ways-gap);
	margin-block: 0;
	list-style: none;
}

.contact-ways__item {
	position: relative;
	display: flex;
	min-width: 0;
}

/* Fine, low-contrast dividers: between rows on phones … */
.contact-ways__item + .contact-ways__item::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background-color: var(--color-rule);
}

/* The whole entry is the link: icon, title, text, hint with arrow. Its
   padding reaches into the gap, so the text lines up with the container
   while the hover surface has room. */
.contact-ways__link {
	flex: 1;
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	grid-template-rows: auto auto 1fr;
	grid-template-areas:
		"icon title"
		"icon text"
		"icon hint";
	column-gap: var(--space-4);
	row-gap: var(--space-1);
	margin-inline: calc(-1 * var(--ways-pad));
	padding: var(--space-5) var(--ways-pad);
	color: var(--color-text);
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.contact-ways__icon {
	grid-area: icon;
	width: 26px;
	height: 26px;
	margin-top: 2px;
	color: var(--color-accent);
}

.contact-ways__title {
	grid-area: title;
	font-family: var(--font-heading);
	font-size: clamp(1.1875rem, 0.4vw + 1.1rem, 1.3125rem);
	font-weight: 700;
	line-height: 1.25;
}

/* Full text color: on the glass over the photo the muted tone drops
   below 4.5:1 (as in the offers strip). */
.contact-ways__text {
	grid-area: text;
	font-size: 0.9375rem;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.contact-ways__hint {
	grid-area: hint;
	align-self: end;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding-top: var(--space-2);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
}

.contact-ways__arrow {
	color: var(--color-orange-600);
	font-size: 1.125rem;
	line-height: 1;
	transition: transform 0.2s ease;
}

/* Subtle, as in the offers strip: a light lift, the arrow nudges right. */
.contact-ways__link:hover,
.contact-ways__link:focus-visible {
	background-color: rgba(255, 255, 255, 0.28);
}

.contact-ways__link:hover .contact-ways__arrow,
.contact-ways__link:focus-visible .contact-ways__arrow {
	transform: translateX(4px);
}

.contact-ways__link:focus-visible {
	outline: 3px solid var(--color-orange-600);
	outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
	.contact-ways__link:hover .contact-ways__arrow,
	.contact-ways__link:focus-visible .contact-ways__arrow {
		transform: none;
	}
}

/* … two columns from 600px (vertical rule between the columns, a row rule
   above the second row) … */
@media (min-width: 600px) {
	.contact-ways__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.contact-ways__item + .contact-ways__item::before {
		content: none;
	}

	.contact-ways__item:nth-child(n + 3)::after {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		right: calc(-1 * var(--ways-gap));
		height: 1px;
		background-color: var(--color-rule);
	}

	.contact-ways__item:nth-child(4)::after {
		left: calc(-1 * var(--ways-gap));
		right: 0;
	}

	.contact-ways__item:nth-child(even)::before {
		content: "";
		position: absolute;
		left: calc(var(--ways-gap) / -2);
		top: 22%;
		width: 1px;
		height: 56%;
		background-color: var(--color-rule);
	}
}

/* … and all four in one row from 1024px, like the offers strip. */
@media (min-width: 1024px) {
	.contact-ways__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.contact-ways__item:nth-child(n + 3)::after {
		content: none;
	}

	.contact-ways__item + .contact-ways__item::before {
		content: "";
		position: absolute;
		left: calc(var(--ways-gap) / -2);
		right: auto;
		top: 22%;
		width: 1px;
		height: 56%;
		background-color: var(--color-rule);
	}

	.contact-ways__link {
		padding-block: var(--space-6);
	}
}

/* ---------- Form section ---------- */

/* Quiet aurora as in the first offer section: straight edge under the
   intro photo, fading to cream towards the footer. */
.contact-page__body {
	padding-block: clamp(56px, 7vw, 112px);
	background:
		linear-gradient(to top, var(--color-cream-100) 0, rgba(247, 243, 236, 0) 16%),
		radial-gradient(ellipse 70% 55% at 12% 42%, var(--aurora-sage), transparent 70%),
		radial-gradient(ellipse 60% 55% at 88% 62%, var(--aurora-sage-soft), transparent 70%),
		radial-gradient(ellipse 45% 45% at 70% 34%, var(--aurora-apricot), transparent 70%),
		var(--color-cream-100);
}

.contact-page__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-8);
}

@media (min-width: 1024px) {
	.contact-page__inner {
		grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
		column-gap: clamp(48px, 6vw, 96px);
		align-items: start;
	}
}

/* Target of the footer's "E-Mail" link: clears the sticky header. */
.contact-page__form {
	min-width: 0;
	scroll-margin-top: calc(var(--site-header-height) + var(--space-5));
}

.contact-page__form:focus {
	outline: none;
}

.contact-page__eyebrow {
	margin-bottom: var(--space-3);
}

.contact-page__title {
	margin: 0 0 var(--space-5);
	color: var(--color-text);
	font-size: clamp(1.875rem, 2vw + 1.25rem, 2.75rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
}

/* ---------- Form ---------- */

.contact-form {
	--field-border: color-mix(in srgb, var(--color-green-900) 60%, transparent);
	position: relative;
	display: grid;
	gap: var(--space-5);
	max-width: 720px;
}

.contact-form__note {
	margin: 0;
	color: var(--color-text-muted);
	font-size: 0.875rem;
}

.contact-form__row {
	display: grid;
	gap: var(--space-5);
}

@media (min-width: 640px) {
	.contact-form__row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Content stays at the top: an error under one field of a row must not
   stretch its neighbour. */
.contact-form__field {
	display: grid;
	align-content: start;
	gap: var(--space-2);
	min-width: 0;
}

.contact-form__label {
	color: var(--color-text);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
}

.contact-form__required {
	color: var(--color-accent-text);
}

.contact-form__optional {
	color: var(--color-text-muted);
	font-weight: 400;
}

/* 16px text so phones don't zoom in on focus; the edge is ≥ 3:1. */
.contact-form__input {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	background-color: color-mix(in srgb, var(--color-white) 80%, var(--color-cream-100));
	color: var(--color-text);
	font-size: 1rem;
	line-height: 1.5;
	transition: border-color 0.15s ease;
}

.contact-form__input:hover {
	border-color: var(--color-green-900);
}

.contact-form__input:focus-visible {
	border-color: var(--color-green-900);
	outline: 3px solid var(--color-orange-600);
	outline-offset: 1px;
}

.contact-form__input--short {
	max-width: 320px;
}

.contact-form__textarea {
	min-height: 180px;
	resize: vertical;
}

/* Invalid: darker accent edge plus the message with a "!" mark — never
   color alone. */
.contact-form__field.is-invalid .contact-form__input {
	border-color: var(--color-accent-text);
	box-shadow: inset 0 0 0 1px var(--color-accent-text);
}

.contact-form__error {
	display: flex;
	align-items: flex-start;
	gap: var(--space-2);
	margin: 0;
	color: var(--color-accent-text);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.45;
}

.contact-form__error-mark {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	border-radius: 50%;
	background-color: var(--color-accent-text);
	color: var(--color-white);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}

/* Neutral privacy notice right before the submit button (D-027). */
.contact-form__privacy {
	margin: 0;
	max-width: 60ch;
	color: var(--color-text);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.contact-form__privacy a {
	text-underline-offset: 3px;
}

.contact-form__privacy a:hover,
.contact-form__privacy a:focus-visible {
	color: var(--color-accent-text);
}

/* Honeypot: out of sight and out of the tab order. */
.contact-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.contact-form__submit {
	justify-self: start;
}

/* Error summary at the top of the form. */
.contact-form__summary {
	padding: var(--space-4) var(--space-5);
	border-left: 3px solid var(--color-accent-text);
	border-radius: var(--radius-sm);
	background-color: color-mix(in srgb, var(--color-accent) 7%, var(--color-white));
	color: var(--color-text);
}

.contact-form__summary-text {
	margin: 0;
	font-weight: 600;
}

.contact-form__summary-list {
	margin: var(--space-2) 0 0;
	padding-left: 1.25em;
}

.contact-form__summary-list a {
	color: var(--color-accent-text);
	text-underline-offset: 3px;
}

/* Thank-you note in place of the form. */
.contact-form__done {
	max-width: 720px;
	padding: var(--space-6);
	border: 1px solid var(--color-rule);
	border-radius: var(--radius-sm);
	background-color: color-mix(in srgb, var(--color-white) 60%, transparent);
}

.contact-form__done-title {
	margin: 0 0 var(--space-2);
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
}

.contact-form__done-text {
	margin: 0 0 var(--space-4);
}

/* ---------- "Gut zu wissen" ---------- */

/* Boxed by fine rules, like the offers' meta box. */
.contact-notes {
	padding-block: var(--space-5);
	border-block: 1px solid var(--color-rule);
}

.contact-notes__label {
	margin-bottom: var(--space-4);
}

.contact-notes__list {
	display: grid;
	gap: var(--space-5);
	margin: 0;
	padding: 0;
	list-style: none;
}

.contact-notes__item {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	column-gap: var(--space-4);
	align-items: start;
}

.contact-notes__icon {
	width: 26px;
	height: 26px;
	color: var(--color-green-900);
}

.contact-notes__text {
	margin: 0;
	color: var(--color-text);
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* "Akute Notlage": the emergency number shown directly (D-027), above the
   general notes and separated from them by a fine rule. */
.contact-emergency {
	display: grid;
	gap: var(--space-2);
	padding-bottom: var(--space-5);
	margin-bottom: var(--space-5);
	border-bottom: 1px solid var(--color-rule);
}

.contact-emergency__label {
	color: var(--color-accent-text);
	font-weight: 600;
}

.contact-emergency__text {
	margin: 0;
	color: var(--color-text);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.contact-emergency__number {
	display: grid;
	gap: 2px;
	margin: var(--space-2) 0 0;
}

.contact-emergency__caption {
	color: var(--color-text-muted);
	font-size: 0.875rem;
	font-weight: 500;
}

/* Large and tappable; the whole line is the tel: link. */
.contact-emergency__link {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	gap: var(--space-3);
	min-height: 44px;
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: clamp(1.625rem, 1vw + 1.3rem, 2rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.01em;
	text-decoration: none;
	transition: color 0.2s ease;
}

.contact-emergency__icon {
	flex: none;
	width: 26px;
	height: 26px;
	color: var(--color-accent);
}

.contact-emergency__link:hover,
.contact-emergency__link:focus-visible {
	color: var(--color-accent-text);
}

/* "E-Mail" never breaks at its hyphen. */
.contact-notes__nowrap {
	white-space: nowrap;
}

.contact-notes__link {
	display: inline-block;
	margin-top: 2px;
	padding-block: 2px;
	color: var(--color-green-900);
	font-weight: 500;
	text-decoration-color: color-mix(in srgb, var(--color-green-900) 35%, transparent);
	text-underline-offset: 4px;
	transition: color 0.2s ease;
}

.contact-notes__link:hover,
.contact-notes__link:focus-visible {
	color: var(--color-accent-text);
}
