/*!
 * WSP Chat — FAQ pages. Token-driven (shares --wsp-chat-* tokens with the chat skin) so a client
 * skin recolours both at once; override or replace via a theme / skin stylesheet.
 */

.wsp-faq-list, .wsp-faq-detail {
  --_primary: var(--wsp-chat-primary, #1f5f8b);
  --_text: var(--wsp-chat-text, #1a1a1a);
  --_muted: var(--wsp-chat-muted, #5b6470);
  --_surface: var(--wsp-chat-surface, #ffffff);
  --_bg: var(--wsp-chat-bg, #f6f7f9);
  --_radius: var(--wsp-chat-radius, 12px);
  /* Type scale: every text size on the FAQ pages comes from here, so the theme's own body and
     heading sizes (often much larger, or light-weight) never leak in. A design overrides these. */
  --_fs-title: clamp(28px, 4vw, 40px); /* page title */
  --_fs-lg: 20px;                      /* group headings */
  --_fs-md: 18px;                      /* box headings: related questions, "didn't find your answer?" */
  --_fs-body: 17px;                    /* answer, intro */
  --_fs-base: 16px;                    /* question rows, box text */
  --_fs-sm: 15px;                      /* related links, buttons, totals */
  --_fs-xs: 14px;                      /* breadcrumb, date, labels, category links */
  --_fs-2xs: 12px;                     /* count badges */
  color: var(--_text);
  font-family: var(--wsp-chat-font, inherit);
  font-size: var(--_fs-base);
  font-weight: 400;
  line-height: 1.5;
}
.wsp-faq-list *, .wsp-faq-detail * { box-sizing: border-box; }

/* Block themes cap every child of the post content at the theme content size (645 px in Twenty Twenty-Five); the FAQ pages
   take the theme wide size instead, like an "alignwide" block, and the inner column is a token a skin can widen. */
.is-layout-constrained > .wsp-faq-list, .is-layout-constrained > .wsp-faq-detail { max-width: var(--wp--style--global--wide-size, none); }
.wsp-faq-list__inner, .wsp-faq-detail__inner { max-width: var(--wsp-chat-faq-width, 1056px); margin: 0 auto; padding: 32px 16px 56px; }

.wsp-faq-list__breadcrumb a, .wsp-faq-detail__breadcrumb a { color: var(--_primary); font-weight: 700; text-decoration: none; font-size: var(--_fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.wsp-faq-list__breadcrumb a::before, .wsp-faq-detail__breadcrumb a::before { content: "‹ "; }
.wsp-faq-list__breadcrumb a:hover, .wsp-faq-detail__breadcrumb a:hover { text-decoration: underline; }

.wsp-faq-list__header { margin: 12px 0 28px; }
.wsp-faq-list__heading, .wsp-faq-detail__question { font-family: var(--wsp-chat-heading-font, inherit); color: var(--_primary); font-size: var(--_fs-title); font-weight: 700; line-height: 1.15; margin: 0 0 10px; }
.wsp-faq-list__intro { color: var(--_muted); font-size: var(--_fs-body); margin: 0; max-width: 60ch; }

.wsp-faq-list__group { margin: 0 0 32px; }
.wsp-faq-list__group-heading { font-size: var(--_fs-lg); font-weight: 700; line-height: 1.25; color: var(--_primary); margin: 0 0 10px; }
.wsp-faq-list__group-link { color: inherit; text-decoration: none; }
.wsp-faq-list__group-link:hover { text-decoration: underline; }

.wsp-faq-list__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wsp-faq-list__item[hidden], .wsp-faq-list__group[hidden], .wsp-faq-related__item[hidden], .wsp-faq-related__all[hidden], .wsp-faq-list__more-btn[hidden] { display: none; }
.wsp-faq-list__link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--_surface);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--_radius);
  padding: 14px 18px;
  color: var(--_text);
  text-decoration: none;
  font-size: var(--_fs-base);
  font-weight: 600;
  line-height: 1.4;
  transition: border-color 0.15s, transform 0.15s;
}
.wsp-faq-list__link:hover, .wsp-faq-list__link:focus-visible { border-color: var(--_primary); transform: translateX(2px); outline: none; }
.wsp-faq-list__arrow, .wsp-faq-related__arrow { flex: 0 0 auto; width: 10px; height: 10px; border-right: 2px solid var(--_primary); border-bottom: 2px solid var(--_primary); transform: rotate(-45deg); }

.wsp-faq-list__more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 24px 0 8px; }
.wsp-faq-list__status { margin: 0; color: var(--_muted); font-size: var(--_fs-xs); }

.wsp-faq-categories { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(0, 0, 0, 0.1); }
.wsp-faq-categories__heading { font-size: var(--_fs-xs); font-weight: 700; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.06em; color: var(--_muted); margin: 0 0 12px; }
.wsp-faq-categories__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.wsp-faq-categories__link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--_primary); background: var(--_surface); color: var(--_primary); text-decoration: none; font-weight: 600; font-size: var(--_fs-xs); line-height: 1.3; }
.wsp-faq-categories__link:hover, .wsp-faq-categories__link[aria-current] { background: var(--_primary); color: #fff; }
.wsp-faq-categories__count { font-size: var(--_fs-2xs); opacity: 0.8; }

/* Detail */
.wsp-faq-detail__layout--aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 1024px) { .wsp-faq-detail__layout--aside { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; } }
.wsp-faq-detail__eyebrow { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--_muted); }
.wsp-faq-detail__eyebrow a { color: inherit; }
.wsp-faq-detail__meta { color: var(--_muted); font-size: var(--_fs-xs); margin: 0 0 20px; }
.wsp-faq-detail__answer { background: var(--_surface); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: var(--_radius); padding: 28px; font-size: var(--_fs-body); line-height: 1.6; }
@media (max-width: 600px) { .wsp-faq-detail__answer { padding: 20px; } }
.wsp-faq-detail__answer > :first-child { margin-top: 0; }
.wsp-faq-detail__answer > :last-child { margin-bottom: 0; }
.wsp-faq-detail__answer h2, .wsp-faq-detail__answer h3, .wsp-faq-detail__answer h4 { color: var(--_primary); font-weight: 700; line-height: 1.25; margin: 1.4em 0 0.5em; }
.wsp-faq-detail__answer h2 { font-size: 22px; }
.wsp-faq-detail__answer h3 { font-size: var(--_fs-lg); }
.wsp-faq-detail__answer h4 { font-size: var(--_fs-md); }
.wsp-faq-detail__answer a { color: var(--_primary); }
.wsp-faq-detail__answer table { border-collapse: collapse; width: 100%; }
.wsp-faq-detail__answer th, .wsp-faq-detail__answer td { border: 1px solid rgba(0, 0, 0, 0.12); padding: 6px 10px; text-align: left; vertical-align: top; }

