/* Catalogue page - direction A, «Фасеты».
 *
 * Owned by templates/core/lawyer_list.html and
 * templates/core/directory/_lawyer_card.html. Loaded from that template's
 * {% block extra_css %}, i.e. AFTER style.css, which is 14k shared lines and
 * must not be edited for this page.
 *
 * Every class here is namespaced `cat-*`. That is not decoration: style.css
 * already owns `.user-card`, `.block-user*`, `.filters*`, `.specialization-link`
 * and friends, and reusing one of those names inherits a layout built for the
 * old single-row filter bar. The three names deliberately NOT namespaced are the
 * ones something else depends on:
 *
 *   .sponsored-card      - the promotion tracking JS binds to it
 *   .lawyer-spec-link    - core/tests/test_catalogue_page.py asserts it, and the
 *                          promotion click binding excludes it by name
 *   .button.primary / .button.secondary
 *                        - a test counts these exact strings, one of each per card
 *
 * plus the markup re-housed verbatim from the old filter bar (`.ui-selectbox`,
 * `.city-selectbox`, `.sort-selectbox`, `.filters`, `.results-summary`,
 * `.empty-state*`, `.article-*`, the pagination), whose JS reaches for those
 * exact selectors. Where style.css styles them for the old bar, the rules below
 * re-house them by out-specifying, never by !important.
 */

.cat-page {
    /* Brand tokens, lifted from style.css so this file has one source of truth
       and no hex literal is repeated down the page. */
    --cat-primary: #8B0000;
    --cat-primary-hover: #730C0B;
    --cat-primary-tint: #fdf2f2;
    --cat-text: #343235;
    --cat-muted: #6b7280;
    --cat-faint: #9ca3af;
    --cat-bg: #f9fafb;
    --cat-surface: #ffffff;
    --cat-border: #e5e7eb;
    --cat-border-strong: #d1d5db;
    --cat-radius-sm: 6px;
    --cat-radius: 8px;
    --cat-radius-lg: 12px;
    --cat-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);
    --cat-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Proxima Nova', 'Helvetica Neue', Arial, sans-serif;
    color: var(--cat-text);
}

.cat-page h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1.25rem;
    color: var(--cat-text);
}

/* ---------------------------------------------------------------- layout -- */

.cat-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.cat-results {
    min-width: 0;
}

/* ------------------------------------------------------------- sidebar --- */

/* The offset is measured, never a constant: `.header-main` is itself sticky
   (navbar.css) and pins a bar of `--app-header-h`, which navbar.js writes from
   the bar's real height on every resize. `top: 16px` put the panel underneath
   it, so the first facet group was covered on every scroll. Same variable every
   other sticky offset on the site reads. */
.cat-sidebar {
    position: sticky;
    top: calc(var(--app-header-h, 64px) + 16px);
    align-self: start;
    max-height: calc(100vh - var(--app-header-h, 64px) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--cat-surface);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius-lg);
    box-shadow: var(--cat-shadow-sm);
    padding: 16px;
}

/* style.css: `.filters { display:flex; flex-wrap:nowrap; min-width:max-content }`
   - the old horizontal bar. The sidebar keeps the class because updateFilters()
   reads its inputs through `document.querySelector('.filters')`. */
.cat-facets.filters {
    display: block;
    min-width: 0;
    gap: 0;
}

.cat-facet {
    padding: 14px 0;
    border-top: 1px solid var(--cat-border);
}

.cat-facet:first-child {
    padding-top: 0;
    border-top: 0;
}

.cat-facet-title {
    margin: 0 0 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cat-faint);
}

.cat-facet-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ------------------------------------------------------- sidebar: search -- */

.cat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px 0 10px;
    background: var(--cat-bg);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.cat-search:focus-within {
    border-color: var(--cat-primary);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, .1);
}

.cat-search-icon {
    color: var(--cat-faint);
    font-size: 0.875rem;
    flex: 0 0 auto;
}

