/* The FAQ reader (partials/faq.php, assets/js/faq.js), 2026-10-11.
 *
 * Three states of one markup:
 *   no script     every answer shows under its question (nothing is hidden
 *                 from a reader, a search engine or an AI tool);
 *   .faq-ready    a ruled list; an answer opens under its question (phones,
 *                 and the 'plain' layout at every width);
 *   .faq-wide     the reader: list on the left, the chosen answer set on the
 *                 right, a marker with the donkey travelling between questions.
 *
 * No boxes: thin rules, numbers and type do the work. Coral is for actions
 * only, so everything that marks "where you are" is the brand-voice blue.
 */

.faq-section { --faq-ink: #c2cade; }

/* "Ask us" in the intro: styled like the site's other text links. */
.faq-section .section-head a {
  color: var(--accent-voice);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.faq-section .section-head a:hover { border-bottom-color: currentColor; }

.faq-reader { max-width: 820px; margin: 0 auto; }
.faq-list { position: relative; }
.faq-pane, .faq-marker, .faq-rider { display: none; }

/* ---- The list ---- */
.faq-topic {
  margin: var(--s-4) 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-voice);
}
.faq-topic:first-of-type { margin-top: 0; }
.faq-item { border-top: 1px solid var(--hairline); }
.faq-item:last-child { border-bottom: 1px solid var(--hairline); }
.faq-q { margin: 0; font-size: inherit; }

/* Reset first: the site's own button styles must not leak in. */
.faq-q button {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 15px 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  cursor: default;
}
.faq-ready .faq-q button { cursor: pointer; }
.faq-q button:focus-visible { outline: 2px solid var(--accent-voice); outline-offset: 2px; border-radius: 4px; }
.faq-num {
  flex: 0 0 22px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.faq-text { flex: 1; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.2s ease; }
.faq-item.is-open .faq-num { color: var(--accent-voice); }

/* Open or shut, on the ruled list only: a small chevron that turns over. */
.faq-caret {
  flex: 0 0 9px;
  height: 9px;
  align-self: center;
  margin: -4px 4px 0 0;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.3s ease, border-color 0.2s ease;
  display: none;
}
.faq-ready .faq-caret { display: block; }
.faq-item.is-open .faq-caret { transform: translateY(4px) rotate(-135deg); border-color: var(--accent-voice); }

/* ---- An answer ---- */
.faq-a { display: grid; grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; min-height: 0; }
.faq-a p {
  margin: 0;
  padding: 0 0 20px 38px;
  color: var(--faq-ink);
  font-size: 16px;
  line-height: 1.7;
}
.faq-a a {
  color: var(--accent-voice);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.faq-a a:hover { border-bottom-color: currentColor; }
.faq-a code {
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* The ruled list with the script running: shut until asked. The grid-rows
   trick slides to the answer's real height without measuring it; a shut answer
   is also visibility:hidden, so its links cannot be reached by Tab. */
.faq-ready .faq-a {
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.35s ease, visibility 0s linear 0.35s;
}
.faq-ready .faq-item.is-open .faq-a {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.35s ease, visibility 0s linear 0s;
}
.faq-ready .faq-a p { opacity: 0; transform: translateY(-4px); transition: opacity 0.25s ease, transform 0.25s ease; }
.faq-ready .faq-item.is-open .faq-a p { opacity: 1; transform: none; transition-delay: 0.08s; }

/* ===== The reader (wide screens; faq.js sets .faq-wide) ===== */
.faq-reader.faq-wide {
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 0 72px;
  align-items: start;
}
.faq-wide .faq-list { padding-left: 46px; }
.faq-wide .faq-item,
.faq-wide .faq-item:last-child { border: 0; }
.faq-wide .faq-topic { margin: 26px 0 4px; }
.faq-wide .faq-topic:first-of-type { margin-top: 0; }
.faq-wide .faq-q button { padding: 9px 0; font-size: 15px; font-weight: 500; color: var(--faq-ink); }
.faq-wide .faq-q button:hover .faq-text { transform: translateX(4px); color: var(--text-primary); }
.faq-wide .faq-item.is-open .faq-text { color: var(--text-primary); font-weight: 600; }
.faq-wide .faq-caret { display: none; }
/* In the list an answer has no place: the open one lives in the pane. */
.faq-wide .faq-item .faq-a { display: none; }

/* The marker: one short line that travels to the chosen question, with a
   little overshoot, as if it had weight. faq.js sets --faq-y and --faq-h. */
.faq-wide .faq-marker {
  display: block;
  position: absolute;
  left: 30px;
  top: 0;
  width: 2px;
  height: var(--faq-h, 0);
  border-radius: 2px;
  background: var(--accent-voice);
  transform: translateY(var(--faq-y, 0));
  transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.5, 1), height 0.3s ease;
}
/* And the donkey rides along beside it, with a hop on the way. */
.faq-wide .faq-rider {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  transform: translateY(calc(var(--faq-y, 0px) + (var(--faq-h, 22px) - 22px) / 2));
  transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.5, 1);
}
.faq-rider img { display: block; width: 22px; height: 22px; }
.faq-list.is-hopping .faq-rider img { animation: faq-hop 0.5s ease-out; }
@keyframes faq-hop {
  0%   { transform: translateY(0) rotate(0); }
  35%  { transform: translateY(-9px) rotate(-8deg); }
  70%  { transform: translateY(0) rotate(0); }
  85%  { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

/* The reading pane: stays in view while the list scrolls past. */
.faq-wide .faq-pane {
  display: block;
  position: sticky;
  top: calc(var(--nav-height) + var(--dcms-hb-h, 0px) + 40px);
  padding-left: 72px;
  border-left: 1px solid var(--hairline);
  min-height: 420px;
}
.faq-pane-count { display: flex; align-items: baseline; gap: 12px; }
/* The question's number, large and drawn in outline: the page's one ornament.
   It rolls like a counter when the question changes. */
.faq-pane-num {
  display: block;
  overflow: hidden;
  /* Room for the line itself: it is drawn outside the digits, and the box that
     hides the rolling number would otherwise shave it off on the right. */
  padding: 3px 5px;
  margin: -3px -5px;
  font-family: var(--font-heading);
  font-size: 76px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  /* Outline only. Sora is a variable font whose shapes overlap inside each digit, and a
     plain text stroke draws those inner seams too (Bugra saw them, 2026-10-11). So the
     stroke is drawn twice as wide FIRST and the fill, in the page's own color, is
     painted over its inner half and every seam: what is left is the outer line. */
  color: var(--bg-void);
  -webkit-text-stroke: 3px var(--accent-voice);
  paint-order: stroke fill;
  stroke-linejoin: round;
}
.faq-pane-num span { display: block; }
.faq-pane-of { color: var(--text-muted); font-size: 13px; font-variant-numeric: lining-nums tabular-nums; }
.faq-pane-q {
  margin: 22px 0 14px;
  font-family: var(--font-heading);
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.faq-pane .faq-a,
.faq-ready .faq-pane .faq-a { display: grid; grid-template-rows: 1fr; visibility: visible; transition: none; }
.faq-pane .faq-a p,
.faq-ready .faq-pane .faq-a p { padding: 0; opacity: 1; transform: none; transition: none; font-size: 17px; line-height: 1.75; }

.faq-pane-nav {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq-pane-nav button {
  all: unset;
  box-sizing: border-box;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-voice);
  cursor: pointer;
}
.faq-pane-nav button:focus-visible { outline: 2px solid var(--accent-voice); outline-offset: 4px; border-radius: 4px; }
.faq-pane-nav .arrow { transition: transform 0.2s ease; }
.faq-pane-nav .faq-next:hover .arrow { transform: translateX(4px); }
.faq-pane-nav .faq-prev:hover .arrow { transform: translateX(-4px); }
.faq-pane-nav button[disabled] { color: var(--text-muted); opacity: 0.45; cursor: default; }
.faq-pane-nav button[disabled] .arrow { transform: none; }

/* A change of question: the number rolls, the question and the answer rise in
   one after the other. The direction follows the list: down for a later
   question, up for an earlier one. */
.faq-pane.is-in .faq-pane-num span { animation: faq-roll 0.5s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.faq-pane.is-in .faq-pane-q        { animation: faq-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.06s both; }
.faq-pane.is-in .faq-pane-body     { animation: faq-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.14s both; }
.faq-pane { --faq-from: 1; }
.faq-pane.from-up { --faq-from: -1; }
@keyframes faq-roll {
  from { transform: translateY(calc(var(--faq-from) * 105%)); }
  to   { transform: translateY(0); }
}
@keyframes faq-rise {
  from { opacity: 0; transform: translateY(calc(var(--faq-from) * 14px)); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .faq-q button { padding: 16px 0; gap: 12px; }
  .faq-a p { padding-left: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-reader *, .faq-reader *::before, .faq-reader *::after { transition: none !important; animation: none !important; }
}
