/* =====================================================================
   Arbeitsakademie – Komponenten
   Setzt tokens.css voraus. Präfix „aa-“ verhindert Konflikte mit
   WordPress- und Plugin-Klassen. Stand: 22.10.2026
   ===================================================================== */

/* ---------- Grundlagen ---------- */
.aa, .aa * { box-sizing: border-box; }
.aa { font-family: var(--aa-schrift); font-size: var(--aa-gr-body); line-height: var(--aa-zeile-text); color: var(--aa-text); background: var(--aa-weiss); }
.aa h1, .aa h2, .aa h3, .aa h4 { margin: 0; font-weight: 700; line-height: var(--aa-zeile-titel); letter-spacing: var(--aa-laufweite-titel); text-wrap: balance; color: inherit; }
.aa p { margin: 0; max-width: var(--aa-textbreite); }
.aa-display { font-weight: 700; font-size: var(--aa-gr-display); letter-spacing: -0.025em; line-height: 1.06; }
.aa-h1 { font-size: var(--aa-gr-h1); }
.aa-h2 { font-size: var(--aa-gr-h2); }
.aa-h3 { font-size: var(--aa-gr-h3); letter-spacing: -0.01em; line-height: 1.2; }
.aa-h4 { font-size: var(--aa-gr-h4); letter-spacing: 0; line-height: 1.3; }
.aa-lead { font-size: var(--aa-gr-lead); line-height: 1.5; color: var(--aa-text-gedaempft); }
.aa-small { font-size: var(--aa-gr-small); }
.aa-zahlen { font-variant-numeric: tabular-nums; }
.aa a { color: var(--aa-hausgruen); text-underline-offset: 0.18em; }
.aa a:hover { color: var(--aa-dunkelgruen); }
.aa :focus-visible { outline: 2px solid var(--aa-hausgruen); outline-offset: 3px; }
.aa-auf-gruen :focus-visible, .aa-kopfbox :focus-visible, .aa-cta-band :focus-visible, .aa-fusszeile :focus-visible { outline-color: var(--aa-weiss); }
.aa-nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .aa *, .aa *::before, .aa *::after { transition: none !important; animation: none !important; } }

