/* Freistil FAQ – Frontend Styles */

.freistil-faq {
  width: 100%;
}

/* ── Accordion-Container ── */
.freistil-faq__accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Item Basis ── */
.freistil-faq__item {
  overflow: hidden;
}

/* Weiße Items (gerade Indizes): weißer Hintergrund, blauer Rahmen, runde Ecken */
.freistil-faq__item--white {
  background-color: #ffffff;
  color: #2719b7;
  border: 2px solid #2719b7;
  border-radius: 16px;
}

/* Blaue Items (ungerade Indizes): blaue Frage-Leiste, weißer Antwortbereich,
   eckige Ecken. Grundfarbe des Items ist weiß – blau ist nur der Header.
   Der blaue Rahmen grenzt den weißen Antwortbereich gegen die Seite ab. */
.freistil-faq__item--blue {
  background-color: #ffffff;
  color: #2719b7;
  border: 2px solid #2719b7;
  border-radius: 0px;
}

/* ── Überschrift um den Button ──
   Die Fragen sind semantisch Überschriften (h2–h6, per Shortcode-Attribut
   heading_level einstellbar). Optisch soll davon nichts ankommen: Astra bringt
   für h2–h6 eigene Größen, Abstände und Farben mit. */
.freistil-faq__heading {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-transform: none;
  border: none;
}

/* ── Header (Button) ── */
.freistil-faq__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 18px 28px;
  background: none;
  border: none;
  color: inherit;
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  gap: 20px;
}

/* Nur bei den eckigen Items ist die Frage-Leiste blau hinterlegt. */
.freistil-faq__item--blue .freistil-faq__header {
  background-color: #2719b7;
  color: #ffffff;
}

/* ── Frage-Text ── */
.freistil-faq__question {
  flex: 1;
  line-height: 1.3;
}

/* ── Kreis-Icon mit Pfeil ── */
.freistil-faq__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.freistil-faq__icon svg {
  width: 18px;
  height: 18px;
}

/* Weiße Items: gefüllter blauer Kreis, weißer Pfeil */
.freistil-faq__item--white .freistil-faq__icon {
  background-color: #2719b7;
  color: #ffffff;
}

/* Blaue Items: weißer Kreis-Rahmen, weißer Pfeil – sitzt auf der blauen Leiste */
.freistil-faq__item--blue .freistil-faq__icon {
  background-color: transparent;
  border: 2px solid #ffffff;
  color: #ffffff;
}

/* Pfeil dreht sich wenn geöffnet */
.freistil-faq__header[aria-expanded="true"] .freistil-faq__icon {
  transform: rotate(180deg);
}

/* ── Body (Antwort) ── */
.freistil-faq__body[hidden] {
  display: none;
}

.freistil-faq__body {
  padding: 0 28px 24px;
}

/* ── Antwort-Text ── */
.freistil-faq__answer {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-family: inherit;

  padding-top: 16px;
  opacity: 0.9;
}

.freistil-faq__answer p:first-child { margin-top: 0; }
.freistil-faq__answer p:last-child  { margin-bottom: 0; }

.freistil-faq__answer ul,
.freistil-faq__answer ol {
  padding-left: 20px;
  margin: 8px 0;
}

.freistil-faq__answer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Bilder in der Antwort ── */
.freistil-faq__answer img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 16px 0;
}

/* Ausrichtung aus der Mediathek (alignleft / alignright / aligncenter / alignnone) */
.freistil-faq__answer .aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.freistil-faq__answer .alignleft {
  float: left;
  margin: 6px 24px 16px 0;
}

.freistil-faq__answer .alignright {
  float: right;
  margin: 6px 0 16px 24px;
}

/* Umflossene Bilder dürfen nicht aus dem Item herausragen */
.freistil-faq__answer::after {
  content: "";
  display: table;
  clear: both;
}

/* ── Bildunterschrift ── */
.freistil-faq__answer .wp-caption {
  max-width: 100%;
  height: auto;
}

.freistil-faq__answer .wp-caption img {
  margin-bottom: 6px;
}

.freistil-faq__answer .wp-caption-text {
  font-size: 0.8em;
  line-height: 1.4;
  opacity: 0.75;
  margin: 0 0 16px 0;
}

/* Auf schmalen Schirmen bringt das Umfließen nichts mehr */
@media (max-width: 600px) {
  .freistil-faq__answer .alignleft,
  .freistil-faq__answer .alignright {
    float: none;
    margin: 16px 0;
  }
}

/* ── Fokus ── */
.freistil-faq__header:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: -3px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .freistil-faq__header {
    padding: 16px 18px 16px 20px;
    font-size: 13px;
  }
  .freistil-faq__body {
    padding: 0 20px 20px;
  }
  .freistil-faq__icon {
    width: 32px;
    height: 32px;
  }
  .freistil-faq__icon svg {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .freistil-faq__icon {
    transition: none;
  }
}
