/* FAQ system v1: /faq, /faq/<group> and the FAQ block on subject / topic pages. Uses the site's colour tokens (light and dark). */
.faq-hero .lead { max-width: 720px; }
.faq-search { position: relative; max-width: 620px; margin-top: 14px; }
.faq-search .bi { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.faq-search input { width: 100%; height: 52px; padding: 0 18px 0 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 1rem; box-shadow: var(--shadow-sm); }
.faq-search input:focus { outline: 0; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(34, 197, 94, .15); }
.faq-meta { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }

.faq-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0 0 24px; }
.faq-cat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.faq-cat:hover { border-color: var(--brand-600); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--ink); }
.faq-cat.active { border-color: var(--brand); background: var(--brand-50); }
.faq-cat > .bi { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-50); color: var(--brand); font-size: 1.15rem; }
.faq-cat.active > .bi { background: var(--surface); }
.faq-cat span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.faq-cat strong { font-size: .95rem; font-weight: 700; }
.faq-cat small { color: var(--muted); font-size: .8rem; }

.faq-group + .faq-group { margin-top: 28px; }
.faq-group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.faq-group-head h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.faq-group-head h2 .bi { color: var(--brand); margin-right: 4px; }
.faq-group-head a { font-size: .9rem; font-weight: 600; text-decoration: none; }

.faq-list-v2 { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.faq-item + .faq-item { border-top: 1px solid var(--line); }
.faq-item > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { background: var(--brand-50); }
.faq-item > summary:focus-visible { outline: 3px solid rgba(34, 197, 94, .45); outline-offset: -3px; }
.faq-q { flex: 1; margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.45; color: var(--ink); }
.faq-toggle { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); position: relative; }
.faq-toggle::before, .faq-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 2px; margin: -1px 0 0 -5.5px; background: var(--brand); border-radius: 2px; transition: transform .2s ease; }
.faq-toggle::after { transform: rotate(90deg); }
.faq-item[open] > summary .faq-toggle::after { transform: rotate(0deg); }
.faq-item[open] > summary { background: var(--brand-50); }
.faq-item[open] > summary .faq-q { color: var(--brand); }
.faq-a { padding: 4px 18px 18px; color: var(--ink-2); line-height: 1.75; }
.faq-a .prose > :last-child { margin-bottom: 0; }
.faq-a .prose a { font-weight: 600; }
.faq-item:target > summary { box-shadow: inset 4px 0 0 var(--brand); }

.faq-mcqs { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--brand-100); border-radius: var(--radius-sm); background: var(--brand-50); }
.faq-mcqs-title { margin: 0 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); }
.faq-mcq-list { margin: 0 0 8px; padding-left: 1.1rem; }
.faq-mcq-list li { margin: 3px 0; line-height: 1.45; }
.faq-mcq-list a { color: var(--ink); text-decoration: none; }
.faq-mcq-list a:hover { color: var(--brand); text-decoration: underline; }
.faq-practise { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; text-decoration: none; }
.faq-link { display: inline-flex; align-items: center; gap: 3px; margin-top: 10px; font-size: .8rem; color: var(--muted); text-decoration: none; }
.faq-link:hover { color: var(--brand); }
.faq-link.copied::after { content: " – copied"; color: var(--brand); }

.faq-empty { margin-top: 16px; }
.faq-item mark { padding: 0 2px; border-radius: 3px; background: #fef08a; color: inherit; }
html[data-theme="dark"] .faq-item mark { background: #854d0e; }
html[data-theme="dark"] .faq-mcqs { border-color: var(--line); }
.faq-block .faq-list-v2 { border-radius: var(--radius-sm); }

@media (max-width: 575.98px) {
  .faq-cats { grid-template-columns: 1fr 1fr; }
  .faq-cat { padding: 10px; gap: 8px; }
  .faq-cat > .bi { flex-basis: 32px; width: 32px; height: 32px; font-size: 1rem; }
  .faq-item > summary { padding: 14px; }
  .faq-a { padding: 4px 14px 16px; }
}
@media print {
  .faq-search, .faq-cats, .faq-link, .faq-toggle { display: none !important; }
  .faq-item > .faq-a { display: block !important; }
}