/* ---------- Layout ---------- */
.aa-container { max-width: var(--aa-breite-seite); margin-inline: auto; padding-inline: var(--aa-a-rand); }
.aa-sektion { padding-block: var(--aa-a-sektion); }
.aa-sektion--grau { background: var(--aa-grau); }
.aa-stapel { display: flex; flex-direction: column; gap: var(--aa-a-m); }
.aa-raster { display: grid; gap: var(--aa-spaltenabstand); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ---------- Eyebrow ---------- */
.aa-eyebrow { font-size: 0.875rem; font-weight: 700; letter-spacing: var(--aa-laufweite-label); text-transform: uppercase; color: var(--aa-hausgruen); }
.aa-kopfbox .aa-eyebrow, .aa-auf-gruen .aa-eyebrow { color: var(--aa-salbei); }

/* ---------- Buttons ---------- */
.aa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; min-height: var(--aa-touch);
  padding: 0.875rem 1.75rem; border: 2px solid transparent; border-radius: var(--aa-r-pille);
  font: 700 var(--aa-gr-body)/1.2 var(--aa-schrift); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.aa-btn svg { width: 1.1em; height: 1.1em; flex: none; }
.aa .aa-btn--primaer, .aa-btn--primaer { background: var(--aa-hausgruen); color: var(--aa-weiss); }
.aa .aa-btn--primaer:hover, .aa-btn--primaer:hover { background: var(--aa-dunkelgruen); color: var(--aa-weiss); }
.aa .aa-btn--kontur, .aa-btn--kontur { background: transparent; color: var(--aa-hausgruen); border-color: var(--aa-hausgruen); }
.aa .aa-btn--kontur:hover, .aa-btn--kontur:hover { background: var(--aa-gruen-hell); color: var(--aa-hausgruen); }
.aa .aa-btn--tonal, .aa-btn--tonal { background: var(--aa-gruen-hell); color: var(--aa-hausgruen); }
.aa .aa-btn--tonal:hover, .aa-btn--tonal:hover { background: var(--aa-gruen-linie); color: var(--aa-hausgruen); }
.aa .aa-btn--salbei, .aa-btn--salbei { background: var(--aa-salbei); color: var(--aa-hausgruen); }
.aa .aa-btn--salbei:hover, .aa-btn--salbei:hover { background: #A3CA99; color: var(--aa-hausgruen); }
.aa .aa-btn--weiss, .aa-btn--weiss { background: var(--aa-weiss); color: var(--aa-hausgruen); }
.aa .aa-btn--weiss:hover, .aa-btn--weiss:hover { background: var(--aa-gruen-hell); color: var(--aa-hausgruen); }
.aa .aa-btn--weiss-kontur, .aa-btn--weiss-kontur { background: transparent; color: var(--aa-weiss); border-color: var(--aa-weiss); }
.aa .aa-btn--weiss-kontur:hover, .aa-btn--weiss-kontur:hover { background: rgba(255,255,255,.12); color: var(--aa-weiss); }
.aa-btn--s { padding: 0.5rem 1.125rem; font-size: var(--aa-gr-small); min-height: 40px; }
.aa-btn--l { padding: 1rem 2rem; font-size: 1.0625rem; min-height: 54px; }
.aa-btn--breit { width: 100%; }
.aa-btn[disabled], .aa-btn[aria-disabled="true"] { background: var(--aa-deaktiviert); color: var(--aa-deaktiviert-text); border-color: transparent; cursor: not-allowed; }
.aa-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--aa-touch); height: var(--aa-touch);
  border-radius: 50%; border: 1px solid var(--aa-linie); background: var(--aa-weiss); color: var(--aa-text); cursor: pointer; }
.aa-icon-btn--gruen { background: var(--aa-hausgruen); border-color: var(--aa-hausgruen); color: var(--aa-weiss); }
.aa .aa-pfeil, .aa-pfeil { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--aa-hausgruen); color: var(--aa-weiss); flex: none; }

/* ---------- Badges ---------- */
.aa-badge { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3rem 0.8rem; border-radius: var(--aa-r-pille);
  font-size: var(--aa-gr-klein); font-weight: 700; line-height: 1.3; background: var(--aa-salbei); color: var(--aa-hausgruen); }
.aa-badge--hell { background: var(--aa-gruen-hell); }
.aa-badge--kontur { background: transparent; box-shadow: inset 0 0 0 1.5px var(--aa-gruen-linie); }

/* ---------- Kopf-Box (Hero, Kursseiten-Kopf) ---------- */
.aa-kopfbox { background: var(--aa-hausgruen); color: var(--aa-weiss); border-radius: var(--aa-r-box);
  padding: clamp(1.5rem, 1rem + 3vw, 3.5rem); display: flex; flex-direction: column; gap: var(--aa-a-l); }
.aa-kopfbox p { color: var(--aa-auf-gruen-text); }

/* ---------- Karten ---------- */
.aa-karte { background: var(--aa-weiss); border: 1px solid var(--aa-linie); border-radius: var(--aa-r-karte); padding: var(--aa-a-l); }
.aa .aa-themenkarte, .aa-themenkarte { display: flex; flex-direction: column; background: var(--aa-weiss); border: 1px solid var(--aa-linie);
  border-radius: var(--aa-r-karte); overflow: hidden; text-decoration: none; color: var(--aa-text); transition: box-shadow .15s ease, border-color .15s ease; }