.cat-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 9px 0;
    font-size: 0.875rem;
    color: var(--cat-text);
    outline: none;
    font-family: inherit;
}

.cat-search input[type="search"]::placeholder {
    color: var(--cat-faint);
}

.cat-search-go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--cat-radius-sm);
    background: var(--cat-primary);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}

.cat-search-go:hover {
    background: var(--cat-primary-hover);
}

.cat-search-go:focus-visible {
    outline: 2px solid var(--cat-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------- sidebar: radio rows -- */

/* Real links, styled as radios: each category is a different listing with its
   own URL (/yurist/, /advokat/, /mediatory/), not a filter on this one. */
.cat-radio-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    margin: 0 -8px;
    border-radius: var(--cat-radius-sm);
    font-size: 0.875rem;
    color: var(--cat-text);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.cat-radio-row:hover {
    background: var(--cat-bg);
    color: var(--cat-primary);
    text-decoration: none;
}

.cat-radio-row.is-active {
    color: var(--cat-primary);
    font-weight: 600;
    background: var(--cat-primary-tint);
}

.cat-radio-dot {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 1px solid var(--cat-border-strong);
    border-radius: 50%;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cat-radio-row:hover .cat-radio-dot {
    border-color: var(--cat-primary);
}

.cat-radio-row.is-active .cat-radio-dot {
    border-color: var(--cat-primary);
    box-shadow: inset 0 0 0 3px var(--cat-primary);
}

/* --------------------------------------------------- sidebar: check rows -- */

.cat-facet-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: var(--cat-radius-sm);
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--cat-text);
    cursor: pointer;
    position: relative;
    transition: background .15s ease;
}

.cat-facet-check:hover {
    background: var(--cat-bg);
}

/* sr-only-but-focusable.
 *
 * `display: none` here is the bug this pattern exists to prevent: it takes the
 * box out of the tab order and out of the accessibility tree at once, so the
 * filter can be reached by neither keyboard nor screen reader. The clip pattern
 * hides it visually and nothing else - the <label> wrapping it supplies the
 * accessible name, and native label-for-input behaviour does the toggling, so
 * no JS may ever toggle it (a handler fires after the native toggle and flips
 * it straight back).
 *
 * core/tests/test_catalogue_page.py asserts this rule keeps `clip` and never
 * grows a `display: none`. */
.cat-facet-check input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.cat-check-box {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border: 1px solid var(--cat-border-strong);
    border-radius: 4px;
    background: #fff;
    color: transparent;
    font-size: 11px;
    line-height: 1;
    transition: background .15s ease, border-color .15s ease;
}

.cat-facet-check:hover .cat-check-box {
    border-color: var(--cat-primary);
}

.cat-facet-check input[type="checkbox"]:checked ~ .cat-check-box {
    background: var(--cat-primary);
    border-color: var(--cat-primary);
    color: #fff;
}

/* The box is invisible, so the row is what has to show focus. */
.cat-facet-check input[type="checkbox"]:focus-visible ~ .cat-check-box {
    outline: 2px solid var(--cat-primary);
    outline-offset: 2px;
}

.cat-check-label {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.cat-check-label .bi {
    color: var(--cat-faint);
    font-size: 0.8125rem;
}

.cat-facet-check input[type="checkbox"]:checked ~ .cat-check-label {
    color: var(--cat-primary);
    font-weight: 600;
}

.cat-facet-check input[type="checkbox"]:checked ~ .cat-check-label .bi {
    color: var(--cat-primary);
}

/* «Показать все N» - a disclosure, so the extra rows are in the DOM (and in the
   page source) from the start rather than fetched. */
.cat-spec-list .cat-facet-extra {
    display: none;
}

.cat-spec-list.is-expanded .cat-facet-extra {
    display: flex;
}

.cat-facet-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cat-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.cat-facet-more:hover {
    color: var(--cat-primary-hover);
    text-decoration: underline;
}

.cat-facet-more:focus-visible {
    outline: 2px solid var(--cat-primary);
    outline-offset: 2px;
}

.cat-facet-more .cat-more-close,
.cat-facet-more[aria-expanded="true"] .cat-more-open {
    display: none;
}

.cat-facet-more[aria-expanded="true"] .cat-more-close {
    display: inline;
}

/* ----------------------------------------------------- sidebar: the city -- */

/* The multi-select dropdown, its markup and its JS, are re-housed verbatim from
   the old filter bar; only the trigger's dimensions change. style.css sizes it
   as a pill in a horizontal row (max-width 11rem), which is narrower than the
   sidebar. */
.cat-facets .city-selectbox .city-select-trigger {
    display: flex;
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    gap: 8px;
    padding: 9px 10px;
    border-radius: var(--cat-radius);
    border: 1px solid var(--cat-border);
    background: var(--cat-bg);
    color: var(--cat-text);
    font-size: 0.875rem;
    white-space: nowrap;
}

.cat-facets .city-selectbox .city-select-trigger:hover,
.cat-facets .city-selectbox.active .city-select-trigger {
    border-color: var(--cat-primary);
    color: var(--cat-primary);
    background: var(--cat-primary-tint);
}

.cat-facets .city-selectbox .city-select-value {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-facets .city-selectbox .bi-chevron-down {
    margin-left: auto;
    flex: 0 0 auto;
    opacity: .6;
}

/* --------------------------------------------------- sidebar: the chips --- */

/* style.css puts `display: contents` on this group so the chips could join the
   old bar's single flex row. In the sidebar it is a wrapping row of its own. */
/* The language filter is three ordinary checkbox rows, exactly like «Формат»
   above it. style.css puts `display: contents` on this group so its chips could
   join the old single-row filter bar; in the sidebar it is a column of its own. */
.cat-facets .filters-lang-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ---------------------------------------------------- sidebar: the price -- */

.cat-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-price-input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    background: var(--cat-bg);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--cat-text);
}

.cat-price-input:focus {
    outline: none;
    border-color: var(--cat-primary);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, .1);
}

