/* faq.css: styles of the three FAQ variants (section #faq) for krobjobsystem.com (28 พ.ย. 2569).
   The same file serves all three; each <section class="faq"> also carries faq-a, faq-b or faq-c, and that class only swaps what differs: the ground colour and the layout of the list. Type, spacing, the accordion row and the focus ring are shared.
   A: single column, 800 px wide, centred, tint ground, <details> accordion with 1 px rules between items (no cards), all items collapsed on load.
   B: every answer visible, white cards, two columns from a 760 px container (CSS columns, so the reading order runs down the left column then the right one, the same order as the markup), page ground. No icons, no gold.
   C: from a 900 px container, a sticky block on the left (heading, one lead line, the gold LINE button, opening hours) and the accordion of A in one white panel on the right; under 900 px the two blocks stack in markup order (heading and LINE button, then the questions), so the visual order and the Tab order stay the same. The gold button is the one gold point of the section.
   Responsive rules use container queries, not media queries: the section must sit in an element with class faq-frame (container-type: inline-size), so the same markup lays out full width on the site and inside the 390 px phone box on the choice page index.html.
   Thai text: no text-transform anywhere, letter-spacing only on the small kicker above the heading.
   Colour tokens come from the page's :root block (index.html today, the site's global tokens later): --navy --gold --blue --white --h-bg --h-tint --h-ink --h-muted --h-line --font-head --font-body. Everything in px or ms below is declared once as a custom property on .faq, so the rules themselves only ever use var(). */

/* ---------- container ---------- */
.faq-frame { container-type: inline-size; container-name: faq; }

/* ---------- size and colour tokens of the section ---------- */
.faq {
  --q-fs: 17px;           /* answer text in A and C */
  --q-fs-card: 16px;      /* answer text in the B cards */
  --q-fs-q: 18px;         /* question text, every variant */
  --q-fs-kicker: 14px;    /* the small label above the heading */
  --q-fs-sm: 15px;        /* opening hours line under the C button */
  --q-fs-btn: 16px;
  --q-h2-min: 28px;       /* h2: clamp(28px, 2.2cqi + 14px, 40px) */
  --q-h2-step: 14px;
  --q-h2-max: 40px;
  --q-lh: 1.7;            /* body */
  --q-lh-h: 1.3;          /* h2 */
  --q-lh-q: 1.4;          /* questions: two-line Thai questions with stacked tone marks need a touch more than 1.3 */
  --q-wrap: 1200px;       /* outer width of B and C */
  --q-col: 800px;         /* the single column of A */
  --q-measure: 34em;      /* answer line length */
  --q-sum-h: 56px;        /* summary row minimum height (tap target) */
  --q-tap: 44px;          /* minimum height of a text link */
  --q-disc: 40px;         /* navy circle behind the chevron */
  --q-icon: 20px;         /* Lucide icon size */
  --q-btn-h: 48px;
  --q-btn-pad: 24px;
  --q-btn-border: 2px;
  --q-btn-ring: 2px;      /* inset navy ring on gold button hover */
  --q-press: 1px;
  --q-s1: 4px;
  --q-s2: 8px;
  --q-s3: 12px;
  --q-s4: 16px;
  --q-s5: 20px;
  --q-s6: 24px;
  --q-s7: 32px;
  --q-s8: 40px;
  --q-s9: 48px;
  --q-s10: 64px;
  --q-s11: 80px;
  --q-sticky: 24px;       /* top offset of the sticky side block in C */
  --q-gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --q-gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --q-radius: 12px;
  --q-radius-sm: 8px;
  --q-radius-btn: 10px;
  --q-ring: 3px;
  --q-ring-gap: 2px;
  --q-hair: 1px;
  --q-ul: 1px;
  --q-ul-hover: 2px;
  --q-ul-gap: 3px;
  --q-letter: 0.04em;
  --q-dur: 200ms;
  /* colours: A is the default */
  --q-bg: var(--h-tint);
  --q-surface: var(--white);
  --q-ink: var(--h-ink);
  --q-muted: var(--h-muted);
  --q-line: var(--h-line);
  --q-title: var(--navy);
  --q-q: var(--h-ink);
  --q-q-hover: var(--navy);
  --q-link: var(--blue);
  --q-ring-c: var(--navy);
  --q-sel: color-mix(in srgb, var(--navy) 16%, transparent);

  background: var(--q-bg);
  color: var(--q-ink);
  font-family: var(--font-body);
  font-size: var(--q-fs);
  line-height: var(--q-lh);
}
/* B: page ground, white cards */
.faq-b { --q-bg: var(--h-bg); --q-q: var(--navy); }
/* C: tint ground like A, white panel on the right */
.faq-c { --q-bg: var(--h-tint); }

.faq *, .faq *::before, .faq *::after { box-sizing: border-box; }
.faq h2, .faq h3, .faq p { margin: 0; }
.faq ::selection { background: var(--q-sel); color: var(--navy); }

.faq-in {
  width: 100%;
  max-width: var(--q-wrap);
  margin: 0 auto;
  padding: var(--q-s9) var(--q-gutter-r) var(--q-s9) var(--q-gutter-l);
}
@container faq (min-width: 760px) {
  .faq-in { padding-block: var(--q-s11); }
}

/* ---------- heading block ---------- */
.faq-head { display: grid; gap: var(--q-s2); margin-bottom: var(--q-s7); }
.faq-kicker {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--q-fs-kicker);
  letter-spacing: var(--q-letter);
  line-height: var(--q-lh-q);
  color: var(--q-muted);
}
.faq-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(var(--q-h2-min), calc(2.2cqi + var(--q-h2-step)), var(--q-h2-max));
  line-height: var(--q-lh-h);
  color: var(--q-title);
  text-wrap: balance;
}