.aa .aa-themenkarte:hover, .aa-themenkarte:hover { color: var(--aa-text); border-color: var(--aa-gruen-linie); box-shadow: var(--aa-schatten-schwebend); }
.aa-themenkarte__bild { aspect-ratio: 4 / 3; max-width: 100%; object-fit: cover; background: var(--aa-grau); position: relative; }
.aa-themenkarte__inhalt { padding: var(--aa-a-l); display: flex; flex-direction: column; gap: var(--aa-a-xs); flex: 1; }
.aa-themenkarte__fuss { margin-top: auto; padding-top: var(--aa-a-xs); display: flex; justify-content: flex-end; }
.aa-kurskarte { display: flex; flex-direction: column; gap: var(--aa-a-s); background: var(--aa-weiss); border: 1px solid var(--aa-linie);
  border-radius: var(--aa-r-karte); padding: var(--aa-a-l); }
.aa-kurskarte__meta { display: flex; flex-wrap: wrap; gap: var(--aa-a-2xs) var(--aa-a-m); font-size: var(--aa-gr-small); color: var(--aa-text-gedaempft); }
.aa-kurskarte__fuss { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: var(--aa-a-m);
  padding-top: var(--aa-a-s); border-top: 1px solid var(--aa-linie); }

/* ---------- Eckdaten ---------- */
.aa-eckdaten { margin: 0; display: grid; gap: var(--aa-a-s); grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.aa-eckdaten > div { background: var(--aa-weiss); border: 1px solid var(--aa-linie); border-radius: var(--aa-r-feld); padding: var(--aa-a-m); }
.aa-eckdaten dt { font-size: var(--aa-gr-klein); color: var(--aa-text-gedaempft); }
.aa-eckdaten dd { margin: 0.125rem 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Akkordeon (natives <details>) ---------- */
.aa-akkordeon { display: flex; flex-direction: column; gap: var(--aa-a-s); }
.aa-akkordeon details { background: var(--aa-gruen-hell); border-radius: 14px; }
.aa-akkordeon summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--aa-a-m);
  padding: 1.25rem 1.5rem; font-size: var(--aa-gr-h4); font-weight: 700; min-height: var(--aa-touch); border-radius: 14px; }
.aa-akkordeon summary::-webkit-details-marker { display: none; }
.aa-akkordeon summary::after { content: ""; width: 10px; height: 10px; border-right: 2.5px solid var(--aa-hausgruen); border-bottom: 2.5px solid var(--aa-hausgruen);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease; flex: none; }
.aa-akkordeon details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.aa-akkordeon__inhalt { margin: 0 var(--aa-a-m) var(--aa-a-m); background: var(--aa-weiss); border-radius: 10px; padding: var(--aa-a-m) var(--aa-a-l); }

/* ---------- Schritte ---------- */
.aa-schritte { list-style: none; margin: 0; padding: 0; counter-reset: aa-schritt; display: grid; gap: var(--aa-a-m);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.aa-schritte li { counter-increment: aa-schritt; background: var(--aa-weiss); border-radius: var(--aa-r-karte); padding: var(--aa-a-l); display: flex; flex-direction: column; gap: var(--aa-a-xs); }
.aa-schritte li::before { content: counter(aa-schritt); width: 40px; height: 40px; border-radius: 50%; background: var(--aa-hausgruen); color: var(--aa-weiss);
  display: flex; align-items: center; justify-content: center; font-weight: 700; }
.aa-schritte span { color: var(--aa-text-gedaempft); font-size: var(--aa-gr-small); }

/* ---------- Querverweis-Box (Salbei, höchstens eine pro Seite) ---------- */
.aa-querverweis { background: var(--aa-salbei); color: var(--aa-hausgruen); border-radius: 20px; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  display: flex; flex-wrap: wrap; gap: var(--aa-a-l) var(--aa-a-xl); align-items: center; justify-content: space-between; }
.aa-querverweis > :first-child { flex: 1 1 320px; min-width: 0; }

/* ---------- Förder-Box (Grün hell) ---------- */
.aa-hellbox { background: var(--aa-gruen-hell); border-radius: 20px; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); display: flex; flex-direction: column; gap: var(--aa-a-m); }

