/*
 * fx3_akkordeon — Fragen & Antworten.
 *
 * Gestaltsprache wie fx10_prozess: navy Linie oben, getoente Linien zwischen
 * den Zeilen, azure Nummern. Schriftgroessen, Farben und Abstaende kommen aus
 * project.css; hier stehen nur Raster, Zustaende und die Aufklapp-Bewegung.
 *
 * Ab 992px zwei Spalten: Kopf links (klebt beim Scrollen), Liste rechts. So
 * bleibt die Antwort auch auf 2560px in Lesebreite, statt ueber die volle
 * Containerbreite zu laufen.
 */

section.fx3_akkordeon .fx3_akkordeon_container {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--fx-gap-block);
}

section.fx3_akkordeon .fx3_topline    { margin-bottom: var(--fx-gap-block-klein); }
section.fx3_akkordeon .fx3_titel      { margin: 0; overflow-wrap: break-word; }
section.fx3_akkordeon .fx3_untertitel { margin: var(--fx-gap-block-klein) 0 0; max-width: 46ch; }

/* ---------- Liste ---------- */

section.fx3_akkordeon .fx3_liste {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--fx-navy);
}

section.fx3_akkordeon .fx3_eintrag {
	display: block;
	border-bottom: 1px solid var(--fx-line-tint);
}

/* Die h3 traegt die Schrift, der Button erbt sie (font: inherit statt eigener
   Familie — Modul-CSS setzt keine font-family). */
section.fx3_akkordeon .fx3_frage { margin: 0; }

section.fx3_akkordeon .fx3_knopf {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 40px;
	align-items: start;
	gap: 0;
	width: 100%;
	margin: 0;
	padding: 30px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	font: inherit;
	color: var(--fx-navy);
	text-align: left;
	cursor: pointer;
	transition: color var(--fx-dauer-header) ease;
}

/* Nummer und Zeichen an der ersten Textzeile ausrichten, nicht an der Mitte —
   bei mehrzeiligen Fragen bleiben sie oben stehen. */
section.fx3_akkordeon .fx3_nummer { padding-top: .5em; }

section.fx3_akkordeon .fx3_frage_text {
	padding-right: 16px;
	overflow-wrap: break-word;
}

section.fx3_akkordeon .fx3_zeichen {
	display: flex;
	justify-self: end;
	padding-top: 2px;
	color: var(--fx-azure);
}

section.fx3_akkordeon .fx3_zeichen svg { display: block; }

section.fx3_akkordeon .fx3_zeichen_hoch {
	transform-origin: 12px 12px;
	transition: transform .4s var(--fx-ease-slider);
}

section.fx3_akkordeon .fx3_knopf:hover,
section.fx3_akkordeon .fx3_knopf:focus-visible {
	color: var(--fx-azure);
}

section.fx3_akkordeon .fx3_knopf:focus-visible { outline-offset: -2px; }

/* ---------- Antwort ---------- */

section.fx3_akkordeon .fx3_antwort {
	display: grid;
	grid-template-rows: 1fr;
}

section.fx3_akkordeon .fx3_antwort_innen {
	min-height: 0;
	overflow: hidden;
}

section.fx3_akkordeon .fx3_antwort_text {
	max-width: 62ch;
	padding: 0 40px 28px 64px;
	color: var(--fx-text);
	overflow-wrap: break-word;
}

section.fx3_akkordeon .fx3_antwort_text > :first-child { margin-top: 0; }
section.fx3_akkordeon .fx3_antwort_text > :last-child  { margin-bottom: 0; }

section.fx3_akkordeon .fx3_antwort_text a {
	color: var(--fx-azure);
	text-decoration: underline;
	text-underline-offset: .18em;
	white-space: nowrap;
}

section.fx3_akkordeon .fx3_antwort_text a:hover,
section.fx3_akkordeon .fx3_antwort_text a:focus-visible {
	color: var(--fx-navy);
}

section.fx3_akkordeon .fx3_antwort_text ul {
	margin: .5em 0;
	padding-left: 1.2em;
}

/* ---------- Geschlossen (nur mit JS) ----------
   visibility nimmt die zugeklappte Antwort aus Tab-Reihenfolge und
   Vorlesebaum; die Verzoegerung laesst das Zuklappen erst zu Ende laufen. */

section.fx3_akkordeon[data-fx3-bereit] .fx3_antwort {
	transition: grid-template-rows .45s var(--fx-ease-slider), visibility 0s linear 0s;
}

section.fx3_akkordeon[data-fx3-js] .fx3_eintrag:not(.is-offen) .fx3_antwort {
	grid-template-rows: 0fr;
	visibility: hidden;
}

/* Uebergaenge erst nach dem ersten Zuklappen — sonst klappt die Liste beim
   Laden sichtbar zu. */
section.fx3_akkordeon[data-fx3-bereit] .fx3_eintrag:not(.is-offen) .fx3_antwort {
	transition: grid-template-rows .45s var(--fx-ease-slider), visibility 0s linear .45s;
}

section.fx3_akkordeon .fx3_eintrag.is-offen .fx3_zeichen_hoch,
section.fx3_akkordeon:not([data-fx3-js]) .fx3_zeichen_hoch {
	transform: scaleY(0);
}

/* ---------- Ab 992px: Kopf links, Liste rechts ---------- */

@media (min-width: 992px) {
	section.fx3_akkordeon .fx3_akkordeon_container {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: clamp(40px, 5vw, 120px);
		align-items: start;
	}

	/* Unter dem geschrumpften Sticky-Header (72px) kleben bleiben. */
	section.fx3_akkordeon .fx3_kopf {
		position: sticky;
		top: calc(72px + var(--fx-pad-block));
	}
}

@media (min-width: 1920px) {
	section.fx3_akkordeon .fx3_akkordeon_container {
		grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	}
}

/* ---------- Mobil ---------- */

@media (max-width: 991px) {
	section.fx3_akkordeon .fx3_knopf {
		grid-template-columns: 40px minmax(0, 1fr) 28px;
		padding: 22px 0;
	}

	section.fx3_akkordeon .fx3_zeichen svg {
		width: 20px;
		height: 20px;
	}

	section.fx3_akkordeon .fx3_antwort_text {
		padding: 0 0 24px 40px;
	}
}

@media (max-width: 359px) {
	section.fx3_akkordeon .fx3_knopf {
		grid-template-columns: 32px minmax(0, 1fr) 24px;
	}

	section.fx3_akkordeon .fx3_frage_text { padding-right: 10px; overflow-wrap: anywhere; }

	section.fx3_akkordeon .fx3_antwort_text {
		padding-left: 0;
	}

	section.fx3_akkordeon .fx3_antwort_text a { white-space: normal; }
}

/* ---------- Bewegung aus ---------- */

@media (prefers-reduced-motion: reduce) {
	section.fx3_akkordeon .fx3_knopf,
	section.fx3_akkordeon .fx3_zeichen_hoch,
	section.fx3_akkordeon[data-fx3-bereit] .fx3_antwort,
	section.fx3_akkordeon[data-fx3-bereit] .fx3_eintrag:not(.is-offen) .fx3_antwort {
		transition: none;
	}
}
