/* ============================================================================
 * Suunta.ai Landing v2 — FAQ PAGE (/faq/) — editorial help-center rebuild
 * ----------------------------------------------------------------------------
 * Premium minimalist, Linear Help / Stripe Docs / Intercom -tasoinen.
 * EI jaettu etusivun .v2-faq__-osion kanssa — kaikki .v2-faq-page__ -prefix.
 *
 * Rakenne:
 *   .v2-faq-page__toolbar    sticky search + category-pills
 *   .v2-faq-page__category   per kategoria (anchor-id)
 *   .v2-faq-page__cat-head   muted slate eyebrow + small count
 *   .v2-faq-page__item       editorial Q&A (kysymys ylhäällä, vastaus alla)
 *   .v2-faq-page__contact    per-category hairline + email CTA
 *   .v2-faq-page__empty      kun searchilla 0 hittiä
 *
 * Periaatteet:
 *   - Hairline-only borders (rgba slate 0.06)
 *   - One accent: search-input focus + aktiivinen pill
 *   - Plus → × icon (kuten etusivun FAQ — pattern reuse, oma scope)
 *   - Section-padding 64-80px (käyttäjäpyyntö: ei valtavaa whitespacea)
 *   - Mobile-first: pills horisontaalinen scroller alle 640px
 * ============================================================================ */


/* ─── Toolbar (sticky search + pills) ───────────────────────────────────── *
 * Sticky top: 64px (mobiili) / 72px (desktop) — sama kuin header.
 * Glass-tausta (light bg + blur) jotta sisältö näkyy hennosti läpi.
 */
.v2-faq-page__toolbar {
  position: sticky;
  top: 64px;
  z-index: 30;
  margin-top: var(--space-6);
  margin-bottom: var(--space-12);
  padding-block: var(--space-4);
  background: rgba(246, 248, 251, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 768px) {
  .v2-faq-page__toolbar { top: 72px; }
}

/* Search-first: iso keskitetty haku ylhäällä, pillit keskitettynä rivinä alla. */
.v2-faq-page__toolbar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  max-width: 880px;
  margin-inline: auto;
}

/* ─── Search input — prominentti, keskitetty. Focus = emerald ring. ──────── */
.v2-faq-page__search {
  position: relative;
  width: 100%;
  max-width: 560px;
}

.v2-faq-page__search-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: rgba(15, 23, 42, 0.40);
  pointer-events: none;
  transition: color var(--transition-hover);
}

.v2-faq-page__search:focus-within .v2-faq-page__search-icon {
  color: var(--emerald-600, #059669);
}

.v2-faq-page__search-input {
  width: 100%;
  padding: 14px 48px 14px 46px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: var(--weight-regular);
  letter-spacing: -0.005em;
  color: var(--text-primary);
  background: var(--white);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--radius-full);
  transition:
    border-color var(--transition-hover),
    box-shadow var(--transition-hover);
}

.v2-faq-page__search-input::placeholder {
  color: rgba(15, 23, 42, 0.40);
  font-weight: var(--weight-regular);
}

.v2-faq-page__search-input:hover {
  border-color: rgba(15, 23, 42, 0.18);
}

.v2-faq-page__search-input:focus-visible {
  outline: none;
  border-color: var(--emerald-500, #10b981);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

/* Clear button — näkyy vain kun input non-empty (JS toggles .is-active) */
.v2-faq-page__search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-full);
  color: rgba(15, 23, 42, 0.46);
  cursor: pointer;
  font-size: 11px;
  transition:
    background var(--transition-hover),
    color var(--transition-hover);
}

.v2-faq-page__search.is-active .v2-faq-page__search-clear {
  display: inline-flex;
}

.v2-faq-page__search-clear:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary);
}

/* "/" -pikanäppäinvihje oikealla. Piilossa kun haku on fokuksessa tai täynnä. */
.v2-faq-page__search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.v2-faq-page__search:focus-within .v2-faq-page__search-kbd,
.v2-faq-page__search.is-active .v2-faq-page__search-kbd {
  display: none;
}

/* Hakuosuman korostus kysymystekstissä (emerald-soft = sivun yksi aksentti). */
.v2-faq-page__question mark {
  background: rgba(16, 185, 129, 0.16);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}


/* ─── Filter pills ─────────────────────────────────────────────────────── *
 * Horisontaalinen rivi, hairline-pillit. Aktiivinen = tumma fill +
 * vaalea teksti (yksi visuaalinen signaali). Mobile: vaakascroller.
 */
.v2-faq-page__pills {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.v2-faq-page__pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.005em;
  color: rgba(15, 23, 42, 0.65);
  background: var(--white);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition:
    color var(--transition-hover),
    background var(--transition-hover),
    border-color var(--transition-hover);
}

.v2-faq-page__pill:hover {
  color: var(--text-primary);
  border-color: rgba(15, 23, 42, 0.18);
}

.v2-faq-page__pill-count {
  font-size: 11px;
  font-weight: var(--weight-regular);
  color: rgba(15, 23, 42, 0.40);
  font-variant-numeric: tabular-nums;
  transition: color var(--transition-hover);
}

