/* Griffith Consulting Group · FAQ question wall (pairs with js/faq.js)
   .faqw-src is the no-JS <details> list. JS hides it and builds the toolbar,
   the drifting stage of cards and the ask form. .is-list is the calm layout. */

.faq-grid:has(> .faqw) { grid-template-columns: 1fr; gap: 28px; }
.faq-grid:has(> .faqw) > .section-head { margin-bottom: 0; }
.faqw { min-width: 0; }
.faqw-src { display: grid; gap: 12px; }
.faqw-src[hidden] { display: none; }
.faqw-src details { scroll-margin-top: 100px; }

/* ---------------------------------------------------------------- toolbar */
.faqw-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.faqw-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; }
.faqw-toggle i {
  width: 10px; height: 11px; flex: none;
  background: linear-gradient(currentColor, currentColor) left / 3px 100% no-repeat, linear-gradient(currentColor, currentColor) right / 3px 100% no-repeat;
}
.faqw-toggle.is-stopped { border-color: var(--accent); color: var(--accent); }
.faqw-toggle.is-stopped i { background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.faqw-count { font: 500 .78rem/1 var(--f-mono); color: var(--muted); }

/* ---------------------------------------------------------------- stage */
.faqw-stage {
  position: relative; overflow: clip;
  min-height: 160px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2);
}
.faqw-stage::before, .faqw-stage::after {
  content: ""; position: absolute; top: 0; bottom: 0; z-index: 3; width: 34px; pointer-events: none;
}
.faqw-stage::before { left: 0; background: linear-gradient(90deg, var(--bg-2), transparent); }
.faqw-stage::after { right: 0; background: linear-gradient(270deg, var(--bg-2), transparent); }

.faqw-card {
  --c: var(--ocean);
  position: absolute; left: 0; top: 0;
  width: var(--cw, 240px); height: var(--ch, 120px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  overflow: hidden;
  transition: border-color .2s, box-shadow .3s;
}
.faqw-stage.is-measuring .faqw-card { height: auto; }
.faqw-card:hover { border-color: color-mix(in oklab, var(--c) 50%, var(--line)); }
.faqw-card.is-open { height: auto; z-index: 4; border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.faqw-card.is-closing { z-index: 2; }

.faqw-card[data-tag="us"] { --c: var(--ocean); }
.faqw-card[data-tag="web"] { --c: var(--sand); }
.faqw-card[data-tag="crm"] { --c: var(--forest); }
.faqw-card[data-tag="seo"] { --c: var(--bark); }
.faqw-card[data-tag="content"] { --c: var(--moss); }
.faqw-card[data-tag="brand"] { --c: var(--bark); }
.faqw-card[data-tag="data"] { --c: var(--ocean); }
.faqw-card.is-yours { --c: var(--accent); border-style: dashed; border-color: color-mix(in oklab, var(--accent) 60%, var(--line)); }

.faqw-h { font-size: 1rem; font-weight: 500; line-height: 1.32; letter-spacing: -0.01em; }
.faqw-q {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  width: 100%; padding: 14px 40px 14px 16px; margin: 0;
  border: 0; border-radius: 11px; background: none; text-align: left; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: inherit;
}
.faqw-q:focus-visible { outline-offset: -3px; border-radius: 11px; }
.faqw-q::after {
  content: ""; position: absolute; right: 15px; top: 17px; width: 12px; height: 12px;
  background: linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat, linear-gradient(var(--accent), var(--accent)) center / 2px 100% no-repeat;
  transition: transform .35s var(--ease-spring);
}
.faqw-card.is-open .faqw-q::after { transform: rotate(135deg); }
.faqw-tag {
  font: 500 .68rem/1 var(--f-mono); letter-spacing: .02em; text-transform: lowercase;
  padding: 5px 8px; border-radius: 999px; color: var(--ink);
  background: color-mix(in oklab, var(--c) 20%, transparent);
}
.faqw-a { padding: 0 16px 16px; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.faqw-a p + p { margin-top: 8px; }
.faqw-a a { color: var(--accent); }
.faqw-card.is-open .faqw-a { animation: faqw-in .42s var(--ease-out) .14s both; }
@keyframes faqw-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- ask form */
.faqw-ask { display: flex; align-items: flex-end; gap: 12px 14px; flex-wrap: wrap; margin-top: 18px; }
.faqw-ask .field { flex: 1 1 260px; min-width: 0; }
.faqw-ask .btn3d { flex: none; margin-bottom: 4px; }
.faqw-msg { flex-basis: 100%; min-height: 1.5em; font-size: .86rem; color: var(--muted); }
.faqw-msg.is-bad { color: var(--moss); }

/* ---------------------------------------------------------------- calm: a still grid */
.faqw.is-list .faqw-toggle { display: none; }
.faqw.is-list .faqw-stage {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px;
  padding: 12px; height: auto !important;
}
.faqw.is-list .faqw-stage::before, .faqw.is-list .faqw-stage::after { display: none; }
.faqw.is-list .faqw-card { position: relative; width: auto; height: auto; translate: none !important; }
.faqw.is-list .faqw-card.is-open { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .faqw-stage::before, .faqw-stage::after { width: 18px; }
  .faqw-ask .btn3d { width: 100%; }
}
