/**
 * Spacewell FacetWP styles.
 *
 * Loaded on the resources listing template after sw.css. Selectors are scoped
 * to be more specific than FacetWP's own front.css, so load order does not matter.
 *
 * Colors come from the GeneratePress global colors, through the --sw-facet-* tokens
 * in sw.css. The pager is styled there too, together with the core pagination.
 */

/* Filters wrapper: main bar with optional subbar underneath */

.sw-resources__filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 32px 16px;
    padding: 16px;
    border-radius: 12px;
    background-color: var(--sw-facet-soft);
}

.sw-resources__filter .facetwp-facet {
    margin: 0;
}

.sw-resources__filter-title {
    margin: 0 0 8px;
    color: #000;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* Result counters are an editorial aid: hidden for visitors, visible when logged in. */

.facetwp-counter {
    display: none;
}

body.logged-in .facetwp-counter {
    display: inline;
    color: red;
}

/* Shared: every selectable item (radio, checkbox) */

.sw-resources__filter .facetwp-radio,
.sw-resources__filter .facetwp-checkbox {
    margin: 0;
    border-radius: var(--sw-facet-radius);
    color: var(--contrast);
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.sw-resources__filter .facetwp-counter {
    font-size: 0.85em;
    opacity: 0.7;
}

/* Categories filter: segmented bar */

.sw-resources__filter--categories .facetwp-facet {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border-radius: 10px;
    background-color: #fff;
}

.sw-resources__filter--categories .facetwp-radio {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    background: none;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.sw-resources__filter--categories .facetwp-radio:not(.checked):not(.disabled):hover {
    background-color: var(--sw-facet-soft);
}

.sw-resources__filter--categories .facetwp-radio.checked {
    background: var(--sw-facet-accent);
    color: var(--sw-facet-on-accent);
    box-shadow: 0 2px 6px rgba(0, 82, 149, 0.25);
}

.sw-resources__filter--categories .facetwp-counter {
    font-weight: 400;
}

@media (max-width: 1024px) {
    .sw-resources__filter--categories .facetwp-facet {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sw-resources__filter--categories .facetwp-radio {
        justify-content: flex-start;
        justify-self: start;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .sw-resources__filter--categories .facetwp-facet {
        grid-template-columns: 1fr;
    }

    .sw-resources__filter--categories .facetwp-radio {
        justify-self: stretch;
        padding: 14px 20px;
        font-size: 1.125rem;
    }
}

/* Solutions filter: optional subbar with multi-select chips */

.sw-resources__filter--solutions .facetwp-facet {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sw-resources__filter--solutions .facetwp-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--sw-facet-border);
    background: var(--base-2);
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: left;
}

.sw-resources__filter--solutions .facetwp-checkbox:not(.checked):not(.disabled):hover {
    border-color: var(--sw-facet-accent);
}

.sw-resources__filter--solutions .facetwp-checkbox.checked {
    border-color: var(--sw-facet-accent);
    background: var(--sw-facet-soft);
    color: var(--sw-facet-accent);
    font-weight: 500;
}

.sw-resources__filter--solutions .facetwp-display-value {
    padding-right: 0;
}

/* The pager lives in sw.css, shared with the core pagination on archives. */