.v2-faq-page__pill.is-active {
  color: var(--white);
  background: var(--brand-blue-500, #1c202a);
  border-color: var(--brand-blue-500, #1c202a);
}

.v2-faq-page__pill.is-active .v2-faq-page__pill-count {
  color: rgba(255, 255, 255, 0.55);
}

.v2-faq-page__pill:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}


/* ─── Result count (small text under toolbar when filtering) ────────────── */
.v2-faq-page__count {
  margin-top: var(--space-3);
  font-size: 12.5px;
  color: rgba(15, 23, 42, 0.55);
  font-variant-numeric: tabular-nums;
  text-align: left;
  max-width: 880px;
  margin-inline: auto;
  display: none;
}

.v2-faq-page__count.is-visible {
  display: block;
}


/* ─── Category section ─────────────────────────────────────────────────── *
 * Editorial header (muted slate eyebrow, NOT emerald — premium per CLAUDE.md
 * "one accent per section" rule). Scroll-margin jotta sticky-toolbar ei peitä
 * kategoria-otsikkoa anchor-navin jälkeen.
 */
.v2-faq-page__list {
  max-width: 880px;
  margin-inline: auto;
}

.v2-faq-page__category {
  scroll-margin-top: calc(64px + 80px); /* header + toolbar */
}

@media (min-width: 768px) {
  .v2-faq-page__category {
    scroll-margin-top: calc(72px + 80px);
  }
}

.v2-faq-page__category + .v2-faq-page__category {
  margin-top: var(--space-16);
}

.v2-faq-page__cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.v2-faq-page__cat-label {
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
  margin: 0;
}

.v2-faq-page__cat-count {
  font-size: 11px;
  font-weight: var(--weight-regular);
  letter-spacing: 0.06em;
  color: rgba(15, 23, 42, 0.42);
  font-variant-numeric: tabular-nums;
}


/* ─── Q&A items — editorial style ──────────────────────────────────────── *
 * Kysymys 17-18px, vastaus prose 15.5px. Plus → × rotaatio (sama spring
 * pattern kuin etusivun FAQ, mutta oma scope). Hairline-divider per item.
 * Hover: kysymys color shift (subtle), icon emerald accent.
 */
.v2-faq-page__item {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.v2-faq-page__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  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.015em;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color var(--transition-hover);
}

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

.v2-faq-page__question:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.30);
  border-radius: var(--radius-sm);
}

/* Plus → × icon (two 1.5px lines, rotate 45° open) */
.v2-faq-page__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-page__icon-h,
.v2-faq-page__icon-v {
  position: absolute;
  background: currentColor;
  border-radius: 1px;
}

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

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

.v2-faq-page__question:hover .v2-faq-page__icon {
  color: var(--emerald-600, #059669);
}

.v2-faq-page__item.is-open .v2-faq-page__icon {
  transform: rotate(45deg);
  color: var(--emerald-600, #059669);
}

/* Answer (collapsible) */
.v2-faq-page__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-page__item.is-open .v2-faq-page__answer {
  opacity: 1;
  /* max-height JS sets to scrollHeight */
}

.v2-faq-page__answer-inner {
  padding-bottom: 26px;
  padding-right: var(--space-8);
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(15, 23, 42, 0.65);
  letter-spacing: -0.005em;
  max-width: 720px;
}

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

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

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

.v2-faq-page__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-page__answer-inner a:hover {
  text-decoration-color: var(--emerald-600, #059669);
}


/* ─── Per-category contact CTA ─────────────────────────────────────────── *
 * Hairline-divider + subtle text line + arrow. Ei buttonia (säilytetään
 * editorial-tunne). One accent: hover emerald.
 */
.v2-faq-page__contact {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  font-size: 13.5px;
  color: rgba(15, 23, 42, 0.55);
  letter-spacing: -0.005em;
}

.v2-faq-page__contact a {
  color: rgba(15, 23, 42, 0.75);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.18);
  transition:
    color var(--transition-hover),
    border-color var(--transition-hover);
}

.v2-faq-page__contact a:hover {
  color: var(--emerald-700, #047857);
  border-bottom-color: var(--emerald-500, #10b981);
}

.v2-faq-page__contact a i {
  font-size: 0.85em;
  margin-left: 4px;
  transition: transform var(--transition-hover);
  display: inline-block;
}

.v2-faq-page__contact a:hover i {
  transform: translateX(2px);
}


/* ─── Empty state (when search returns 0) ──────────────────────────────── */
.v2-faq-page__empty {
  max-width: 560px;
  margin: var(--space-16) auto;
  text-align: center;
  display: none;
  padding-inline: var(--space-6);
}

.v2-faq-page__empty.is-visible {
  display: block;
}

.v2-faq-page__empty-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: rgba(15, 23, 42, 0.45);
  font-size: 15px;
}

.v2-faq-page__empty-title {
  font-size: 17px;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}

.v2-faq-page__empty-text {
  font-size: 14px;
  color: rgba(15, 23, 42, 0.55);
  margin: 0 0 var(--space-5);
  line-height: 1.55;
}

.v2-faq-page__empty-actions {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
}

.v2-faq-page__empty-actions a {
  font-size: 13.5px;
  color: rgba(15, 23, 42, 0.75);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.18);
  transition:
    color var(--transition-hover),
    border-color var(--transition-hover);
}

.v2-faq-page__empty-actions a:hover {
  color: var(--emerald-700, #047857);
  border-bottom-color: var(--emerald-500, #10b981);
}

/* When a category becomes empty after filtering (search), hide it.
   JS toggles .is-hidden. */
.v2-faq-page__category.is-hidden,
.v2-faq-page__item.is-hidden {
  display: none;
}


/* ─── Mobile tarkennukset ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .v2-faq-page__question {
    padding: 18px 0;
    font-size: 16px;
    gap: var(--space-4);
  }
  .v2-faq-page__answer-inner {
    font-size: 14.5px;
    padding-bottom: 22px;
    padding-right: 0;
  }
  .v2-faq-page__cat-head {
    padding-bottom: var(--space-3);
  }
  .v2-faq-page__category + .v2-faq-page__category {
    margin-top: var(--space-12);
  }
}


/* ─── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .v2-faq-page__icon,
  .v2-faq-page__answer,
  .v2-faq-page__contact a i {
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
