/* ============================================================================
 * Suunta.ai Landing v2 — FAQ  (V2 — premium minimalist rebuild)
 * ----------------------------------------------------------------------------
 * LIGHT. Accordion-list. Hairline-divider jokaisen itemin alle.
 *
 * V2 polish (käyttäjäpalaute "premium ja minimalistinen"):
 *   - Aiempi grid-template-rows -accordion-bug korjattu max-height-pohjaisella
 *     ratkaisulla joka mittaa scrollHeight:n dynaamisesti → animaatio menee
 *     täsmälleen sisällön korkeuteen (ei hard-coded max).
 *   - Plus → × rotaatio-icon (45° spring transform) chevron:n sijaan
 *     → Linear/Stripe modern premium pattern.
 *   - Isompi question font (17px), generosa padding (22px vertical).
 *   - Ei emerald-bg auki-tilassa — vain icon vaihtaa emerald-värin.
 *   - Ensimmäinen item open default → käyttäjä saa visuaalisen kontekstin.
 *
 * Ops styleguide:
 *   - Question: 500 medium, ei bold
 *   - Hairline-divider per item
 *   - Plus-icon: 14×14 + transform rotate(45deg) auki
 *   - Answer: prose-tyyli, secondary color
 * ============================================================================ */

.v2-faq__head {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}

.v2-faq__head h2 { margin-top: var(--space-4); }
.v2-faq__head .lead { margin-top: var(--space-6); }

/* ─── List container ─────────────────────────────────────────────── */
.v2-faq__list {
  max-width: 760px;
  margin-inline: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.v2-faq__item {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

/* ─── Question (toggle button) ─────────────────────────────────────── */
.v2-faq__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: 22px 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color var(--transition-hover);
}

.v2-faq__question:hover {
  color: var(--emerald-700, #047857);
}

.v2-faq__question:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.40);
  border-radius: 6px;
}

/* ─── Plus → × icon ───────────────────────────────────────────────── *
 * Two 1.5px lines crossed (+). Open: whole container rotates 45° → ×.
 * Spring easing (cubic-bezier 1.56 overshoot) antaa "settling" -tunteen.
 * Icon-color vaihtuu muted → emerald-600 auki.
 */
.v2-faq__icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: rgba(15, 23, 42, 0.40);
  transition:
    transform 360ms cubic-bezier(0.34, 1.56, 0.64, 1),
    color var(--transition-hover);
}

.v2-faq__icon-h,
.v2-faq__icon-v {
  position: absolute;
  background: currentColor;
  border-radius: 1px;
}

.v2-faq__icon-h {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  transform: translateY(-50%);
}

.v2-faq__icon-v {
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}

.v2-faq__question:hover .v2-faq__icon {
  color: var(--emerald-600, #059669);
}

/* Open state: 45° rotate (+→×) + emerald color */
.v2-faq__item.is-open .v2-faq__icon {
  transform: rotate(45deg);
  color: var(--emerald-600, #059669);
}

/* ─── Answer (collapsible) ────────────────────────────────────────── *
 * Max-height + opacity transition. JS asettaa max-height = scrollHeight
 * jotta animation menee täysin sisällön korkeuteen ilman jerkkiä.
 * Initial state max-height: 0 → suljettuna. Open: JS sets exact px value.
 */
.v2-faq__answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 420ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.v2-faq__item.is-open .v2-faq__answer {
  opacity: 1;
  /* max-height asetetaan JS:n kautta (scrollHeight px) */
}

.v2-faq__answer-inner {
  padding-bottom: 24px;
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(15, 23, 42, 0.65);
  letter-spacing: -0.005em;
  max-width: 640px;                          /* parempi reading rhythm */
}

.v2-faq__answer-inner p { margin: 0; color: inherit; }
.v2-faq__answer-inner p + p { margin-top: 14px; }

.v2-faq__answer-inner ul,
.v2-faq__answer-inner ol {
  margin: 14px 0 0;
  padding-left: 20px;
  list-style: disc;
}

.v2-faq__answer-inner li { margin-top: 8px; color: inherit; }

.v2-faq__answer-inner a {
  color: var(--emerald-700, #047857);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(16, 185, 129, 0.40);
  transition: text-decoration-color var(--transition-hover);
}

.v2-faq__answer-inner a:hover {
  text-decoration-color: var(--emerald-600, #059669);
}

/* ─── Mobile tarkennukset ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .v2-faq__question {
    padding: 18px 0;
    font-size: 16px;
  }
  .v2-faq__answer-inner {
    font-size: 14.5px;
    padding-bottom: 20px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .v2-faq__icon,
  .v2-faq__answer {
    transition: none !important;
  }
}