/* ---------- question text, shared ---------- */
.faq-q {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--q-fs-q);
  line-height: var(--q-lh-q);
  color: var(--q-q);
  text-wrap: pretty;
}

/* ---------- answers, shared ---------- */
.faq-ans { display: grid; gap: var(--q-s3); max-width: var(--q-measure); color: var(--q-ink); }
/* no-break group: a number with its unit, the opening hours, or a short Thai phrase (written by build.mjs) */
.faq .nw { white-space: nowrap; }
.faq-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--q-tap);
  color: var(--q-link);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: var(--q-ul);
  text-underline-offset: var(--q-ul-gap);
}
.faq-link:hover { text-decoration-thickness: var(--q-ul-hover); }
.faq a:focus-visible { outline: var(--q-ring) solid var(--q-ring-c); outline-offset: var(--q-ring-gap); border-radius: var(--q-radius-sm); }

/* ---------- accordion (A and the right side of C) ---------- */
.faq-item { border-top: var(--q-hair) solid var(--q-line); }
.faq-item:last-child { border-bottom: var(--q-hair) solid var(--q-line); }
.faq-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--q-s4);
  min-height: var(--q-sum-h);
  padding-block: var(--q-s4);
  cursor: pointer;
  list-style: none;
}
.faq-sum::-webkit-details-marker { display: none; }
.faq-sum::marker { content: ""; }
.faq-sum:hover .faq-q { color: var(--q-q-hover); }
.faq-sum:focus-visible { outline: var(--q-ring) solid var(--q-ring-c); outline-offset: var(--q-ring-gap); border-radius: var(--q-radius-sm); }
.faq-chev {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--q-disc);
  height: var(--q-disc);
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
}
.faq-chev svg { width: var(--q-icon); height: var(--q-icon); transition: transform var(--q-dur) ease-out; }
.faq-item[open] .faq-chev svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .faq-chev svg { transition: none; } }
.faq-item > .faq-ans { padding-bottom: var(--q-s5); }

/* ---------- A: one centred column ---------- */
.faq-a .faq-in { max-width: calc(var(--q-col) + var(--q-gutter-l) + var(--q-gutter-r)); }

/* ---------- B: all answers open, white cards ---------- */
.faq-cards { column-gap: var(--q-s6); }
.faq-card {
  display: grid;
  gap: var(--q-s3);
  break-inside: avoid;
  margin-bottom: var(--q-s6);
  padding: var(--q-s6);
  background: var(--q-surface);
  border: var(--q-hair) solid var(--q-line);
  border-radius: var(--q-radius);
}
.faq-card .faq-ans { font-size: var(--q-fs-card); }
@container faq (min-width: 760px) {
  .faq-cards { columns: 2; }
}

/* ---------- C: sticky side block and the accordion panel ---------- */
.faq-c .faq-in { display: grid; grid-template-columns: minmax(0, 1fr); }
/* narrow: side block (heading, lead, button, hours) first, the questions panel under it, same order as the markup and the Tab order */
.faq-side { display: grid; align-content: start; margin-bottom: var(--q-s7); }
.faq-c .faq-head { margin-bottom: var(--q-s5); }
.faq-panel {
  padding-inline: var(--q-s5);
  background: var(--q-surface);
  border: var(--q-hair) solid var(--q-line);
  border-radius: var(--q-radius);
}
/* inside the white panel the outer rules would double the panel border, so the first and last item drop theirs */
.faq-panel .faq-item:first-child { border-top: 0; }
.faq-panel .faq-item:last-child { border-bottom: 0; }
.faq-cta { display: grid; gap: var(--q-s3); justify-items: start; }
.faq-lead { color: var(--q-ink); max-width: var(--q-measure); }
.faq-hours { font-size: var(--q-fs-sm); color: var(--q-muted); }
.faq-hours .num { font-variant-numeric: tabular-nums; }
.faq-c .faq-cta .btn { width: 100%; }
@container faq (min-width: 560px) {
  .faq-c .faq-cta .btn { width: auto; }
}
@container faq (min-width: 900px) {
  .faq-c .faq-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--q-s9); align-items: start; }
  .faq-side { position: sticky; top: var(--q-sticky); margin-bottom: 0; }
  .faq-c .faq-head { margin-bottom: var(--q-s6); }
  .faq-panel { padding-inline: var(--q-s6); }
}

/* ---------- the gold button (C only): same as .btn .btn-gold in hero.css ---------- */
.faq .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--q-s2);
  min-height: var(--q-btn-h);
  padding: 0 var(--q-btn-pad);
  border-radius: var(--q-radius-btn);
  border: var(--q-btn-border) solid transparent;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--q-fs-btn);
  line-height: var(--q-lh-q);
  text-decoration: none;
  cursor: pointer;
}
/* one gold only: hover keeps the fill and shows a navy inner ring, no second shade */
.faq .btn-gold { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 700; }
.faq .btn-gold:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); box-shadow: inset 0 0 0 var(--q-btn-ring) var(--navy); }
.faq .btn-gold:focus-visible { outline: var(--q-ring) solid var(--navy); outline-offset: var(--q-ring-gap); border-radius: var(--q-radius-btn); }
.faq .btn-gold:active { transform: translateY(var(--q-press)); }
.faq .btn svg { flex: none; width: var(--q-icon); height: var(--q-icon); }
