/*
 * Catalog: filters column (wide screens), listing heading, card grid, pagination and empty state.
 * Below 1100px the column gives way to the filters sheet and the sticky compact bar.
 */

.home-catalog {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: var(--rg-space-8);
    max-width: 1520px;
    margin: 0 auto;
    padding: 64px var(--home-gutter) 72px;
}

.home-catalog__main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.home-catalog__results[aria-busy="true"] {
    opacity: 0.55;
    transition: opacity 0.2s 0.1s;
}

.home-catalog__facts {
    margin: var(--rg-space-2) 0 0;
    color: var(--rg-color-text-muted);
    font-size: var(--rg-font-size-md);
    text-align: center;
}

/* Filters column */
.home-sidebar {
    position: sticky;
    top: calc(var(--home-header-height) + 24px);
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-6);
    max-height: calc(100dvh - var(--home-header-height) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.home-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
}

.home-sidebar__title {
    margin: 0;
    font-size: var(--rg-font-size-2xl);
    font-weight: var(--rg-font-weight-regular);
    letter-spacing: -0.4px;
}

.home-page .home-sidebar__clear {
    padding: 6px 0;
    color: var(--rg-color-brand);
    font-size: var(--rg-font-size-md);
}

.home-filters {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.home-filters__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-filters__label {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 6px;
    padding: 0 var(--rg-space-1);
    color: var(--rg-color-text-muted);
    font-size: var(--rg-font-size-sm);
}

.home-filters__value {
    color: var(--rg-color-ink);
    font-size: var(--rg-font-size-md);
}

.js .home-filters__apply {
    display: none;
}

.home-filters__apply {
    height: 44px;
    border: 0;
    border-radius: var(--rg-radius-pill);
    background: var(--home-ink);
    color: var(--rg-color-inverse-text);
    cursor: pointer;
}

/* Sport rows: four in view, the rest scroll inside the list */
.home-sports {
    --home-sport-row: 48px;
    --home-sport-gap: 6px;
    --home-sports-visible: 4;

    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--home-sport-gap);
    max-height: calc(var(--home-sports-visible) * var(--home-sport-row) + (var(--home-sports-visible) - 1) * var(--home-sport-gap));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.home-sports > li {
    flex-shrink: 0;
}

.home-sport {
    display: flex;
    align-items: center;
    gap: var(--rg-space-3);
    height: var(--home-sport-row);
    padding: 0 14px 0 6px;
    border-radius: var(--rg-radius-md);
    font-size: var(--rg-font-size-base);
    transition: background var(--rg-transition), color var(--rg-transition);
}

.home-sport:hover {
    background: var(--home-hover);
}

.home-sport.is-empty {
    color: var(--rg-color-text-faint);
}

.home-page .home-sport.is-active {
    background: var(--home-ink);
    color: var(--rg-color-inverse-text);
}

.home-sport__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--rg-radius-sm);
    background: var(--rg-color-surface);
    font-size: 18px;
}

.home-sport.is-active .home-sport__icon {
    background: var(--home-glass-light);
}

.home-sport__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-sport__count {
    color: var(--rg-color-text-muted);
    font-size: var(--rg-font-size-sm);
}

.home-sport.is-active .home-sport__count {
    color: var(--home-mute-on-ink);
}

/* Listing heading */
.home-catalog__toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-3);
}

.home-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--rg-space-4);
}

.home-toolbar__title {
    margin: 0;
    font-size: 36px;
    font-weight: var(--rg-font-weight-regular);
    letter-spacing: -1.2px;
}

.home-toolbar__count {
    color: var(--rg-color-text-muted);
    font-size: 16px;
    letter-spacing: 0;
}

.home-toolbar__sort {
    border-radius: var(--rg-radius-pill);
    box-shadow: inset 0 0 0 1px var(--home-line-soft);
}

.home-toolbar__sort .home-segment__option {
    border-radius: var(--rg-radius-pill);
    font-size: var(--rg-font-size-md);
}

.home-toolbar__compact {
    display: none;
}

/* Grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--rg-space-4);
}

.home-grid__item {
    min-width: 0;
}

.home-pager {
    display: flex;
    justify-content: center;
    gap: var(--rg-space-2);
    padding-top: var(--rg-space-4);
}

.home-pager:empty {
    display: none;
}

.home-pager [aria-disabled="true"] {
    opacity: 0.6;
    pointer-events: none;
}

.home-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--rg-space-3);
    padding: 64px var(--rg-space-8);
    border-radius: var(--rg-radius-xl);
    background: var(--rg-color-surface);
    text-align: center;
}

.home-empty__title {
    margin: 0;
    font-size: var(--rg-font-size-2xl);
    letter-spacing: -0.6px;
}

.home-empty__hint {
    margin: 0 0 var(--rg-space-2);
    color: var(--rg-color-ink-muted);
}

/* Tablets and phones: the filters live in the sheet */
@media (max-width: 1099px) {
    .home-catalog {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-top: 48px;
    }

    .home-sidebar {
        display: none;
    }

    .home-catalog__toolbar {
        position: sticky;
        top: var(--home-header-height);
        z-index: 10;
        margin: 0 calc(-1 * var(--home-gutter));
        padding: 10px var(--home-gutter);
        background: rgb(246 246 244 / 95%);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }

    .home-toolbar__title,
    .home-toolbar__sort {
        display: none;
    }

    .home-toolbar__compact {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: space-between;
        gap: var(--rg-space-2);
    }

    .home-toolbar__summary {
        display: flex;
        flex-direction: column;
        padding-left: var(--rg-space-1);
    }

    .home-toolbar__compact-title {
        font-size: var(--rg-font-size-2xl);
        letter-spacing: -0.4px;
    }

    .home-toolbar__compact-meta {
        color: var(--rg-color-text-muted);
        font-size: var(--rg-font-size-sm);
    }

    .home-toolbar__filters {
        display: inline-flex;
        align-items: center;
        gap: var(--rg-space-2);
        height: 44px;
        padding: 0 var(--rg-space-2) 0 14px;
        border: 0;
        border-radius: var(--rg-radius-pill);
        background: var(--home-ink);
        color: var(--rg-color-inverse-text);
        font-size: var(--rg-font-size-base);
        cursor: pointer;
    }

    .home-toolbar__filters > .home-icon {
        font-size: 17px;
    }

    .home-toolbar__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 26px;
        height: 28px;
        padding: 0 6px;
        border-radius: var(--rg-radius-pill);
        background: var(--home-glass-light-strong);
        font-size: var(--rg-font-size-sm);
    }

    .home-toolbar__badge.is-active {
        background: var(--rg-color-brand);
    }

    .home-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .home-catalog__results {
        padding-top: var(--rg-space-3);
    }

    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 699px) {
    .home-catalog {
        padding: var(--rg-space-8) var(--rg-space-3) var(--rg-space-8);
    }

    .home-catalog__toolbar {
        margin: 0 calc(-1 * var(--rg-space-3));
        padding: 10px var(--rg-space-4);
    }

    .home-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--rg-space-3);
    }

    .home-empty {
        padding: var(--rg-space-9) var(--rg-space-5);
    }
}