.cat-price-input::placeholder {
    color: var(--cat-faint);
}

.cat-price-dash {
    color: var(--cat-faint);
    flex: 0 0 auto;
}

.cat-facet-apply {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--cat-border-strong);
    border-radius: var(--cat-radius);
    background: #fff;
    color: var(--cat-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}

.cat-facet-apply:hover {
    border-color: var(--cat-primary);
    color: var(--cat-primary);
    background: var(--cat-primary-tint);
}

.cat-facet-apply:focus-visible {
    outline: 2px solid var(--cat-primary);
    outline-offset: 2px;
}

/* ---------------------------------------------------- sidebar: the reset -- */

.cat-facet-foot {
    padding-top: 14px;
    border-top: 1px solid var(--cat-border);
}

.cat-facet-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cat-muted);
    text-decoration: none;
}

.cat-facet-reset:hover {
    color: var(--cat-primary);
    text-decoration: none;
}

/* -------------------------------------------------------- applied chips --- */

.cat-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cat-applied-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 11px;
    border: 1px solid var(--cat-border);
    border-radius: 999px;
    background: var(--cat-surface);
    font-size: 0.8125rem;
    color: var(--cat-text);
    max-width: 100%;
}

.cat-applied-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-applied-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cat-bg);
    color: var(--cat-muted);
    font-size: 9px;
    text-decoration: none;
}

.cat-applied-remove:hover {
    background: var(--cat-primary);
    color: #fff;
    text-decoration: none;
}

.cat-applied-reset {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cat-primary);
    text-decoration: none;
}

.cat-applied-reset:hover {
    color: var(--cat-primary-hover);
    text-decoration: underline;
}

/* ------------------------------------------------------------- toolbar ---- */

.cat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: var(--cat-surface);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius-lg);
    box-shadow: var(--cat-shadow-sm);
}

/* style.css gives `.results-summary` a vertical padding meant for a standalone
   line; inside the toolbar it is one half of a flex row. */