.wsp-faq-related { background: var(--_bg); border-radius: var(--_radius); padding: 20px; position: sticky; top: 24px; }
.wsp-faq-related__heading { font-size: var(--_fs-md); font-weight: 700; line-height: 1.3; margin: 0 0 12px; color: var(--_primary); }
.wsp-faq-related__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wsp-faq-related__link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--_surface); border-radius: 8px; color: var(--_text); text-decoration: none; font-size: var(--_fs-sm); line-height: 1.4; }
.wsp-faq-related__link:hover { color: var(--_primary); }
.wsp-faq-related__all { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--_primary); font-size: var(--_fs-sm); font-weight: 700; text-decoration: none; }
/* Phone (no JS): keep 8 rows. */
@media (max-width: 1023px) { .wsp-faq-related__item:nth-child(n + 9) { display: none; } .wsp-faq-related { position: static; } }

/* Page environment (templates/faq-page.php): the FAQ section owns its spacing between the theme's header and footer. */
.wsp-faq-page { display: block; margin-block: 0; padding: 0; }

/* Breadcrumb (templates/faq-breadcrumb.php): the pages above this one; the <h1> follows. */
.wsp-faq-breadcrumb { margin: 0 0 12px; }
.wsp-faq-breadcrumb__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: var(--_fs-xs); font-weight: 500; line-height: 1.4; }
.wsp-faq-breadcrumb__item { display: inline-flex; align-items: center; }
.wsp-faq-breadcrumb__item + .wsp-faq-breadcrumb__item::before { content: "\203A"; margin: 0 10px; color: var(--_muted); font-weight: 400; }
.wsp-faq-breadcrumb__link { color: var(--_primary); text-decoration: none; }
/* The current page ends the trail: plain text, normal case, cut short with "…" when long. */
.wsp-faq-breadcrumb__item--current { min-width: 0; max-width: 100%; }
.wsp-faq-breadcrumb__current { display: block; min-width: 0; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--_muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.wsp-faq-breadcrumb__link:hover { text-decoration: underline; text-underline-offset: 3px; }
/* A small house before "Home". */
.wsp-faq-breadcrumb__item:first-child .wsp-faq-breadcrumb__link { display: inline-flex; align-items: center; gap: 6px; }
.wsp-faq-breadcrumb__item:first-child .wsp-faq-breadcrumb__link::before {
  content: ""; flex: none; width: 14px; height: 14px; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6 1.5 11.2l1.3 1.6L4 11.8V21h6.5v-6h3v6H20v-9.2l1.2 1 1.3-1.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6 1.5 11.2l1.3 1.6L4 11.8V21h6.5v-6h3v6H20v-9.2l1.2 1 1.3-1.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Page head: breadcrumb, title, count / date — on a light band across the full width, so the
   head reads as one block above the content (the band bleeds past the column with a box-shadow,
   clipped top and bottom, so no markup or horizontal scroll is needed). */
.wsp-faq-list__inner, .wsp-faq-detail__inner { padding-top: 0; }
.wsp-faq-list__hero, .wsp-faq-list--category .wsp-faq-list__header, .wsp-faq-detail__header {
  background: var(--_bg); box-shadow: 0 0 0 100vmax var(--_bg); clip-path: inset(0 -100vmax);
  padding: 32px 0 36px; margin: 0 0 32px;
}
.wsp-faq-list__heading, .wsp-faq-detail__question { color: var(--_text); letter-spacing: -0.01em; margin-bottom: 14px; }
.wsp-faq-detail__question { font-size: clamp(24px, 12px + 3vw, 40px); } /* long questions: smaller on phones */
/* The count and the date as small chips. */
.wsp-faq-list__total, .wsp-faq-detail__meta {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 4px 12px; border-radius: 99px; background: var(--_surface); border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--_muted); font-size: var(--_fs-xs); line-height: 1.4;
}
.wsp-faq-list__total::before, .wsp-faq-detail__meta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--_primary); }
.wsp-faq-list__intro + .wsp-faq-list__total { margin-top: 14px; }
.wsp-faq-detail__header > * { max-width: 52rem; }
.wsp-faq-list__heading, .wsp-faq-detail__question { text-wrap: balance; }
.wsp-faq-list__hero .wsp-faq-list__header { margin-bottom: 0; }
.wsp-faq-list__hero .wsp-faq-categories { margin-top: 24px; padding-top: 0; border-top: 0; }
.wsp-faq-list__group-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.wsp-faq-list__group-count { font-size: var(--_fs-xs); font-weight: 400; color: var(--_muted); }

