/* ==========================================================================
   Category hub (app/pages/category.php, page-system.md §3.3)
   1. Intro: the outcome, who it's for and the problems on seven columns, the emphasised entry callout beside
   2. Services: a sticky head beside a numbered index of rows (the order they're usually needed)
   3. The sections that follow: pathway beside its head, often combined with, the stage tiles on the dark band
   Rows, cards, the pathway, capabilities and the entry callout are shared (wisdigix.css).
   ========================================================================== */

/* 1. Intro
   ----------------------------------------------------------------------- */
.cat-intro__grid {
    display: grid;
    gap: var(--s-7) var(--gap);
    align-items: start;
}
@media (min-width: 992px) {
    .cat-intro__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .cat-intro__main { grid-column: 1 / span 7; }
    .cat-intro__side { grid-column: 9 / -1; }
}
.cat-intro__main { min-width: 0; }
.cat-intro__side { min-width: 0; }
.cat-intro .wg-section-head { margin-bottom: var(--s-5); }
.cat-intro .wg-section-head .wg-title { max-width: 16em; }
.cat-intro__text { max-width: 40rem; margin: 0; color: var(--fg); }

/* The problems, in the customer's own words: short lines on hairlines, two across from 576px */
.cat-problems__title {
    margin: var(--s-7) 0 var(--s-4);
    font-size: var(--fs-h4);
    font-weight: 620;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.cat-problems {
    display: grid;
    gap: 0 var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}
.cat-problems li {
    position: relative;
    padding: var(--s-4) 0 var(--s-4) var(--s-5);
    border-top: 1px solid var(--rule);
    color: var(--fg-strong);
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -.006em;
}
/* A small right-angle connector: the coordination view's line, not a quote mark */
.cat-problems li::before {
    content: "";
    position: absolute;
    top: calc(var(--s-4) + .25em);
    left: 0;
    width: .625rem;
    height: .5em;
    border-bottom: 1px solid var(--rule-strong);
    border-left: 1px solid var(--rule-strong);
}
@media (min-width: 576px) {
    .cat-problems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 2. Services: the numbered index
   ----------------------------------------------------------------------- */
.cat-services__grid {
    display: grid;
    gap: 0 var(--gap);
    align-items: start;
}
@media (min-width: 992px) {
    .cat-services__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .cat-services__head {
        position: sticky;
        top: calc(72px + var(--s-6));
        grid-column: 1 / span 4;
        margin-bottom: 0;
    }
    .cat-services__list { grid-column: 6 / -1; }
}
.cat-services__list { min-width: 0; }
.cat-services__head .wg-meta {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    font-variant-numeric: tabular-nums;
}

.cat-list { counter-reset: cat-service; border-top-color: var(--rule-strong); }
.cat-list > .wg-row {
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    padding-block: var(--s-5);
    counter-increment: cat-service;
}
.cat-list > .wg-row::before {
    content: counter(cat-service, decimal-leading-zero);
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-top: .3rem;
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    line-height: 1.4;
}
.cat-list .wg-row__main,
.cat-list .wg-row > .wg-meta { grid-column: 2; }
.cat-list .wg-row__act { grid-column: 3; grid-row: 1 / span 2; }
.cat-list .wg-row__name {
    font-size: var(--fs-h3);
    font-weight: 620;
    letter-spacing: -.014em;
}
.cat-list .wg-row__text { margin-top: .4rem; font-size: var(--fs-body); color: var(--fg); }
.cat-list .wg-row > .wg-meta { margin-top: .25rem; }
@media (max-width: 575px) {
    .cat-list > .wg-row { grid-template-columns: 2rem minmax(0, 1fr); column-gap: var(--s-3); }
    .cat-list > .wg-row::before { grid-row: 1; }
    .cat-list .wg-row__act { grid-column: 2; grid-row: auto; }
}

.cat-list__foot {
    margin: var(--s-5) 0 0;
    color: var(--fg-muted);
    font-size: var(--fs-small);
    line-height: 1.55;
}
.cat-list__foot .wg-link { margin-left: .25rem; }

/* The add toggles are hidden without JS, so the sentence about them is too */
.no-js .cat-js-only { display: none; }

/* 3. Sections that follow
   ----------------------------------------------------------------------- */
/* A vertical pathway sits beside its head: the split's own gap applies when stacked */
.cat-path--beside .wg-section-head { margin-bottom: 0; }

/* Packages: two cards share the row, three take a third each */
@media (min-width: 768px) {
    .cat-packages { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
}
.cat-tags { margin-top: var(--s-7); }
.cat-tags .wg-tags { padding-bottom: 0; }

/* Questions: the head and rows on the page's left edge, the rows at a reading measure */
.cat-faq .wg-faq { max-width: 56rem; }

.cat-combined__grid {
    display: grid;
    gap: 0 var(--gap);
    align-items: start;
}
@media (min-width: 992px) {
    .cat-combined__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .cat-combined__grid > .wg-section-head { grid-column: 1 / span 5; margin-bottom: 0; }
    .cat-combined__grid > .wg-rows { grid-column: 6 / -1; }
}

.cat-stages .wg-section-head--split { align-items: flex-end; }

/* Same ground, one hairline: .wg-dark bands share the obsidian of the plain sections beside them on the dark
   site, so the seam on either side is a 1px rule (the coal and graphite grounds carry their own edge) */
.wg-section:not(.wg-section--stone):not(.wg-ice):not(.wg-dark) + .wg-dark,
.wg-dark + .wg-section:not(.wg-section--stone):not(.wg-ice):not(.wg-dark) { border-top: 1px solid var(--rule); }

/* 4. UX pass (2026-11-17): services first, then who it's for, the usual order, one Related block, four questions */
.cat-services__entry { margin-top: var(--s-6); }
.cat-intro .wg-title { margin-bottom: var(--s-4); }
.cat-intro__lead { max-width: 36rem; margin: 0 0 var(--s-4); color: var(--fg-strong); font-size: var(--fs-lead); line-height: 1.5; letter-spacing: -.008em; }
.cat-intro__side .cat-problems__title { margin-top: 0; }

/* Related: two columns from 992px, packages and goals on the left, often combined and on request on the right */
.cat-related__heading { margin-bottom: clamp(2rem, 1.4rem + 2vw, 3.5rem); }
.cat-related__grid { display: grid; gap: var(--s-8) var(--gap); }
@media (min-width: 992px) {
    .cat-related__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(2.5rem, 1rem + 4vw, 6rem); }
}
.cat-related__col { min-width: 0; }
.cat-related__title { margin: 0 0 var(--s-4); color: var(--fg-muted); font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; }
.cat-related__packages { margin: 0; padding: 0; border-top: 1px solid var(--rule); list-style: none; }
.cat-related__packages li { position: relative; padding: var(--s-4) 0; border-bottom: 1px solid var(--rule); }
.cat-related__packages p { margin: .35rem 0 0; color: var(--fg); font-size: var(--fs-small); line-height: 1.5; }
.cat-related__name {
    color: var(--fg-strong);
    font-size: var(--fs-h4);
    font-weight: 620;
    letter-spacing: -.01em;
    text-decoration: none;
}
.cat-related__name::after { content: ""; position: absolute; inset: 0; }   /* the whole row is the link */
.cat-related__packages li:hover .cat-related__name,
.cat-related__packages li:focus-within .cat-related__name { text-decoration: underline; text-decoration-color: var(--accent-fg); text-decoration-thickness: 1px; text-underline-offset: .22em; }
.cat-related__name:focus-visible { outline: none; }
.cat-related__packages li:has(.cat-related__name:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.cat-related__more { margin: var(--s-4) 0 0; }
.cat-related .cat-tags { margin-top: var(--s-6); }
.cat-related__ask { margin-top: var(--s-7); }
.cat-related__col > .cat-related__ask:first-child { margin-top: 0; }
.cat-related__note { margin: -.5rem 0 var(--s-4); color: var(--fg-muted); font-size: var(--fs-small); }

/* Questions: the head on the left, the rows beside it */
.cat-faq__grid { display: grid; gap: var(--s-6) var(--gap); }
@media (min-width: 992px) {
    .cat-faq__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: clamp(2.5rem, 1rem + 4vw, 6rem); align-items: start; }
    .cat-faq__grid .wg-section-head { position: sticky; top: calc(72px + var(--s-6)); }
}