.cat-toolbar .results-summary {
    padding: 0;
    font-size: 0.9375rem;
    color: var(--cat-text);
    font-weight: 600;
}

.cat-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* The sort control keeps its markup and its JS hooks (.sort-trigger,
   #sortDirToggle, .ui-selectbox-list[data-value]); style.css only styles it via
   `.block-filters .sort-selectbox`, a wrapper this page no longer has. */
.cat-toolbar .sort-selectbox .ui-selectbox-text {
    min-width: 0;
    padding: 7px 10px;
    gap: 8px;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    background: var(--cat-surface);
    color: var(--cat-text);
    font-size: 0.875rem;
    font-weight: 600;
    justify-content: flex-start;
}

.cat-toolbar .sort-selectbox .ui-selectbox-text:hover {
    border-color: var(--cat-primary);
    color: var(--cat-primary);
}

.cat-toolbar .sort-selectbox .sort-trigger-icon {
    flex: 0 0 auto;
    font-size: 0.9375rem;
    color: var(--cat-primary);
}

.cat-toolbar .sort-selectbox .ui-selectbox-text .value {
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-toolbar .sort-selectbox .bi-chevron-down {
    margin-left: auto;
    flex: 0 0 auto;
    opacity: .5;
}

.cat-toolbar .sort-selectbox .sort-dir-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 2px 0 8px;
    border: 0;
    border-left: 1px solid var(--cat-border);
    background: transparent;
    color: var(--cat-muted);
    cursor: pointer;
    line-height: 1;
    font-family: inherit;
}

.cat-toolbar .sort-selectbox .sort-dir-toggle:hover {
    color: var(--cat-primary);
}

.cat-toolbar .sort-selectbox .sort-dir-toggle:focus-visible {
    outline: 2px solid var(--cat-primary);
    outline-offset: 1px;
}

/* Bootstrap's reboot sets `font-family: inherit` on <button>, which the icon
   font inside one must not inherit. */
.cat-toolbar .sort-selectbox .sort-dir-toggle .bi {
    display: block;
    font-size: 1rem;
    line-height: 1;
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-weight: normal !important;
}

/* ---------------------------------------------------------- the results --- */

.cat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --------------------------------------------------------------- a card --- */

.cat-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 200px;
    gap: 16px;
    padding: 16px;
    background: var(--cat-surface);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius-lg);
    box-shadow: var(--cat-shadow-sm);
    transition: box-shadow .18s ease, border-color .18s ease;
}

.cat-card:hover {
    box-shadow: var(--cat-shadow-md);
    border-color: var(--cat-border-strong);
}

/* A paid placement is marked, not shouted. The predecessor painted the whole
   card #FAE8BB from an inline <style> block, which dropped the muted card copy
   under the 4.5:1 contrast floor and read as a warning rather than an ad. */
.cat-card.sponsored-card {
    border-color: rgba(139, 0, 0, .28);
    background: linear-gradient(180deg, #fdf6f6 0%, var(--cat-surface) 120px);
    box-shadow: 0 1px 2px 0 rgba(139, 0, 0, .07);
}

.cat-card.sponsored-card:hover {
    border-color: rgba(139, 0, 0, .45);
    box-shadow: var(--cat-shadow-md);
}

.cat-card-photo {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: var(--cat-radius-lg);
    overflow: hidden;
    background: var(--cat-bg);
    flex: 0 0 auto;
}

.cat-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The photo-less card keeps style.css's `.avatar-initials` block (a test asserts
   it, and two initials say more than the same grey silhouette on every such
   card). Only the glyph size is this card's business: 2rem was set for the old
   140px avatar and overflows a 96px one - and the two narrow breakpoints below
   shrink the frame again. */
.cat-card-photo .avatar-initials span {
    font-size: 1.75rem;
}

.cat-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cat-card-title {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.cat-card-name {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--cat-text);
    text-decoration: none;
}

.cat-card-name:hover {
    color: var(--cat-primary);
    text-decoration: none;
}

