/* Catalogue and hold-type pages: filters, bar, chips, type tabs. */
@layer pages {
    .cat {
        display: grid;
        grid-template-columns: 230px 1fr;
        gap: 56px;
        padding-top: 48px;
        padding-bottom: 140px;
    }
    .filters {
        position: sticky;
        top: calc(100px + var(--kz-adminbar));
        align-self: start;
    }
    .fgroup {
        border-top: 1px solid var(--line);
        padding: 18px 0 14px;
        & h2 {
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
        }
        & h2 button {
            font-size: 0.8125rem;
            color: var(--soft);
            font-weight: 500;
            text-decoration: underline;
        }
    }
    .opt {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 0;
        cursor: pointer;
        font-size: 0.9375rem;
        user-select: none;
        & input {
            appearance: none;
            width: 16px;
            height: 16px;
            border: 1px solid var(--ink);
            border-radius: 2px;
            flex: none;
            margin: 0;
            display: grid;
            place-items: center;
            transition: background var(--t1) var(--ease);
        }
        & input:checked {
            background: var(--graphite);
        }
        /* The tick fades with the box, so a switch never shows a dark box without it. */
        & input::after {
            content: '';
            width: 7px;
            height: 3.5px;
            border: solid #fff;
            border-width: 0 0 1.5px 1.5px;
            transform: rotate(-45deg) translate(1px, -1px);
            opacity: 0;
            transition: opacity var(--t1) var(--ease);
        }
        & input:checked::after {
            opacity: 1;
        }
        & small {
            color: var(--soft);
            font-size: 0.8125rem;
        }
        .c {
            margin-left: auto;
            font-size: 0.8125rem;
            color: var(--soft);
        }
        .tip {
            width: 15px;
            height: 15px;
            border-radius: 50%;
            border: 1px solid var(--soft);
            color: var(--soft);
            display: inline-grid;
            place-items: center;
            position: relative;
            cursor: help;
        }
        .tip svg {
            width: 11px;
            height: 11px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.6;
            stroke-linecap: round;
        }
        .tip circle {
            fill: currentColor;
            stroke: none;
        }
        .tip:hover::after {
            content: attr(data-t);
            position: absolute;
            left: 22px;
            top: -8px;
            background: var(--graphite);
            color: #fff;
            font-size: 0.8125rem;
            width: 210px;
            padding: 10px 12px;
            border-radius: 3px;
            z-index: 30;
            line-height: 1.4;
            box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.35);
        }
    }
    .finfo {
        border-top: 1px solid var(--line);
        padding-top: 18px;
    }
    .cat-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        margin-bottom: 24px;
        flex-wrap: wrap;
        min-height: 40px;
    }
    .chips {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;

        /* "Clear all" link after the chips. */
        & [data-clrall] {
            font-size: 0.84375rem;
            margin-left: 8px;
        }
    }
    .chip {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--ink);
        padding: 4px 6px 4px 12px;
        border-radius: 16px;
        font-size: 0.84375rem;
        font-weight: 500;
        & button {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--graphite);
            color: #fff;
            font-size: 0.75rem;
            line-height: 1;
        }
    }
    select.sort {
        appearance: none;
        -webkit-appearance: none;
        border: 0;
        border-bottom: 1px solid var(--ink);
        padding: 8px 28px 8px 2px;
        font-weight: 500;
        font-size: 0.90625rem;
        outline-offset: 4px;
        background: transparent
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23212121' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
            no-repeat right 4px center/11px 7px;
    }
    /* The site's dropdown (chrome/select.js) in place of the select. */
    .kzs-btn.sort {
        border-bottom: 1px solid var(--ink);
        padding: 8px 4px 8px 2px;
        gap: 13px;
        font-weight: 500;
        font-size: 0.90625rem;
        outline-offset: 4px;
    }
    .ftoggle,
    .fclose {
        display: none;
    }
    .empty {
        grid-column: 1/-1;
        border: 1px solid var(--line);
        border-radius: 3px;
        padding: 72px 32px;
        text-align: center;
        & p {
            color: var(--soft);
            margin: 10px 0 24px;
        }
    }
    .empty[hidden],
    .pc[hidden] {
        display: none;
    }
    .typetabs {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 28px;
        & a {
            height: 38px;
            padding: 0 16px;
            display: inline-flex;
            align-items: center;
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 19px;
            font-size: 0.875rem;
            font-weight: 500;
            transition:
                background var(--t1) var(--ease),
                color var(--t1) var(--ease),
                border-color var(--t1) var(--ease);
        }
        & a:hover {
            border-color: #fff;
        }
        & a.on {
            background: #fff;
            color: var(--graphite);
            border-color: #fff;
        }
    }
    @media (min-width: 901px) {
        .filters {
            z-index: 20;
        }
    }
    @media (max-width: 900px) {
        .cat {
            grid-template-columns: 1fr;
        }
        .filters {
            position: fixed;
            inset: var(--kz-adminbar) 0 0 0;
            align-self: stretch;
            background: var(--paper);
            z-index: 60;
            padding: 24px var(--pad);
            overflow: auto;
            overscroll-behavior: contain;
            transform: translateX(-100%);
            /* Stay visible until the slide-out ends. */
            transition:
                transform var(--t2) var(--ease),
                visibility 0s var(--t2);
            visibility: hidden;
            &.open {
                transform: none;
                visibility: visible;
                transition-delay: 0s;
            }
        }
        .ftoggle {
            display: inline-flex;
        }
        .fclose {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
    }
}
