/* ============================================================
   KOGNEV — Projektai (case index)
   Scoped to body.kg2, loaded alongside home.css, which supplies
   the tokens, the shared component treatments (buttons, nav,
   footer, reviews, the kg-faq disclosure this page's accordion
   borrows its interaction from), and the .kg-ps-hero anatomy
   this page reuses verbatim.

   The problem this page had: sixteen case studies in identical
   cards, all fully expanded, all the same length. Nobody scans
   that — you either read all of it or none of it. This replaces
   the card grid with a categorised index: three groups a visitor
   can recognise at a glance, each holding rows that show a title
   and a one-line outcome closed, and open to the full before /
   built / changed story on click. Same disclosure element the
   FAQ already uses, so the interaction is already familiar by the
   time someone reaches it.
   ============================================================ */

/* ---------- Category groups ----------
   Same narrow-rail-plus-wide-column anatomy as kg-tx__row: the
   category name and its one-line scope sit in the left rail, the
   case rows run in the wide column beside it. */
.kg2 .kg-cs-wrap { border-top: 2px solid var(--ink); }

.kg2 .kg-cs__group {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  column-gap: clamp(2rem, 1.4rem + 3.4vw, 4.5rem);
  align-items: start;
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--rule);
}
.kg2 .kg-cs__head { display: grid; gap: var(--s-2); position: sticky; top: 96px; }
.kg2 .kg-cs__head p { margin: 0; max-width: 32ch; }

/* ---------- Case rows ----------
   Each row is a <details>: closed, it shows the title and the
   single line that matters for scanning (what changed). Open, it
   reveals the three-part story. Chevron mechanics copied from
   kg-faq__q so the affordance reads the same everywhere it appears. */
.kg2 .kg-cs__list { border-top: 1px solid var(--rule); }
.kg2 .kg-cs__item { border-bottom: 1px solid var(--rule); }

.kg2 .kg-cs__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}
.kg2 .kg-cs__item summary::-webkit-details-marker { display: none; }

.kg2 .kg-cs__summary-text { display: grid; gap: 4px; min-width: 0; }
.kg2 .kg-cs__title {
  margin: 0;
  font-size: var(--t-body);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.35;
  color: var(--ink);
}
.kg2 .kg-cs__hook {
  margin: 0;
  font-size: var(--t-micro);
  line-height: 1.5;
  color: var(--slate);
}

.kg2 .kg-cs__item summary::after {
  content: "";
  flex: none;
  align-self: center;
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--slate);
  border-bottom: 1.5px solid var(--slate);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1), border-color 150ms ease;
}
.kg2 .kg-cs__item[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.kg2 .kg-cs__item summary:hover::after { border-color: var(--signal-ink); }
.kg2 .kg-cs__item summary:focus-visible {
  outline: 2px solid var(--signal-ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.kg2 .kg-cs__body {
  display: grid;
  gap: var(--s-4);
  max-width: 68ch;
  padding: 0 var(--s-6) var(--s-5) 0;
}
.kg2 .kg-cs__label {
  margin: 0 0 4px;
  font-size: var(--t-micro);
  font-weight: 600;
  color: var(--ink);
}
.kg2 .kg-cs__block p {
  margin: 0;
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--slate);
}
.kg2 .kg-cs__block p + p { margin-top: var(--s-2); }

@media (prefers-reduced-motion: reduce) {
  .kg2 .kg-cs__item summary::after { transition: none; }
}

/* ---------- Closing CTA (dark band) ---------- */
.kg2 .kg-cs-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}
.kg2 .kg-cs-cta__text { display: grid; gap: var(--s-2); max-width: 46ch; }

/* ---------- Responsive ----------
   Same breakpoints and stacking behaviour as the rest of the
   system: rail collapses above content below 1024px. */
@media (max-width: 1023px) {
  .kg2 .kg-cs__group { grid-template-columns: 1fr; }
  .kg2 .kg-cs__head { position: static; margin-bottom: var(--s-4); }
}
@media (max-width: 700px) {
  .kg2 .kg-cs__group { padding: var(--s-5) 0; }
  .kg2 .kg-cs__body { padding-right: 0; }
  .kg2 .kg-cs-cta .btn-primary { width: 100%; justify-content: center; }
}