/* ---------- CTA-Band ---------- */
.aa-cta-band { background: var(--aa-hausgruen); color: var(--aa-weiss); border-radius: var(--aa-r-box); padding: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  display: flex; flex-wrap: wrap; gap: var(--aa-a-xl); align-items: center; justify-content: space-between; }
.aa-cta-band p { color: var(--aa-auf-gruen-text); }

/* ---------- Formular ---------- */
.aa-feld { display: flex; flex-direction: column; gap: var(--aa-a-xs); }
.aa-feld label, .aa-feld legend { font-weight: 600; font-size: var(--aa-gr-small); padding: 0; }
.aa-feld input, .aa-feld select, .aa-feld textarea { font: inherit; color: var(--aa-text); background: var(--aa-weiss);
  border: 1.5px solid var(--aa-feldrand); border-radius: var(--aa-r-feld); padding: 0.75rem 1rem; min-height: 48px; width: 100%; }
.aa-feld input::placeholder, .aa-feld textarea::placeholder { color: var(--aa-deaktiviert-text); }
.aa-feld input:focus-visible, .aa-feld select:focus-visible, .aa-feld textarea:focus-visible { outline: 2px solid var(--aa-hausgruen); outline-offset: 2px; border-color: var(--aa-hausgruen); }
.aa-feld__hilfe { font-size: var(--aa-gr-klein); color: var(--aa-text-gedaempft); }
.aa-feld--fehler input, .aa-feld--fehler select, .aa-feld--fehler textarea { border-color: var(--aa-fehler); }
.aa-feld__fehler { font-size: var(--aa-gr-klein); font-weight: 600; color: var(--aa-fehler); }
.aa-auswahl { display: flex; flex-wrap: wrap; gap: var(--aa-a-xs); border: 0; margin: 0; padding: 0; }
.aa-auswahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aa-auswahl label { display: inline-flex; align-items: center; min-height: var(--aa-touch); padding: 0 1.25rem; border-radius: var(--aa-r-pille);
  border: 1.5px solid var(--aa-gruen-linie); background: var(--aa-weiss); color: var(--aa-hausgruen); font-weight: 600; cursor: pointer; }
.aa-auswahl input:checked + label { background: var(--aa-hausgruen); border-color: var(--aa-hausgruen); color: var(--aa-weiss); }
.aa-auswahl input:focus-visible + label { outline: 2px solid var(--aa-hausgruen); outline-offset: 3px; }
.aa-datenschutz { font-size: var(--aa-gr-klein); color: var(--aa-text-gedaempft); display: flex; gap: var(--aa-a-xs); align-items: flex-start; }

/* ---------- Hinweise (Funktionsfarben) ---------- */
.aa-meldung { border-radius: var(--aa-r-feld); padding: var(--aa-a-m) var(--aa-a-l); font-size: var(--aa-gr-small); display: flex; gap: var(--aa-a-s); align-items: flex-start; }
.aa-meldung--erfolg { background: var(--aa-erfolg-hell); color: var(--aa-erfolg); }
.aa-meldung--hinweis { background: var(--aa-hinweis-hell); color: var(--aa-hinweis); }
.aa-meldung--fehler { background: var(--aa-fehler-hell); color: var(--aa-fehler); }

/* ---------- Reiter und Brotkrumen ---------- */
.aa-reiter { display: flex; flex-wrap: wrap; gap: var(--aa-a-xs); }
.aa-reiter a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1.125rem; border-radius: var(--aa-r-pille);
  color: var(--aa-text); font-weight: 600; text-decoration: none; }
.aa-reiter a:hover { background: var(--aa-gruen-hell); }
.aa-reiter a[aria-current="true"], .aa-reiter a[aria-current="page"] { background: var(--aa-dunkelgruen); color: var(--aa-weiss); }
.aa-brotkrumen { display: flex; flex-wrap: wrap; gap: var(--aa-a-xs); font-size: var(--aa-gr-small); color: var(--aa-text-gedaempft); }
.aa-brotkrumen a { color: var(--aa-text-gedaempft); }

