/* ============================================================
   PeppolBridge — FAQ accordion (site-wide upgrade)
   Load AFTER style.css / light.css / scene3d.css.
   Pairs with assets/faq.js (loaded after main.js).

   Specificity notes (deliberate — no !important needed):
   - style.css legacy rules are .faq-item / .faq-q / .faq-x /
     .faq-a p at (0,1,0)–(0,3,0). Everything here is prefixed
     with .faq-wrap to sit one class above them.
   - scene3d.css sets frosted glass via `html.has-bg3d .faq-item`
     at (0,2,1). The base card below stays at (0,2,0) so the
     frost keeps winning; only the .open tint goes to (0,3,1)
     via the `html` prefix to override it intentionally.
   ============================================================ */

/* ---------- list: separated card stack, single column ---------- */
html .faq-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* max-width: 840px + margin-inline auto inherited from style.css */
}

/* ---------- item card ---------- */
.faq-wrap .faq-item {
  position: relative;
  border: 1px solid #d8dee8;             /* replaces the fused border-bottom rows */
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72); /* fallback; scene3d frost wins on has-bg3d pages */
  scroll-margin-top: 96px;               /* deep links clear the fixed nav */
  transition: border-color .25s ease, box-shadow .25s ease,
              background-color .25s ease;
}
.faq-wrap .faq-item:hover {
  border-color: rgba(36, 87, 255, 0.32);
}
html .faq-wrap .faq-item.open {
  border-color: rgba(36, 87, 255, 0.38);
  background-color: rgba(255, 255, 255, 0.88);
  background-image: linear-gradient(rgba(36, 87, 255, 0.04), rgba(36, 87, 255, 0.04));
  box-shadow: inset 3px 0 0 #2457ff,     /* left accent rail (follows the radius) */
              0 14px 30px -22px rgba(17, 38, 60, 0.35);
}

/* ---------- question row ---------- */
.faq-wrap .faq-item .faq-q {
  min-height: 44px;                      /* touch target */
  padding: 1.15rem 1.4rem;
  gap: 1rem;
  border-radius: 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.06rem;
  line-height: 1.4;
  letter-spacing: -0.008em;
  color: #11263c;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, background-color .2s ease;
}
.faq-wrap .faq-item .faq-q:hover {
  color: #2457ff;
  background-color: rgba(36, 87, 255, 0.045);
}
.faq-wrap .faq-item.open .faq-q {
  border-radius: 14px 14px 0 0;
}
.faq-wrap .faq-item .faq-q:focus-visible {
  outline: 2px solid #2457ff;
  outline-offset: 2px;
  color: #2457ff;
}

/* ---------- indicator: legacy plus becomes a rotating chevron ---------- */
.faq-wrap .faq-item .faq-x {
  width: 32px;
  height: 32px;
  border: 1px solid #d8dee8;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  color: #4c5d70;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1),
              border-color .2s ease, background-color .2s ease, color .2s ease;
}
.faq-wrap .faq-item .faq-q:hover .faq-x {
  color: #2457ff;
  border-color: rgba(36, 87, 255, 0.4);
}
/* turn the legacy plus bars into one down-pointing chevron */
.faq-wrap .faq-item .faq-x::before {
  width: 9px;
  height: 9px;
  background: transparent;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  transform: translate(-50%, -68%) rotate(45deg);
  transition: none;
}
.faq-wrap .faq-item .faq-x::after { content: none; }
/* beats style.css `.faq-item.open .faq-x` (0,3,0) with (0,4,0) */
.faq-wrap .faq-item.open .faq-x {
  transform: rotate(180deg);
  border-color: rgba(36, 87, 255, 0.45);
  background: rgba(36, 87, 255, 0.08);
  color: #2457ff;
}

/* ---------- answer ---------- */
.faq-wrap .faq-item .faq-a {
  overflow: hidden; /* height:0 base comes from style.css; faq.js animates inline px */
}
.faq-wrap .faq-item .faq-a p {
  max-width: 62ch;
  margin: 0;
  padding: 0.1rem 1.4rem 1.3rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #4c5d70;
  overflow-wrap: break-word;
}
.faq-wrap .faq-item .faq-a p + p {
  padding-top: 0;
  margin-top: -0.45rem;
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  html .faq-wrap { gap: 10px; }
  .faq-wrap .faq-item .faq-q {
    padding: 0.95rem 1.05rem;
    gap: 0.75rem;
    font-size: 1.02rem;
  }
  .faq-wrap .faq-item .faq-a p {
    padding: 0.05rem 1.05rem 1.05rem;
    font-size: 0.93rem;
  }
  .faq-wrap .faq-item .faq-x { width: 28px; height: 28px; }
  .faq-wrap .faq-item .faq-x::before { width: 8px; height: 8px; }
}

/* ---------- reduced motion: no animated transitions at all ---------- */
@media (prefers-reduced-motion: reduce) {
  .faq-wrap .faq-item,
  .faq-wrap .faq-item .faq-q,
  .faq-wrap .faq-item .faq-x,
  .faq-wrap .faq-item .faq-a {
    transition: none !important;
  }
}