/* Category links: the default design shows the badge and leaves the worded total to screen readers. */
.wsp-faq-categories__total { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* "Didn't find your answer?" (templates/faq-ask.php) — opens the chat drawer. */
.wsp-faq-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 32px; padding: 24px 28px; background: var(--_bg); border: 1px solid rgba(0, 0, 0, 0.06); border-radius: var(--_radius); }
.wsp-faq-ask__text { flex: 1 1 280px; }
.wsp-faq-ask__heading { margin: 0 0 4px; font-size: var(--_fs-md); font-weight: 700; line-height: 1.3; color: var(--_primary); }
.wsp-faq-ask__intro { margin: 0; color: var(--_muted); font-size: var(--_fs-base); line-height: 1.5; }
.wsp-faq-ask__btn { appearance: none; border: 0; cursor: pointer; font-family: inherit; font-size: var(--_fs-sm); font-weight: 700; line-height: 1.2; white-space: nowrap; padding: 13px 24px; border-radius: 99px; background: var(--_primary); color: #fff; }
.wsp-faq-ask__btn:hover { filter: brightness(1.1); }

/* Every clickable part of the FAQ pages shows the hand cursor, whatever the theme sets. */
.wsp-faq-list a[href], .wsp-faq-detail a[href], .wsp-faq-list button:not(:disabled), .wsp-faq-detail button:not(:disabled) { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .wsp-faq-list__link { transition: none; }
  .wsp-faq-list__link:hover, .wsp-faq-list__link:focus-visible { transform: none; }
}

/* Keyboard focus (WCAG 2.4.7): a visible ring, not only the hover colour. */
.wsp-faq-list__link:focus-visible, .wsp-faq-related__link:focus-visible, .wsp-faq-related__all:focus-visible,
.wsp-faq-categories__link:focus-visible, .wsp-faq-list__group-link:focus-visible,
.wsp-faq-breadcrumb__link:focus-visible, .wsp-faq-ask__btn:focus-visible { outline: 2px solid var(--_primary); outline-offset: 2px; }
