/* ===== GAD Academy: Kernschulungen als Flip-Karten (Variante A, live seit 2026-09-30) ===== */
.ac-trainings { padding: clamp(24px, 3vw, 40px) 0 clamp(36px, 4vw, 56px); }
.acf-head { text-align: center; max-width: 760px; margin: 0 auto 18px; }
.acf-head .eyebrow { margin-bottom: 6px; }
.acf-head h2 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.1; color: #0b1c3d; margin: 0 0 6px; }
.acf-head .accent-blue { color: #2b8aff; }
.acf-head .lead { font-size: 16px; line-height: 1.45; color: #4a5568; margin: 0; }

.acf-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.acf-card { flex: 0 1 calc((100% - 32px) / 3); min-width: 0; perspective: 1400px; scroll-margin-top: 92px; }
.acf-inner { display: grid; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.acf-card.is-flipped .acf-inner { transform: rotateY(180deg); }
.acf-face {
  grid-area: 1 / 1; min-width: 0; display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.acf-front { position: relative; }
.acf-back { transform: rotateY(180deg); background: #0b1c3d; color: #fff; padding: 14px 18px 16px; gap: 8px; }

/* Vorderseite */
.acf-front-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 14px; flex: 1; }
.acf-front h3 { font-size: 18px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.acf-lead { font-size: 14px; line-height: 1.4; margin: 0; }
.acf-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.acf-facts { display: flex; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0; padding: 0; }
.acf-facts li { font-size: 12.5px; line-height: 1; padding: 6px 9px; border-radius: 999px; }
.acf-price { font-size: 15px; font-weight: 700; white-space: nowrap; }
.acf-price small { font-size: 11.5px; font-weight: 500; opacity: .75; }
.acf-icon { display: none; }

/* ganze Vorderseite ist die Schaltfläche (Pseudo-Element spannt sich über die Karte) */
.acf-toggle {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; margin-top: 4px; border-radius: 999px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1; cursor: pointer; background: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.acf-toggle::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.acf-toggle:focus-visible { outline: none; }
.acf-toggle:focus-visible::after { outline: 3px solid #2b8aff; outline-offset: -3px; }
.acf-card:not(.is-flipped) .acf-front:hover .acf-toggle svg { transform: rotate(-60deg); }
.acf-toggle svg { transition: transform .35s ease; }

/* Rückseite */
.acf-back-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.acf-back h4 { font-size: 16px; line-height: 1.25; margin: 10px 0 0; color: inherit; }
.acf-close {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff;
}
.acf-close:hover { background: rgba(255, 255, 255, .2); }
.acf-close:focus-visible, .acf-cta:focus-visible { outline: 3px solid #2b8aff; outline-offset: 2px; }
.acf-learn { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.acf-learn li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.35; }
.acf-learn li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: #2b8aff; }
.acf-who, .acf-note { font-size: 12.5px; line-height: 1.35; margin: 0; opacity: .82; }
.acf-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 2px 0 0; }
.acf-prices div { background: rgba(255, 255, 255, .07); border-radius: 10px; padding: 7px 9px; }
.acf-prices dt { font-size: 11px; line-height: 1.2; opacity: .72; }
.acf-prices dd { margin: 3px 0 0; font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.acf-cta {
  margin-top: auto; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; background: #fff; color: #0b1c3d; font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .2s ease;
}
.acf-cta:hover { background: #e6eefb; }

.acf-common { text-align: center; font-size: 13px; line-height: 1.5; color: #5a6478; margin: 16px auto 0; max-width: 900px; }

/* Bewegung reduziert: Überblenden statt Drehen */
@media (prefers-reduced-motion: reduce) {
  .acf-inner, .acf-card.is-flipped .acf-inner { transform: none; transition: none; }
  .acf-back { transform: none; }
  /* nur Deckkraft: visibility würde focus() blockieren; Tastatur/Screenreader regelt inert */
  .acf-face { transition: opacity .2s ease; }
  .acf-back, .acf-card.is-flipped .acf-front { opacity: 0; pointer-events: none; }
  .acf-card.is-flipped .acf-back { opacity: 1; pointer-events: auto; }
  .acf-toggle svg { transition: none; }
}

/* Mobil: Wischreihe, nächste Karte lugt hervor */
@media (max-width: 700px) {
  .acf-head { text-align: left; }
  .acf-grid {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px; padding: 4px 16px 12px; scroll-padding: 0 16px; scrollbar-width: none;
  }
  .acf-grid::-webkit-scrollbar { display: none; }
  .acf-card { flex: 0 0 86%; scroll-snap-align: start; }
  .acf-common { text-align: left; }
}
@media (min-width: 701px) and (max-width: 980px) {
  .acf-card { flex-basis: calc((100% - 16px) / 2); }
}

/* Kompaktierung (Runde 2) */
.acf-back { gap: 6px; padding: 12px 16px 14px; }
.acf-back h4 { margin-top: 12px; }
@media (min-width: 981px) {
  .acf-head { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px 40px; text-align: left; max-width: none; margin-bottom: 16px; }
  .acf-head .eyebrow { grid-column: 1; }
  .acf-head h2 { grid-column: 1; margin: 0; }
  .acf-head .lead { grid-column: 2; grid-row: 2; justify-self: end; max-width: 440px; text-align: right; }
}

/* Kompaktierung (Runde 3) */
.ac-trainings { padding-top: clamp(20px, 2vw, 28px); }
.acf-front-body { gap: 6px; }
.acf-facts { margin-top: auto; }
.acf-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.acf-foot .acf-toggle { margin: 0; }
.acf-back { gap: 6px; padding: 14px 16px; }
.acf-back h4 { margin: 0; font-size: 15px; }
.acf-learn { gap: 2px; }
.acf-prices div { padding: 6px 8px; }
.acf-prices dd { font-size: 13px; margin-top: 2px; }
.acf-back-foot { display: flex; gap: 8px; margin-top: auto; }
.acf-back-foot .acf-cta { flex: 1; margin: 0; padding: 0 12px; font-size: 13.5px; }
.acf-toggle { white-space: nowrap; }
.acf-toggle svg, .acf-close svg { flex: none; }
.acf-foot { flex-wrap: wrap; }
/* Variante A: kleines Bild oben, weiße Karte, Rückseite Navy */
.acf--a .acf-front { background: #fff; border: 1px solid #e3e9f2; box-shadow: 0 8px 28px rgba(11, 28, 61, .07); color: #0b1c3d; transition: box-shadow .25s ease, border-color .25s ease; }
.acf--a .acf-front:hover { border-color: #c9d6ea; box-shadow: 0 12px 34px rgba(11, 28, 61, .12); }
.acf--a .acf-media { height: 92px; overflow: hidden; }
.acf--a .acf-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acf--a .acf-lead { color: #4a5568; }
.acf--a .acf-facts li { background: #eef3f9; color: #16336a; }
.acf--a .acf-toggle { border: 1px solid #16336a; color: #16336a; }
.acf--a .acf-front:hover .acf-toggle { background: #16336a; color: #fff; }
.acf--a .acf-media { height: auto; flex: 1 1 92px; min-height: 92px; }
.acf--a .acf-front-body { flex: none; }

/* ===== Runde 4 (2026-09-30): größere Karten, Details-Dialog, FAQ wie Startseite ===== */
@media (min-width: 981px) {
  .ac-trainings > .container { max-width: 1320px; }
  .acf-grid { gap: 20px; }
  .acf-card { flex-basis: calc((100% - 40px) / 3); }
  /* Höhe an den Bildschirm gekoppelt: 1440×900 und 1280×800 zeigen beide Reihen komplett */
  .acf-inner { min-height: clamp(300px, calc((100vh - 220px) / 2), 360px); }
}
.acf-front-body { padding: 16px 22px 18px; gap: 8px; }
.acf-front h3 { font-size: 20px; }
.acf-lead { font-size: 15px; line-height: 1.45; }
.acf--a .acf-media { flex: 1 1 110px; min-height: 110px; }
.acf-back { padding: 20px 22px; gap: 9px; }
.acf-back h4 { font-size: 17px; }
.acf-learn { gap: 4px; }
.acf-learn li { font-size: 14px; }
.acf-who, .acf-note { font-size: 13px; }
.acf-prices { gap: 8px; }
.acf-prices div { padding: 8px 10px; }
.acf-prices dd { font-size: 14px; }
.acf-back-head { align-items: center; }
.acf-more {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: none; color: #fff;
  font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.acf-more:hover { background: rgba(255, 255, 255, .12); }
.acf-more:focus-visible { outline: 3px solid #2b8aff; outline-offset: 2px; }

/* Details-Dialog (natives <dialog>, Fokusfalle über GADDialog) */
html.acd-lock { overflow: hidden; }
.acd {
  width: min(960px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 22px;
  background: #fff; color: #0b1c3d; box-shadow: 0 30px 80px rgba(11, 28, 61, .35); overflow: auto; overscroll-behavior: contain;
}
.acd::backdrop { background: rgba(11, 28, 61, .6); }
.acd-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 18px; background: #0b1c3d; color: #fff; }
.acd-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8fc1ff; }
.acd-head h3 { margin: 0 0 8px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; color: #fff; }
.acd-lead { margin: 0; max-width: 720px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .85); }
.acd-x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .12); color: #fff; }
.acd-x:hover { background: rgba(255, 255, 255, .22); }
.acd-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; padding: 8px 28px 8px; }
.acd-col h4 { margin: 20px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #0066cc; }
.acd-col p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; color: #3a4658; }
.acd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.acd-list li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.45; color: #3a4658; }
.acd-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: #2b8aff; }
.acd-facts { margin: 0; display: grid; gap: 0; border-top: 1px solid #e3e9f2; }
.acd-facts div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e3e9f2; font-size: 14.5px; line-height: 1.4; }
.acd-facts dt { color: #5a6478; }
.acd-facts dd { margin: 0; font-weight: 600; }
.acd-prices { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.acd-prices th, .acd-prices td { padding: 8px 0; border-bottom: 1px solid #e3e9f2; text-align: left; font-weight: 400; color: #5a6478; }
.acd-prices td { text-align: right; font-weight: 700; color: #0b1c3d; white-space: nowrap; padding-left: 12px; }
.acd-prices thead th { font-size: 12.5px; font-weight: 600; text-align: right; padding-left: 12px; }
.acd-col .acd-small { margin-top: 8px; font-size: 13px; color: #5a6478; }
.acd-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 16px 28px 20px; background: #fff; border-top: 1px solid #e3e9f2; }
.acd-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; background: #16336a; color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; }
.acd-cta:hover { background: #1d4180; }
.acd-x:focus-visible, .acd-cta:focus-visible { outline: 3px solid #2b8aff; outline-offset: 2px; }
@media (max-width: 760px) {
  .acd { width: 100%; max-width: none; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .acd-head { padding: 18px 16px 14px; }
  .acd-body { grid-template-columns: 1fr; padding: 0 16px 8px; }
  .acd-foot { padding: 12px 16px 16px; }
  .acd-cta { flex: 1; justify-content: center; }
  .acd-facts div { grid-template-columns: 110px 1fr; }
}

/* Intro unten: Button unter dem Text */
.ac-intro-cta { margin-top: 6px; }

/* FAQ wie Startseite: Zeilen mit Trennlinien statt Kästen, Akzent in der Überschrift */
body:not(.is-home) .ac-faq .faq-item { border: 0; border-bottom: 1px solid var(--line, #d2d2d7); border-radius: 0; background: transparent; }
body:not(.is-home) .ac-faq .faq-list { border-top: 1px solid var(--line, #d2d2d7); }
.ac-faq .faq-headline { color: #0b1c3d; }
.ac-faq .faq-headline-answer { color: #2b8aff; }
/* flache Laptops (1280×800): beide Reihen ohne Anschnitt */
@media (min-width: 981px) and (max-height: 840px) {
  .acf--a .acf-media { flex-basis: 92px; min-height: 92px; }
  .acf-front-body { padding: 14px 22px 14px; }
  .acf-back { padding: 16px 22px; }
}
.acd { margin: auto; inset: 0; }
@media (max-width: 760px) { .acd { margin: 0; } }
/* Intro direkt unter Nachweis: kein doppelter Abstand */
.ac-cert + .ac-intro { padding-top: 0; padding-bottom: clamp(48px, 7vw, 96px); }
@media (max-width: 760px) { .acd-head { position: static; } }

/* ===== Runde 5 (2026-09-30): Kopf wie andere Sektionen (untereinander, links, volle Breite) ===== */
.acf-head, .acf-head .lead { text-align: left; }
.acf-head { display: block; max-width: none; margin: 0 0 clamp(24px, 3vw, 40px); }
.acf-head .eyebrow { margin-bottom: 12px; }
.acf-head h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.12; margin: 0 0 14px; }
.acf-head .lead { justify-self: auto; max-width: 820px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; }
@media (min-width: 981px) {
  .ac-trainings { padding-top: clamp(28px, 3vw, 44px); }
  /* größerer Kopf: Kartenhöhe etwas kleiner, damit 1440×900 beide Reihen zeigt */
  .acf-inner { min-height: clamp(290px, calc((100vh - 300px) / 2), 360px); }
}
/* Personenfotos: Bildausschnitt auf Kopfhöhe */
.acf--a .acf-img { object-position: 50% 40%; }

/* ===== Runde 6 (2026-09-30): 6. Karte, Raster links beginnend; Academy + Nachweis als eine Kachel ===== */
.acf-grid { justify-content: flex-start; }
.ac-cert--merged .ac-cert-grid {
  grid-template-columns: 1fr 1fr; align-items: start; row-gap: clamp(24px, 3vw, 36px);
  grid-template-areas: "text media" "proof list" "cta list";
  grid-template-rows: auto auto 1fr;
}
.ac-cert--merged .ac-cert-text { grid-area: text; align-self: center; }
.ac-cert--merged .ac-cert-media { grid-area: media; }
.ac-cert--merged .ac-cert-media img { width: 100%; height: clamp(220px, 24vw, 320px); object-fit: cover; object-position: center 22%; border-radius: 18px; display: block; }
.ac-cert--merged .ac-cert-proof { grid-area: proof; padding-top: clamp(20px, 2.4vw, 32px); border-top: 1px solid rgba(20, 40, 80, .1); }
.ac-cert--merged .ac-checklist { grid-area: list; }
.ac-cert--merged .ac-cert-cta { grid-area: cta; align-self: start; }
.ac-cert-proof h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.2; letter-spacing: -.01em; color: #0b1c3d; margin: 0 0 12px; }
.ac-cert-proof p { font-size: 16px; line-height: 1.6; margin: 0; }
.ac-cert-proof .ac-cert-hint { margin-top: 12px; color: #6e6e73; font-size: 15px; }
@media (min-width: 981px) { .ac-cert--merged .ac-checklist { margin-top: clamp(20px, 2.4vw, 32px); } }
@media (max-width: 980px) {
  .ac-cert--merged .ac-cert-grid { grid-template-columns: 1fr; grid-template-areas: "text" "media" "proof" "list" "cta"; grid-template-rows: none; }
}
/* Rückseite (Yusuf 2026-10-01): „Alle Details" unten statt „Schulung anfragen", Inhalt luftiger über die Höhe verteilt */
.acf-back { gap: 12px !important; }
.acf-back .acf-learn { margin-top: 4px; }
.acf-back .acf-prices { margin-top: auto; }
.acf-back-foot .acf-more.acf-cta { flex: 1; justify-content: center; }
/* Handy (2026-10-01): Preis-Kästchen der Rückseite, „Wissenstest" passt in die schmale Karte */
@media (max-width: 700px) {
  .acf-prices div { padding: 8px 7px; min-width: 0; }
  .acf-prices dt { overflow-wrap: anywhere; hyphens: auto; }
}

/* ===== Handy Runde 2 (2026-10-02): einfacher, kein 3D-Drehen, keine Kachel in der Kachel ===== */
@media (max-width: 760px) {
  /* iOS/WebKit zeigt in der Wischreihe die Rückseite gespiegelt über der Vorderseite (backface-visibility
     greift in overflow-Scrollern nicht). Am Handy daher Überblenden statt Drehen, wie bei reduzierter Bewegung. */
  .acf-inner, .acf-card.is-flipped .acf-inner { transform: none; transform-style: flat; transition: none; }
  .acf-back { transform: none; }
  .acf-face { transition: opacity .2s ease; }
  .acf-back, .acf-card.is-flipped .acf-front { opacity: 0; pointer-events: none; }
  .acf-card.is-flipped .acf-back { opacity: 1; pointer-events: auto; }
  /* Wischreihe nach Muster: Karte 84 %, erste Karte bündig mit dem Text (24 px), Reihe bis zum Rand */
  .acf-grid { margin: 0 -24px; padding: 4px 24px 12px; scroll-padding: 0 24px; gap: 14px; }
  .acf-card { flex-basis: 84%; }
  /* Schrift: nichts unter 12 px */
  .acf-price small { font-size: 12.5px; }
  .acf-facts li { font-size: 13px; }
  .acf-prices dt { font-size: 12px; }
  .acf-common { font-size: 14px; }
  /* Nachweis: am Handy keine Karte in der Sektion (doppelter Innenabstand), Abstände 48 px */
  .ac-cert { padding: 48px 0; }
  .ac-cert .ac-cert-grid { background: none; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding-left: 24px; padding-right: 24px; }
  .ac-cert--merged .ac-cert-media img { height: auto; aspect-ratio: 16 / 10; }
  .ac-checklist { gap: 8px; }
  .ac-checklist li { padding: 12px 14px 12px 46px; }
  .ac-checklist li::before { left: 17px; }
  .ac-cert-cta .btn { display: flex; justify-content: center; width: 100%; }
  .ac-faq.faq-section { padding-top: 48px; padding-bottom: 56px; }
}
/* Quiz-Antworten: Anheben nur mit echter Maus, sonst bleibt der Effekt nach dem Tippen hängen */
@media (hover: none) {
  .ac-quiz-opt:hover:not(:disabled) { transform: none; }
}
/* Handy: Preise der Rückseite als Zeilen (Bezeichnung links, Preis rechts), sonst brechen „Wissenstest" und „Online p. P." mitten im Wort */
@media (max-width: 760px) {
  .acf-prices { grid-template-columns: 1fr; gap: 4px; }
  .acf-prices div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 12px; }
  .acf-prices dt { font-size: 13px; overflow-wrap: normal; hyphens: manual; }
  .acf-prices dd { margin: 0; font-size: 15px; }
}
