/* FAQ Box (pichler_faq_box)
   Aufbau: 1. Basis und Kopf  2. Fragen  3. Stile  4. Zwei Spalten  5. Symbol
   Schrift kommt vom Theme (Überschrift als h2). Farben als Variablen, das Portlet setzt nur eingetragene Werte.
   Seit 1.1.0 lesen Farben und Radius die Variablen des Templates PICHLER 2027 (--p27-*), der zweite Wert ist der
   bisherige Rückfall: ohne das Template bleibt die Box wie in 1.0.1. */

/* ------------------------------------------------------ 1. Basis und Kopf */
.opc-pfaq {
  --pfaq-accent: var(--p27-brand, var(--primary, #0090ff));
  --pfaq-ink: var(--p27-ink, #1f2b35);
  --pfaq-text: var(--p27-ink-2, #475569);
  --pfaq-line: var(--p27-line, #e3e8ee);
  --pfaq-radius: var(--p27-r-ctl, 8px);
  container: pfaq / inline-size;
  width: 100%;
  width: -webkit-fill-available;
  width: -moz-available;
  width: stretch;
}
.opc-pfaq,
.opc-pfaq *,
.opc-pfaq *::before,
.opc-pfaq *::after { box-sizing: border-box; }

.opc-pfaq .pfaq-inner {
  max-width: var(--pfaq-max, 800px);
  margin: 0 auto;
}

.opc-pfaq .pfaq-head { margin-bottom: 20px; }
.opc-pfaq .pfaq-headline { margin: 0; }
.opc-pfaq .pfaq-subline { margin: 6px 0 0; color: var(--pfaq-text); }
.opc-pfaq--head-center .pfaq-head,
.opc-pfaq--head-lines .pfaq-head { text-align: center; }
/* Mittig mit Linien links und rechts der Überschrift */
.opc-pfaq--head-lines .pfaq-headline {
  display: flex;
  align-items: center;
  gap: 22px;
}
.opc-pfaq--head-lines .pfaq-headline::before,
.opc-pfaq--head-lines .pfaq-headline::after {
  content: "";
  flex: 1 1 24px;
  height: 1px;
  background: var(--pfaq-line);
}

/* --------------------------------------------------------- 2. Fragen */
.opc-pfaq .pfaq-list {
  display: grid;
  gap: 10px;
}
.opc-pfaq .pfaq-item {
  border: 1px solid var(--pfaq-line);
  border-radius: var(--pfaq-radius);
  background: var(--pfaq-bg, #fff);
}
.opc-pfaq .pfaq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: var(--pfaq-ink);
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}
.opc-pfaq .pfaq-question::-webkit-details-marker { display: none; }
.opc-pfaq .pfaq-question:hover .pfaq-question-text { color: var(--pfaq-link, var(--p27-buy, var(--pfaq-accent))); }
.opc-pfaq .pfaq-question:focus-visible { outline: 2px solid var(--pfaq-accent); outline-offset: 2px; border-radius: var(--pfaq-radius); }
.opc-pfaq .pfaq-question-text { min-width: 0; transition: color .15s; }

.opc-pfaq .pfaq-answer {
  padding: 0 16px 16px;
  color: var(--pfaq-text);
  line-height: 1.6;
}
.opc-pfaq .pfaq-answer p,
.opc-pfaq .pfaq-answer ul { margin: 0 0 10px; }
.opc-pfaq .pfaq-answer > :last-child { margin-bottom: 0; }
.opc-pfaq .pfaq-answer ul { padding-left: 20px; }
.opc-pfaq .pfaq-answer a,
.opc-pfaq .pfaq-more-link { color: var(--pfaq-link, var(--p27-buy, var(--pfaq-accent))); text-decoration: underline; text-underline-offset: 2px; }
.opc-pfaq .pfaq-answer--missing { color: #b90000; font-style: italic; }

.opc-pfaq .pfaq-more {
  margin: 18px 0 0;
  color: var(--pfaq-text);
  text-align: center;
}
.opc-pfaq--head-left .pfaq-more { text-align: left; }
.opc-pfaq .pfaq-more-link { font-weight: 600; }
.opc-pfaq .pfaq-empty {
  padding: 12px 16px;
  border: 1px dashed #cfd6de;
  background: #f5f7fa;
  color: #6b7680;
  font-size: 12px;
}

/* ---------------------------------------------------------- 3. Stile */
/* Linien: nur eine Linie unter jeder Frage, ohne Fläche */
.opc-pfaq--line .pfaq-list { gap: 0; border-top: 1px solid var(--pfaq-line); }
.opc-pfaq--line .pfaq-item {
  border-width: 0 0 1px;
  border-radius: 0;
  background: var(--pfaq-bg, transparent);
}
.opc-pfaq--card .pfaq-item { border-color: transparent; box-shadow: 0 6px 20px rgba(15, 23, 42, .06); }
.opc-pfaq--card .pfaq-item[open] { box-shadow: 0 10px 28px rgba(15, 23, 42, .09); }
.opc-pfaq--clean .pfaq-item { border-color: transparent; background: var(--pfaq-bg, var(--p27-hangar, #f5f7fa)); }

/* --------------------------------------------------- 4. Zwei Spalten */
@container pfaq (min-width: 760px) {
  .opc-pfaq--cols-2 .pfaq-list {
    display: block;
    column-count: 2;
    column-gap: 24px;
  }
  .opc-pfaq--cols-2 .pfaq-item {
    margin-bottom: 10px;
    break-inside: avoid;
  }
  .opc-pfaq--cols-2.opc-pfaq--line .pfaq-list { border-top: 0; }
  .opc-pfaq--cols-2.opc-pfaq--line .pfaq-item { margin-bottom: 0; border-top: 1px solid var(--pfaq-line); }
  .opc-pfaq--cols-2.opc-pfaq--line .pfaq-item + .pfaq-item { border-top: 0; }
}

/* ---------------------------------------------------------- 5. Symbol */
.opc-pfaq .pfaq-icon {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--pfaq-accent);
}
/* Plus: zwei Balken, der senkrechte klappt beim Öffnen weg (Minus) */
.opc-pfaq--icon-plus .pfaq-icon::before,
.opc-pfaq--icon-plus .pfaq-icon::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 1px;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform .2s ease;
}
.opc-pfaq--icon-plus .pfaq-icon::after { transform: rotate(90deg); }
.opc-pfaq--icon-plus .pfaq-item[open] .pfaq-icon::after { transform: rotate(0deg); }
/* Pfeil: Winkel, dreht beim Öffnen nach oben */
.opc-pfaq--icon-chevron .pfaq-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease, top .2s ease;
}
.opc-pfaq--icon-chevron .pfaq-item[open] .pfaq-icon::before { top: 7px; transform: rotate(-135deg); }

@media (prefers-reduced-motion: reduce) {
  .opc-pfaq *,
  .opc-pfaq *::before,
  .opc-pfaq *::after { transition: none !important; }
}
