/* AGM Material – schlichte Grundgestaltung, die sich ins jeweilige Theme einfügt.
   Schrift, Größen und Farben kommen vom Theme; anpassbar über die Variablen unten
   (oder komplett durch eigene Vorlagen im Theme-Ordner „agm-material/“). */
.agm-liste {
	--agm-akzent: #9e1b61;
	--agm-linie: rgba(0, 0, 0, .14);
	--agm-flaeche: #fff;
	--agm-text-2: inherit;
	--agm-rund: 12px;
	margin: 1.5em 0;
	container-type: inline-size;  /* richtet sich nach der Breite im Theme, nicht nach dem Bildschirm */
}
.agm-liste [hidden] { display: none !important; }
.agm-liste__titel { margin: 0 0 .6em; }

.agm-filter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1em; margin-bottom: 1.6em; }
.agm-filter > * { min-width: 0; }
.agm-filter__suche { margin: 0; display: grid; gap: .3em; }
.agm-filter__suche label { font-weight: 700; }
.agm-filter input[type="search"], .agm-filter select {
	font: inherit; padding: .55em .8em; border: 1px solid var(--agm-linie); border-radius: 999px; background: var(--agm-flaeche); color: inherit; min-height: 44px;
}
.agm-filter input[type="search"] { border-radius: 8px; width: 100%; max-width: 40em; box-sizing: border-box; }
.agm-filter select { max-width: 100%; }
.agm-chips { display: flex; flex-wrap: wrap; gap: .6em; }
.agm-chip {
	font: inherit; font-weight: 700; padding: .45em 1em; border: 1px solid var(--agm-linie); border-radius: 999px; background: var(--agm-flaeche); color: inherit; cursor: pointer; min-height: 44px;
}
.agm-chip[aria-pressed="true"] { background: var(--agm-akzent); border-color: var(--agm-akzent); color: #fff; }
.agm-chip .agm-n { font-weight: 400; opacity: .85; }
/* Unterkategorien (Bausteine): zweite, leichtere Reihe – nur sichtbar, wenn ihre Kategorie gewählt ist */
.agm-chips--unter { align-items: center; padding: .7em .8em; border-left: 3px solid var(--agm-akzent); background: rgba(0, 0, 0, .025); border-radius: 0 var(--agm-rund) var(--agm-rund) 0; }
.agm-chips__titel { font-weight: 700; margin-right: .2em; }
.agm-chip--unter { font-weight: 600; font-size: .92em; padding: .35em .85em; min-height: 40px; }
.agm-chip--unter[aria-pressed="true"] { background: #fff; color: var(--agm-akzent); border-color: var(--agm-akzent); box-shadow: inset 0 0 0 1px var(--agm-akzent); }
.agm-leiste { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6em 1.2em; }
.agm-anzahl { margin: 0; font-weight: 700; }
.agm-leiste > * { min-width: 0; max-width: 100%; }
.agm-wahl { display: flex; flex-wrap: wrap; gap: .6em 1.2em; min-width: 0; }
.agm-wahl label { display: inline-flex; align-items: center; gap: .5em; min-width: 0; max-width: 100%; }
.agm-wahl select { min-width: 0; text-overflow: ellipsis; }

.agm-downloads { list-style: none; margin: 0; padding: 0 1.5em; background: var(--agm-flaeche); border: 1px solid var(--agm-linie); border-radius: var(--agm-rund); }
.agm-gruppe { list-style: none; font-weight: 700; font-size: 1.1em; padding: 1.6em 0 .3em; }
.agm-download { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) auto; gap: 1.4em; align-items: center; padding: 1.5em 0; border-top: 1px solid var(--agm-linie); line-height: 1.55; }
.agm-downloads > :first-child { border-top: 0; }
.agm-download__art { display: grid; justify-items: center; gap: .2em; color: inherit; }
.agm-icon { display: block; width: 2.4em; height: auto; }
.agm-download__artname { font-size: .72em; font-weight: 700; letter-spacing: .02em; opacity: .75; text-align: center; line-height: 1.1; }
/* Knopf und darunter die Downloadzahl */
.agm-download__aktion { display: flex; flex-direction: column; align-items: center; gap: .45em; }
.agm-download__zahl { font-size: .85em; font-weight: 600; color: var(--agm-akzent); white-space: nowrap; text-align: center; }
.agm-download__qrknopf { display: inline-flex; align-items: center; gap: .3em; font-size: .85em; font-weight: 600; color: inherit; opacity: .8; text-decoration: underline; text-underline-offset: .2em; min-height: 32px; }
.agm-download__qrknopf:hover, .agm-download__qrknopf:focus-visible, .agm-download__qrknopf[aria-expanded="true"] { color: var(--agm-akzent); opacity: 1; }
.agm-download__qr { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 1em 1.6em; padding: 1em 1.2em; background: #fbf8f4; border-radius: var(--agm-rund); }
.agm-download__qr img { width: var(--agm-qr, 168px); height: var(--agm-qr, 168px); max-width: 100%; background: #fff; border-radius: 6px; flex: none; }
.agm-download__qr > div { flex: 1 1 16em; min-width: 0; }
.agm-download__qr p { margin: 0 0 .5em; }
.agm-download__qrlinks a { color: var(--agm-akzent); font-weight: 600; }
.agm-download__text { min-width: 0; }
/* Titel der Downloads. Themes wie Avada geben h3 eine eigene Schrift und Größe; „:is(…, #agm-nie)“ hebt die
   Gewichtung auf ID-Stufe, damit „kompakt“ zuverlässig gilt. „--theme“ lässt Schrift und Größe beim Theme. */
.agm-download__titel { overflow-wrap: break-word; hyphens: auto; }
.agm-liste .agm-download :is(.agm-download__titel, #agm-nie) { margin: 0; }
.agm-liste .agm-download :is(.agm-download__titel--kompakt, #agm-nie) { font-family: inherit; font-size: 1.05em; font-weight: 700; line-height: 1.35; letter-spacing: normal; text-transform: none; }
.agm-download__kurz, .agm-download__meta { overflow-wrap: break-word; hyphens: auto; }
.agm-download__titel a { color: inherit; text-decoration: none; }
.agm-download__titel a:hover, .agm-download__titel a:focus-visible { color: var(--agm-akzent); text-decoration: underline; }
.agm-download__kurz { margin: .4em 0 0; max-width: 70ch; }
.agm-download__meta { margin: .6em 0 0; font-size: .9em; display: flex; flex-wrap: wrap; align-items: center; gap: .4em .9em; }
.agm-download__meta > :not(.agm-download__zahl) { opacity: .8; }
.agm-download__knopf {
	display: inline-flex; align-items: center; gap: .4em; padding: .55em 1em; border: 1px solid currentColor; border-radius: 999px; color: var(--agm-akzent); text-decoration: none; font-weight: 700; min-height: 44px;
}
.agm-download__knopf:hover, .agm-download__knopf:focus-visible { background: var(--agm-akzent); border-color: var(--agm-akzent); color: #fff; }
.agm-leer { margin: 1em 0; }

/* Breite Spalte (alignwide): Block-Themes setzen die Breite selbst; „voll“ bekommt einen Innenabstand zum Fensterrand */
.agm-voll { padding-left: var(--wp--style--root--padding-left, 16px); padding-right: var(--wp--style--root--padding-right, 16px); box-sizing: border-box; }
/* Downloads stehen immer einspaltig – auch in der breiten Spalte, damit nicht zu viel gleichzeitig auf dem Bildschirm ist */
@container (min-width: 1000px) {
	.agm-downloads { padding: 0 2em; }
	.agm-download { gap: 1.8em; }
	.agm-filter__suche input[type="search"] { max-width: 44em; }
}
.agm-zuruecksetzen { font: inherit; background: none; border: 0; padding: 0; color: var(--agm-akzent); text-decoration: underline; cursor: pointer; }

@container (max-width: 760px) {
	.agm-leiste, .agm-wahl { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
	.agm-wahl label { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); width: 100%; }
	.agm-wahl select { width: 100%; }
	.agm-download { grid-template-columns: 2.6em minmax(0, 1fr) auto; gap: .9em; padding: 1.2em 0; }
	.agm-downloads { padding: 0 1em; }
	.agm-icon { width: 2em; }
	.agm-download__artname { display: none; }
	.agm-download__knopf span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@container (max-width: 480px) {
	.agm-downloads { padding: 0 .8em; }
	/* schmal: Knopf unter den Text, damit lange Titel die ganze Breite haben */
	.agm-download { grid-template-columns: 1.9em minmax(0, 1fr); gap: .5em .75em; align-items: start; }
	.agm-icon { width: 1.8em; }
	.agm-download__aktion { grid-column: 2; justify-self: start; gap: .35em; }
	.agm-download__knopf { padding: .35em .95em; min-height: 40px; font-size: .95em; }
	.agm-download__knopf span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
	.agm-download__kurz { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

.agm-passwort { max-width: 32em; margin: 3em auto; padding: 0 1em; }
.agm-passwort input { font: inherit; padding: .6em .8em; width: 100%; max-width: 20em; }
.agm-passwort button { font: inherit; font-weight: 700; padding: .6em 1.2em; cursor: pointer; }
.agm-passwort__fehler { font-weight: 700; }

/* ---------- Suchfeld [sdm_search_form] / [agm_suchformular] ---------- */
.agm-suchformular { display: flex; flex-wrap: wrap; gap: .5em; margin: 1em 0; max-width: 40em; }
.agm-suchformular input[type="search"] { flex: 1 1 14em; min-width: 0; font: inherit; padding: .55em .8em; border: 1px solid rgba(0, 0, 0, .2); border-radius: 8px; min-height: 44px; box-sizing: border-box; }
.agm-suchformular button { font: inherit; font-weight: 700; padding: .55em 1.2em; border-radius: 999px; min-height: 44px; cursor: pointer; }

/* ---------- Häufige Fragen ---------- */
.agm-fragen { --agm-akzent: #9e1b61; --agm-linie: rgba(0, 0, 0, .14); --agm-flaeche: #fff; --agm-rund: 12px; margin: 1.5em 0; }
.agm-fragen--kasten { background: var(--agm-flaeche); border: 1px solid var(--agm-linie); border-top: 4px solid var(--agm-akzent); border-radius: var(--agm-rund); padding: 1.2em clamp(1em, 3vw, 1.6em) .6em; }
.agm-fragen__bereich { margin: 0 0 .2em; font-size: .8em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--agm-akzent); }
.agm-fragen__titel { margin: 0 0 .5em; }
.agm-frage { border-top: 1px solid var(--agm-linie); }
.agm-frage:first-child { border-top: 0; }
.agm-frage__frage { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: .9em 0; font-weight: 700; min-height: 44px; }
.agm-frage__frage::-webkit-details-marker { display: none; }
.agm-frage__frage::after { content: "+"; flex: none; width: 1.6em; height: 1.6em; display: grid; place-items: center; border: 1px solid var(--agm-akzent); border-radius: 50%; color: var(--agm-akzent); font-weight: 700; line-height: 1; }
.agm-frage[open] > .agm-frage__frage::after { content: "–"; background: var(--agm-akzent); color: #fff; }
.agm-frage__frage:hover, .agm-frage__frage:focus-visible { color: var(--agm-akzent); }
.agm-frage__antwort { padding: 0 0 1em; overflow-wrap: break-word; max-width: 78ch; }   /* gut lesbare Zeilenlänge auch in breiter Spalte */
.agm-frage__antwort > :first-child { margin-top: 0; }
.agm-frage__antwort img { max-width: 100%; height: auto; }
.agm-frage__antwort a { color: var(--agm-akzent); }

/* ---------- Materialbereich mit Reitern [agm_material] ---------- */
.agm-material { --agm-akzent: #9e1b61; --agm-linie: rgba(0, 0, 0, .14); --agm-flaeche: #fff; --agm-rund: 12px; margin: 1.5em 0; container-type: inline-size; }
.agm-material [hidden] { display: none !important; }
.agm-material__titel { margin: 0 0 .6em; }
.agm-material__suche { display: grid; gap: .3em; margin: 0 0 1em; }
.agm-material__suche label { font-weight: 700; }
.agm-material__feld { display: flex; gap: .5em; max-width: 44em; }
.agm-material__feld input[type="search"] { flex: 1 1 auto; min-width: 0; font: inherit; padding: .6em .9em; border: 1px solid var(--agm-linie); border-radius: 8px; background: var(--agm-flaeche); color: inherit; min-height: 48px; box-sizing: border-box; }
.agm-material__feld button { font: inherit; font-weight: 700; padding: .55em 1.2em; border: 1px solid var(--agm-akzent); border-radius: 999px; background: var(--agm-akzent); color: #fff; min-height: 48px; cursor: pointer; }
.agm-material--reiter .agm-material__feld button { display: none; }   /* mit JavaScript sucht das Feld schon beim Tippen */
.agm-reiter { display: flex; flex-wrap: nowrap; gap: .1em; overflow-x: auto; scrollbar-width: thin; border-bottom: 2px solid var(--agm-linie); margin: 0 0 1.2em; }
.agm-reiter__knopf { flex: none; white-space: nowrap; font: inherit; font-weight: 700; padding: .7em .9em; margin-bottom: -2px; border: 0; border-bottom: 3px solid transparent; background: none; color: inherit; cursor: pointer; min-height: 48px; }
.agm-reiter__knopf .agm-n { font-weight: 400; opacity: .8; }
.agm-reiter__knopf[aria-selected="true"] { color: var(--agm-akzent); border-bottom-color: var(--agm-akzent); }
.agm-reiter__knopf:hover, .agm-reiter__knopf:focus-visible { color: var(--agm-akzent); }
.agm-material__hinweis { margin: -.4em 0 1em; padding: .7em 1em; border-left: 3px solid var(--agm-akzent); background: rgba(0, 0, 0, .025); }
.agm-material__ueberschrift { margin: 1.2em 0 .6em; }
.agm-material--reiter .agm-material__ueberschrift { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.agm-material__bereich:focus { outline: none; }
.agm-material .agm-liste { margin-top: 0; }
.agm-material .agm-filter__suche { display: none; }   /* das gemeinsame Feld oben übernimmt */
@container (max-width: 680px) {
	.agm-reiter__knopf { font-size: .92em; padding: .65em .6em; }
	.agm-reiter__knopf .agm-n { font-size: .9em; }
}
@container (max-width: 480px) {
	/* schmal: alle Reiter sichtbar nebeneinander, Name und Zahl untereinander */
	.agm-reiter { overflow: visible; }
	.agm-reiter__knopf { flex: 1 1 0; min-width: 0; white-space: normal; text-align: center; line-height: 1.2; padding: .55em .3em; }
	.agm-reiter__knopf .agm-n { display: block; }
}

/* Häufige Fragen im Materialbereich: alle Fachbereiche, wählbar */
.agm-mfragen .agm-chips { margin-bottom: .8em; }
.agm-mfragen .agm-anzahl { margin: 0 0 .6em; }
.agm-mfragen [hidden] { display: none !important; }
.agm-fragen--alle { margin-top: 0; }
.agm-frage__bereich { display: block; font-size: .78em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--agm-akzent); margin-bottom: .15em; }
.agm-frage__weiter { margin: .8em 0 0; font-weight: 700; }

/* ---------- Glossar [agm_glossar] ---------- */
.agm-glossar { --agm-akzent: #9e1b61; --agm-linie: rgba(0, 0, 0, .14); margin: 1.5em 0; container-type: inline-size; }
@container (min-width: 900px) {
	.agm-glossar__gruppe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.4em; }
	.agm-glossar__buchstabe { grid-column: 1 / -1; }
}
.agm-glossar [hidden] { display: none !important; }
.agm-material .agm-glossar { margin-top: 0; }
.agm-glossar__suche { display: grid; gap: .3em; margin: 0 0 1em; }
.agm-glossar__suche label { font-weight: 700; }
.agm-glossar__suche input { font: inherit; padding: .55em .8em; border: 1px solid var(--agm-linie); border-radius: 8px; min-height: 44px; max-width: 30em; box-sizing: border-box; }
.agm-glossar__abc { display: flex; flex-wrap: wrap; gap: .3em; margin: 0 0 1em; }
.agm-glossar__abc a { display: grid; place-items: center; min-width: 2.4em; min-height: 2.4em; border: 1px solid var(--agm-linie); border-radius: 8px; font-weight: 700; text-decoration: none; color: var(--agm-akzent); }
.agm-glossar__abc a:hover, .agm-glossar__abc a:focus-visible { background: var(--agm-akzent); border-color: var(--agm-akzent); color: #fff; }
.agm-glossar__abc a.agm-aus { opacity: .35; pointer-events: none; }
.agm-glossar__buchstabe { margin: 1em 0 .3em; color: var(--agm-akzent); scroll-margin-top: 6rem; }
.agm-eintrag { padding: .8em 0; border-top: 1px solid var(--agm-linie); scroll-margin-top: 6rem; }
.agm-eintrag:target { background: rgba(0, 0, 0, .03); box-shadow: -.6em 0 0 rgba(0, 0, 0, .03), .6em 0 0 rgba(0, 0, 0, .03); }
.agm-eintrag__begriff { margin: 0 0 .25em; font-size: 1.05em; }
.agm-eintrag__text > :first-child { margin-top: 0; }
.agm-eintrag__text > :last-child { margin-bottom: 0; }
.agm-eintrag__weiter { list-style: none; margin: .5em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3em 1.2em; font-size: .92em; }
.agm-eintrag__weiter a { color: var(--agm-akzent); font-weight: 700; }
.agm-eintrag__art { font-size: .85em; opacity: .7; }

/* Begriffe im Text und ihr Erklär-Fenster */
.agm-begriff { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.agm-begriff:hover, .agm-begriff:focus-visible, .agm-begriff[aria-expanded="true"] { color: #9e1b61; text-decoration-style: solid; }
.agm-erklaerung { position: absolute; z-index: 9999; width: min(340px, calc(100vw - 32px)); box-sizing: border-box; padding: 1em 2.6em 1em 1.1em; background: #fff; color: #222; border: 1px solid rgba(0, 0, 0, .15); border-top: 4px solid #9e1b61; border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); font-size: .95rem; line-height: 1.5; }
.agm-erklaerung[hidden] { display: none; }
.agm-erklaerung p { margin: 0 0 .5em; }
.agm-erklaerung__begriff { font-weight: 700; color: #9e1b61; }
.agm-erklaerung a { color: #9e1b61; font-weight: 700; }
.agm-erklaerung__zu { position: absolute; top: .35em; right: .35em; width: 2.2em; height: 2.2em; border: 0; border-radius: 50%; background: none; font-size: 1.3em; line-height: 1; cursor: pointer; color: inherit; }
.agm-erklaerung__zu:hover, .agm-erklaerung__zu:focus-visible { background: rgba(0, 0, 0, .06); }
@media (max-width: 520px) {
	.agm-erklaerung { position: fixed; left: 16px !important; right: 16px; top: auto !important; bottom: 16px; width: auto; }
}

/* ---------- Live-Suche [agm_suche] ---------- */
.agm-suche { --agm-akzent: #9e1b61; --agm-linie: rgba(0, 0, 0, .14); margin-top: 1.5em; margin-bottom: 1.5em; }
.agm-suche [hidden] { display: none !important; }
.agm-suche .agm-suchformular { margin: 0; max-width: none; }
.agm-suche--laedt .agm-suchformular input { background-image: linear-gradient(90deg, transparent, rgba(158, 27, 97, .12), transparent); background-size: 200% 100%; animation: agm-laden 1s linear infinite; }
@keyframes agm-laden { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .agm-suche--laedt .agm-suchformular input { animation: none; } }
.agm-suche__treffer { margin-top: .8em; padding: .4em 1.1em 1em; border: 1px solid var(--agm-linie); border-radius: 12px; background: #fff; }
.agm-suche__art { margin: .9em 0 .3em; font-size: .85em; letter-spacing: .06em; text-transform: uppercase; color: var(--agm-akzent); }
.agm-suche__liste { list-style: none; margin: 0; padding: 0; }
.agm-suche__eintrag { padding: .5em 0; border-top: 1px solid var(--agm-linie); }
.agm-suche__eintrag:first-child { border-top: 0; }
.agm-suche__kopf { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .5em; }
.agm-suche__kopf a { font-weight: 700; color: inherit; overflow-wrap: anywhere; }
.agm-suche__kopf a:hover, .agm-suche__kopf a:focus-visible { color: var(--agm-akzent); }
.agm-suche__marke { font-size: .75em; font-weight: 700; padding: .1em .5em; border: 1px solid var(--agm-linie); border-radius: 999px; }
.agm-suche__text { margin: .2em 0 0; font-size: .92em; opacity: .85; overflow-wrap: break-word; }
.agm-suche__alle { display: inline-block; margin-top: .8em; font-weight: 700; color: var(--agm-akzent); }
.agm-suche__leer { margin: .6em 0 0; }
.agm-suche .screen-reader-text, .agm-suchformular .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Höchstbreite (0.5.1): breite Bereiche wachsen nicht über die ganze Fensterbreite (z. B. Avada-Container 100 %).
   Die Grenze sitzt auf den Kindern, damit Block-Themes ihre eigene breite Spalte behalten (es gilt die kleinere).
   hoechstbreite="…" am Kurzbefehl setzt --agm-max am Element selbst und gilt dann auch für breite="text" oder "voll". */
.agm-material:not(.agm-voll) > *, .agm-weit > *, [class^="agm-"][style*="--agm-max"] > * { max-width: var(--agm-max, 1100px); margin-left: auto; margin-right: auto; box-sizing: border-box; }