/* style.css sizes `.sticker` for the old 24px-padded card. */
.cat-card-title .sticker {
    margin-left: 0;
    padding: 3px 7px;
    font-size: 10px;
    border-radius: var(--cat-radius-sm);
}

.cat-card-title .reputation-badge {
    display: inline-flex;
    margin-left: 0;
    padding: 2px 8px;
    font-size: 12px;
}

.cat-ad-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--cat-radius-sm);
    background: var(--cat-primary-tint);
    border: 1px solid rgba(139, 0, 0, .25);
    color: var(--cat-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cat-ad-badge .bi {
    font-size: 11px;
    cursor: help;
}

/* rating -------------------------------------------------------------------*/

.cat-card-rating {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 0.8125rem;
}

.cat-card-rating .bi-star-fill {
    color: #f59e0b;
    font-size: 0.875rem;
}

.cat-rating-value {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--cat-text);
}

.cat-rating-reviews {
    color: var(--cat-muted);
    text-decoration: none;
    border-bottom: 1px dashed var(--cat-border-strong);
}

.cat-rating-reviews:hover {
    color: var(--cat-primary);
    border-bottom-color: var(--cat-primary);
    text-decoration: none;
}

.cat-card-rating .badge-new-specialist {
    font-size: 0.6875rem;
}

/* specialization chips ------------------------------------------------------*/

