/* =====================================================
   Divi FAQ Accordion — Frontend Styles
   ===================================================== */

:root {
  --dfaq-accent: #2c7be5;
}

.dfaq-wrapper {
  max-width: 820px;
  margin: 0 auto;
  font-family: inherit;
}

.dfaq-heading {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #1a1a2e;
}

.dfaq-accordion {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.07);
}

.dfaq-item {
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: background 0.2s ease;
}

.dfaq-item:last-child { border-bottom: none; }
.dfaq-item--open { background: #f8faff; }

/* Question button */
.dfaq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.975rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.45;
  transition: color 0.2s ease;
}

.dfaq-question:hover { color: var(--dfaq-accent); }

.dfaq-question:focus-visible {
  outline: 3px solid var(--dfaq-accent);
  outline-offset: -3px;
}

.dfaq-item--open .dfaq-question { color: var(--dfaq-accent); }

/* Icon — Chevron */
.dfaq-icon--chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #999;
  transition: transform 0.3s ease, color 0.2s ease;
}

.dfaq-icon--chevron svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dfaq-item--open .dfaq-icon--chevron {
  transform: rotate(-180deg);
  color: var(--dfaq-accent);
}

/* Icon — Plus/Minus */
.dfaq-icon {
  flex-shrink: 0;
  position: relative;
  width: 18px;
  height: 18px;
}

.dfaq-icon__h,
.dfaq-icon__v {
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  color: #999;
}

.dfaq-icon__h {
  width: 100%; height: 2px;
  top: 50%; left: 0;
  transform: translateY(-50%);
}

.dfaq-icon__v {
  width: 2px; height: 100%;
  left: 50%; top: 0;
  transform: translateX(-50%);
}

.dfaq-item--open .dfaq-icon__v {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}

.dfaq-item--open .dfaq-icon__h,
.dfaq-item--open .dfaq-icon__v { color: var(--dfaq-accent); }

/* Answer panel — Höhe wird komplett per JS gesteuert */
.dfaq-answer {
  overflow: hidden;
  height: 0;        /* JS überschreibt das beim Init */
}

.dfaq-answer__inner {
  padding: 0 1.4rem 1.2rem 1rem;
  margin: 0 1.4rem 1.2rem 1.4rem;
  font-size: 0.925rem;
  color: #444;
  line-height: 1.7;
  border-left: 3px solid var(--dfaq-accent);
}

/* Error */
.dfaq-error {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #856404;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .dfaq-question { padding: 1rem; font-size: 0.9rem; }
  .dfaq-answer__inner { margin: 0 1rem 1rem 1rem; }
  .dfaq-heading { font-size: 1.35rem; }
}
