/* Section 9, FAQ: "Questions, clipped short." Driven by faq.js.
   Wispr's "Good questions" answers like a chat, because Wispr is about messages. Ours
   answers like a clip, because Vclip is about video: a playlist of questions, each with
   a thumbnail and its read time, and a player that plays the chosen answer: the two
   handles snap around a moment and the answer runs like captions.
   Without the script every answer simply shows; faq.js adds .fq-ready. */

.faq { width: min(1100px, calc(100% - 32px)); margin: -24px auto 120px; } /* 96px above the heading, not the usual 120 (your call) */
.fq-head { text-align: center; margin-bottom: clamp(36px, 5vw, 56px); }
.faq .headline.section .l2 { color: var(--violet); }

.fq-box {
  max-width: 960px;
  margin: 0 auto;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(27, 21, 48, 0.08);
}
.fq-h { margin: 0; }

/* ---------- a question in the playlist ---------- */
.fq-q {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px 10px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: none;
  color: var(--ink);
  font: 500 14px/1.35 var(--body);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.fq-q:hover { background: #F6F2FF; }
.fq-q:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.fq-thumb { display: block; width: 56px; height: 32px; border-radius: 6px; background: #E4DDF7; }
.fq-len { padding: 2px 7px; border-radius: 5px; background: var(--lilac); color: var(--violet); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fq-item.open .fq-q { background: #F3EEFF; border-left-color: var(--violet); font-weight: 600; }
.fq-item.open .fq-len { background: var(--violet); color: #fff; }

/* ---------- the player: the chosen answer ---------- */
.fq-a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 240px;
  padding: clamp(20px, 2.6vw, 30px);
  overflow: hidden;
  background: #15111F;
  color: #fff;
}
.fq-frame { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: blur(4px) brightness(0.3) saturate(1.05); transform: scale(1.06); } /* dim: the words come first */
.fq-title, .fq-caption, .fq-line { position: relative; margin: 0; }
.fq-title { font: 700 clamp(22px, 2.1vw, 26px)/1.15 var(--display); }
.fq-caption { max-width: 540px; font-size: clamp(15px, 1.35vw, 17px); line-height: 1.65; color: rgba(255, 255, 255, 0.9); }
/* the Vclip timeline: two handles around a moment, filling as the answer "plays" */
.fq-line { display: flex; align-items: center; gap: 14px; }
.fq-track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.fq-range { position: absolute; top: -3px; bottom: -3px; left: 20%; width: 40%; background: rgba(139, 108, 255, 0.3); border-top: 2px solid #8B6CFF; border-bottom: 2px solid #8B6CFF; }
.fq-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: rgba(168, 139, 255, 0.55); }
.fq-h1, .fq-h2 { position: absolute; top: -7px; width: 10px; height: 20px; margin-left: -5px; border-radius: 4px; background: #fff; border: 2px solid #8B6CFF; }
.fq-h1 { left: 20%; }
.fq-h2 { left: 60%; }
.fq-time { font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.7); white-space: nowrap; }

/* ---------- with the script: one answer at a time ---------- */
.fq-ready .fq-a { display: none; }
.fq-ready .fq-item.open .fq-a { display: flex; animation: fq-in 0.35s ease both; }
.fq-ready .fq-item.open .fq-caption { animation: fq-rise 0.45s 0.1s ease both; }
@keyframes fq-in { from { opacity: 0; } }
@keyframes fq-rise { from { opacity: 0; transform: translateY(8px); } }
.fq-ready .fq-range, .fq-ready .fq-h1, .fq-ready .fq-h2 { transition: left 0.5s cubic-bezier(0.34, 1.4, 0.64, 1), width 0.5s cubic-bezier(0.34, 1.4, 0.64, 1); }

/* computers: the playlist on the left, the player on the right */
@media (min-width: 900px) {
  .fq-ready .fq-box { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .fq-ready .fq-item { display: contents; }
  .fq-ready .fq-h { grid-column: 1; }
  .fq-ready .fq-a { grid-column: 2; } /* every answer spans all the rows (set in faq.js) */
  .fq-ready .fq-item:last-child .fq-q { border-bottom: 0; }
}
@media (max-width: 1023px) { .faq { margin-top: -16px; margin-bottom: 96px; } } /* 80px above */
@media (max-width: 899px) { .fq-ready .fq-title { display: none; } } /* the question is right above, on its button */
@media (max-width: 600px) {
  .fq-box { border-radius: 22px; }
  .fq-q { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 11px; padding: 11px 13px 11px 10px; font-size: 15px; }
  .fq-thumb { width: 50px; height: 28px; }
  .fq-a { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .fq-ready .fq-item.open .fq-a, .fq-ready .fq-item.open .fq-caption { animation: none; }
  .fq-ready .fq-range, .fq-ready .fq-h1, .fq-ready .fq-h2 { transition: none; }
}