/* ---------- Kopfzeile, Fußzeile, Leiste mobil ---------- */
.aa-kopfzeile { background: var(--aa-weiss); border-bottom: 1px solid var(--aa-linie); position: sticky; top: 0; z-index: 50; }
.aa-kopfzeile__innen { min-height: var(--aa-kopfzeile); display: flex; align-items: center; gap: var(--aa-a-l); }
.aa-kopfzeile__logo img { display: block; height: 50px; width: auto; }
.aa-kopfzeile__nav { display: flex; flex-wrap: wrap; gap: var(--aa-a-2xs) var(--aa-a-l); margin-left: auto; font-weight: 500; }
.aa-kopfzeile__nav a { color: var(--aa-text); text-decoration: none; }
.aa-kopfzeile__nav a[aria-current="page"] { color: var(--aa-hausgruen); font-weight: 700; }
@media (max-width: 899px) { .aa-kopfzeile__nav { display: none; } .aa-kopfzeile__logo img { height: 40px; } .aa-kopfzeile__innen { min-height: 64px; } }
.aa-fusszeile { background: var(--aa-dunkelgruen); color: var(--aa-footer-text); font-size: var(--aa-gr-small); }
.aa-fusszeile a { color: var(--aa-footer-text); }
.aa-fusszeile a:hover { color: var(--aa-weiss); }
.aa-mobilleiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--aa-weiss); border-top: 1px solid var(--aa-linie);
  padding: 0.75rem max(1rem, env(safe-area-inset-right, 0px)) calc(0.75rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px)); display: flex; gap: var(--aa-a-xs); }
@media (min-width: 900px) { .aa-mobilleiste { display: none; } }
@media (max-width: 899px) { .aa--mit-leiste { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Bilder ---------- */
.aa-bild { position: relative; border-radius: var(--aa-r-bild); overflow: hidden; }
.aa-bild img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aa-ki-hinweis { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 0.35em;
  background: rgba(16, 29, 20, 0.78); color: var(--aa-weiss); font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: var(--aa-r-pille); }

/* ---------- Ansprechpartner ---------- */
.aa-person { display: flex; align-items: center; gap: var(--aa-a-m); }
.aa-person__foto { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--aa-gruen-linie); flex: none; }
.aa-person__name { font-weight: 700; }
.aa-person__rolle { font-size: var(--aa-gr-small); color: var(--aa-text-gedaempft); }

/* ---------- WordPress-Blockstile (registriert in functions-snippet.php) ---------- */
.wp-block-button.is-style-tonal .wp-block-button__link { background: var(--aa-gruen-hell); color: var(--aa-hausgruen); }
.wp-block-button.is-style-salbei .wp-block-button__link { background: var(--aa-salbei); color: var(--aa-hausgruen); }
.wp-block-button.is-style-auf-gruen .wp-block-button__link { background: var(--aa-weiss); color: var(--aa-hausgruen); }
.wp-block-group.is-style-kopfbox { background: var(--aa-hausgruen); color: var(--aa-weiss); border-radius: var(--aa-r-box); padding: clamp(1.5rem, 1rem + 3vw, 3.5rem); }
.wp-block-group.is-style-kopfbox :where(h1, h2, h3, h4) { color: var(--aa-weiss); }
.wp-block-group.is-style-kopfbox :where(p) { color: var(--aa-auf-gruen-text); }
.wp-block-group.is-style-kopfbox .wp-block-button__link { background: var(--aa-weiss); color: var(--aa-hausgruen); }
.wp-block-group.is-style-querverweis { background: var(--aa-salbei); color: var(--aa-hausgruen); border-radius: 20px; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.wp-block-group.is-style-hellbox { background: var(--aa-gruen-hell); border-radius: 20px; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.wp-block-group.is-style-abschnitt-grau { background: var(--aa-grau); }