.cat-spec-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Namespaced under `.cat-spec-chips`, so style.css's `.lawyer-spec-links
   .lawyer-spec-link` (inline body copy with a dashed underline, for the old
   card) does not apply. The class name itself must stay: a test asserts it, and
   the promotion click binding excludes it by name so a filter navigation cannot
   spend a paying lawyer's CPC budget. */
.cat-spec-chips .lawyer-spec-link,
.cat-spec-chips .lawyer-spec-more {
    display: inline-block;
    max-width: 100%;
    padding: 3px 9px;
    border: 1px solid var(--cat-border);
    border-radius: 999px;
    background: var(--cat-bg);
    color: var(--cat-muted);
    font-size: 0.75rem;
    line-height: 1.5;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all .15s ease;
}

.cat-spec-chips .lawyer-spec-link:hover,
.cat-spec-chips .lawyer-spec-more:hover {
    border-color: var(--cat-primary);
    background: var(--cat-primary-tint);
    color: var(--cat-primary);
    text-decoration: none;
}

.cat-spec-chips .lawyer-spec-more {
    font-weight: 600;
}

/* meta line ----------------------------------------------------------------*/

.cat-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    font-size: 0.8125rem;
    color: var(--cat-muted);
    margin-top: auto;
}

.cat-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.cat-meta-item .bi {
    color: var(--cat-faint);
    font-size: 0.8125rem;
    flex: 0 0 auto;
}

.cat-meta-item.is-positive .bi {
    color: #15803d;
}

/* CTA column ---------------------------------------------------------------*/

.cat-card-cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--cat-border);
    min-width: 0;
}

.cat-card-price {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 2px;
}

.cat-card-price-label {
    font-size: 0.6875rem;
    line-height: 1.3;
    color: var(--cat-faint);
}

.cat-card-price-value {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cat-text);
    white-space: nowrap;
}

/* One button leads. Both of these used to be solid dark red, so neither did.
   The two classes keep the same footprint - swapping the hierarchy must not
   reflow the card. */
.cat-card-cta .button.primary,
.cat-card-cta .button.secondary {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--cat-radius);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .18s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-card-cta .button.primary {
    background: var(--cat-primary);
    border-color: var(--cat-primary);
    color: #fff;
}

.cat-card-cta .button.primary:hover {
    background: var(--cat-primary-hover);
    border-color: var(--cat-primary-hover);
    color: #fff;
    text-decoration: none;
}

.cat-card-cta .button.secondary {
    background: var(--cat-surface);
    border-color: var(--cat-primary);
    color: var(--cat-primary);
}

.cat-card-cta .button.secondary:hover {
    background: var(--cat-primary-tint);
    color: var(--cat-primary);
    text-decoration: none;
}

.cat-card-cta .button .bi {
    margin-right: 5px;
}

.cat-card-cta .button:focus-visible {
    outline: 2px solid var(--cat-primary);
    outline-offset: 2px;
}

/* ---------------------------------------------------------- empty state --- */

/* style.css owns `.empty-state*`; it only needs a card to sit in here. */
.cat-list .empty-state {
    background: var(--cat-surface);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius-lg);
    padding: 40px 24px;
    text-align: center;
}

/* --------------------------------------------------------- the firms tab -- */

/* The firms branch is unchanged markup. It only needs to stop being a 1050px
   centred column inside a column that is already narrower than that. */
.cat-results .center-wrap-column {
    max-width: none;
    padding: 0;
    gap: 12px;
}

.cat-results .block-specialists {
    margin-bottom: 0;
}

/* ---------------------------------------------------------- pagination ---- */

.cat-pagination {
    margin-top: 16px;
}

.cat-pagination .lawyer-pagination-wrapper {
    background: var(--cat-surface);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius-lg);
    box-shadow: var(--cat-shadow-sm);
    padding: 12px 14px;
}

/* -------------------------------------------------------------- the SEO --- */

/* A long SEO paragraph belongs under the results, not between the reader and
   them. */
.cat-seo {
    margin-top: 24px;
    padding: 18px 20px;
    background: var(--cat-surface);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius-lg);
    color: var(--cat-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.cat-seo p:last-child {
    margin-bottom: 0;
}

.cat-seo .read-more-link {
    color: var(--cat-primary);
    font-weight: 600;
}

/* ------------------------------------------------------------ responsive -- */

/* 1024: the two columns still fit (the container is 960px wide there), so only
   the gap tightens. */
@media (max-width: 1199.98px) {
    .cat-layout {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 18px;
    }

    .cat-card {
        grid-template-columns: 88px minmax(0, 1fr) 180px;
    }
}

/* Below 992 the sidebar stops being a column and sits above the results. */
@media (max-width: 991.98px) {
    .cat-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .cat-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    /* Two facet columns rather than one very tall one above the results. */
    .cat-facets.filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 20px;
        align-items: start;
    }

    .cat-facet-search {
        grid-column: 1 / -1;
    }

    .cat-facet-foot {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .cat-page h1 {
        font-size: 1.375rem;
    }

    .cat-card {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .cat-card-photo {
        width: 72px;
        height: 72px;
    }

    .cat-card-photo .avatar-initials span {
        font-size: 1.375rem;
    }

    .cat-card-head {
        flex-direction: column;
        gap: 6px;
    }

    .cat-card-cta {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 0 0;
        border-left: 0;
        border-top: 1px solid var(--cat-border);
    }

    .cat-card-price {
        flex: 1 1 100%;
        flex-direction: row;
        align-items: baseline;
        gap: 6px;
        margin-bottom: 0;
    }

    .cat-card-cta .button.primary,
    .cat-card-cta .button.secondary {
        flex: 1 1 140px;
        width: auto;
    }
}

@media (max-width: 575.98px) {
    .cat-facets.filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .cat-toolbar {
        padding: 10px 12px;
    }

    .cat-sort,
    .cat-toolbar .results-summary {
        flex: 1 1 100%;
    }

    .cat-toolbar .sort-selectbox .ui-selectbox-text {
        width: 100%;
    }

    .cat-card {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .cat-card-photo {
        width: 56px;
        height: 56px;
        border-radius: var(--cat-radius);
    }

    .cat-card-photo .avatar-initials span {
        font-size: 1.0625rem;
    }

    .cat-card-name {
        font-size: 1rem;
    }

    /* The pagination row is the one thing on the page that can overflow a
       390px viewport; it scrolls inside itself rather than dragging the page
       sideways. */
    .cat-pagination .pagination-controls {
        max-width: 100%;
        overflow-x: auto;
    }
}
